Hi
I am doing a SYS driver (on NT/Win2k) that must Load/Unload itself dynamicaly and filter some input from the keyboard (ie not allow some keys to be typed in). So its a layered intermediate kernel mode driver :)
Inside the Dispatch_Read routine i use IoSetCompletionRoutine to set a callback to my code when the lower driver has done its job and has a key scancode for me.
All works ok, until i try to unload my driver. After unload any key will generate a nasty NT crash (not even a blue screen).
Now, if i comment out the IoSetCompletionRoutine, everything loads/unloads fine....but of course i can not filter keys anymore...
So i am asking if some NT driver guru knows how do i unset the job done by IoSetCompletionRoutine in a gracefully way ...
Any help will be appreciated
Thx
I am doing a SYS driver (on NT/Win2k) that must Load/Unload itself dynamicaly and filter some input from the keyboard (ie not allow some keys to be typed in). So its a layered intermediate kernel mode driver :)
Inside the Dispatch_Read routine i use IoSetCompletionRoutine to set a callback to my code when the lower driver has done its job and has a key scancode for me.
All works ok, until i try to unload my driver. After unload any key will generate a nasty NT crash (not even a blue screen).
Now, if i comment out the IoSetCompletionRoutine, everything loads/unloads fine....but of course i can not filter keys anymore...
So i am asking if some NT driver guru knows how do i unset the job done by IoSetCompletionRoutine in a gracefully way ...
Any help will be appreciated
Thx
I'll take a quick shot :
http://www.osr.com/ddk/k104_5w6q.htm
Read through the comments near the bottom of the page.
Quote :
"Non-PnP drivers that might be unloaded before their IoCompletion routines execute should use IoSetCompletionRoutineEx instead."
OSR are THE PROS when it comes to kernel driver stuff. I encourage you to browse their website. Especially their archives of 'NT Insider' are a valuable source of information.
More on IoCompletition as I find it, coz I'll be facing the exact same thing very soon.
http://www.osr.com/ddk/k104_5w6q.htm
Read through the comments near the bottom of the page.
Quote :
"Non-PnP drivers that might be unloaded before their IoCompletion routines execute should use IoSetCompletionRoutineEx instead."
OSR are THE PROS when it comes to kernel driver stuff. I encourage you to browse their website. Especially their archives of 'NT Insider' are a valuable source of information.
More on IoCompletition as I find it, coz I'll be facing the exact same thing very soon.
Thx Man,
I am reading it but it looks like this "Ex" function is available only on XP... my driver must work on NT4 and Win2k (hehe on Win9x also but there i use a Vxd in ASM :) )
So it has to be another solution ....
i hope :)
I am reading it but it looks like this "Ex" function is available only on XP... my driver must work on NT4 and Win2k (hehe on Win9x also but there i use a Vxd in ASM :) )
So it has to be another solution ....
i hope :)
Thx again man
now i have to study,work,study,work ...
:alright:
now i have to study,work,study,work ...
:alright: