I want to track changes on volume in folowing way (file system minifilter):
I am initializing memory mapped file section view in driver entry and bitmap that is based on file mapped memory, in PFLT_PRE_OPERATION_CALLBACK on IRP_MJ_WRITE i write bits to that bitmap.
If i creating mapped view, bitmap and then write to bitmap in pre operation callback -all works, but if i initialize view and bitmap in driver entry os crash on RtlSetBits with SYSTEM_SERVICE_EXCEPTION (3b)
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s…
As i can see Driver Entry is called in Kernel process(System), so file is mapped to virtual memory of kernell process and PRE_OPERATION_CALLBACK is called in user process that caused IO, so virtual memory from kernel will be wrong for user process. Am i right?
How can i write to kernel adress space from PFLT_PRE_OPERATION_CALLBACK? What can you advice?