Click or drag to resize
Xcalibur Systems LLC Logo

ServiceHelperOpenSCManager Method

Establishes a connection to the service control manager on the specified computer and opens the specified service control manager database.

OpenSCManager function


Namespace: Xcalibur.NativeMethods.V2.Services
Assembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax
[DllImportAttribute("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static IntPtr OpenSCManager(
	string machineName,
	string databaseName,
	int desiredAccess
)

Parameters

machineName  String
The name of the target computer. If the pointer is NULL or points to an empty string, the function connects to the service control manager on the local computer.
databaseName  String
The name of the service control manager database. This parameter should be set to . If it is NULL, the database is opened by default.
desiredAccess  Int32
The access to the service control manager. For a list of access rights, see Service Security and Access Rights. Before granting the requested access rights, the system checks the access token of the calling process against the discretionary access-control list of the security descriptor associated with the service control manager. The access right is implicitly specified by calling this function.

Return Value

IntPtr
See Also