2 instantiations of SafeServiceHandle
System.ServiceProcess.ServiceController (2)
System\ServiceProcess\ServiceController.cs (2)
631
var databaseHandle = new
SafeServiceHandle
();
685
var serviceHandle = new
SafeServiceHandle
();
44 references to SafeServiceHandle
System.ServiceProcess.ServiceController (44)
_generated\0\LibraryImports.g.cs (18)
35
internal static unsafe partial bool ControlService(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
serviceHandle, int control, global::Interop.Advapi32.SERVICE_STATUS* pStatus)
42
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __serviceHandle_native__marshaller = new();
78
internal static partial bool EnumDependentServices(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
serviceHandle, int serviceState, nint bufferOfENUM_SERVICE_STATUS, int bufSize, ref int bytesNeeded, ref int numEnumerated)
85
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __serviceHandle_native__marshaller = new();
124
internal static partial bool EnumServicesStatusEx(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
databaseHandle, int infolevel, int serviceType, int serviceState, nint status, int size, out int bytesNeeded, out int servicesReturned, ref int resumeHandle, string group)
133
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __databaseHandle_native__marshaller = new();
174
internal static unsafe partial bool GetServiceDisplayName(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
SCMHandle, string serviceName, char* displayName, ref int displayNameLength)
181
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __SCMHandle_native__marshaller = new();
220
internal static unsafe partial bool GetServiceKeyName(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
SCMHandle, string displayName, char* KeyName, ref int KeyNameLength)
227
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __SCMHandle_native__marshaller = new();
293
internal static partial nint OpenService(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
databaseHandle, string serviceName, int access)
299
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __databaseHandle_native__marshaller = new();
334
internal static partial bool QueryServiceConfig(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
serviceHandle, nint queryServiceConfigPtr, int bufferSize, out int bytesNeeded)
342
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __serviceHandle_native__marshaller = new();
380
internal static unsafe partial bool QueryServiceStatus(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
serviceHandle, global::Interop.Advapi32.SERVICE_STATUS* pStatus)
387
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __serviceHandle_native__marshaller = new();
423
internal static partial bool StartService(global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
serviceHandle, int argNum, nint argPtrs)
430
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeServiceHandle
>.ManagedToUnmanagedIn __serviceHandle_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.ControlService.cs (1)
14
internal static unsafe partial bool ControlService(
SafeServiceHandle
serviceHandle, int control, SERVICE_STATUS* pStatus);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.EnumDependentServices.cs (1)
15
SafeServiceHandle
serviceHandle,
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.EnumServicesStatusEx.cs (1)
15
SafeServiceHandle
databaseHandle,
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetServiceDisplayName.cs (1)
17
internal static unsafe partial bool GetServiceDisplayName(
SafeServiceHandle
? SCMHandle, string serviceName, char* displayName, ref int displayNameLength);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetServiceKeyName.cs (1)
17
internal static unsafe partial bool GetServiceKeyName(
SafeServiceHandle
? SCMHandle, string displayName, char* KeyName, ref int KeyNameLength);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.OpenService.cs (1)
13
internal static partial IntPtr OpenService(
SafeServiceHandle
? databaseHandle, string serviceName, int access);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.QueryServiceConfig.cs (1)
14
internal static partial bool QueryServiceConfig(
SafeServiceHandle
serviceHandle, IntPtr queryServiceConfigPtr, int bufferSize, out int bytesNeeded);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.QueryServiceStatus.cs (1)
14
internal static unsafe partial bool QueryServiceStatus(
SafeServiceHandle
serviceHandle, SERVICE_STATUS* pStatus);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.StartService.cs (1)
14
internal static partial bool StartService(
SafeServiceHandle
serviceHandle, int argNum, IntPtr argPtrs);
System\ServiceProcess\ServiceController.cs (17)
36
private
SafeServiceHandle
? _serviceManagerHandle;
186
using
var
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_ENUMERATE_DEPENDENTS);
304
using
var
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_QUERY_CONFIG);
388
using
var
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_QUERY_CONFIG);
498
using
var
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_QUERY_STATUS);
568
private unsafe string? GetServiceKeyName(
SafeServiceHandle
? SCMHandle, string serviceDisplayName)
599
private unsafe string? GetServiceDisplayName(
SafeServiceHandle
? scmHandle, string serviceName)
629
private static
SafeServiceHandle
GetDataBaseHandleWithAccess(string machineName, int serviceControlManagerAccess)
631
var
databaseHandle = new SafeServiceHandle();
681
private
SafeServiceHandle
GetServiceHandle(int desiredAccess)
685
var
serviceHandle = new SafeServiceHandle();
748
using
SafeServiceHandle
databaseHandle = GetDataBaseHandleWithAccess(machineName, Interop.Advapi32.ServiceControllerOptions.SC_MANAGER_ENUMERATE_SERVICE);
805
using
var
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_PAUSE_CONTINUE);
821
using
var
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_PAUSE_CONTINUE);
837
using
var
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_USER_DEFINED_CONTROL);
873
using
SafeServiceHandle
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_START);
940
using
SafeServiceHandle
serviceHandle = GetServiceHandle(Interop.Advapi32.ServiceOptions.SERVICE_STOP);