I hope someone can help with the following problem. I have developed a
function to rename files which uses FltSetInformationFile. I use the
function from two different places in my filter diver (a minidriver,
actually).
When called from the PreOp for IRP_MJ_CLEANUP it works out allright. When I
call it from a
DeferredIoWorkItem (of IRP_MJ_SET_INFORMATION ) it crashes within
FltSetInformationFile.
For the record, in my PostOp for IRP_MJ_SET_INFORMATION I detect if a file
has been renamed and if it has I queue a deferred Io work item, which,
AFAIK, runs at PASSIVE_LEVEL.
Any suggestion?
thanks,
Marco
The debugger tells me that it fails within FltSetInformationFile:
*******************************************************************************
*
*
* Bugcheck Analysis
*
*
*
*******************************************************************************
PAGE_FAULT_IN_NONPAGED_AREA (50)
Invalid system memory was referenced. This cannot be protected by
try-except,
it must be protected by a Probe. Typically the address is just plain bad or
it
is pointing at freed memory.
Arguments:
Arg1: f25ac01c, memory referenced.
Arg2: 00000000, value 0 = read operation, 1 = write operation.
Arg3: baf284ae, If non-zero, the instruction address which referenced the
bad memory
address.
Arg4: 00000000, (reserved)
Debugging Details:
READ_ADDRESS: f25ac01c Nonpaged pool
FAULTING_IP:
fltmgr!FltAllocateCallbackData+c
baf284ae 8b401c mov eax,[eax+0x1c]
MM_INTERNAL_CODE: 0
IMAGE_NAME: fltmgr.sys
DEBUG_FLR_IMAGE_TIMESTAMP: 41107bad
MODULE_NAME: fltmgr
FAULTING_MODULE: baf24000 fltmgr
DEFAULT_BUCKET_ID: DRIVER_FAULT
BUGCHECK_STR: 0x50
LAST_CONTROL_TRANSFER: from baf36bdf to baf284ae
TRAP_FRAME: f88f6854 -- (.trap fffffffff88f6854)
ErrCode = 00000000
eax=f25ac000 ebx=00000000 ecx=f25abbbc edx=824343b0 esi=824343b0
edi=828b8ec0
eip=baf284ae esp=f88f68c8 ebp=f88f68cc iopl=0 nv up ei pl zr na po
nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000
efl=00010246
fltmgr!FltAllocateCallbackData+0xc:
baf284ae 8b401c mov eax,[eax+0x1c]
Resetting default scope
STACK_TEXT:
f88f68cc baf36bdf 824343b0 ffdff538 f88f68e4
fltmgr!FltAllocateCallbackData+0xc
f88f68ec f8898c70 824343b0 ffdff538 8307afd8
fltmgr!FltSetInformationFile+0x1f
f88f6914 f8897a93 e1cc0884 f25abbbc f88f6930 ick!RenameFile+0xc0 [xxx.cpp @
2263]
f88f6d64 baf3b272 828b8ec0 8248ec7c f25abbbc
ick!ICKDeferredPostSetInfo+0x1f3 [xxx.cpp @ 1521]
f88f6d7c 8080b3b5 828b8ec0 00000000 82ada3c8
fltmgr!FltpProcessDeferredIoWorkItem+0x16
f88f6dac 8089d128 828b8ec0 00000000 00000000 nt!ExpWorkerThread+0xef
f88f6ddc 80818c81 8080b2f1 00000001 00000000 nt!PspSystemThreadStartup+0x34
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16
FOLLOWUP_IP:
fltmgr!FltAllocateCallbackData+c
baf284ae 8b401c mov eax,[eax+0x1c]
SYMBOL_STACK_INDEX: 0
FOLLOWUP_NAME: MachineOwner
SYMBOL_NAME: fltmgr!FltAllocateCallbackData+c
STACK_COMMAND: .trap fffffffff88f6854 ; kb
FAILURE_BUCKET_ID: 0x50_fltmgr!FltAllocateCallbackData+c
BUCKET_ID: 0x50_fltmgr!FltAllocateCallbackData+c
Followup: MachineOwner
***********************
here is a disassebly:
fltmgr!FltAllocateCallbackData:
baf284a2 8bff mov edi,edi
baf284a4 55 push ebp
baf284a5 8bec mov ebp,esp
baf284a7 56 push esi
baf284a8 8b7508 mov esi,[ebp+0x8]
baf284ab 8b4618 mov eax,[esi+0x18]
baf284ae 8b401c mov eax,[eax+0x1c] << bang!
baf284b1 57 push edi
and the PCR:
1: kd> !pcr
KPCR for Processor 1 at f872f000:
Major 1 Minor 1
NtTib.ExceptionList: f88f5ca4
NtTib.StackBase: f88f6df0
NtTib.StackLimit: f88f4000
NtTib.SubSystemTib: 00000000
NtTib.Version: 00000000
NtTib.UserPointer: 00000000
NtTib.SelfTib: 00000000
SelfPcr: f872f000
Prcb: f872f120
Irql: 00000000
IRR: 00000000
IDR: ffffffff
InterruptMode: 00000000
IDT: f8733560
GDT: f8733160
TSS: f872fd70
CurrentThread: 82ada3c8
NextThread: 00000000
IdleThread: f8731e20
DpcQueue: