NtCurrentProcess - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTPSAPI_H
// Processes
#if (PHNT_MODE != PHNT_MODE_KERNEL)

#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)

#endif
#endif

View code on GitHub
#ifndef _NTPSAPI_H
// Processes
#if (PHNT_MODE != PHNT_MODE_KERNEL)

#define ZwCurrentProcess() NtCurrentProcess()

#endif
#endif

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.

Applicable to

This pseudo-handle can be used with all functions that accept process handles.

See also