IoGetRequestorProcessId function (ntifs.h)

The IoGetRequestorProcessId routine returns the unique 32-bit process ID for the thread that originally requested a given I/O operation.

Syntax

ULONG IoGetRequestorProcessId(
  [in] PIRP Irp
);

Parameters

[in] Irp

A pointer to the I/O request packet (IRP) for the specified I/O operation.

Return value

IoGetRequestorProcessId returns the process ID for the thread that requested the I/O operation. If the IRP is not associated with any thread, IoGetRequestorProcessId returns zero.

Remarks

On Microsoft Windows XP and later, IoGetRequestorProcessId returns the process ID for the process to which the thread is currently attached.

On Microsoft Windows 2000 and earlier, IoGetRequestorProcessId returns the process ID for the process that created the thread.

For more information about using system threads and managing synchronization within a nonarbitrary thread context, see Driver Threads, Dispatcher Objects, and Resources.

Requirements

Requirement Value
Minimum supported client Windows 2000
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= DISPATCH_LEVEL

See also

IoGetRequestorProcess