Opening an SCManager Database

Many operations require an open handle to an SCManager object. The following example demonstrates how to obtain the handle.

Different operations on the SCM database require different levels of access, and you should only request the minimum access required. If SC_MANAGER_ALL_ACCESS is requested, the OpenSCManager function fails if the calling process does not have administrator privileges. The following example shows how to request full access to the ServicesActive database on the local machine.

// Open a handle to the SC Manager database.

schSCManager = OpenSCManager(

NULL, // local machine

NULL, // ServicesActive database

SC_MANAGER_ALL_ACCESS); // full access rights

if (schSCManager == NULL)

MyErrorExit("OpenSCManager");

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database