|
ServiceHelperOpenService Method |
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 OpenService(
IntPtr managerHandle,
string serviceName,
uint desiredAccess
)
<DllImportAttribute("advapi32.dll", CharSet := CharSet.Auto, SetLastError := true>]
Public Shared Function OpenService (
managerHandle As IntPtr,
serviceName As String,
desiredAccess As UInteger
) As IntPtr
public:
[DllImportAttribute(L"advapi32.dll", CharSet = CharSet::Auto, SetLastError = true)]
static IntPtr OpenService(
IntPtr managerHandle,
String^ serviceName,
unsigned int desiredAccess
)
[<DllImportAttribute("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)>]
static member OpenService :
managerHandle : IntPtr *
serviceName : string *
desiredAccess : uint32 -> IntPtr
Parameters
- managerHandle IntPtr
- A handle to the service control manager database. The
function returns this handle.
- serviceName String
- The name of the service to be opened. This is the name specified
by the serviceName parameter of the function when the
service object was created, not the service display name that is shown by user interface
applications to identify the service.
The maximum string length is 256 characters.The service control manager database preserves
the case of the characters, but service name comparisons are always case insensitive.
Forward-slash(/) and backslash(\) are invalid service name characters.
- desiredAccess UInt32
- The access to the service.
Return Value
IntPtrSee Also Reference
CreateService(IntPtr, String, String, UInt32, ServiceTypes, ServiceStartTypes, ServiceErrors, String, String, String, String, String, String)