Re: How to read from Keyboard

> Sorry there is no safe way to handle input from a keyboard before the

system is up.
Thank you for the answer.

What has been recomended over the years is using a custom switch on the
boot.ini line, this can be read from the registry and is safe.
boot.ini is not the only candidate, your very own my.cfg file works fine.

In some [production] cases you will have to do some rounds: if you need
these settings too early, postpone the decision to some later stage when
file[s] and/or hives are accessible, and do whatever you need then and
there.

For instance on XP, it is more then likely that KeyboardClass0 is the
terminal
services redirected virtual keyboard, not a physical keyboard.
This one hit me recently.
My guess was that keyboard0 is always local, and keyboard1 is always
MSTSC’s (I’m talking about wxp, not w2k3s).
Wrong I was: on a couple of [my] boxes it was the case, on a QA’s box -
where else? - it was not.

BTW, I still do not know how to tell which is which, does anyone?
A hint - not a solution - would be appreciated.
I think that the solution can be found in VNC sources, but maybe someone can
save me some time.

Here’s the problem: I need to control kbd lights [when some lengthy download
is being done] without changing the kbd status, that is, “num lock” light
blinks, but “num lock” state does not.
A sample (symlink to \Device\keyboard0 and IOCTLs) I googled out and
modified is ok, but - see above.

Your assumption that by the time your filter starts, the keyboard is
working is completely bogus. There is no such guarantee.
Oh! Even if it’s an upper filter?
See how good it is to do the research before?
I quickly browsed thru kbd-related samples in the DDK and decided that it
may be the case (check my post, I say “probably” twice).

Your code isn’t even system friendly in terms of time consumed.
Oh yes.
The ugliness of polling can compete only with ugliness of port reads.
The two just shine.
Not that the speed matters under the circumstances though.
I thought that the [ugliness of the] code speaks for itself and therefore
omitted obvious comments.
I repeat: it is a typical “what if” research. Nothing more, nothing less.

Your design is awful IMO
There was no such thing as “design” here. See above, below and my previous
post.

Please let me know what product this is going into
Good gracious, probably my English is not good enough also:
(a) as I already said, this was a ctrl2cap-related research;
(b) as I already said, it is not (where “not” means “not”) going into any
product, my product at least;
(c) as I already said, I have to use a product [that was bought from
another comapny] that apparently uses port reads, and this is what scares
me.

And sorry, I am not at liberty to name the product I’m talking about. I
have to talk to the vendor instead, and I will certainly quote all the
emotionally charged lyrics from this thread. Thanks for you helping me out
here.

Oh dear, I almost forgot to say that it was and is a research, it is not
going into a product and I do have to deal with a suspicious driver from a
vendor I can not name.

[That’s how it all started actually: why do they need port reads? Let’s
check using my uctl2cap/kctl2cap as a test base etc.]

I am not just some chicken little screaming at the sky ;).
Is someone trying to fry you?:slight_smile:

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 12:52 PM
Subject: RE: [ntdev] How to read from Keyboard in Native Mode

Even on a machine with only one physical keyboard attached, there can be
multiple /virtual/ keyboards which are also enumerated as keyboards on the
machine. For instance on XP, it is more then likely that KeyboardClass0 is
the terminal services redirected virtual keyboard, not a physical keyboard.
You cannot make this assumption that there is a mapping to hard coded name.
You need to use the device interface and you need to read from all the
keyboards.

I used to own all of the input stacks in Windows. I have debugged these
types of issues and assumptions for years, I am not just some chicken little
screaming at the sky ;).

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pruthviraj Kajale
Sent: Saturday, December 24, 2005 5:08 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to read from Keyboard in Native Mode

Hi,

I am assuming that there is only one keyboard. In that case Keyboardclass0
will work. So I need the method to read the key. Please help

Prithvi
Don Burn wrote:
Well how do you know the device is KeyboardClass0? Systems can have
multiple keyboards, or zero keyboards in the case of headless. Even if you
get this working for some class of systems, what are you going to do about
“lights out operations” where the computer is in a closet and the monitor is
turned off. I know of a small software firm that did this, and was sued
after they sold software licenses to a large company. It turns out that a
power glitch caused a system in the midwest to reboot, unfortunately if hung
by this stuff, and the large company sent someone from New York to see what
was wrong. In the end the software company refunded all the sales (a huge
loss) and paid for the cost of the trip to the midwest.

