Hello,
I have a volume filter (based on toaster filter samples)
that attaches on top of the parition object
“\Device\Harddisk1\Partition0” by calling IoAttachDevice
The filter driver does not do much. It prints out some debug
info then passes everything down to the next lower driver.
I have another device driver that needs perform data read from the
partition.
The driver does this by keeping a pointer to the partition device object.
////
IoGetDeviceObjectPointer
(&ntDeviceName, // L"\Device\Harddisk1\Partition0"
, …);
pDevObj->AlignmentRequirement =
pTargetDevObj->AlignmentRequirement;
pDevObj->StackSize = pTargetDevObj->StackSize + 1;
////
To perform a read, this driver will builds a Read IRP using
IoBuildSynchronousFsdRequest and then calls
IoCallDriver(pTargetDevObj, readIrp)
I load the drivers, issue a read and get this error
////
Access violation - code c0000005 (!!! second chance !!!)
CLASSPNP!ServiceTransferRequest+159:
f95a9055 8b4010 mov eax,[eax+0x10] ;eax = 0 here
////
and the stack_text is:
f765c564 f95aa256 823c6038 81db1808 823c6038
CLASSPNP!ServiceTransferRequest+0x159
f765c5b4 80a2675c 823c6038 81db1808 81db1808 CLASSPNP!ClassReadWrite+0x28e
f765c5d0 f983595f 823c6dc0 81db1808 00000000 nt!IofCallDriver+0x62
f765c5e8 80a2675c 823c6dc0 81db1808 81e55048 PartMgr!PmReadWrite+0xb5
f765c604 f9c1dd1e 00000001 81e55100 00000000 nt!IofCallDriver+0x62
f765c61c 80a2675c 81e55048 81db1808 f765c8cc MY_FILTER!FltrPassDown+0x1ce
[u:\my_filter\fltr.c @ 363]
f765c638 f78cdf32 00000001 00000001 00000001 nt!IofCallDriver+0x62
f765c664 f78c8617 81e55048 f765c6c4 00000200
MY_DEVICE!ReadPartitionDevice+0x1d2 [u:\my_device\dev.c @ 114]
…
I check the irq levels, Irp fields, etc. They all have reasonable values.
If I run only one driver at a time then everything works fine.
My filter will see and pass down the read requests.
My other device driver will read the correct data from the partition.
But together they won’t go. Please shed some light on my confusion.
Thanks.
Chu Bun