Re: GetLastError / SetLastError functionality from inside a driver



Let's get to the substance of Don's reply. You have attempted to force the
world of drivers into a user mode mindset. I won't work. Read, study, and
quit bottom posting. I usually don't scroll down since bottom posters
mostly don't have anything useful.

If you HAVE to leap into this for whatever reason, that doesn't mean you
will receive a drivers 101 tutorial via this newsgroup.

"developer28" <aman.k.sethi@xxxxxxxxx> wrote in message
news:2751c812-3ffa-47a0-9079-0a9e7d3b28d1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 26, 7:30 pm, "Don Burn" <b...@xxxxxxxxxxxxxxxxxxxx> wrote:
No, there is not you need to return the correct code for a request and it
will be converted to a Win32 error code. Before trying to go further in
the
kernel, I would strongly recommend you take a class or two or at a minimum
read the "Windows Internals" book by Russinovich and Solomon. Note: you
mention file system filters, these are some of the toughest kernel drivers
to get right, don't even go near them with the questions you are asking.

--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website:http://www.windrvr.com
Blog:http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"developer28" <aman.k.se...@xxxxxxxxx> wrote in message

news:9642ae71-40c4-4802-9d03-20edc70886db@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 26, 5:27 pm, "Volodymyr M. Shcherbyna"



<v_scherb...@xxxxxxxxxxxxxxx> wrote:
There is no such things in drivers. If something fails you get return
code
and look into documentation or you have a bluescreen which has to be
analyzed.

--
Volodymyr, blog:http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no
rights)

"developer28" <aman.k.se...@xxxxxxxxx> wrote in message

news:709f3ed5-b7d4-4f3f-8d84-74abd5016f60@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hi,

Please cooperate if this appears to be a trivial question.

I am newbie to this.

I just wanted to know how is it possible to get functionality similar
to GetLastError() and SetLastError() inside a driver?

If there is something more particular about a file system filter
driver, please advise me about that too because i am working on a file
system filter.

Thanks for any help.

Regards,
Aman.

Is there a way to set last error (SetLastError() ) from the kernel
mode , so that when GetLastError() is called in the user mode, the
error that was set in the kernel mode is returned?

Your reply is appreciated Don.
Somehow i have no other choice but to dive into these drivers. It is
tough going i know but i guess i'll eventually find a way. It'll take
time i do understand.

For now if you can guide me on how do i send the error code back. Is
it to be passed back as the part of the IRP or some other way?

It is a legacy filter and not a minifilter.

Thanks again.

Regards,
Aman.


.



Relevant Pages

  • Re: Obsoleteness of X concept
    ... What if we go more further and embed second layer into new kernel ... be exchanged that easily as user mode ... Compare this to the old printer driver model of windows which also had ... kernel mode drivers. ...
    (comp.os.linux.x)
  • Re: Memory >3.5GB not used?
    ... When I went to rebuild the kernel I got this message: ... *** Error code 1 ... # PAE -- Generic kernel configuration file for FreeBSD/i386 PAE ... # What follows is a list of drivers that are normally in GENERIC, ...
    (freebsd-questions)
  • Re: USB performance bug since kernel 2.6.13 (CRITICAL???)
    ... user mode for this sort of thing. ... kernel mode drivers in this regard. ... Recall that each transaction ...
    (Linux-Kernel)
  • Re: building module regression
    ... With latest kernel it is no more possible ... to do something like this (with net drivers): ... *** Error code 1 ... It is introduced once ifdef VIMAGE are removed from net/vnet.h in ...
    (freebsd-current)
  • Re: Allocating and accessing physically contiguous memory in user mode in WinCE 6.0 Beta
    ... because most embedded systems are closed systems, ... User mode drivers are exactly what we have had for all versions prior to CE ... What is new in V6.0 is Kernel mode drivers, ...
    (microsoft.public.windowsce.platbuilder)

Quantcast