Why do you think you need this, there are other approaches to gettiug
information at boot time, explain your needs to the group, there may be an
answer that works.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Pruthviraj Kajale” wrote in message
news:xxxxx@ntdev…
> Hi,
>
> I am writing a Native Application. I want to read from Keyboard. I have
> written following code. but NtReadFile fails. can anybody tell me what’s
> wrong with it.
>
> NTSTATUS Status;
> UNICODE_STRING UnicodeFilespec;
> OBJECT_ATTRIBUTES ObjectAttributes;
> HANDLE FileHandle;
> IO_STATUS_BLOCK Iosb;
> ULONG MessageLength = strlen(Message);
> KEYBOARD_INPUT_DATA kbInputData;
> ULONG uiSize = 0, uiByteOffset = 0;
> RtlInitUnicodeString(&UnicodeFilespec, L"\Device\KeyboardClass0");
> InitializeObjectAttributes(&ObjectAttributes, // ptr to structure
> &UnicodeFilespec, // ptr to file spec
> OBJ_CASE_INSENSITIVE, // attributes
> NULL, // root directory handle
> NULL ); // ptr to security descriptor
> Status = NtCreateFile(&FileHandle, // returned file handle
> ( GENERIC_READ | SYNCHRONIZE | GENERIC_WRITE ), // desired access
> &ObjectAttributes, // ptr to object attributes
> &Iosb, // ptr to I/O status block
> 0, // allocation size
> FILE_ATTRIBUTE_NORMAL, // file attributes
> FILE_SHARE_WRITE /| FILE_SHARE_READ/, // share access
> FILE_OPEN, // create disposition
> FILE_DIRECTORY_FILE, // create options
> NULL, // ptr to extended attributes
> 0); // length of ea buffer
> if( !NT_SUCCESS(Status) )
> {
> DisplayString ( L"\r\n *NtCreateFile: Unable to create keyboard device
> " );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> }
> DisplayString ( L”\r\n
Press a Key" );
>
> uiSize = sizeof ( kbInputData );
> memset( &kbInputData, 0, sizeof( kbInputData ) );
> Status = NtReadFile ( FileHandle, // file Handle
> 0, // event Handle
> NULL, // APC entry point
> NULL, // APC context
> &Iosb, // IOSB address
> &kbInputData, // ptr to data buffer
> uiSize, // length
> &uiByteOffset, // byte offset
> NULL ); // key
> if ( ! NT_SUCCESS ( Status ) )
> {
> DisplayString ( L"\r\nNtReadFile to Read From keyboard is FAILED" );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> //printf(“NtWriteFile request failed 0x%0x\n”, Status);
>
> }
> swprintf ( szwError, L” kbInputData.MakeCode = %0x “,
> kbInputData.MakeCode );
> DisplayString ( szwError );
> DisplayString ( L”\r\n ***NtReadFile FINISHED" );
> NtClose ( FileHandle );
>
>
> Prithvi
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events, holidays,
> whatever.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping — Questions? First
check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

To figure out the difference between the keyboards, you can open each
one, query for the PDO
(IRP_MN_QUERY_DEVICE_RELATIONS/TargetDeviceRelation), and then use
IoGetDeviceProperty(DevicePropertyHardwareID and/or
DevicePropertyCompatibleIDs), and then iterate over the results.

Skip over the enumerator name if it is ROOT\ both the TS and ps2
keyboard can be enumerated by ROOT), and then see if the ID starts with
“pnp03” (use a case insensitive search). For instance a ps2 keyboard
could have an ID pnp03b or pnp0303.

If your driver is a true pnp upper filter (do you have an AddDevice
routine which is executed?), you get loaded when the ps2 keyboard is
loaded and started when the ps2 keyboard is started. The ps2 stack has
an IOCTL interface to talk to the ports and a callback for the filter to
initialize the keyboard at the right time.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 11:22 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

Sorry there is no safe way to handle input from a keyboard before the
system is up.
Thank you for the answer.

What has been recomended over the years is using a custom switch on
the
boot.ini line, this can be read from the registry and is safe.
boot.ini is not the only candidate, your very own my.cfg file works
fine.

In some [production] cases you will have to do some rounds: if you need
these settings too early, postpone the decision to some later stage when

file[s] and/or hives are accessible, and do whatever you need then and
there.

For instance on XP, it is more then likely that KeyboardClass0 is the
terminal
services redirected virtual keyboard, not a physical keyboard.
This one hit me recently.
My guess was that keyboard0 is always local, and keyboard1 is
always
MSTSC’s (I’m talking about wxp, not w2k3s).
Wrong I was: on a couple of [my] boxes it was the case, on a QA’s box -
where else? - it was not.

BTW, I still do not know how to tell which is which, does anyone?
A hint - not a solution - would be appreciated.
I think that the solution can be found in VNC sources, but maybe someone
can
save me some time.

Here’s the problem: I need to control kbd lights [when some lengthy
download
is being done] without changing the kbd status, that is, “num lock”
light
blinks, but “num lock” state does not.
A sample (symlink to \Device\keyboard0 and IOCTLs) I googled out and
modified is ok, but - see above.

Your assumption that by the time your filter starts, the keyboard is
working is completely bogus. There is no such guarantee.
Oh! Even if it’s an upper filter?
See how good it is to do the research before?
I quickly browsed thru kbd-related samples in the DDK and decided that
it
may be the case (check my post, I say “probably” twice).

Your code isn’t even system friendly in terms of time consumed.
Oh yes.
The ugliness of polling can compete only with ugliness of port reads.
The two just shine.
Not that the speed matters under the circumstances though.
I thought that the [ugliness of the] code speaks for itself and
therefore
omitted obvious comments.
I repeat: it is a typical “what if” research. Nothing more, nothing
less.

Your design is awful IMO
There was no such thing as “design” here. See above, below and my
previous
post.

Please let me know what product this is going into
Good gracious, probably my English is not good enough also:
(a) as I already said, this was a ctrl2cap-related research;
(b) as I already said, it is not (where “not” means “not”) going into
any
product, my product at least;
(c) as I already said, I have to use a product [that was bought from
another comapny] that apparently uses port reads, and this is what
scares
me.

And sorry, I am not at liberty to name the product I’m talking about. I

have to talk to the vendor instead, and I will certainly quote all the
emotionally charged lyrics from this thread. Thanks for you helping me
out
here.

Oh dear, I almost forgot to say that it was and is a research, it is not

going into a product and I do have to deal with a suspicious driver from
a
vendor I can not name.

[That’s how it all started actually: why do they need port reads? Let’s
check using my uctl2cap/kctl2cap as a test base etc.]

I am not just some chicken little screaming at the sky ;).
Is someone trying to fry you?:slight_smile:

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 12:52 PM
Subject: RE: [ntdev] How to read from Keyboard in Native Mode

Even on a machine with only one physical keyboard attached, there can
be
multiple /virtual/ keyboards which are also enumerated as keyboards on
the
machine. For instance on XP, it is more then likely that KeyboardClass0
is
the terminal services redirected virtual keyboard, not a physical
keyboard.
You cannot make this assumption that there is a mapping to hard coded
name.
You need to use the device interface and you need to read from all the

keyboards.

I used to own all of the input stacks in Windows. I have debugged these

types of issues and assumptions for years, I am not just some chicken
little
screaming at the sky ;).

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pruthviraj
Kajale
Sent: Saturday, December 24, 2005 5:08 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to read from Keyboard in Native Mode

Hi,

I am assuming that there is only one keyboard. In that case
Keyboardclass0
will work. So I need the method to read the key. Please help

Prithvi
Don Burn wrote:
Well how do you know the device is KeyboardClass0? Systems can have
multiple keyboards, or zero keyboards in the case of headless. Even if
you
get this working for some class of systems, what are you going to do
about
“lights out operations” where the computer is in a closet and the
monitor is
turned off. I know of a small software firm that did this, and was sued
after they sold software licenses to a large company. It turns out that
a
power glitch caused a system in the midwest to reboot, unfortunately if
hung
by this stuff, and the large company sent someone from New York to see
what
was wrong. In the end the software company refunded all the sales (a
huge
loss) and paid for the cost of the trip to the midwest.

Why do you think you need this, there are other approaches to gettiug
information at boot time, explain your needs to the group, there may be
an
answer that works.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Pruthviraj Kajale” wrote in message
news:xxxxx@ntdev…
> Hi,
>
> I am writing a Native Application. I want to read from Keyboard. I
have
> written following code. but NtReadFile fails. can anybody tell me
what’s
> wrong with it.
>
> NTSTATUS Status;
> UNICODE_STRING UnicodeFilespec;
> OBJECT_ATTRIBUTES ObjectAttributes;
> HANDLE FileHandle;
> IO_STATUS_BLOCK Iosb;
> ULONG MessageLength = strlen(Message);
> KEYBOARD_INPUT_DATA kbInputData;
> ULONG uiSize = 0, uiByteOffset = 0;
> RtlInitUnicodeString(&UnicodeFilespec, L"\Device\KeyboardClass0");
> InitializeObjectAttributes(&ObjectAttributes, // ptr to structure
> &UnicodeFilespec, // ptr to file spec
> OBJ_CASE_INSENSITIVE, // attributes
> NULL, // root directory handle
> NULL ); // ptr to security descriptor
> Status = NtCreateFile(&FileHandle, // returned file handle
> ( GENERIC_READ | SYNCHRONIZE | GENERIC_WRITE ), // desired access
> &ObjectAttributes, // ptr to object attributes
> &Iosb, // ptr to I/O status block
> 0, // allocation size
> FILE_ATTRIBUTE_NORMAL, // file attributes
> FILE_SHARE_WRITE /| FILE_SHARE_READ/, // share access
> FILE_OPEN, // create disposition
> FILE_DIRECTORY_FILE, // create options
> NULL, // ptr to extended attributes
> 0); // length of ea buffer
> if( !NT_SUCCESS(Status) )
> {
> DisplayString ( L"\r\n *NtCreateFile: Unable to create keyboard
device
> " );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> }
> DisplayString ( L”\r\n
Press a Key" );
>
> uiSize = sizeof ( kbInputData );
> memset( &kbInputData, 0, sizeof( kbInputData ) );
> Status = NtReadFile ( FileHandle, // file Handle
> 0, // event Handle
> NULL, // APC entry point
> NULL, // APC context
> &Iosb, // IOSB address
> &kbInputData, // ptr to data buffer
> uiSize, // length
> &uiByteOffset, // byte offset
> NULL ); // key
> if ( ! NT_SUCCESS ( Status ) )
> {
> DisplayString ( L"\r\nNtReadFile to Read From keyboard is FAILED" );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> //printf(“NtWriteFile request failed 0x%0x\n”, Status);
>
> }
> swprintf ( szwError, L” kbInputData.MakeCode = %0x “,
> kbInputData.MakeCode );
> DisplayString ( szwError );
> DisplayString ( L”\r\n ***NtReadFile FINISHED" );
> NtClose ( FileHandle );
>
>
> Prithvi
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events,
holidays,
> whatever.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping — Questions?
First
check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Great, that’s exactly what I was looking for.
Nice talking to a professional.

If your driver is a true pnp upper filter
No, this time it’s a UM app (the blink-kbd–as-we-download thing).
If what you described can be done from the UM (looks like it is NOT the case
if the caller is NOT an admin though - IOCTLs), I’ll do it there, if not, I
will add this functionality to one of my own [production] drivers [which
never ever poll and/or read ports directly].

see if the ID starts with “pnp03”
Wow! How on earth I could have guessed that…
Am I right to assume that this logic is ok in upwards from wxp (w2k3s,
vista)?

Thanks again.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 3:00 PM
Subject: RE: [ntdev] How to read from Keyboard

To figure out the difference between the keyboards, you can open each
one, query for the PDO
(IRP_MN_QUERY_DEVICE_RELATIONS/TargetDeviceRelation), and then use
IoGetDeviceProperty(DevicePropertyHardwareID and/or
DevicePropertyCompatibleIDs), and then iterate over the results.

Skip over the enumerator name if it is ROOT\ both the TS and ps2
keyboard can be enumerated by ROOT), and then see if the ID starts with
“pnp03” (use a case insensitive search). For instance a ps2 keyboard
could have an ID pnp03b or pnp0303.

If your driver is a true pnp upper filter (do you have an AddDevice
routine which is executed?), you get loaded when the ps2 keyboard is
loaded and started when the ps2 keyboard is started. The ps2 stack has
an IOCTL interface to talk to the ports and a callback for the filter to
initialize the keyboard at the right time.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 11:22 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> Sorry there is no safe way to handle input from a keyboard before the
> system is up.
Thank you for the answer.

> What has been recomended over the years is using a custom switch on
the
> boot.ini line, this can be read from the registry and is safe.
boot.ini is not the only candidate, your very own my.cfg file works
fine.

In some [production] cases you will have to do some rounds: if you need
these settings too early, postpone the decision to some later stage when

file[s] and/or hives are accessible, and do whatever you need then and
there.

> For instance on XP, it is more then likely that KeyboardClass0 is the
> terminal
> services redirected virtual keyboard, not a physical keyboard.
This one hit me recently.
My guess was that keyboard0 is always local, and keyboard1 is
always
MSTSC’s (I’m talking about wxp, not w2k3s).
Wrong I was: on a couple of [my] boxes it was the case, on a QA’s box -
where else? - it was not.

BTW, I still do not know how to tell which is which, does anyone?
A hint - not a solution - would be appreciated.
I think that the solution can be found in VNC sources, but maybe someone
can
save me some time.

Here’s the problem: I need to control kbd lights [when some lengthy
download
is being done] without changing the kbd status, that is, “num lock”
light
blinks, but “num lock” state does not.
A sample (symlink to \Device\keyboard0 and IOCTLs) I googled out and
modified is ok, but - see above.

> Your assumption that by the time your filter starts, the keyboard is
> working is completely bogus. There is no such guarantee.
Oh! Even if it’s an upper filter?
See how good it is to do the research before?
I quickly browsed thru kbd-related samples in the DDK and decided that
it
may be the case (check my post, I say “probably” twice).

> Your code isn’t even system friendly in terms of time consumed.
Oh yes.
The ugliness of polling can compete only with ugliness of port reads.
The two just shine.
Not that the speed matters under the circumstances though.
I thought that the [ugliness of the] code speaks for itself and
therefore
omitted obvious comments.
I repeat: it is a typical “what if” research. Nothing more, nothing
less.

> Your design is awful IMO
There was no such thing as “design” here. See above, below and my
previous
post.

> Please let me know what product this is going into
Good gracious, probably my English is not good enough also:
(a) as I already said, this was a ctrl2cap-related research;
(b) as I already said, it is not (where “not” means “not”) going into
any
product, my product at least;
(c) as I already said, I have to use a product [that was bought from
another comapny] that apparently uses port reads, and this is what
scares
me.

And sorry, I am not at liberty to name the product I’m talking about. I

have to talk to the vendor instead, and I will certainly quote all the
emotionally charged lyrics from this thread. Thanks for you helping me
out
here.

Oh dear, I almost forgot to say that it was and is a research, it is not

going into a product and I do have to deal with a suspicious driver from
a
vendor I can not name.

[That’s how it all started actually: why do they need port reads? Let’s
check using my uctl2cap/kctl2cap as a test base etc.]

> I am not just some chicken little screaming at the sky ;).
Is someone trying to fry you?:slight_smile:

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 12:52 PM
Subject: RE: [ntdev] How to read from Keyboard in Native Mode

Even on a machine with only one physical keyboard attached, there can
be
multiple /virtual/ keyboards which are also enumerated as keyboards on
the
machine. For instance on XP, it is more then likely that KeyboardClass0
is
the terminal services redirected virtual keyboard, not a physical
keyboard.
You cannot make this assumption that there is a mapping to hard coded
name.
You need to use the device interface and you need to read from all the

keyboards.

I used to own all of the input stacks in Windows. I have debugged these

types of issues and assumptions for years, I am not just some chicken
little
screaming at the sky ;).

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pruthviraj
Kajale
Sent: Saturday, December 24, 2005 5:08 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to read from Keyboard in Native Mode

Hi,

I am assuming that there is only one keyboard. In that case
Keyboardclass0
will work. So I need the method to read the key. Please help

Prithvi
Don Burn wrote:
Well how do you know the device is KeyboardClass0? Systems can have
multiple keyboards, or zero keyboards in the case of headless. Even if
you
get this working for some class of systems, what are you going to do
about
“lights out operations” where the computer is in a closet and the
monitor is
turned off. I know of a small software firm that did this, and was sued
after they sold software licenses to a large company. It turns out that
a
power glitch caused a system in the midwest to reboot, unfortunately if
hung
by this stuff, and the large company sent someone from New York to see
what
was wrong. In the end the software company refunded all the sales (a
huge
loss) and paid for the cost of the trip to the midwest.

Why do you think you need this, there are other approaches to gettiug
information at boot time, explain your needs to the group, there may be
an
answer that works.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Pruthviraj Kajale” wrote in message
news:xxxxx@ntdev…
> Hi,
>
> I am writing a Native Application. I want to read from Keyboard. I
have
> written following code. but NtReadFile fails. can anybody tell me
what’s
> wrong with it.
>
> NTSTATUS Status;
> UNICODE_STRING UnicodeFilespec;
> OBJECT_ATTRIBUTES ObjectAttributes;
> HANDLE FileHandle;
> IO_STATUS_BLOCK Iosb;
> ULONG MessageLength = strlen(Message);
> KEYBOARD_INPUT_DATA kbInputData;
> ULONG uiSize = 0, uiByteOffset = 0;
> RtlInitUnicodeString(&UnicodeFilespec, L"\Device\KeyboardClass0");
> InitializeObjectAttributes(&ObjectAttributes, // ptr to structure
> &UnicodeFilespec, // ptr to file spec
> OBJ_CASE_INSENSITIVE, // attributes
> NULL, // root directory handle
> NULL ); // ptr to security descriptor
> Status = NtCreateFile(&FileHandle, // returned file handle
> ( GENERIC_READ | SYNCHRONIZE | GENERIC_WRITE ), // desired access
> &ObjectAttributes, // ptr to object attributes
> &Iosb, // ptr to I/O status block
> 0, // allocation size
> FILE_ATTRIBUTE_NORMAL, // file attributes
> FILE_SHARE_WRITE /| FILE_SHARE_READ/, // share access
> FILE_OPEN, // create disposition
> FILE_DIRECTORY_FILE, // create options
> NULL, // ptr to extended attributes
> 0); // length of ea buffer
> if( !NT_SUCCESS(Status) )
> {
> DisplayString ( L"\r\n *NtCreateFile: Unable to create keyboard
device
> " );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> }
> DisplayString ( L”\r\n
Press a Key" );
>
> uiSize = sizeof ( kbInputData );
> memset( &kbInputData, 0, sizeof( kbInputData ) );
> Status = NtReadFile ( FileHandle, // file Handle
> 0, // event Handle
> NULL, // APC entry point
> NULL, // APC context
> &Iosb, // IOSB address
> &kbInputData, // ptr to data buffer
> uiSize, // length
> &uiByteOffset, // byte offset
> NULL ); // key
> if ( ! NT_SUCCESS ( Status ) )
> {
> DisplayString ( L"\r\nNtReadFile to Read From keyboard is FAILED" );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> //printf(“NtWriteFile request failed 0x%0x\n”, Status);
>
> }
> swprintf ( szwError, L” kbInputData.MakeCode = %0x “,
> kbInputData.MakeCode );
> DisplayString ( szwError );
> DisplayString ( L”\r\n ***NtReadFile FINISHED" );
> NtClose ( FileHandle );
>
>
> Prithvi
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events,
holidays,
> whatever.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping — Questions?
First
check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Let me clarify a bit here as well. If you are a pnp filter, there is no
need for opening the device at all (ie this whole name nonsense goes
away), nor is the need to inspect the hw / compat IDs b/c you are a part
of the stack already.

You cannot open the keyboard from UM, but you can up setupapi to iterate
over the instances of the keyboard interface GUID. In this case, you
can either check the IDs (which have remained the same on any OS since
win9x) or if you are feeling really lucky, just check the installed
service against “i8042prt”. I would stick with the IDs.

Now, a word of caution about programming a keyboard through the LEDs.
If you are setting the LED state to the exact same state that the LEDs
are on the keyboard, i8042prt will not write out the sequence to the
KBC/keyboard. It will just complete the request as is b/c there is no
state change. This behavior is in win2k and beyond.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 12:37 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

Great, that’s exactly what I was looking for.
Nice talking to a professional.

If your driver is a true pnp upper filter
No, this time it’s a UM app (the blink-kbd–as-we-download thing).
If what you described can be done from the UM (looks like it is NOT the
case
if the caller is NOT an admin though - IOCTLs), I’ll do it there, if
not, I
will add this functionality to one of my own [production] drivers [which

never ever poll and/or read ports directly].

see if the ID starts with “pnp03”
Wow! How on earth I could have guessed that…
Am I right to assume that this logic is ok in upwards from wxp (w2k3s,
vista)?

Thanks again.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 3:00 PM
Subject: RE: [ntdev] How to read from Keyboard

To figure out the difference between the keyboards, you can open each
one, query for the PDO
(IRP_MN_QUERY_DEVICE_RELATIONS/TargetDeviceRelation), and then use
IoGetDeviceProperty(DevicePropertyHardwareID and/or
DevicePropertyCompatibleIDs), and then iterate over the results.

Skip over the enumerator name if it is ROOT\ both the TS and ps2
keyboard can be enumerated by ROOT), and then see if the ID starts with
“pnp03” (use a case insensitive search). For instance a ps2 keyboard
could have an ID pnp03b or pnp0303.

If your driver is a true pnp upper filter (do you have an AddDevice
routine which is executed?), you get loaded when the ps2 keyboard is
loaded and started when the ps2 keyboard is started. The ps2 stack has
an IOCTL interface to talk to the ports and a callback for the filter to
initialize the keyboard at the right time.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 11:22 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> Sorry there is no safe way to handle input from a keyboard before the
> system is up.
Thank you for the answer.

> What has been recomended over the years is using a custom switch on
the
> boot.ini line, this can be read from the registry and is safe.
boot.ini is not the only candidate, your very own my.cfg file works
fine.

In some [production] cases you will have to do some rounds: if you need
these settings too early, postpone the decision to some later stage when

file[s] and/or hives are accessible, and do whatever you need then and
there.

> For instance on XP, it is more then likely that KeyboardClass0 is the
> terminal
> services redirected virtual keyboard, not a physical keyboard.
This one hit me recently.
My guess was that keyboard0 is always local, and keyboard1 is
always
MSTSC’s (I’m talking about wxp, not w2k3s).
Wrong I was: on a couple of [my] boxes it was the case, on a QA’s box -
where else? - it was not.

BTW, I still do not know how to tell which is which, does anyone?
A hint - not a solution - would be appreciated.
I think that the solution can be found in VNC sources, but maybe someone
can
save me some time.

Here’s the problem: I need to control kbd lights [when some lengthy
download
is being done] without changing the kbd status, that is, “num lock”
light
blinks, but “num lock” state does not.
A sample (symlink to \Device\keyboard0 and IOCTLs) I googled out and
modified is ok, but - see above.

> Your assumption that by the time your filter starts, the keyboard is
> working is completely bogus. There is no such guarantee.
Oh! Even if it’s an upper filter?
See how good it is to do the research before?
I quickly browsed thru kbd-related samples in the DDK and decided that
it
may be the case (check my post, I say “probably” twice).

> Your code isn’t even system friendly in terms of time consumed.
Oh yes.
The ugliness of polling can compete only with ugliness of port reads.
The two just shine.
Not that the speed matters under the circumstances though.
I thought that the [ugliness of the] code speaks for itself and
therefore
omitted obvious comments.
I repeat: it is a typical “what if” research. Nothing more, nothing
less.

> Your design is awful IMO
There was no such thing as “design” here. See above, below and my
previous
post.

> Please let me know what product this is going into
Good gracious, probably my English is not good enough also:
(a) as I already said, this was a ctrl2cap-related research;
(b) as I already said, it is not (where “not” means “not”) going into
any
product, my product at least;
(c) as I already said, I have to use a product [that was bought from
another comapny] that apparently uses port reads, and this is what
scares
me.

And sorry, I am not at liberty to name the product I’m talking about. I

have to talk to the vendor instead, and I will certainly quote all the
emotionally charged lyrics from this thread. Thanks for you helping me
out
here.

Oh dear, I almost forgot to say that it was and is a research, it is not

going into a product and I do have to deal with a suspicious driver from
a
vendor I can not name.

[That’s how it all started actually: why do they need port reads? Let’s
check using my uctl2cap/kctl2cap as a test base etc.]

> I am not just some chicken little screaming at the sky ;).
Is someone trying to fry you?:slight_smile:

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 12:52 PM
Subject: RE: [ntdev] How to read from Keyboard in Native Mode

Even on a machine with only one physical keyboard attached, there can
be
multiple /virtual/ keyboards which are also enumerated as keyboards on
the
machine. For instance on XP, it is more then likely that KeyboardClass0
is
the terminal services redirected virtual keyboard, not a physical
keyboard.
You cannot make this assumption that there is a mapping to hard coded
name.
You need to use the device interface and you need to read from all the

keyboards.

I used to own all of the input stacks in Windows. I have debugged these

types of issues and assumptions for years, I am not just some chicken
little
screaming at the sky ;).

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pruthviraj
Kajale
Sent: Saturday, December 24, 2005 5:08 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to read from Keyboard in Native Mode

Hi,

I am assuming that there is only one keyboard. In that case
Keyboardclass0
will work. So I need the method to read the key. Please help

Prithvi
Don Burn wrote:
Well how do you know the device is KeyboardClass0? Systems can have
multiple keyboards, or zero keyboards in the case of headless. Even if
you
get this working for some class of systems, what are you going to do
about
“lights out operations” where the computer is in a closet and the
monitor is
turned off. I know of a small software firm that did this, and was sued
after they sold software licenses to a large company. It turns out that
a
power glitch caused a system in the midwest to reboot, unfortunately if
hung
by this stuff, and the large company sent someone from New York to see
what
was wrong. In the end the software company refunded all the sales (a
huge
loss) and paid for the cost of the trip to the midwest.

Why do you think you need this, there are other approaches to gettiug
information at boot time, explain your needs to the group, there may be
an
answer that works.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Pruthviraj Kajale” wrote in message
news:xxxxx@ntdev…
> Hi,
>
> I am writing a Native Application. I want to read from Keyboard. I
have
> written following code. but NtReadFile fails. can anybody tell me
what’s
> wrong with it.
>
> NTSTATUS Status;
> UNICODE_STRING UnicodeFilespec;
> OBJECT_ATTRIBUTES ObjectAttributes;
> HANDLE FileHandle;
> IO_STATUS_BLOCK Iosb;
> ULONG MessageLength = strlen(Message);
> KEYBOARD_INPUT_DATA kbInputData;
> ULONG uiSize = 0, uiByteOffset = 0;
> RtlInitUnicodeString(&UnicodeFilespec, L"\Device\KeyboardClass0");
> InitializeObjectAttributes(&ObjectAttributes, // ptr to structure
> &UnicodeFilespec, // ptr to file spec
> OBJ_CASE_INSENSITIVE, // attributes
> NULL, // root directory handle
> NULL ); // ptr to security descriptor
> Status = NtCreateFile(&FileHandle, // returned file handle
> ( GENERIC_READ | SYNCHRONIZE | GENERIC_WRITE ), // desired access
> &ObjectAttributes, // ptr to object attributes
> &Iosb, // ptr to I/O status block
> 0, // allocation size
> FILE_ATTRIBUTE_NORMAL, // file attributes
> FILE_SHARE_WRITE /| FILE_SHARE_READ/, // share access
> FILE_OPEN, // create disposition
> FILE_DIRECTORY_FILE, // create options
> NULL, // ptr to extended attributes
> 0); // length of ea buffer
> if( !NT_SUCCESS(Status) )
> {
> DisplayString ( L"\r\n *NtCreateFile: Unable to create keyboard
device
> " );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> }
> DisplayString ( L”\r\n
Press a Key" );
>
> uiSize = sizeof ( kbInputData );
> memset( &kbInputData, 0, sizeof( kbInputData ) );
> Status = NtReadFile ( FileHandle, // file Handle
> 0, // event Handle
> NULL, // APC entry point
> NULL, // APC context
> &Iosb, // IOSB address
> &kbInputData, // ptr to data buffer
> uiSize, // length
> &uiByteOffset, // byte offset
> NULL ); // key
> if ( ! NT_SUCCESS ( Status ) )
> {
> DisplayString ( L"\r\nNtReadFile to Read From keyboard is FAILED" );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> //printf(“NtWriteFile request failed 0x%0x\n”, Status);
>
> }
> swprintf ( szwError, L” kbInputData.MakeCode = %0x “,
> kbInputData.MakeCode );
> DisplayString ( szwError );
> DisplayString ( L”\r\n ***NtReadFile FINISHED" );
> NtClose ( FileHandle );
>
>
> Prithvi
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events,
holidays,
> whatever.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping — Questions?
First
check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> You cannot open the keyboard from UM, but you can up setupapi to iterate

over the instances of the keyboard interface GUID
IIRC I must be root to use any SetpAPIs so it may be a dead end - my
product should run w/o privileges.
(runas? no…)

I would stick with the IDs.
I agree.

If you are setting the LED state to the exact same state that the LEDs
are on the keyboard
No, that’s the core of the problem!
The keyboard should work normally (say, caps are either locked or unlocked,
and letters are printed as caps or non-caps, depending on YOUR
keypress[es]), but:

(a) “caps lock” LED - and LED only, not the device state - blinks as some
lengthy process runs, and

(b) stops blinking and is returned to its real state (as if nobody forced
it to blink) once this lengthy process is over.

In other words, temporarily the 1-to-1 mapping between the internal state of
the device, on one hand, and the state of the LED, on the other, is broken,
and is restored when done.

The “restore-when-done” part is trivial, blinking is trivial, the only
non-trivial part was - what kbd to work with?

Thanks, I guess I can proceed now.

Merry Christmas!

P.S. It’s a real pleasure to know that you are not the only one who works on
24th:-)

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 3:48 PM
Subject: RE: [ntdev] How to read from Keyboard

Let me clarify a bit here as well. If you are a pnp filter, there is no
need for opening the device at all (ie this whole name nonsense goes
away), nor is the need to inspect the hw / compat IDs b/c you are a part
of the stack already.

You cannot open the keyboard from UM, but you can up setupapi to iterate
over the instances of the keyboard interface GUID. In this case, you
can either check the IDs (which have remained the same on any OS since
win9x) or if you are feeling really lucky, just check the installed
service against “i8042prt”. I would stick with the IDs.

Now, a word of caution about programming a keyboard through the LEDs.
If you are setting the LED state to the exact same state that the LEDs
are on the keyboard, i8042prt will not write out the sequence to the
KBC/keyboard. It will just complete the request as is b/c there is no
state change. This behavior is in win2k and beyond.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 12:37 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

Great, that’s exactly what I was looking for.
Nice talking to a professional.

> If your driver is a true pnp upper filter
No, this time it’s a UM app (the blink-kbd–as-we-download thing).
If what you described can be done from the UM (looks like it is NOT the
case
if the caller is NOT an admin though - IOCTLs), I’ll do it there, if
not, I
will add this functionality to one of my own [production] drivers [which

never ever poll and/or read ports directly].

> see if the ID starts with “pnp03”
Wow! How on earth I could have guessed that…
Am I right to assume that this logic is ok in upwards from wxp (w2k3s,
vista)?

Thanks again.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 3:00 PM
Subject: RE: [ntdev] How to read from Keyboard

To figure out the difference between the keyboards, you can open each
one, query for the PDO
(IRP_MN_QUERY_DEVICE_RELATIONS/TargetDeviceRelation), and then use
IoGetDeviceProperty(DevicePropertyHardwareID and/or
DevicePropertyCompatibleIDs), and then iterate over the results.

Skip over the enumerator name if it is ROOT\ both the TS and ps2
keyboard can be enumerated by ROOT), and then see if the ID starts with
“pnp03” (use a case insensitive search). For instance a ps2 keyboard
could have an ID pnp03b or pnp0303.

If your driver is a true pnp upper filter (do you have an AddDevice
routine which is executed?), you get loaded when the ps2 keyboard is
loaded and started when the ps2 keyboard is started. The ps2 stack has
an IOCTL interface to talk to the ports and a callback for the filter to
initialize the keyboard at the right time.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 11:22 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> Sorry there is no safe way to handle input from a keyboard before the
> system is up.
Thank you for the answer.

> What has been recomended over the years is using a custom switch on
the
> boot.ini line, this can be read from the registry and is safe.
boot.ini is not the only candidate, your very own my.cfg file works
fine.

In some [production] cases you will have to do some rounds: if you need
these settings too early, postpone the decision to some later stage when

file[s] and/or hives are accessible, and do whatever you need then and
there.

> For instance on XP, it is more then likely that KeyboardClass0 is the
> terminal
> services redirected virtual keyboard, not a physical keyboard.
This one hit me recently.
My guess was that keyboard0 is always local, and keyboard1 is
always
MSTSC’s (I’m talking about wxp, not w2k3s).
Wrong I was: on a couple of [my] boxes it was the case, on a QA’s box -
where else? - it was not.

BTW, I still do not know how to tell which is which, does anyone?
A hint - not a solution - would be appreciated.
I think that the solution can be found in VNC sources, but maybe someone
can
save me some time.

Here’s the problem: I need to control kbd lights [when some lengthy
download
is being done] without changing the kbd status, that is, “num lock”
light
blinks, but “num lock” state does not.
A sample (symlink to \Device\keyboard0 and IOCTLs) I googled out and
modified is ok, but - see above.

> Your assumption that by the time your filter starts, the keyboard is
> working is completely bogus. There is no such guarantee.
Oh! Even if it’s an upper filter?
See how good it is to do the research before?
I quickly browsed thru kbd-related samples in the DDK and decided that
it
may be the case (check my post, I say “probably” twice).

> Your code isn’t even system friendly in terms of time consumed.
Oh yes.
The ugliness of polling can compete only with ugliness of port reads.
The two just shine.
Not that the speed matters under the circumstances though.
I thought that the [ugliness of the] code speaks for itself and
therefore
omitted obvious comments.
I repeat: it is a typical “what if” research. Nothing more, nothing
less.

> Your design is awful IMO
There was no such thing as “design” here. See above, below and my
previous
post.

> Please let me know what product this is going into
Good gracious, probably my English is not good enough also:
(a) as I already said, this was a ctrl2cap-related research;
(b) as I already said, it is not (where “not” means “not”) going into
any
product, my product at least;
(c) as I already said, I have to use a product [that was bought from
another comapny] that apparently uses port reads, and this is what
scares
me.

And sorry, I am not at liberty to name the product I’m talking about. I

have to talk to the vendor instead, and I will certainly quote all the
emotionally charged lyrics from this thread. Thanks for you helping me
out
here.

Oh dear, I almost forgot to say that it was and is a research, it is not

going into a product and I do have to deal with a suspicious driver from
a
vendor I can not name.

[That’s how it all started actually: why do they need port reads? Let’s
check using my uctl2cap/kctl2cap as a test base etc.]

> I am not just some chicken little screaming at the sky ;).
Is someone trying to fry you?:slight_smile:

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 12:52 PM
Subject: RE: [ntdev] How to read from Keyboard in Native Mode

Even on a machine with only one physical keyboard attached, there can
be
multiple /virtual/ keyboards which are also enumerated as keyboards on
the
machine. For instance on XP, it is more then likely that KeyboardClass0
is
the terminal services redirected virtual keyboard, not a physical
keyboard.
You cannot make this assumption that there is a mapping to hard coded
name.
You need to use the device interface and you need to read from all the

keyboards.

I used to own all of the input stacks in Windows. I have debugged these

types of issues and assumptions for years, I am not just some chicken
little
screaming at the sky ;).

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pruthviraj
Kajale
Sent: Saturday, December 24, 2005 5:08 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to read from Keyboard in Native Mode

Hi,

I am assuming that there is only one keyboard. In that case
Keyboardclass0
will work. So I need the method to read the key. Please help

Prithvi
Don Burn wrote:
Well how do you know the device is KeyboardClass0? Systems can have
multiple keyboards, or zero keyboards in the case of headless. Even if
you
get this working for some class of systems, what are you going to do
about
“lights out operations” where the computer is in a closet and the
monitor is
turned off. I know of a small software firm that did this, and was sued
after they sold software licenses to a large company. It turns out that
a
power glitch caused a system in the midwest to reboot, unfortunately if
hung
by this stuff, and the large company sent someone from New York to see
what
was wrong. In the end the software company refunded all the sales (a
huge
loss) and paid for the cost of the trip to the midwest.

Why do you think you need this, there are other approaches to gettiug
information at boot time, explain your needs to the group, there may be
an
answer that works.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Pruthviraj Kajale” wrote in message
news:xxxxx@ntdev…
> Hi,
>
> I am writing a Native Application. I want to read from Keyboard. I
have
> written following code. but NtReadFile fails. can anybody tell me
what’s
> wrong with it.
>
> NTSTATUS Status;
> UNICODE_STRING UnicodeFilespec;
> OBJECT_ATTRIBUTES ObjectAttributes;
> HANDLE FileHandle;
> IO_STATUS_BLOCK Iosb;
> ULONG MessageLength = strlen(Message);
> KEYBOARD_INPUT_DATA kbInputData;
> ULONG uiSize = 0, uiByteOffset = 0;
> RtlInitUnicodeString(&UnicodeFilespec, L"\Device\KeyboardClass0");
> InitializeObjectAttributes(&ObjectAttributes, // ptr to structure
> &UnicodeFilespec, // ptr to file spec
> OBJ_CASE_INSENSITIVE, // attributes
> NULL, // root directory handle
> NULL ); // ptr to security descriptor
> Status = NtCreateFile(&FileHandle, // returned file handle
> ( GENERIC_READ | SYNCHRONIZE | GENERIC_WRITE ), // desired access
> &ObjectAttributes, // ptr to object attributes
> &Iosb, // ptr to I/O status block
> 0, // allocation size
> FILE_ATTRIBUTE_NORMAL, // file attributes
> FILE_SHARE_WRITE /| FILE_SHARE_READ/, // share access
> FILE_OPEN, // create disposition
> FILE_DIRECTORY_FILE, // create options
> NULL, // ptr to extended attributes
> 0); // length of ea buffer
> if( !NT_SUCCESS(Status) )
> {
> DisplayString ( L"\r\n *NtCreateFile: Unable to create keyboard
device
> " );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> }
> DisplayString ( L”\r\n
Press a Key" );
>
> uiSize = sizeof ( kbInputData );
> memset( &kbInputData, 0, sizeof( kbInputData ) );
> Status = NtReadFile ( FileHandle, // file Handle
> 0, // event Handle
> NULL, // APC entry point
> NULL, // APC context
> &Iosb, // IOSB address
> &kbInputData, // ptr to data buffer
> uiSize, // length
> &uiByteOffset, // byte offset
> NULL ); // key
> if ( ! NT_SUCCESS ( Status ) )
> {
> DisplayString ( L"\r\nNtReadFile to Read From keyboard is FAILED" );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> //printf(“NtWriteFile request failed 0x%0x\n”, Status);
>
> }
> swprintf ( szwError, L” kbInputData.MakeCode = %0x “,
> kbInputData.MakeCode );
> DisplayString ( szwError );
> DisplayString ( L”\r\n ***NtReadFile FINISHED" );
> NtClose ( FileHandle );
>
>
> Prithvi
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events,
holidays,
> whatever.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping — Questions?
First
check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

> > If your driver is a true pnp upper filter

No, this time it’s a UM app (the blink-kbd–as-we-download thing).

Why not use SendInput to blink LEDs during download?

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

You do not need to have any privileges to use setupapi, esp to enumerate
an interface. Opening the interface may be a different story, but
finding it can be done by any user, otherwise things like dinput would
not work for a guest account.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 1:13 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

You cannot open the keyboard from UM, but you can up setupapi to
iterate
over the instances of the keyboard interface GUID
IIRC I must be root to use any SetpAPIs so it may be a dead end - my
product should run w/o privileges.
(runas? no…)

I would stick with the IDs.
I agree.

If you are setting the LED state to the exact same state that the LEDs
are on the keyboard
No, that’s the core of the problem!
The keyboard should work normally (say, caps are either locked or
unlocked,
and letters are printed as caps or non-caps, depending on YOUR
keypress[es]), but:

(a) “caps lock” LED - and LED only, not the device state - blinks as
some
lengthy process runs, and

(b) stops blinking and is returned to its real state (as if nobody
forced
it to blink) once this lengthy process is over.

In other words, temporarily the 1-to-1 mapping between the internal
state of
the device, on one hand, and the state of the LED, on the other, is
broken,
and is restored when done.

The “restore-when-done” part is trivial, blinking is trivial, the only
non-trivial part was - what kbd to work with?

Thanks, I guess I can proceed now.

Merry Christmas!

P.S. It’s a real pleasure to know that you are not the only one who
works on
24th:-)

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 3:48 PM
Subject: RE: [ntdev] How to read from Keyboard

Let me clarify a bit here as well. If you are a pnp filter, there is no
need for opening the device at all (ie this whole name nonsense goes
away), nor is the need to inspect the hw / compat IDs b/c you are a part
of the stack already.

You cannot open the keyboard from UM, but you can up setupapi to iterate
over the instances of the keyboard interface GUID. In this case, you
can either check the IDs (which have remained the same on any OS since
win9x) or if you are feeling really lucky, just check the installed
service against “i8042prt”. I would stick with the IDs.

Now, a word of caution about programming a keyboard through the LEDs.
If you are setting the LED state to the exact same state that the LEDs
are on the keyboard, i8042prt will not write out the sequence to the
KBC/keyboard. It will just complete the request as is b/c there is no
state change. This behavior is in win2k and beyond.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 12:37 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

Great, that’s exactly what I was looking for.
Nice talking to a professional.

> If your driver is a true pnp upper filter
No, this time it’s a UM app (the blink-kbd–as-we-download thing).
If what you described can be done from the UM (looks like it is NOT the
case
if the caller is NOT an admin though - IOCTLs), I’ll do it there, if
not, I
will add this functionality to one of my own [production] drivers [which

never ever poll and/or read ports directly].

> see if the ID starts with “pnp03”
Wow! How on earth I could have guessed that…
Am I right to assume that this logic is ok in upwards from wxp (w2k3s,
vista)?

Thanks again.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 3:00 PM
Subject: RE: [ntdev] How to read from Keyboard

To figure out the difference between the keyboards, you can open each
one, query for the PDO
(IRP_MN_QUERY_DEVICE_RELATIONS/TargetDeviceRelation), and then use
IoGetDeviceProperty(DevicePropertyHardwareID and/or
DevicePropertyCompatibleIDs), and then iterate over the results.

Skip over the enumerator name if it is ROOT\ both the TS and ps2
keyboard can be enumerated by ROOT), and then see if the ID starts with
“pnp03” (use a case insensitive search). For instance a ps2 keyboard
could have an ID pnp03b or pnp0303.

If your driver is a true pnp upper filter (do you have an AddDevice
routine which is executed?), you get loaded when the ps2 keyboard is
loaded and started when the ps2 keyboard is started. The ps2 stack has
an IOCTL interface to talk to the ports and a callback for the filter to
initialize the keyboard at the right time.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Saturday, December 24, 2005 11:22 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> Sorry there is no safe way to handle input from a keyboard before the
> system is up.
Thank you for the answer.

> What has been recomended over the years is using a custom switch on
the
> boot.ini line, this can be read from the registry and is safe.
boot.ini is not the only candidate, your very own my.cfg file works
fine.

In some [production] cases you will have to do some rounds: if you need
these settings too early, postpone the decision to some later stage when

file[s] and/or hives are accessible, and do whatever you need then and
there.

> For instance on XP, it is more then likely that KeyboardClass0 is the
> terminal
> services redirected virtual keyboard, not a physical keyboard.
This one hit me recently.
My guess was that keyboard0 is always local, and keyboard1 is
always
MSTSC’s (I’m talking about wxp, not w2k3s).
Wrong I was: on a couple of [my] boxes it was the case, on a QA’s box -
where else? - it was not.

BTW, I still do not know how to tell which is which, does anyone?
A hint - not a solution - would be appreciated.
I think that the solution can be found in VNC sources, but maybe someone
can
save me some time.

Here’s the problem: I need to control kbd lights [when some lengthy
download
is being done] without changing the kbd status, that is, “num lock”
light
blinks, but “num lock” state does not.
A sample (symlink to \Device\keyboard0 and IOCTLs) I googled out and
modified is ok, but - see above.

> Your assumption that by the time your filter starts, the keyboard is
> working is completely bogus. There is no such guarantee.
Oh! Even if it’s an upper filter?
See how good it is to do the research before?
I quickly browsed thru kbd-related samples in the DDK and decided that
it
may be the case (check my post, I say “probably” twice).

> Your code isn’t even system friendly in terms of time consumed.
Oh yes.
The ugliness of polling can compete only with ugliness of port reads.
The two just shine.
Not that the speed matters under the circumstances though.
I thought that the [ugliness of the] code speaks for itself and
therefore
omitted obvious comments.
I repeat: it is a typical “what if” research. Nothing more, nothing
less.

> Your design is awful IMO
There was no such thing as “design” here. See above, below and my
previous
post.

> Please let me know what product this is going into
Good gracious, probably my English is not good enough also:
(a) as I already said, this was a ctrl2cap-related research;
(b) as I already said, it is not (where “not” means “not”) going into
any
product, my product at least;
(c) as I already said, I have to use a product [that was bought from
another comapny] that apparently uses port reads, and this is what
scares
me.

And sorry, I am not at liberty to name the product I’m talking about. I

have to talk to the vendor instead, and I will certainly quote all the
emotionally charged lyrics from this thread. Thanks for you helping me
out
here.

Oh dear, I almost forgot to say that it was and is a research, it is not

going into a product and I do have to deal with a suspicious driver from
a
vendor I can not name.

[That’s how it all started actually: why do they need port reads? Let’s
check using my uctl2cap/kctl2cap as a test base etc.]

> I am not just some chicken little screaming at the sky ;).
Is someone trying to fry you?:slight_smile:

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 12:52 PM
Subject: RE: [ntdev] How to read from Keyboard in Native Mode

Even on a machine with only one physical keyboard attached, there can
be
multiple /virtual/ keyboards which are also enumerated as keyboards on
the
machine. For instance on XP, it is more then likely that KeyboardClass0
is
the terminal services redirected virtual keyboard, not a physical
keyboard.
You cannot make this assumption that there is a mapping to hard coded
name.
You need to use the device interface and you need to read from all the

keyboards.

I used to own all of the input stacks in Windows. I have debugged these

types of issues and assumptions for years, I am not just some chicken
little
screaming at the sky ;).

d


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pruthviraj
Kajale
Sent: Saturday, December 24, 2005 5:08 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to read from Keyboard in Native Mode

Hi,

I am assuming that there is only one keyboard. In that case
Keyboardclass0
will work. So I need the method to read the key. Please help

Prithvi
Don Burn wrote:
Well how do you know the device is KeyboardClass0? Systems can have
multiple keyboards, or zero keyboards in the case of headless. Even if
you
get this working for some class of systems, what are you going to do
about
“lights out operations” where the computer is in a closet and the
monitor is
turned off. I know of a small software firm that did this, and was sued
after they sold software licenses to a large company. It turns out that
a
power glitch caused a system in the midwest to reboot, unfortunately if
hung
by this stuff, and the large company sent someone from New York to see
what
was wrong. In the end the software company refunded all the sales (a
huge
loss) and paid for the cost of the trip to the midwest.

Why do you think you need this, there are other approaches to gettiug
information at boot time, explain your needs to the group, there may be
an
answer that works.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Pruthviraj Kajale” wrote in message
news:xxxxx@ntdev…
> Hi,
>
> I am writing a Native Application. I want to read from Keyboard. I
have
> written following code. but NtReadFile fails. can anybody tell me
what’s
> wrong with it.
>
> NTSTATUS Status;
> UNICODE_STRING UnicodeFilespec;
> OBJECT_ATTRIBUTES ObjectAttributes;
> HANDLE FileHandle;
> IO_STATUS_BLOCK Iosb;
> ULONG MessageLength = strlen(Message);
> KEYBOARD_INPUT_DATA kbInputData;
> ULONG uiSize = 0, uiByteOffset = 0;
> RtlInitUnicodeString(&UnicodeFilespec, L"\Device\KeyboardClass0");
> InitializeObjectAttributes(&ObjectAttributes, // ptr to structure
> &UnicodeFilespec, // ptr to file spec
> OBJ_CASE_INSENSITIVE, // attributes
> NULL, // root directory handle
> NULL ); // ptr to security descriptor
> Status = NtCreateFile(&FileHandle, // returned file handle
> ( GENERIC_READ | SYNCHRONIZE | GENERIC_WRITE ), // desired access
> &ObjectAttributes, // ptr to object attributes
> &Iosb, // ptr to I/O status block
> 0, // allocation size
> FILE_ATTRIBUTE_NORMAL, // file attributes
> FILE_SHARE_WRITE /| FILE_SHARE_READ/, // share access
> FILE_OPEN, // create disposition
> FILE_DIRECTORY_FILE, // create options
> NULL, // ptr to extended attributes
> 0); // length of ea buffer
> if( !NT_SUCCESS(Status) )
> {
> DisplayString ( L"\r\n *NtCreateFile: Unable to create keyboard
device
> " );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> }
> DisplayString ( L”\r\n
Press a Key" );
>
> uiSize = sizeof ( kbInputData );
> memset( &kbInputData, 0, sizeof( kbInputData ) );
> Status = NtReadFile ( FileHandle, // file Handle
> 0, // event Handle
> NULL, // APC entry point
> NULL, // APC context
> &Iosb, // IOSB address
> &kbInputData, // ptr to data buffer
> uiSize, // length
> &uiByteOffset, // byte offset
> NULL ); // key
> if ( ! NT_SUCCESS ( Status ) )
> {
> DisplayString ( L"\r\nNtReadFile to Read From keyboard is FAILED" );
> swprintf ( szwError, L" Status = %0x “, Status );
> DisplayString ( szwError );
> //printf(“NtWriteFile request failed 0x%0x\n”, Status);
>
> }
> swprintf ( szwError, L” kbInputData.MakeCode = %0x “,
> kbInputData.MakeCode );
> DisplayString ( szwError );
> DisplayString ( L”\r\n ***NtReadFile FINISHED" );
> NtClose ( FileHandle );
>
>
> Prithvi
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events,
holidays,
> whatever.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@yahoo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping — Questions?
First
check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> Oh dear, I almost forgot to say that it was and is a research, it is not

going into a product and I do have to deal with a suspicious driver from a
vendor I can not name.

This was your original posting mistake. You should have said this FIRST,
and LOUDLY. And probably REPEATEDLY, since we don’t always believe people
when they say that.

(Many of us have been burned in our professional lives by being told to make
some hack to demonstrate feasibility “that will never go out of the lab”,
making such a hack, and discovering the next day it has been sold and
shipped to 48,241 customers. And now must be supported forever, but is
completely unsupportable, will crash the system 90% of the time, and is a
piece of shit. And of course can’t be redesigned correctly because “this
version works, we have no budget for idle code writing!” So you spend the
rest of your life at the company supporting a piece of shit that never
should have been written (hacked) in the first place.)

(c) as I already said, I have to use a product [that was bought from
another comapny] that apparently uses port reads, and this is what
scares
me.

What you haven’t made clear is what this has to do with why you want to
fiddle the keyboard.

Are you saying you have some external box attached to the computer by the
keyboard port, and if you don’t keep petting it it will get mad and reboot
the system?

Or are you saying that you have some ugly device that does things an ugly
way, and for reasons you haven’t really given, you feel you have to do
something else the same way?

Or something else?

Loren

> (a) “caps lock” LED - and LED only, not the device state - blinks as some

lengthy process runs, and

Could you use scroll lock instead? That seems to be a more-or-less useless
indicator on most keyboards, and won’t mess up data entry as far as I knwo.

Loren

Except for excel (which is the only app I know of which uses scroll
lock) ;).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Saturday, December 24, 2005 5:17 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

(a) “caps lock” LED - and LED only, not the device state - blinks as
some
lengthy process runs, and

Could you use scroll lock instead? That seems to be a more-or-less
useless
indicator on most keyboards, and won’t mess up data entry as far as I
knwo.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> Why not use SendInput to blink LEDs during download?
That’s what the current code does, but VK_xyz’s do change the state
(=some bit in the software), not just the LED state (=some trigger inside
the kbd).

Imagine that you type in a notepad as the lengthy process takes place and
you set caps to “on” manually.

For a while you happily type in caps as expected, but here comes the next
forced blink from my VK_xyz, and the state goes to caps-off. Result? All
of a sudden you see “DEAr santa” in the job application you are typing
instead of “DEAR SANTA”.

My clients can live with that, but I invented this exercise for myself: is
it possible to control lights:
(a) without changing the state, and
(b) without another driver?

[An upper kbd filter would be an obvious solution, and uctl2cap/kctl2cap
pair derived from Mark’s sample seemed a good start to play around, but I
left it as the last resort, I don’t need driver #4 to support. Oh gosh, I
just realized that I will have that same problem - what kbd to filter…]

You do not need to have any privileges to use setupapi
esp to enumerate an interface. Opening the interface may be a different
story, but
finding it can be done by any user
I was not sure about all the SetupAPIs I might need.
Let me experiment with the new info you gave me, that pnp03 trick looks
encouraging.
As I said, I can go both ways: either stay in UM 100% (SetupAPIs) if
possible or add all I need to existing driver[s].

This was your original posting mistake. You should have said this FIRST,
and LOUDLY. And probably REPEATEDLY, since we don’t always believe people
when they say that.
I will not yell, period.
Those who want to hear, hear. Those who do not want, don’t.
It has nothing to do with volume.
The ability to hear comes (or goes) with upbringing and culture (or lack of
thereof).
In case you did not notice, this list is not the best place to learn good
manners.
At last, I’d like to once whisper that it is not intended to be the place to
teach good manners either.

Could you use scroll lock instead?
Not the point, the exercise was supposed to be generic, be it Excel or
notepad, num or scroll, whatever.
The sample code I googled out (symlink to \Device\keyboardclass0 + IOCTLs)
was almost a solution.
The pnp03xy trick may make it the solution.
I will probably give it a shot.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 8:26 PM
Subject: RE: [ntdev] How to read from Keyboard

Except for excel (which is the only app I know of which uses scroll
lock) ;).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Saturday, December 24, 2005 5:17 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> (a) “caps lock” LED - and LED only, not the device state - blinks as
some
> lengthy process runs, and

Could you use scroll lock instead? That seems to be a more-or-less
useless
indicator on most keyboards, and won’t mess up data entry as far as I
knwo.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Scroll lock is routinely used by those switches that share the
same keyboard, mouse and display between two machines, hitting
scroll lock twice is the way to switch the peripherals from one
system to the other. Now, if you want a less than satisfactory
experience, you can install Windbg on two systems, connect them
with a serial or a 1394 cable, and then try to drive the system
from a common keyboard, mouse and display using the scroll lock
key! It’s not for the fainthearted, that’s the least I can say,
I don’t think either Windbg or Windows turn very happy about it.

Alberto.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”

Sent: Saturday, December 24, 2005 8:26 PM
Subject: RE: [ntdev] How to read from Keyboard

Except for excel (which is the only app I know of which uses
scroll
lock) ;).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren
Wilton
Sent: Saturday, December 24, 2005 5:17 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> (a) “caps lock” LED - and LED only, not the device state -
> blinks as
some
> lengthy process runs, and

Could you use scroll lock instead? That seems to be a
more-or-less
useless
indicator on most keyboards, and won’t mess up data entry as far
as I
knwo.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@microsoft.com
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com

For a switch of this type, what he is doing has no affect. These type
of switch boxes trap the hardware even on the wire before they ever
present it to the PC. Manually setting/clearing the scroll lock light
will have no affect on the switch state itself.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alberto Moreira
Sent: Sunday, December 25, 2005 7:11 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

Scroll lock is routinely used by those switches that share the
same keyboard, mouse and display between two machines, hitting
scroll lock twice is the way to switch the peripherals from one
system to the other. Now, if you want a less than satisfactory
experience, you can install Windbg on two systems, connect them
with a serial or a 1394 cable, and then try to drive the system
from a common keyboard, mouse and display using the scroll lock
key! It’s not for the fainthearted, that’s the least I can say,
I don’t think either Windbg or Windows turn very happy about it.

Alberto.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”

Sent: Saturday, December 24, 2005 8:26 PM
Subject: RE: [ntdev] How to read from Keyboard

Except for excel (which is the only app I know of which uses
scroll
lock) ;).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren
Wilton
Sent: Saturday, December 24, 2005 5:17 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> (a) “caps lock” LED - and LED only, not the device state -
> blinks as
some
> lengthy process runs, and

Could you use scroll lock instead? That seems to be a
more-or-less
useless
indicator on most keyboards, and won’t mess up data entry as far
as I
knwo.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@microsoft.com
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

To change the LEDs on the hardware w/out affecting the raw input thread
(RIT)'s state, you can send IOCTL_KEYBOARD_SET_INDICATORS from your
filter driver (again, just install yourself as a pnp upper filter and be
done with it or send it to all the keyboards, there is no harm in that).
Remember that the keyboard itself has no different state whether the
caps lock key (or shift for that matter) is pressed or not. The same
scancode for ‘a’ is sent no matter if the caps lock LED is lit or not.
The transformation of the scan code to ‘a’ or ‘A’ happens in the raw
input thread above based on the seeing the caps lock key being pressed.

By using SendInput(),the RIT changes state b/c it looks at the injected
scan code and changes state.

The biggest complaint I have with this thread is that you presented
experimental code as functioning code. The posts here persist for a
very long time. As such, folks will pick up the thread and just see the
keyboard access code w/out the explanation and subsequent
thread/soldution/discussion as to why out of band hw access is bad.
This is what happened when you referred to the ntfsd thread. The thread
just showed how to do it, but you presented it as fact and that since it
was already posted on another thread, it was a valid thing to do.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Sunday, December 25, 2005 4:40 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

Why not use SendInput to blink LEDs during download?
That’s what the current code does, but VK_xyz’s do change the state
(=some bit in the software), not just the LED state (=some trigger
inside
the kbd).

Imagine that you type in a notepad as the lengthy process takes place
and
you set caps to “on” manually.

For a while you happily type in caps as expected, but here comes the
next
forced blink from my VK_xyz, and the state goes to caps-off. Result?
All
of a sudden you see “DEAr santa” in the job application you are typing
instead of “DEAR SANTA”.

My clients can live with that, but I invented this exercise for myself:
is
it possible to control lights:
(a) without changing the state, and
(b) without another driver?

[An upper kbd filter would be an obvious solution, and uctl2cap/kctl2cap

pair derived from Mark’s sample seemed a good start to play around, but
I
left it as the last resort, I don’t need driver #4 to support. Oh gosh,
I
just realized that I will have that same problem - what kbd to
filter…]

You do not need to have any privileges to use setupapi
esp to enumerate an interface. Opening the interface may be a
different
story, but
finding it can be done by any user
I was not sure about all the SetupAPIs I might need.
Let me experiment with the new info you gave me, that pnp03 trick looks
encouraging.
As I said, I can go both ways: either stay in UM 100% (SetupAPIs) if
possible or add all I need to existing driver[s].

This was your original posting mistake. You should have said this
FIRST,
and LOUDLY. And probably REPEATEDLY, since we don’t always believe
people
when they say that.
I will not yell, period.
Those who want to hear, hear. Those who do not want, don’t.
It has nothing to do with volume.
The ability to hear comes (or goes) with upbringing and culture (or lack
of
thereof).
In case you did not notice, this list is not the best place to learn
good
manners.
At last, I’d like to once whisper that it is not intended to be the
place to
teach good manners either.

Could you use scroll lock instead?
Not the point, the exercise was supposed to be generic, be it Excel or
notepad, num or scroll, whatever.
The sample code I googled out (symlink to \Device\keyboardclass0 +
IOCTLs)
was almost a solution.
The pnp03xy trick may make it the solution.
I will probably give it a shot.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 8:26 PM
Subject: RE: [ntdev] How to read from Keyboard

Except for excel (which is the only app I know of which uses scroll
lock) ;).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Saturday, December 24, 2005 5:17 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> (a) “caps lock” LED - and LED only, not the device state - blinks as
some
> lengthy process runs, and

Could you use scroll lock instead? That seems to be a more-or-less
useless
indicator on most keyboards, and won’t mess up data entry as far as I
knwo.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> That’s what the current code does, but VK_xyz’s do change the state

(=some bit in the software), not just the LED state (=some trigger inside
the kbd).

And this is correct. The actual keyboard input state must corellate with the
LED state, period.

If the download manager does such tricks - then please name me this product
so I will never use it (and un-recommend to everybody).

The job of the download manager is to download files, period. Playing
rock-n-roll on the keyboard LEDs is not its job. This could be tolerated (but
irritating) if this would be done using safe ways, but sorry, if the download
manager
(not a keyboard addon!) does such things using unsafe ways - then
sorry. For me, this means - lack of correct attitudes among the product
management, and I will expect more gotchas and “bugs-which-are-features” for
such a “great” piece of the software.

Download manager is a tool, whose purpose is to do its work. Any side LED or
sound effects are frowned upon. Download manager who install the filter drivers
to the keyboard stack - is surely a bad piece of software.

Please tell this to your project management, who are exactly the guys which are
planning to release a shitty product.

For a while you happily type in caps as expected, but here comes the next
forced blink from my VK_xyz, and the state goes to caps-off. Result? All
of a sudden you see “DEAr santa” in the job application you are typing
instead of “DEAR SANTA”.

That’s why the whole idea of using keyboard LEDs for the UI is brain-damaged.
It is hardly a good idea even for games.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> Scroll lock is routinely used by those switches that share the

same keyboard, mouse and display between two machines, hitting
scroll lock twice is the way to switch the peripherals from one
system to the other.

Not so routinely. My current KVM switches use Ctrl+Ctrl (one) and
Ctrl+Shift+Alt (another).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> To change the LEDs on the hardware w/out affecting the raw input thread

(RIT)'s state, you can send IOCTL_KEYBOARD_SET_INDICATORS
from your filter driver
Plus, of course, I set LED’s states correctly when blinking is over.
This is what the sample UM code does, and that’s what I already do.
If interested, see
http://www.codeguru.com/Cpp/W-P/system/keyboard/article.php/c2825
or I can send you my version.

Remember that the keyboard itself has no different state whether the
caps lock key (or shift for that matter) is pressed or not. The same
scancode for ‘a’ is sent no matter if the caps lock LED is lit or not.
Manually setting/clearing the scroll lock light
will have no affect on the switch state itself.
Exactly. That’s what I tried to explain earlier: it is a bit inside the
driver [extension]
that tells the driver how to interpret scan codes; the kbd itself is dumb.

The biggest complaint I have with this thread is that you presented
experimental code as functioning code.
If you are talking about blinking, then no, I did not post any code at all.
I can do that, but it makes no sense, it’s a trivial UM code.
If you are talking about “Press ESC to disable myBest.sys”, then the anser
is also “no, I did not”.
Check it out, I said “hope it helps”, meaning - I am dealing with people who
do not require comments like “ugly, unreliable” etc., am I not? - read it
and make your decisions.

Those who need explanations “polling is almost always bad” or “direct access
to hw registers is almost always bad” etc. all are (or should be), well, in
a different list. Probably, they all are in a list devoted to good manners.

Note that directly in the code I provided 2 refs, both of them to OSR
archives/lists, one of them contains deep analysis and critisism.

More than enough for those who wants to read.

There was a question; I gave a [working, but sleasy] answer, that’s it.
Period.

BTW, I think I found the way to stay away from any kernel games at all.
As one of the [wonderful] OSR articles ends: “… and then JK told me that
we don’t need a driver for this project at all. I like this job!”

Exactly.

The idea is to use WMI which:
(a) lists just one kbd, the local one [why? I run a test through an RDP
session], and
(b) it gives me, among other things, the property

name=DeviceID value=ACPI\PNP0303\4&35F762C4&0

after which the search for a local kbd (this is the only problem left -
which one is local) becomes trivial, I gather.

The beauty is that all responsibility for finding the local kbd is not on
me, not on Doron but on OS itself:-)

One way to handle this is to insist that the user’s machine has
an USB keyboard and mouse
Oh yeah. Explain it to aunt Polly:-)
Start from what USB is and see (hear) what happens:-)

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Sunday, December 25, 2005 1:26 PM
Subject: RE: [ntdev] How to read from Keyboard

