- Exception Handling in the kernel
- Posted by fat_boy on June 24th, 2005
Hi all.
I have never used exception handling in driver code, but I recall that
in NT4 you could use it in code called by an application, so
read/write/deviceiocontrol dispatch code could contain it.
I was wondering if the situation had changed at all and was looking for
a definitive statement on what exception handling can be used, where it
can be used, and at what level/priority it can be used.
Not having found an answer on line, or in the DDK, I was wondering if
anyone can enlighten me?
- Posted by Mark Roddy on June 24th, 2005
fat_boy wrote:
limited to your passive level dispatch side code and ought not to be
used over on the interrupt side of your driver. I don't believe there is
an explicit restriction on application vs system process threads, and I
don't see why there should be. If you can search far enough back in the
various newsgroups or perhaps on ntdev, the reasons why bad things might
happen on interrupt side processing has been discussed.
Of course you also cannot use C++ style exception handling as there is
no runtime support in the kernel, and you should be aware that SEH
exception frames are a bit large and the kernel stack is a bit small.
--
=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
- Posted by fat_boy on June 24th, 2005
So no change then really. I saw in the 2003 DDK mention of SEH in
reference to a few Probexxx() functions.
I guess I'll continue to not use it.
Thx
- Posted by Jonathan Morrison [MSFT] on June 24th, 2005
Just to be clear - there are some cases where you HAVE to use exception
handling. For instance if you are directly accessing memory via a usermode
virtual address. You would have to first capture and probe the address and
then wrap any accesses to it in a try/except block.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"fat_boy" <m.sykes@option.com> wrote in message
news:1119618333.212596.317290@g43g2000cwa.googlegr oups.com...