Re: IRP status

Thanks for your answers, finally I got a chance to back to the issue and fix
it. It was my mistake because I didn’t take into account that my
DeviceIoControl handler is called from the driver dispatch routine and from
FastIoDeviceControl. I fixed the return value in the dispatch routine and
forget to fix the return value in FastIoDeviceControl.
Now everything seems to work OK, however STATUS_SUCCESS doesn’t clear the
error code if it was set by other WinAPI functions previously, so I clear
the error code explicitly before calling DeviceIoControl


Roman

“Roman Kudinov” <krandv_> wrote in message news:…
> Thanks Tony,
>
> Can I affect OS level error somehow? It seems that the return value from
the
> dispatch routine doesn’t affect it.
>
> I might seem to be stupid but I have never heard about thread’s TEB block,
> does it have anything with TLS?
>
>
> P.S.
> I have a problem that if I call DeviceIoControl with a custom IOCTL and
> generate and roll a standard IRP (FSCTL_GET_RETRIEVAL_POINTERS) to the
> underlying driver in my dispatch routine then GetLastError returns a error
> code (in my user-mode application after a call to DeviceIoControl) even if
> this IRP succeeded and I return Irp->IoStatus = 0 from the dispatch
routine.
>
>
> “Tony Mason” wrote in message news:xxxxx@ntfsd…
> 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
>
></krandv_>