Using QueryInformationFile

Hello:

I’m trying to determine if the File Object that I’m dealing with is a
directory or a file. I’m using a modified version of FileSpy to
accomplish this.

I am using a copy of the method SpyQueryInformationFile defined in
fspyLib.c except that I removed the PAGED_CODE() directive from the file
and called it SpyQueryInformationFileNoPage. This creates a new IRP
requesting IRP_MJ_QUERY_INFORMATION.

I’m calling SpyQueryInformationFile in SpyLogIrpCompletion which is
called during the IO Completion Routine. My desktop simply freezes, and
no bugcheck is thrown. Where can I start to look for the problem? If I
simply remove the call to SpyQueryInformationFileNoPage everything works
fine.

Thanks in advance,
-Matt

PAGED_CODE is just assertion that current IRQL < DISPATCH_LEVEL. It is there
to make sure that this function is not invoked at DISPATCH_LEVEL because it
is illegal to send IRP_MJ_QUERY_INFORMATION and it is illegal to wait at
IRQL > APC_LEVEL.
In completion routine you may me be at DISPATCH_LEVEL and then you will have
problems.

Alexei.

“Matthew Giedt” wrote in message news:xxxxx@ntfsd…
>
> Hello:
>
> I’m trying to determine if the File Object that I’m dealing with is a
> directory or a file. I’m using a modified version of FileSpy to
> accomplish this.
>
> I am using a copy of the method SpyQueryInformationFile defined in
> fspyLib.c except that I removed the PAGED_CODE() directive from the file
> and called it SpyQueryInformationFileNoPage. This creates a new IRP
> requesting IRP_MJ_QUERY_INFORMATION.
>
> I’m calling SpyQueryInformationFile in SpyLogIrpCompletion which is
> called during the IO Completion Routine. My desktop simply freezes, and
> no bugcheck is thrown. Where can I start to look for the problem? If I
> simply remove the call to SpyQueryInformationFileNoPage everything works
> fine.
>
> Thanks in advance,
> -Matt
>
>
>
>

Thanks, that makes sense. I was getting confused with the SYNCHing code.

So my take at the best way to handle this: Capture all of the
information I care about in the completion routine inside the pLogRecord
structure just as I’m doing. Then at the end of my existing completion
routine call the QueryFileInformation routine passing in the recorded
pLogRecord data in a separate (worker?) thread and setting a new
completion routine?

Thanks,
-Matt

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alexei Jelvis
Sent: Friday, June 27, 2003 11:18 PM
To: File Systems Developers
Subject: [ntfsd] Re: Using QueryInformationFile

PAGED_CODE is just assertion that current IRQL < DISPATCH_LEVEL. It is
there
to make sure that this function is not invoked at DISPATCH_LEVEL because
it
is illegal to send IRP_MJ_QUERY_INFORMATION and it is illegal to wait
at
IRQL > APC_LEVEL.
In completion routine you may me be at DISPATCH_LEVEL and then you will
have
problems.

Alexei.

“Matthew Giedt” wrote in message
news:xxxxx@ntfsd…
>
> Hello:
>
> I’m trying to determine if the File Object that I’m dealing with is a
> directory or a file. I’m using a modified version of FileSpy to
> accomplish this.
>
> I am using a copy of the method SpyQueryInformationFile defined in
> fspyLib.c except that I removed the PAGED_CODE() directive from the
file
> and called it SpyQueryInformationFileNoPage. This creates a new IRP
> requesting IRP_MJ_QUERY_INFORMATION.
>
> I’m calling SpyQueryInformationFile in SpyLogIrpCompletion which is
> called during the IO Completion Routine. My desktop simply freezes,
and
> no bugcheck is thrown. Where can I start to look for the problem? If I
> simply remove the call to SpyQueryInformationFileNoPage everything
works
> fine.
>
> Thanks in advance,
> -Matt
>
>
>
>


You are currently subscribed to ntfsd as: xxxxx@appliedrt.com
To unsubscribe send a blank email to xxxxx@lists.osr.com