To change the LEDs on the hardware w/out affecting the raw input thread
(RIT)‘s state, you can send IOCTL_KEYBOARD_SET_INDICATORS from your
filter driver (again, just install yourself as a pnp upper filter and be
done with it or send it to all the keyboards, there is no harm in that).
Remember that the keyboard itself has no different state whether the
caps lock key (or shift for that matter) is pressed or not. The same
scancode for ‘a’ is sent no matter if the caps lock LED is lit or not.
The transformation of the scan code to ‘a’ or ‘A’ happens in the raw
input thread above based on the seeing the caps lock key being pressed.

By using SendInput(),the RIT changes state b/c it looks at the injected
scan code and changes state.

The biggest complaint I have with this thread is that you presented
experimental code as functioning code. The posts here persist for a
very long time. As such, folks will pick up the thread and just see the
keyboard access code w/out the explanation and subsequent
thread/soldution/discussion as to why out of band hw access is bad.
This is what happened when you referred to the ntfsd thread. The thread
just showed how to do it, but you presented it as fact and that since it
was already posted on another thread, it was a valid thing to do.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@Home
Sent: Sunday, December 25, 2005 4:40 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> Why not use SendInput to blink LEDs during download?
That’s what the current code does, but VK_xyz’s do change the state
(=some bit in the software), not just the LED state (=some trigger
inside
the kbd).

