Hi,
After reviewing some website
(http://www.sysinternal.com) I programmed a keyboard/mouse
filter driver. But there is something strange. I have a
global variable to control whether to ignore keyboard scan
code:
if (ignore)
{
for (i=0; i<numOfKey; i++)
KeyData[i].makecode=0;
}

I initialized the variable "ignore=0" in DriverEntry
but once I rebooted my PC, the driver starts working and
my keyboard does not have any respond. It seems that the
variable ignore is non-zero even I initialized it with
zero!! Can anoyone help?

Re: a keybaord/mousr filter driver by James

James
Mon Nov 17 21:40:13 CST 2003

Use WinDbg or SoftICE or something similar to get more information.

cmcheung wrote:

> I programmed a keyboard/mouse
> filter driver. But there is something strange. I have a
> global variable to control whether to ignore keyboard scan
> code:
> if (ignore)
> {
> for (i=0; i<numOfKey; i++)
> KeyData[i].makecode=0;
> }
>
> I initialized the variable "ignore=0" in DriverEntry
> but once I rebooted my PC, the driver starts working and
> my keyboard does not have any respond. It seems that the
> variable ignore is non-zero even I initialized it with
> zero!! Can anoyone help?

--
If replying by e-mail, please remove "nospam." from the address.

James Antognini
Windows DDK MVP



Re: a keybaord/mousr filter driver by cmcheung

cmcheung
Tue Nov 18 07:52:46 CST 2003

Hi,
Thanks. But is this only the thing I could do? Any
sample/webpage about this (other than www.osr.com or
www.sysinternal.com)?

>-----Original Message-----
>Use WinDbg or SoftICE or something similar to get more
information.
>
>
>James Antognini
>Windows DDK MVP
>

Re: a keybaord/mousr filter driver by Ray

Ray
Tue Nov 18 14:39:54 CST 2003

Well, theoretically you could put out debug output and use something
like DebugView to see it, but why not use WinDbg? The debugger is your
friend...

cmcheung@csis.hku.hk wrote:

> Hi,
> Thanks. But is this only the thing I could do? Any
> sample/webpage about this (other than www.osr.com or
> www.sysinternal.com)?
>
>
>>-----Original Message-----
>>Use WinDbg or SoftICE or something similar to get more
>
> information.
>
>>
>>James Antognini
>>Windows DDK MVP
>>

--
../ray\..

Re: a keybaord/mousr filter driver by anonymous

anonymous
Tue Nov 18 18:57:52 CST 2003

Hi,
I get single machine.

>-----Original Message-----
>Well, theoretically you could put out debug output and
use something
>like DebugView to see it, but why not use WinDbg? The
debugger is your
>friend...


Re: a keybaord/mousr filter driver by Ray

Ray
Tue Nov 18 19:27:43 CST 2003

Well... the best suggestion I have is to a) make sure you started with
the DDK's kbfiltr sample driver (you have to handle a lot of random
things correctly in order for a kb/mouse filter driver to work, and this
sample is the easiest place to start), and b) use DbgPrint and DebugView
to debug it.

SoftIce isn't really usable for debugging keyboard drivers because it
traps keyboard/mouse data for use in its own UI.

Either that or borrow a second machine and use WinDbg.

anonymous@discussions.microsoft.com wrote:

> Hi,
> I get single machine.
>
>
>>-----Original Message-----
>>Well, theoretically you could put out debug output and
>
> use something
>
>>like DebugView to see it, but why not use WinDbg? The
>
> debugger is your
>
>>friend...
>
>

--
../ray\..

Re: a keybaord/mousr filter driver by Barry

Barry
Tue Nov 18 19:48:51 CST 2003

Another way would be use a USB keyboard to debug the filter driver in
SoftICE.


"Ray Trent" <rat@synaptics.com.spamblock> wrote in message
news:efhcVxjrDHA.4060@TK2MSFTNGP11.phx.gbl...
> Well... the best suggestion I have is to a) make sure you started with
> the DDK's kbfiltr sample driver (you have to handle a lot of random
> things correctly in order for a kb/mouse filter driver to work, and this
> sample is the easiest place to start), and b) use DbgPrint and DebugView
> to debug it.
>
> SoftIce isn't really usable for debugging keyboard drivers because it
> traps keyboard/mouse data for use in its own UI.
>
> Either that or borrow a second machine and use WinDbg.
>



Re: a keybaord/mousr filter driver by Kirk

Kirk
Wed Nov 19 03:03:03 CST 2003

<anonymous@discussions.microsoft.com> wrote in message
news:05d701c3ae38$29224820$a401280a@phx.gbl...
> Hi,
> I get single machine.

You can use VMWare workstation with windbg.

-Kirk



Re: a keybaord/mousr filter driver by James

James
Wed Nov 19 09:01:08 CST 2003

I used SoftICE to debug a keyboard driver. As you suggest, it was painful.

Ray Trent wrote:

> SoftIce isn't really usable for debugging keyboard drivers because it
> traps keyboard/mouse data for use in its own UI.

--
If replying by e-mail, please remove "nospam." from the address.

James Antognini
Windows DDK MVP



Re: a keybaord/mousr filter driver by James

James
Wed Nov 19 09:05:23 CST 2003

You have to judge what you need and can afford. But: How much does a
second machine cost and how valuable to you is your work? If your
testing blows up your system -- has that ever happened to anybody here?
-- there's a chance your development files will be damaged. Second, if
you do use DebugView, you're going to find that all the output generated
by keyboard activity in running DebugView is going to be a pain.

anonymous@discussions.microsoft.com wrote:

> I get single machine.

--
If replying by e-mail, please remove "nospam." from the address.

James Antognini
Windows DDK MVP



Re: a keybaord/mousr filter driver by chris

chris
Thu Dec 04 10:38:09 CST 2003

Hi there,

I am Chris Plakyda the manager/Development Lead for SoftICE.

There will be conflicts if you are attempting to debug a ps2 driver
while using a ps2 keyboard, or if trying to debug a usb driver using a
usb keyboard. The best thing to do is to hook up both keyboards.
SoftICE has support for both usb and ps2 keyboards. Another good
option is remote debugging. In any case, SoftICE can be configured to
not touch a particular keyboard. IE You can tell it to leave the ps2
ports alone via the NullKeyboard and MouseType registry entries. To
Disable usb support modify the NullUSBKb and NullUsbMS registry
entries. These items are detailed in the using SoftICE guide and in
the readmes. They can also be disabled from our configuration
application.

Chris
Chris Plakyda
chris.plakyda@compuware.com
SoftICE Manager
Tech Lead SoftICE
Development Lead SoftICE
DriverStudio Software Engineer
Numega/Compuware

James Antognini <antognini@mindspring.nospam.com> wrote in message news:<3FBB85B4.251CD177@mindspring.nospam.com>...
> I used SoftICE to debug a keyboard driver. As you suggest, it was painful.
>
> Ray Trent wrote:
>
> > SoftIce isn't really usable for debugging keyboard drivers because it
> > traps keyboard/mouse data for use in its own UI.