#ifndef _NTPSAPI_H
// Processes
#if (PHNT_MODE != PHNT_MODE_KERNEL)
#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
View code on GitHub
#ifndef _NTPSAPI_H
// Processes
#if (PHNT_MODE != PHNT_MODE_KERNEL)
#define ZwCurrentProcess() NtCurrentProcess()
View code on GitHub
This macro is documented in Windows Driver Kit. It is a native equivalent of the GetCurrentProcess
function and returns a pseudo-handle that grants PROCESS_ALL_ACCESS
to the current process. You do not need to call NtClose
on the returned handle.
This pseudo-handle can be used with all functions that accept process handles.