Imagine that you type in a notepad as the lengthy process takes place
and
you set caps to “on” manually.

For a while you happily type in caps as expected, but here comes the
next
forced blink from my VK_xyz, and the state goes to caps-off. Result?
All
of a sudden you see “DEAr santa” in the job application you are typing
instead of “DEAR SANTA”.

My clients can live with that, but I invented this exercise for myself:
is
it possible to control lights:
(a) without changing the state, and
(b) without another driver?

[An upper kbd filter would be an obvious solution, and uctl2cap/kctl2cap

pair derived from Mark’s sample seemed a good start to play around, but
I
left it as the last resort, I don’t need driver #4 to support. Oh gosh,
I
just realized that I will have that same problem - what kbd to
filter…]

> You do not need to have any privileges to use setupapi
> esp to enumerate an interface. Opening the interface may be a
different
> story, but
> finding it can be done by any user
I was not sure about all the SetupAPIs I might need.
Let me experiment with the new info you gave me, that pnp03 trick looks
encouraging.
As I said, I can go both ways: either stay in UM 100% (SetupAPIs) if
possible or add all I need to existing driver[s].

> This was your original posting mistake. You should have said this
FIRST,
> and LOUDLY. And probably REPEATEDLY, since we don’t always believe
people
> when they say that.
I will not yell, period.
Those who want to hear, hear. Those who do not want, don’t.
It has nothing to do with volume.
The ability to hear comes (or goes) with upbringing and culture (or lack
of
thereof).
In case you did not notice, this list is not the best place to learn
good
manners.
At last, I’d like to once whisper that it is not intended to be the
place to
teach good manners either.

