The OpenProcess function returns a handle of an existing process object.
HANDLE OpenProcess(
DWORD dwDesiredAccess, |
// access flag |
BOOL bInheritHandle, |
// handle inheritance flag |
DWORD dwProcessId |
// process identifier |
); |
Access |
Description |
PROCESS_ALL_ACCESS |
Specifies all possible access flags for the process object. |
PROCESS_CREATE_PROCESS |
Used internally. |
PROCESS_CREATE_THREAD |
Enables using the process handle in the CreateRemoteThread function to create a thread in the process. |
PROCESS_DUP_HANDLE |
Enables using the process handle as either the source or target process in the DuplicateHandle function to duplicate a handle. |
PROCESS_QUERY_INFORMATION |
Enables using the process handle in the GetExitCodeProcess and GetPriorityClass functions to read information from the process object. |
PROCESS_SET_INFORMATION |
Enables using the process handle in the SetPriorityClass function to set the priority class of the process. |
PROCESS_TERMINATE |
Enables using the process handle in the TerminateProcess function to terminate the process. |
PROCESS_VM_OPERATION |
Enables using the process handle in the VirtualProtectEx and WriteProcessMemory functions to modify the virtual memory of the process. |
PROCESS_VM_READ |
Enables using the process handle in the ReadProcessMemory function to read from the virtual memory of the process. |
PROCESS_VM_WRITE |
Enables using the process handle in the WriteProcessMemory function to write to the virtual memory of the process. |
SYNCHRONIZE |
Windows NT only: Enables using the process handle in any of the wait functions to wait for the process to terminate. |
If the function succeeds, the return value is an open handle of the specified process.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
The handle returned by the OpenProcess function can be used in any function that requires a handle to a process, such as the wait functions, provided the appropriate access rights were requested.
When you are finished with the handle, be sure to close it using the CloseHandle function.
CloseHandle, CreateProcess, CreateRemoteThread, DuplicateHandle, GetCurrentProcess, GetCurrentProcessId, GetExitCodeProcess, GetPriorityClass, ReadProcessMemory, SetPriorityClass, TerminateProcess, VirtualProtectEx, WriteProcessMemory
file: /Techref/os/win/api/win32/func/src/f66_6.htm, 6KB, , updated: 2000/4/7 12:19, local time: 2024/10/10 12:30,
98.84.18.52:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/os/win/api/win32/func/src/f66_6.htm"> OpenProcess</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.