Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "OpenProcess" in [All]

Enums

.

    public const int CO_E_FAILEDTOOPENPROCESSTOKEN = unchecked((int)0x8001013C);

.

    Public Const CO_E_FAILEDTOOPENPROCESSTOKEN As Integer = CInt(&H8001013cUI)

.

    /// Required to retrieve certain information about a process, such as its token, exit code, and priority class (see OpenProcessToken).

.

Used with OpenProcess.

Constants

.

        static extern bool OpenProcessToken(

.

            if (OpenProcessToken(pId, TOKEN_QUERY, out hToken)) {

.

        public const int CO_E_FAILEDTOOPENPROCESSTOKEN = (int)(0x8001013C - 0x100000000);

kernel32

.

   internal static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

.

        IntPtr ptrProcess = OpenProcess(QueryLimitedInformation, false, iPID);

.
Summary
.

public static extern IntPtr OpenProcess(

.

public static IntPtr OpenProcess(Process proc, ProcessAccessFlags flags)

.

     return OpenProcess(flags, false, proc.Id);

.

Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As ProcessAccessFlags, bInheritHandle As Boolean, processId As UInt32) As IntPtr

.

def OpenProcess(dwDesiredAccess as UInt32, bInheritHandle as bool, dwProcessID as UInt32) as IntPtr:

.

IntPtr handle = OpenProcess(ProcessAccess.QueryLimitedInformation, false, process.Id);

userenv

.

in Token for the user, which is returned by the LogonUser, CreateRestrictedToken, DuplicateToken, OpenProcessToken, or OpenThreadToken function. The token must have TOKEN_QUERY and TOKEN_IMPERSONATE and TOKEN_DUPLICATE access. For more information, see Access Rights for Access-Token Objects.

secur32

.
DynamicLoader
ADVAPI32/OpenProcessToken

psapi

.

IntPtr pic = OpenProcess(NativeMethods.ProcessAccessFlags.All, true, (int)pid);

ntdll

.

static extern NTSTATUS NtOpenProcess(ref IntPtr ProcessHandle, UInt32 AccessMask, ref OBJECT_ATTRIBUTES ObjectAttributes, ref CLIENT_ID ClientId);

.

def NtOpenProcess(ref ProcessHandle as IntPtr, AccessMask as UInt32, ref ObjectAttributes as OBJECT_ATTRIBUTES, ref ClientId as CLIENT_ID) as UInt32:

.
Documentation
[NtOpenProcess] on MSDN
.

See also OpenProcess, CloseHandle.

.

        IntPtr hProc = OpenProcess(0x001F0FFF, false, Process.GetCurrentProcess().Id);

.

        IntPtr hProc = OpenProcess((ProcessAccessFlags)0x001F0FFF, false, Process.GetCurrentProcess().Id);

.
Summary
Resumes a suspended process. Pass the process handle from "OpenProcess"

user32

.

See http://www.pinvoke.net/default.aspx/kernel32/OpenProcess.html for the OpenProcess API.

.

    private static extern IntPtr OpenProcess(

.

        hProcess = StatusBar.OpenProcess(ProcessAccessTypes.PROCESS_ALL_ACCESS, false, this.OwningPID);

16: TCITEM
.

    IntPtr process = OpenProcess(ProcessAccessFlags.VMOperation | ProcessAccessFlags.VMRead |

.

    static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);

advapi32

.

    internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr

.

        retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);

.

          if (NativeMethods.OpenProcessToken(currentProcess, NativeMethods.TOKEN_ADJUST_PRIVILEGES | NativeMethods.TOKEN_QUERY, out tokenHandle))

.

                                 "OpenProcessToken failed. CurrentProcess: {0}",

.

      internal static extern bool OpenProcessToken(IntPtr processHandle,

.

    Private Function OpenProcessToken( _

.

        If Not OpenProcessToken(hProc, TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY, hToken) Then

.

             "OpenProcessToken failed with error " & lastWin32Error.ToString & ".")

.

static extern bool OpenProcessToken(IntPtr ProcessHandle,

.

Private Function OpenProcessToken( _

.

Declare Function OpenProcessToken Lib "advapi32.dll" ( _

.

    Source: Link to ''http://groups.google.com/group/microsoft.public.dotnet.general/browse_thread/thread/5742d50ec2e9f798/c702b8d7771f9016lnk=st&q=OpenProcessToken+0x00020000&rnum=1&hl=en#c702b8d7771f9016''

.

    public static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle);

.

        if (!OpenProcessToken(processHandle, TOKEN_READ, out tokenHandle))

.
Documentation
[OpenProcessToken] on MSDN

 
Access PInvoke.net directly from VS: