Issuing IRP_MJ_DIRECTORY_CONTROL

Hi,

I will be highly appreciated if you can get me an advice on
how to build an IRP for enumerating a directory contents.

Can I use IoBuildAsync… or IoBuildSync… for these purposes?
Will these calls initialize buffer pointers depending on the type of IO
or they do it only for READ/WRITE requests?
Or I have to use IoAllocateIrp and initialize all fields manually?

Thanks in advance,
Leonid.

Both APIs you reffer do correctly initialize the IRP and allocate a MDL , if
required, based on device type.
However , NT kernel already wraped this call for you into a convenable
function called ZwQueryDirectoryFile.

Dan

“Leonid Zhigunov” wrote in message
news:xxxxx@ntfsd…
>
> Hi,
>
> I will be highly appreciated if you can get me an advice on
> how to build an IRP for enumerating a directory contents.
>
> Can I use IoBuildAsync… or IoBuildSync… for these purposes?
> Will these calls initialize buffer pointers depending on the type of IO
> or they do it only for READ/WRITE requests?
> Or I have to use IoAllocateIrp and initialize all fields manually?
>
> Thanks in advance,
> Leonid.
>
>
>
>
>

Thank you, Dan.

Yes, I know about ZwQueryDirectoryFile.
One thing is that I need to issue this call from
DIRECTORY_CONTROL/QUERY_DIRECTORY.
But it is not so bad, but another thing is that ZwQueryDirectoryFile does
not take FileIndex parameter.

I need to handle QUERY_DIRECTORY in my filter in order to add some entries,
which are really
from another (shadow) directory. So, I need to open it and query for
contents.
Cause I can get several queries for original directory I need to maintain a
kind of context to handle
this situation, say to keep FileIndex. But I can not use it with
ZwQueryDirectoryFile.

May be there is a better solution.
I would be nice if you advice something.

Leonid.

“Dan Partelly” wrote in message news:xxxxx@ntfsd…
>
> Both APIs you reffer do correctly initialize the IRP and allocate a MDL ,
if
> required, based on device type.
> However , NT kernel already wraped this call for you into a convenable
> function called ZwQueryDirectoryFile.
>
> Dan
>
> “Leonid Zhigunov” wrote in message
> news:xxxxx@ntfsd…
> >
> > Hi,
> >
> > I will be highly appreciated if you can get me an advice on
> > how to build an IRP for enumerating a directory contents.
> >
> > Can I use IoBuildAsync… or IoBuildSync… for these purposes?
> > Will these calls initialize buffer pointers depending on the type of IO
> > or they do it only for READ/WRITE requests?
> > Or I have to use IoAllocateIrp and initialize all fields manually?
> >
> > Thanks in advance,
> > Leonid.
> >
> >
> >
> >
> >
>
>
>
>

I am sorry for stupid question.

If I use IoBuildSynchronousFsdRequest, should I use the current stack
location
to setup request parameters or the next stack location?

Leonid.

“Dan Partelly” wrote in message news:xxxxx@ntfsd…
>
> Both APIs you reffer do correctly initialize the IRP and allocate a MDL ,
if
> required, based on device type.
> However , NT kernel already wraped this call for you into a convenable
> function called ZwQueryDirectoryFile.
>
> Dan
>
> “Leonid Zhigunov” wrote in message
> news:xxxxx@ntfsd…
> >
> > Hi,
> >
> > I will be highly appreciated if you can get me an advice on
> > how to build an IRP for enumerating a directory contents.
> >
> > Can I use IoBuildAsync… or IoBuildSync… for these purposes?
> > Will these calls initialize buffer pointers depending on the type of IO
> > or they do it only for READ/WRITE requests?
> > Or I have to use IoAllocateIrp and initialize all fields manually?
> >
> > Thanks in advance,
> > Leonid.
> >
> >
> >
> >
> >
>
>
>
>

Use the next stack location. The I/O Manager will advance the current stack
location pointer when you call IoCallDriver.

(In fact, you do not HAVE a current stack location!)

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Leonid Zhigunov [mailto:xxxxx@progate.spb.ru]
Sent: Monday, July 15, 2002 12:03 PM
To: File Systems Developers
Subject: [ntfsd] Re: Issuing IRP_MJ_DIRECTORY_CONTROL

I am sorry for stupid question.

If I use IoBuildSynchronousFsdRequest, should I use the current stack
location
to setup request parameters or the next stack location?

Leonid.

“Dan Partelly” wrote in message news:xxxxx@ntfsd…
>
> Both APIs you reffer do correctly initialize the IRP and allocate a MDL ,
if
> required, based on device type.
> However , NT kernel already wraped this call for you into a convenable
> function called ZwQueryDirectoryFile.
>
> Dan
>
> “Leonid Zhigunov” wrote in message
> news:xxxxx@ntfsd…
> >
> > Hi,
> >
> > I will be highly appreciated if you can get me an advice on
> > how to build an IRP for enumerating a directory contents.
> >
> > Can I use IoBuildAsync… or IoBuildSync… for these purposes?
> > Will these calls initialize buffer pointers depending on the type of IO
> > or they do it only for READ/WRITE requests?
> > Or I have to use IoAllocateIrp and initialize all fields manually?
> >
> > Thanks in advance,
> > Leonid.
> >
> >
> >
> >
> >
>
>
>
>


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

> If I use IoBuildSynchronousFsdRequest, should I use the current
stack

location
to setup request parameters or the next stack location?

Next.
Next location - to set the parameters before sending the IRP down.
Current location - to parse the parameters in the IRP arrived to you
from up.

Max