Check for Irp->CurrentLocation

Hi,

I have made the following check in my driver dispatch routine.

NTSTATUS MyDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp,PCOMMON_FUNCTION CommonFunction, PUINT8 CommonFunctionName,BOOLEAN Wait )
{
.
.
.
.
.
if(Irp->CurrentLocation >= DeviceObject->StackSize)
{
}

}

Can any one please tell me the popssible scenarios where the “Irp->CurrentLocation < DeviceObject->StackSize” ?

"Can any one please tell me the popssible scenarios where the
“Irp->CurrentLocation < DeviceObject->StackSize” "

Scenario One: You fucked-up

Scenario Two: You fucked-up

Sorry, best I can do this morning…

I’ve only seen OS bugs where the CurrentLocation is > than the StackSize,
I’ve never personally seen the opposite
that you describe or have heard of bugs in the OS that would produce that.

Perhaps you should reexamine your code and look at some of the rather
helpful documents that pertain to IRP Handling.


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) 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

one example - TDI and NetBT (WinXP)

see http://tech.groups.yahoo.com/group/discussion-pcausa/message/4760

TDI clients determin the number of I/O stack locations that they must
provide when they open a TDI device. This value is never recomputed. When a
TDI filter attached to a TDI provider device it adds an additional layer in
the device stack, which in turn requires an additional I/O stack location.

If a TDI filter attaches to a TDI provider device AFTER a TDI client has
opened the device, then the TDI client will provide IRPs with insufficuent
I/O stack locations. The test below will be positive. The primary example of
this case is when this filter is loaded AFTER the NetBT TDI client.
Certainly this would be the case if the TDI filter is loaded dynamically. It
can also be the case if the TDI filter is loaded automatically - but still
not early enough to attach before NetBT.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: 30. b?ezna 2009 11:37
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Check for Irp->CurrentLocation

Hi,

I have made the following check in my driver dispatch routine.

NTSTATUS MyDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP
Irp,PCOMMON_FUNCTION CommonFunction, PUINT8 CommonFunctionName,BOOLEAN
Wait )
{
.
.
.
.
.
if(Irp->CurrentLocation >= DeviceObject->StackSize)
{
}

}

Can any one please tell me the popssible scenarios where the
“Irp->CurrentLocation < DeviceObject->StackSize” ?


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) 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

> Can any one please tell me the popssible scenarios where the "Irp->CurrentLocation <

DeviceObject->StackSize" ?

I encountered same problem when writing a TDI-filter (when tested compatibility problem).
Variant 1: report this situation upper-filter developer and wait bug-fix…
Variant 2: reallocate IRP and enjoy)

Thanks for your reply.