IRP status

Hello ,

If I complete an intercepted IRP without passing it to the underlying
driver does Irp->IoStatus affect the error code returned by
GetLastError function?
If no, then is there a way to affect the value returned by this function?


Roman

mailto:xxxxx@rbcmail.ru

GetLastError retrieves its value from the thread’s TEB block.
Presumably, one of the things Win32 does is converts the OS level error
into a Win32 error and then stores it into that field of the TEB.

Thus, you should be able to change the results of this, albeit
indirectly.

Regards,

Tony

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

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roman Kudinov
Sent: Friday, October 15, 2004 8:41 AM
To: ntfsd redirect
Subject: [ntfsd] IRP status

Hello ,

If I complete an intercepted IRP without passing it to the underlying
driver does Irp->IoStatus affect the error code returned by
GetLastError function?
If no, then is there a way to affect the value returned by this
function?


Roman

mailto:xxxxx@rbcmail.ru


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

> If I complete an intercepted IRP without passing it to the underlying

driver does Irp->IoStatus affect the error code returned by
GetLastError function?

Not exactly. The return value is converted from
NTSTATUS to Win32 error code. What you get
from GetLastError is the Win32 error code

e.g.

STATUS_ACCESS_DENIED => ERROR_ACCESS_DENIED
STATUS_OBJECT_NAME_NOT_FOUND =>
ERROR_FILE_NOT_FOUND

etc.

If you are uncertain how to fill the Irp->IoStatus,
I would strongly suggest to use Driver Verifier,
it checks all returns from your driver and bugchecks
e.g. if the return value differs from the IoStatus.Status.

L.