Roll your own IRPs

Folks,

Is there an library available that contain functions equivalent to Zw… but instead of taking handles it takes things like file objects and device objects and internally uses IRPs to issue the actual request to the targeted device?

Essencially a library of functions that allow you to issue all IRP_MJ_… using IRP’s and File objects

If available, what is the cost of such a library?

I guess, OSR folks should have something like this.

Regards,

Manish


Do you Yahoo!?
Free online calendar with sync to Outlook™.

>“Manish Apte” wrote in message news:xxxxx@ntfsd…
>
> Is there an library available that contain functions equivalent to Zw…
but instead of taking handles it takes things like file objects and device
> objects and internally uses IRPs to issue the actual request to the
targeted device?

I hate to give you the traditional reply, but, here goes anyhow: “What are
you trying to accomplish?”

What you’re describing “a library that … takes a device object… and
internally uses IRPs to issue the actual request to the targted device” is
precisely what NtXxxx and ZwXxxx do.

Tell us what you need to do, and we’ll see if we can help you find a
solution.

Peter
OSR

Peter,

The reason why I need to construct my own IRP’s and send it to a driver is because some of the Zw/Nt calls hide some of the parameters that can be specified by directly using the IRP mechanism

For example, ZwQueryDirectoryFile does not take the starting logical offset, to read a directory at random offsets (as long as correct offset values are give). This parameter, I believe, can be specified through the equivalent IRP mechanism

In general, IRP mechanism allows more control compared to Zw/Nt interface, and I guess hence requires for more work to be done by the programmer (compared to just calling simple Zw/Nt calls)

The library that I was referring to was something that I thought would do this work of creating the IRP and fills it up with proper settings (flags/parameters) and then send the IRP to the targeted device/driver.

I know its not that difficult to create IRP’s and use IoCallDriver (may be I am wrong here, may be it is not that simple), but if a library is available to me that does this work correctly for me and provides almost the same interface as Zw/Nt calls for me, my life is going to be simple.

Regards,

Manish

Peter Viscarola wrote:

>“Manish Apte” wrote in message news:xxxxx@ntfsd…
>
> Is there an library available that contain functions equivalent to Zw…
but instead of taking handles it takes things like file objects and device
> objects and internally uses IRPs to issue the actual request to the
targeted device?

I hate to give you the traditional reply, but, here goes anyhow: “What are
you trying to accomplish?”

What you’re describing “a library that … takes a device object… and
internally uses IRPs to issue the actual request to the targted device” is
precisely what NtXxxx and ZwXxxx do.

Tell us what you need to do, and we’ll see if we can help you find a
solution.

Peter
OSR


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

---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

“Manish Apte” wrote in message news:xxxxx@ntfsd…
Peter,

The reason why I need to construct my own IRP’s and send it to a driver is because some of the Zw/Nt calls hide some of the parameters that can be specified by directly using the IRP mechanism

For example, ZwQueryDirectoryFile does not take the starting logical offset, to read a directory at random offsets (as long as correct offset values are give). This parameter, I believe, can be specified through the equivalent IRP mechanism

Well, probably the reason ZwQueryDirectoryFile doesn’t allow you to specify an “offset” into the directory is that this function doesn’t simply read a directory as if it were a file. That technique may work in some flavors of UNIX, but doesn’t work in NT.

Carl

Rolling your own IRP is simple. You can write equivalents to all Zw/Nt routines in several hours. But if you want to spend some money I can write it for you :wink:

-htfv

----- Original Message -----
From: Manish Apte
To: File Systems Developers
Sent: Saturday, June 14, 2003 3:43 AM
Subject: [ntfsd] Roll your own IRPs

Folks,

Is there an library available that contain functions equivalent to Zw… but instead of taking handles it takes things like file objects and device objects and internally uses IRPs to issue the actual request to the targeted device?

Essencially a library of functions that allow you to issue all IRP_MJ_… using IRP’s and File objects

If available, what is the cost of such a library?

I guess, OSR folks should have something like this.

Regards,

Manish


Do you Yahoo!?
Free online calendar with sync to Outlook™. — You are currently subscribed to ntfsd as: xxxxx@vba.com.by To unsubscribe send a blank email to xxxxx@lists.osr.com

“Alexey Logachyov” wrote in message news:xxxxx@ntfsd…
Rolling your own IRP is simple. You can write equivalents to all Zw/Nt routines in several hours. But if you want to spend some money I can write it for you :wink:

-htfv

Maybe all of us should contribute $ to see what you come up with for ZwCreateFile :slight_smile: That seems to be the most difficult one. Luckily, I don’t need a substitute.

Carl

Try finding the following post for a create

“Sent: Wednesday, February 14, 2001 4:16 PM
To: File Systems Developers
Subject: [ntfsd] RE: Question on preventing my driver from filtering i
t’s own transactions…”

-Avi

-----Original Message-----
From: Carl Appellof [mailto:xxxxx@nospam.veritas.com]
Sent: Tuesday, June 17, 2003 6:28 PM
To: File Systems Developers
Subject: [ntfsd] Re: Roll your own IRPs

“Alexey Logachyov” wrote in message
news:xxxxx@ntfsd…
Rolling your own IRP is simple. You can write equivalents to all
Zw/Nt routines in several hours. But if you want to spend some money I
can write it for you :wink:

-htfv

Maybe all of us should contribute $ to see what you come up with for
ZwCreateFile :slight_smile: That seems to be the most difficult one. Luckily, I
don’t need a substitute.

Carl


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

I used custom implementation of ZwCreateFile (based on sources found on ntfsd) until I implemented shadow devices. And it works!

-htfv

----- Original Message -----
From: Carl Appellof
Newsgroups: ntfsd
To: File Systems Developers
Sent: Wednesday, June 18, 2003 1:28 AM
Subject: [ntfsd] Re: Roll your own IRPs

“Alexey Logachyov” wrote in message news:xxxxx@ntfsd…
Rolling your own IRP is simple. You can write equivalents to all Zw/Nt routines in several hours. But if you want to spend some money I can write it for you :wink:

-htfv

Maybe all of us should contribute $ to see what you come up with for ZwCreateFile :slight_smile: That seems to be the most difficult one. Luckily, I don’t need a substitute.

Carl


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