Let me see if I got this right. The filter above yours is a minifilter ? It is illegal for a minifilter to call IoCreateFileSpecifyDeviceObjectHint, because it will violate layering.
Basically, this is a layering violation of some sort. The filter above yours targeted some IRP_MJ_CREATEs at you (at least your filter sees them) and other below you. A filter must be consistent in its use of layers.
FltMgr can’t really help you in this scenario because it doesn’t really know that you own the FILE_OBJECT or anything of that nature. Besides, it is possible that the caller of IoCreateFileSpecifyDeviceObjectHint bypasses FltMgr completely and calls directly into NTFS.
Does this make sense ?
Thanks,
Alex.
On Apr 23, 2013, at 6:18 AM, xxxxx@unidesk.com wrote:
Hello All,
My filter driver is running at the Virtualization level and I am using the Shadow Volume technique where I redirect the creates to an alternate volume and handle the file object above my layer and use the real file object below my layer. I’ve run into an issue where a driver above me is calling IoCreateFileSpecifyDeviceObjectHint with an object attributes that has the RootDirectory set. I get called to do a create on the root directory object, but I don?t get called for the actual create using that object attributes because I see the call stack shown below first. I?m not getting the chance to redirect correctly because something else is using the objects before issuing the call down to me.
I see the dreaded 0x24 blue screen because the file object that is being referenced is mine, but there are no calls to my driver to get the information, instead the ntfs objects are assumed to be in the fscontext.
Here is the callstack that I am seeing when the crash happens:
fffff880
012ea911 : fffffa80
01e8ed30 fffffa8002dd4b70 fffff880
034f5e50 fffff880034f5ea0 : Ntfs!NtfsFindStartingNode+0xdc fffff880
01253a3d : fffffa8001e8ed30 fffffa80
02dd4b70 fffff8800303df20 00000000
00000000 : Ntfs!NtfsCommonCreate+0x3e1
fffff80002678cb7 : fffff880
0303de90 0000000000000000 00000000
00000000 0000000000000000 : Ntfs!NtfsCommonCreateCallout+0x1d fffff800
02678c78 : 0000000000000000 00000000
00000000 fffff880034f6000 fffff800
0268d032 : nt!KxSwitchKernelStackCallout+0x27
fffff8000268d032 : 00000000
00000000 0000000000000002 fffffa80
01dd6960 fffffa8000000000 : nt!KiSwitchKernelStackContinue fffff880
012541bf : fffff88001253a20 fffff880
01253020 0000000000000000 fffff880
012f4f00 : nt!KeExpandKernelStackAndCalloutEx+0x2a2
fffff880012ed99c : 00000000
00000000 0000000000000000 fffffa80
034816d8 fffffa8002dd4b70 : Ntfs!NtfsCommonCreateOnNewStack+0x4f fffff800
0297abe5 : fffffa8001bd2030 fffffa80
02dd4b70 fffffa8000f64900 fffffa80
01d31c58 : Ntfs!NtfsFsdCreate+0x1ac
fffff80002977212 : fffffa80
01a3d3c0 fffffa8000000000 fffffa80
03481520 fffff88000000000 : nt!IopParseDevice+0x5a5 fffff800
029786a6 : ffffffff80000d18 fffffa80
03481520 fffffa8000cbd040 fffffa80
00cd8790 : nt!ObpLookupObjectName+0x312
fffff80002979fac : 00000000
00000000 0000000000000000 fffffa80
00000000 fffffa8000000201 : nt!ObOpenObjectByName+0x306 fffff800
0292172b : fffff8800303e6d8 00000000
00100020 fffff8800303e668 fffff880
0303e658 : nt!IopCreateFile+0x2bc
fffff800028f90a5 : fffff880
0303e658 fffff8800303e6d8 00000000
00100020 fffff8800303e668 : nt!IoCreateFileEx+0xfb fffff880
05a9a177 : 0000000000000000 fffff880
0303e669 0000000000000000 fffffa80
01bd2030 : nt!IoCreateFileSpecifyDeviceObjectHint+0xe5
fffff88005b29c3f : ffffffff
80000d18 0000000000000000 fffffa80
01d30dd0 0000000000000000 : klif+0x11177 fffff880
05b283a0 : ffffffff80000e5c 00000000
0000011c 0000000000000001 00000000
00000000 : klif+0xa0c3f
fffff80002a65317 : fffffa80
0300adb0 fffffa800300adb0 fffffa80
0300adb0 00000000000007ff : klif+0x9f3a0 fffff800
02a65715 : 0000000000000010 00000000
00000000 0000000000000010 00000000
00010206 : nt!IopLoadDriver+0xa07
fffff8000268a851 : fffff800
00000000 ffffffff80000dec fffff800
02a656c0 fffff8000281e2d8 : nt!IopLoadUnloadDriver+0x55 fffff800
02917e6a : 0000000125b926c3 fffffa80
01fd0b50 0000000000000080 fffffa80
00cbd040 : nt!ExpWorkerThread+0x111My questions are:
- Is is legal to call the IoCreateFileSpeciyDeviceObjectHint from a mini-filter with a root directory set?
- I thought that even if the call was made the filter manager layers would make sure that I was called for all operations, allowing me to manage the file object correctly, since I am lower in the stack than the driver that is issuing the call.
Any insight on this would be welcome.
NTFSD is sponsored by OSR
OSR is hiring!! Info at http://www.osr.com/careers
For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminarsTo unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer