So, if you leave the call to FltGetFileNameInformation but comment out the call to FltReleaseFileNameInformation, it doesn’t freeze?
(Of course, this keeps the reference to nameInfo forever, but…)
Also, could the IRQL be > APC_LEVEL? Try:
if ( KeGetCurrentIrql() <= APC_LEVEL )
{
…
}
Ken
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Alessandro Sardo
Sent: Sunday, December 09, 2007 12:19 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Problem with FltGetFileNameInformation
Hello,
I have already tried that and it didn’t change anything. The culprit
really seems to be FltReleaseFileNameInformation.
For your information, these are the registered IRPs through the same
pre-callback:
CONST FLT_OPERATION_REGISTRATION Callbacks =
{
{ IRP_MJ_CREATE,
0,
PreFileOperationCallback,
NULL,
NULL },
{ IRP_MJ_READ,
0,
PreFileOperationCallback,
NULL,
NULL },
{ IRP_MJ_WRITE,
0,
PreFileOperationCallback,
NULL,
NULL },
{ IRP_MJ_SET_INFORMATION,
0,
PreFileOperationCallback,
NULL,
NULL },
{ IRP_MJ_FILE_SYSTEM_CONTROL,
0,
PreFileOperationCallback,
NULL,
NULL },
{ IRP_MJ_OPERATION_END }
};
Thank you all for your help!
Ken Cross ha scritto:
Another possible explanation is that you’re not checking for success on the call to FltGetFileNameInformation.
If the call is not successful, it’s possible that nameInfo is not null. In that case, the call to FltReleaseFileNameInformation
could have unknown behavior. I don’t know if this is happening, but it’s theoretically possible.
So does changing it to this make any difference?
if ( NT_SUCCESS( status ) && nameInfo != NULL )
FltReleaseFileNameInformation( nameInfo );
Ken
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Alessandro Sardo
Sent: Saturday, December 08, 2007 3:43 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Problem with FltGetFileNameInformation
Hello gentlemen,
I have been experimenting with writing a simple minifilter for the past
few days, but I have come across a nasty problem.
This is my current PreOperationCallback:
FLT_PREOP_CALLBACK_STATUS PreFileOperationCallback( __inout
PFLT_CALLBACK_DATA Data,
__in
PCFLT_RELATED_OBJECTS FltObjects,
__deref_out_opt
PVOID *CompletionContext )
{
PFLT_FILE_NAME_INFORMATION nameInfo = NULL;
NTSTATUS status;
*CompletionContext = NULL;
if ( FltObjects->FileObject != NULL )
status = FltGetFileNameInformation( Data,
FLT_FILE_NAME_NORMALIZED | DEFAULT_NAME_QUERY_METHOD, &nameInfo );
if ( nameInfo != NULL )
FltReleaseFileNameInformation( nameInfo );
return FLT_PREOP_SUCCESS_NO_CALLBACK;
}
As you can see, it’s some pretty useless and (as far as I can tell)
bug-free code. Nonetheless, it will sometimes cause hard lock-ups and
force me to reboot my machine. However, that only happens when I open a
Microsoft Visio document I have on my desktop. At first, I thought the
document was the problem, so I rebooted and tried to open it without
loading the minifilter. Unfortunately, it all worked like a charm (like
it always did); so I loaded the minifilter and opened the Visio document
again… and that triggered the freeze.
After that, I tried to comment the call to FltGetFileNameInformation and
re-test opening the Visio document -> no freeze.
Un-commented it back -> freeze again.
Any idea what the problem is?
- is there a bug in the code above?
- is there a known bug in the FltGetFileNameInformation function (and
maybe the FltMgr.sys I have is old)?
- could my Visio document be the only culprit?
The minifilter seems to work fine and act stable besides when opening
that Visio document, but I’m not 100% sure since I had no time to test
many other programs. I do not have any other Visio document to test, in
order to check out if the problem is Visio itself. However, I noticed
that if I reboot my machine, open the Visio document, close it, load the
minifilter and re-open the Visio document -> the freeze does NOT occur
anymore. It only happens first time I load Visio after a reboot.
Ah, the same thing happens when using the stock “MiniSpy” sample code.
Same lock-up caused by FltGetFileNameInformation when opening the Visio
document.
Thanks for your attention,
OS version: Windows XP SP2
WDK version: 6001
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: xxxxx@polito.it
To unsubscribe send a blank email to xxxxx@lists.osr.com
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com