Returns the PID (process ID) of the process that initiated the operation
function GetOriginatorProcessId( var ProcessId : LongWord) : boolean;
bool GetOriginatorProcessId( unsigned long * ProcessId);
bool __fastcall GetOriginatorProcessId( unsigned long& ProcessId);
bool GetOriginatorProcessId( unsigned long & ProcessId);
bool GetOriginatorProcessId( ref UInt32 ProcessId);
Function GetOriginatorProcessId( ByRef ProcessId As UInt32) As Boolean
TRUE / true if the function succeeded or FALSE / false if the function failed.
Use GetOriginatorProcessId to get the process ID (PID) of the process that originated the operation.
Note that the PID is guaranteed to be unique only during lifetime of the process. When the process is terminated, its PID can (in theory) be used by other process. In fact this never happens, but such possibility is documented by Microsoft.
Do not call this method from handlers for OnReadFile, OnWriteFile and other callbacks that work with opened files, as that callbacks can be initiated by the system components (cache manager, memory manager etc.). Instead do the following:
This method may be called only from callback / event handlers.