IRP creation..

Hi,

I have created a IRP pool using IOAllocateIRP() and reusing the IRP using reuseIRP call.

I am trying fill IRP retrieved from pool, but how do set the starting offset(disk sector) in the IRP created by IOAllocateIRP() and set the buffers?

I found that using “StackPtr = IoGetNextIrpStackLocation(Irp);” I can set the offset and other information but I am not sure if this is complaint with later windows OS (2008, server 2012 etc…).

In contrary if I use IoBuildAsynchronousFsdRequest() to create IRP then I can not reuse it.

Any pointers in this context will be helpful.

Thanks,
Amrat

StackPtr = IoGetNextIrpStackLocation(Irp); is correct in this case. You will have to format the stack location entirely in your code, no API will help you

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?1/?2/?2015 4:32 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] IRP creation…

Hi,

I have created a IRP pool using IOAllocateIRP() and reusing the IRP using reuseIRP call.

I am trying fill IRP retrieved from pool, but how do set the starting offset(disk sector) in the IRP created by IOAllocateIRP() and set the buffers?

I found that using “StackPtr = IoGetNextIrpStackLocation(Irp);” I can set the offset and other information but I am not sure if this is complaint with later windows OS (2008, server 2012 etc…).

In contrary if I use IoBuildAsynchronousFsdRequest() to create IRP then I can not reuse it.

Any pointers in this context will be helpful.

Thanks,
Amrat


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

Hi Doron,

Thanks for the quick response, that helps.

So If I continue with the “StackPtr = IoGetNextIrpStackLocation(Irp)” approach, will it be complaint and fine with all the flavours Win OSs (2008, 2012 server editions, win7 etc…)? I mean to say there will be NO issues with any win LATEST OSs interms of system behaviour and stability?

Also Can you please elaborate more on formatting of stack location, that will help?

Thanks,
Amrat

The os doesn’t know how an irp was formatted. It is compliant from that pov. It is quite normal for drivers to format irps on their own. Read up on MSDN if you don’t understand irp stack location formatting. If you are still struggling, I suggest using kmdf where there are many request formatting routines that help you out.

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?1/?2/?2015 10:52 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] IRP creation…

Hi Doron,

Thanks for the quick response, that helps.

So If I continue with the “StackPtr = IoGetNextIrpStackLocation(Irp)” approach, will it be complaint and fine with all the flavours Win OSs (2008, 2012 server editions, win7 etc…)? I mean to say there will be NO issues with any win LATEST OSs interms of system behaviour and stability?

Also Can you please elaborate more on formatting of stack location, that will help?

Thanks,
Amrat


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

xxxxx@gmail.com wrote:

I have created a IRP pool using IOAllocateIRP() and reusing the IRP using reuseIRP call.

I am trying fill IRP retrieved from pool, but how do set the starting offset(disk sector) in the IRP created by IOAllocateIRP() and set the buffers?

I found that using “StackPtr = IoGetNextIrpStackLocation(Irp);” I can set the offset and other information but I am not sure if this is complaint with later windows OS (2008, server 2012 etc…).

What on earth would have led you to think this was a problem?
Seriously, I’m wondering what even placed that fear in your mind.

The IRP is fundamental. It has not changed in any non-trivial way since
Windows NT was created 25 years ago. It is unlikely to change in the
future, EVER, until Windows is replaced by something else.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.