/// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
 private static extern IntPtr OpenSCManager(string lpMachineName, string
                                            lpDatabaseName, ServiceManagerRights dwDesiredAccess);
Exemplo n.º 5
0
 protected static extern NativeServiceManager OpenSCManager(
     string lpMachineName,
     string lpDatabaseName,
     ServiceManagerRights dwDesiredAccess
 );
Exemplo n.º 6
0
 /// <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;
 }
Exemplo n.º 7
0
 private static extern IntPtr OpenSCManager(string lpMachineName, string
 lpDatabaseName, ServiceManagerRights dwDesiredAccess);
Exemplo n.º 8
0
 protected static extern NativeServiceManager OpenSCManager(
     string lpMachineName,
     string lpDatabaseName,
     ServiceManagerRights dwDesiredAccess
     );
 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;
 }