Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The IoGetCurrentProcess routine returns a pointer to the current process. Call PsGetCurrentProcess instead of IoGetCurrentProcess.
Syntax
PEPROCESS IoGetCurrentProcess();
Return value
IoGetCurrentProcess returns a pointer to the current process.
Remarks
This routine is identical to PsGetCurrentProcess:
#define PsGetCurrentProcess IoGetCurrentProcess
PsGetCurrentProcess (and IoGetCurrentProcess) retrieves the current process from the thread's APC state. This returns the process that the current thread is attached to, which might be different from the process that originally created the thread.
The process returned by PsGetCurrentProcess may differ from the process whose ID is returned by PsGetCurrentProcessId. Use PsGetCurrentProcessId to get the process ID of the process that created the current thread. Use PsGetProcessId(PsGetCurrentProcess()) to get the process ID of the process that the thread is currently attached to.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows 2000 |
| Target Platform | Universal |
| Header | wdm.h (include Wdm.h, Ntddk.h, Ntifs.h) |
| Library | NtosKrnl.lib |
| DLL | NtosKrnl.exe |
| IRQL | Any level |