Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to trap a Div by zero error in Interrupt roputine of a kernel driver

0 views
Skip to first unread message

Pierre-Alain Oberson

unread,
Dec 17, 2004, 6:16:15 AM12/17/04
to
Hello,

Is-it possible to trap a Divide-by-zero error on an INTERRUPT routine of
a Windows 2000 kernel driver?

A "try" and "except" functions works correctly on driver but not in
Interrupt routine.

Thanks for your help.

Pierre-Alain

Alexander Grigoriev

unread,
Dec 17, 2004, 10:14:52 AM12/17/04
to
Check for zero before divide.

"Pierre-Alain Oberson" <p-a.ober...@fastware.ch> wrote in message
news:uaTXUnC5...@TK2MSFTNGP14.phx.gbl...

Pierre-Alain Oberson

unread,
Dec 17, 2004, 12:10:22 PM12/17/04
to
This divide by zero is made in an external function! It is not so simple!

Pavel A.

unread,
Dec 18, 2004, 5:59:57 PM12/18/04
to
"Pierre-Alain Oberson" <p-a.ober...@fastware.ch> wrote in message news:OalrMtF5...@TK2MSFTNGP10.phx.gbl...

> This divide by zero is made in an external function! It is not so simple!

Yep. Kernel and user modes differ, and you just can't do in kernel mode all
things you do in usermode. At least, it is not simple.
--PA

Alexander Grigoriev

unread,
Dec 18, 2004, 8:35:56 PM12/18/04
to
What function is that? what it is doing?


"Pierre-Alain Oberson" <p-a.ober...@fastware.ch> wrote in message

news:OalrMtF5...@TK2MSFTNGP10.phx.gbl...

Carl Daniel [VC++ MVP]

unread,
Dec 18, 2004, 10:41:28 PM12/18/04
to
Pierre-Alain Oberson wrote:

> This divide by zero is made in an external function! It is not so
> simple!

Change your design to not rely on code that wasn't specifically written to
be used in an ISR. Perhaps you can do the work with the 3rd party library
in a DPC instead.

-cd


0 new messages