GetProcessHandleInformation(GetCurrentProcess(), &processInfo);
GetCurrentProcess
is a function in the kernel32.h
header file that returns a handle to the current process.
None.
A handle to the current process.
The handle returned by GetCurrentProcess
is a process handle. This handle can be used with other Windows API functions to interact with the current process.
ProcessHandleInformation processInfo;
DWORD result = GetProcessHandleInformation(GetCurrentProcess(), &processInfo);
if (result == 0) {
// Handle obtained successfully
// Access process information from processInfo
} else {
// Handle not obtained
}