> Could you use scroll lock instead?
Not the point, the exercise was supposed to be generic, be it Excel or
notepad, num or scroll, whatever.
The sample code I googled out (symlink to \Device\keyboardclass0 +
IOCTLs)
was almost a solution.
The pnp03xy trick may make it the solution.
I will probably give it a shot.

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 24, 2005 8:26 PM
Subject: RE: [ntdev] How to read from Keyboard

Except for excel (which is the only app I know of which uses scroll
lock) ;).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Loren Wilton
Sent: Saturday, December 24, 2005 5:17 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to read from Keyboard

> (a) “caps lock” LED - and LED only, not the device state - blinks as
some
> lengthy process runs, and

Could you use scroll lock instead? That seems to be a more-or-less
useless
indicator on most keyboards, and won’t mess up data entry as far as I
knwo.

Loren


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
’'
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

> Now, if you want a less than satisfactory

experience, you can install Windbg on two systems, connect them
with a serial or a 1394 cable, and then try to drive the system
from a common keyboard, mouse and display using the scroll lock
key! It’s not for the fainthearted, that’s the least I can say,
I don’t think either Windbg or Windows turn very happy about it.

I do this all the time. Never had a problem with it.

BTW, Apex switches use a single click of the SysReq key rather than banging
repeatedly on the Scroll Lock key until the stupid switch FINALLY decides
that you have met its timing requirements and will beep at you. MUCH nicer
interface!

