Example #1
0
        public static IntPtr OpenProcess(int processid, NativeEnums.ProcessAccess flags)
        {
            IntPtr hProcess = NativeMethods.OpenProcess((uint)flags, false, (uint)processid);

            if (hProcess == IntPtr.Zero)
            {
                throw new Win32Exception();
            }

            return(hProcess);
        }
Example #2
0
 public static IntPtr OpenProcess(Process process, NativeEnums.ProcessAccess flags)
 {
     return(OpenProcess(process.Id, flags));
 }