I am writing a minifilter driver in which i am monitoring whatsoever process is being created by using PsSetCreateProcessNotifyRoutine callback routine as:
status = PsSetCreateProcessNotifyRoutine( CreateProcessNotifyProc,
FALSE
) ;
Now inside CreateProcessNotifyProc i am using FltCreateFile which doesnt create any problems
VOID
CreateProcessNotifyProc (
IN HANDLE ParentId,
IN HANDLE ProcessId,
IN BOOLEAN Create
)
{
…
status = FltCreateFile( ScannerData.Filter,
NULL,//FltObjects->Instance,
&handle,
//NULL,
GENERIC_READ,
&objAttr,
&iosblock,
(PLARGE_INTEGER)0,
(ULONG)FILE_ATTRIBUTE_NORMAL,
(ULONG)FILE_SHARE_READ,
(ULONG)FILE_OPEN,
(ULONG)0,
NULL,
(ULONG)0,
(ULONG)0
);
…
}
Now if i need to use FltReadFile its documentation states that 1st param
IN PFLT_INSTANCE InitiatingInstance:
Opaque instance pointer for the minifilter driver instance that is initiating the read request. This parameter is required and cannot be NULL.
But here i don’t have InitiatingInstance. Can anybody suggest what can be done to get InitiatingInstance inside CreateProcessNotifyProc calback, so that i can use FltReadFile.
Thanks in advance
SR