public IntPtr OpenServiceControlManager(string machineName, string databaseName, ScmAccess serviceControlManagerAccess)
        {
            var handle = OpenSCManagerW(machineName, databaseName, (uint) serviceControlManagerAccess);

            if (handle == IntPtr.Zero)
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }

            return handle;
        }
        public IntPtr OpenService(IntPtr serviceControlManagerHandle, string serviceName, ScmAccess serviceControlManagerAccess)
        {
            var handle = OpenService(serviceControlManagerHandle, serviceName, (uint) serviceControlManagerAccess);

            if (handle == IntPtr.Zero)
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }

            return handle;
        }
        public IntPtr OpenServiceControlManager(string machineName, string databaseName, ScmAccess serviceControlManagerAccess)
        {
            var handle = OpenSCManagerW(machineName, databaseName, (uint)serviceControlManagerAccess);

            if (handle == IntPtr.Zero)
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }

            return(handle);
        }
        public IntPtr OpenService(IntPtr serviceControlManagerHandle, string serviceName, ScmAccess serviceControlManagerAccess)
        {
            var handle = OpenService(serviceControlManagerHandle, serviceName, (uint)serviceControlManagerAccess);

            if (handle == IntPtr.Zero)
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }

            return(handle);
        }
Beispiel #5
0
 public static extern IntPtr OpenSCManager(string?machineName, string?databaseName, ScmAccess dwAccess);
Beispiel #6
0
 private static extern IntPtr OpenSCManager(
     string machineName,
     string databaseName,
     ScmAccess dwDesiredAccess);
Beispiel #7
0
 private static extern IntPtr OpenSCManager(
     string machineName,
     string databaseName,
     ScmAccess dwDesiredAccess);