IoGetCurrentProcess 例程返回指向当前进程的指针。 调用 PsGetCurrentProcess,而不是 IoGetCurrentProcess。
语法
PEPROCESS IoGetCurrentProcess();
返回值
IoGetCurrentProcess 返回指向当前进程的指针。
言论
此例程与 PsGetCurrentProcess 相同:
#define PsGetCurrentProcess IoGetCurrentProcess
PsGetCurrentProcess (和 IoGetCurrentProcess)从线程的 APC 状态检索当前进程。 这会返回当前线程附加到的进程,这可能不同于最初创建线程的进程。
PsGetCurrentProcess 返回的进程可能与 PsGetCurrentProcessId 返回 ID 的进程不同。 使用 PsGetCurrentProcessId 获取创建当前线程的进程的进程 ID。 使用 PsGetProcessId(PsGetCurrentProcess() 获取线程当前附加到的进程的进程 ID。
要求
| 要求 | 价值 |
|---|---|
| 最低支持的客户端 | Windows 2000 |
| 目标平台 | 普遍 |
| 标头 | wdm.h (包括 Wdm.h、Ntddk.h、Ntifs.h) |
| 库 | NtosKrnl.lib |
| DLL | NtosKrnl.exe |
| IRQL | 任何级别 |