/// <summary> /// Opens the service manager /// </summary> /// <param name="Rights">The service manager rights</param> /// <returns>the handle to the service manager</returns> private static IntPtr OpenSCManager(ServiceManagerRights Rights) { IntPtr scman = OpenSCManager(null, null, Rights); if (scman == IntPtr.Zero) { throw new Win32Exception(Marshal.GetLastWin32Error()); } return(scman); }
/// <summary> /// Opens the service manager /// </summary> /// <param name="Rights">The service manager rights</param> /// <returns>the handle to the service manager</returns> private static IntPtr OpenSCManager(ServiceManagerRights Rights) { IntPtr scman = OpenSCManager(null, null, Rights); if (scman == IntPtr.Zero) { throw new ApplicationException("Could not connect to service control manager."); } return(scman); }
/// <summary> /// Opens the service manager /// </summary> /// <param name="Rights">The service manager rights</param> /// <returns>the handle to the service manager</returns> private static IntPtr OpenSCManager(ServiceManagerRights Rights) { IntPtr scman = OpenSCManager(null, null, Rights); if (scman == IntPtr.Zero) { CDFMonitor.LogOutputHandler("Could not connect to service control manager."); return(IntPtr.Zero); } return(scman); }
private static extern IntPtr OpenSCManager(string lpMachineName, string lpDatabaseName, ServiceManagerRights dwDesiredAccess);
protected static extern NativeServiceManager OpenSCManager( string lpMachineName, string lpDatabaseName, ServiceManagerRights dwDesiredAccess );
/// <summary> /// Opens the service manager /// </summary> /// <param name="Rights">The service manager rights</param> /// <returns>the handle to the service manager</returns> private static IntPtr OpenSCManager(ServiceManagerRights Rights) { IntPtr scman = OpenSCManager(null, null, Rights); if (scman == IntPtr.Zero) { throw new ApplicationException("Could not connect to service control manager."); } return scman; }
private static IntPtr OpenSCManager(ServiceManagerRights Rights) { IntPtr intPtr = ServiceInstaller.OpenSCManager(null, null, Rights); if (intPtr == IntPtr.Zero) { throw new ApplicationException("Could not connect to service control manager."); } return intPtr; }