Loren

The double scroll lock is used by Belkin in some of their rack mounted KVMs.
I have two linked together and using that with the up and down arrow keys
works well to switch computers. If I want to jump to the correct port on
the two KVMs, I need to use two two digit numbers with the first being the
KVM number and the second the port number. These KVMs allow USB computers
to be connected, but your keyboard and mouse must be PS/2.

At home I have a StarTech Starview KVM that uses Ctrl+Ctrl and a number. It
is PS/2 only and works well.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
>> Scroll lock is routinely used by those switches that share the
>> same keyboard, mouse and display between two machines, hitting
>> scroll lock twice is the way to switch the peripherals from one
>> system to the other.
>
> Not so routinely. My current KVM switches use Ctrl+Ctrl (one) and
> Ctrl+Shift+Alt (another).
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>

> Plus, of course, I set LED’s states correctly when blinking is over.

This is what the sample UM code does, and that’s what I already do.
If interested, see
http://www.codeguru.com/Cpp/W-P/system/keyboard/article.php/c2825
or I can send you my version.

Of course, all this assumes you aren’t using a keyboard switch. If you are,
and the led state is wrong when the user switches to another machine, it
will be faithfully restored to the wrong state when you switch back to the
machine your code is on, even though you sent out the (ignored) command to
swizzle the lights back.

