|
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.ServicesAssembly: 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
)
<DllImportAttribute("advapi32.dll", CharSet := CharSet.Auto, SetLastError := true>]
Public Shared Function OpenSCManager (
machineName As String,
databaseName As String,
desiredAccess As Integer
) As IntPtr
public:
[DllImportAttribute(L"advapi32.dll", CharSet = CharSet::Auto, SetLastError = true)]
static IntPtr OpenSCManager(
String^ machineName,
String^ databaseName,
int desiredAccess
)
[<DllImportAttribute("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)>]
static member OpenSCManager :
machineName : string *
databaseName : string *
desiredAccess : int -> IntPtr
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
IntPtrSee Also