/// <summary> /// Connects to the Windows service manager. /// </summary> /// <param name="access">The desired access to the service manager.</param> public ServiceManagerHandle(SC_MANAGER_RIGHTS access) { this.Handle = OpenSCManager(0, 0, access); if (this.Handle == 0) ThrowLastWin32Error(); }
/// <summary> /// Connects to the Windows service manager. /// </summary> /// <param name="access">The desired access to the service manager.</param> public ServiceManagerHandle(SC_MANAGER_RIGHTS access) { this.Handle = OpenSCManager(0, 0, access); if (this.Handle == 0) { ThrowLastWin32Error(); } }
public static extern int OpenSCManager(int MachineName, int DatabaseName, SC_MANAGER_RIGHTS DesiredAccess);