I think I really have to agree with Maxim here. Yes, you can do this. Yes,
it might be (if you are very bored) an interesting learning excercise to
figure out how to do it - safely. “Safely”, not “right”. Because *by
definition* this cannot be done “right”. The “right” way to do it is to NOT
DO IT.

Basically if you have a download manager, you business is to do a download.
Now, there is nothing against a progress display. If it is a dialog window,
it damn well better have a minimize button on it, and it damn double damn
well better not be sysmodal or expand to cover the entire screen. If it
does either of those things, rest assured that it will never complete any
download longer than about 6.3 seconds on my machines, and will be removed
(if a reinstall of the OS is required, it will be done), and not only it,
but ALL SOFTWARE FROM YOUR COMPANY WILL BE FOREVER BANNED. I conside
“clever” hacks like that to be virui of the worst sort. Furthermore, I
assume that anyone that would do stupid tricks like that has my worst
interests at heart, and intends me and my computer harm. If they didn’t,
why would they do such aggravating things?

Now, you can claim that fiddling the caps lock indicator isn’t that
annoying. True; it isn’t. It is equivalent to the polite little dialog
that takes a quarter of the screen and STILL doesn’t allow itself to be
minimized. That will be removed from my system too. Although I might allow
it to complete ONE download, IF the code it is downloading doesn’t appear to
be from the same company. It won’t start, much less ever complete, a second
activation.

If you REALLY feel the ABSOLUTE NEED for some sort of active “you damn well
can’t ignore this!” progress indicator, go back to CodeGuru and search for
“systray”. Find out how to do an animated tray icon.

BTW, PROVIDE A SWITCH in your software to turn this off. And DO NOT turn on
a “ding at the end of download” as the mandatory optional ‘feature’ if the
user disables the tray icon. Download managers are BACKGROUND software.
They ARE NOT the most important thing I’m doing. I’ll go look at their
status when I want to, not when THEY WANT ME TO. If I *really* want to know
the progress, I’ll leave the progess dialog up. That is what is there for.
It is also My Choice to do it or not.

Nothing like a good Christmas rant to get the blood flowing!

Loren