// fltkernel.h
NTSTATUS FLTAPI FltGetRequestorSessionId(
[in] PFLT_CALLBACK_DATA CallbackData,
[out] PULONG SessionId
);
View the official Windows Driver Kit DDI referenceNo description available.
The FltGetRequestorSessionId routine returns the session ID of the process that originally requested the specified I/O operation.
CallbackData [in]A pointer to the FLT_CALLBACK_DATA structure specifying the I/O operation.
SessionId [out]A pointer to the session ID for the requesting operation.
The FltGetRequestorSessionId routine returns STATUS_SUCCESS on success or STATUS_UNSUCCESSFUL on failure.
If a process has no session ID, the SessionId parameter refers to -1 and the FltGetRequestorSessionId routine returns STATUS_SUCCESS.
If the FltGetRequestorSessionId routine returns STATUS_UNSUCCESSFUL, SessionId is not valid.