Accessing registry from keyboard driver

I want to persist status of a system key and hence using registry for the same. Inconsistent behavior is noticed in reading value from regsitry, when writing is also done from the same part of code.

Reading from the registry is done from the ‘GeneralDispatch’ function which is defined for the IRP_MJ_XXX other than IRP_MJ_POWER, IRP_MJ_PNP and IRP_MJ_READ. Is this the correct function to use to read from the registry? Or is the reading of the registry to be done in the function where the IRP_MJ_PNP is handled or at some other location?

Any input would be greatly appreciated.

I think you can read the registry at the passive level if you try to read at
the dispatch you will get a bug check. coming back to your problem does the
write is happening properly and does your read call was succeeded ? . as
far as I know there should not be any problem.


From:
Sent: Thursday, February 18, 2010 3:19 PM
To: “Windows System Software Devs Interest List”
Subject: [ntdev] Accessing registry from keyboard driver

> I want to persist status of a system key and hence using registry for the
> same. Inconsistent behavior is noticed in reading value from regsitry,
> when writing is also done from the same part of code.
>
> Reading from the registry is done from the ‘GeneralDispatch’ function
> which is defined for the IRP_MJ_XXX other than IRP_MJ_POWER, IRP_MJ_PNP
> and IRP_MJ_READ. Is this the correct function to use to read from the
> registry? Or is the reading of the registry to be done in the function
> where the IRP_MJ_PNP is handled or at some other location?
>
> Any input would be greatly appreciated.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Keyboard drivers do not get many io based irps, basically just internal ioctls to set leds and typematic. What state do you want to persist? And when you say persist, for how longh across reboots or device instances? Please explain the problem you are trying to solve and we can probably give you a better answer other than touching the registry all the time

d

tiny phone keyboard + fat thumbs = you do the muth

-----Original Message-----
From: xxxxx@wipro.com
Sent: Thursday, February 18, 2010 1:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Accessing registry from keyboard driver

I want to persist status of a system key and hence using registry for the same. Inconsistent behavior is noticed in reading value from regsitry, when writing is also done from the same part of code.

Reading from the registry is done from the ‘GeneralDispatch’ function which is defined for the IRP_MJ_XXX other than IRP_MJ_POWER, IRP_MJ_PNP and IRP_MJ_READ. Is this the correct function to use to read from the registry? Or is the reading of the registry to be done in the function where the IRP_MJ_PNP is handled or at some other location?

Any input would be greatly appreciated.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Vijay and Doron. Please find my inputs to your queries, below.

For Vijay >> Writing to registry (done from application) and reading (done from keyboard driver) is successful, but the value read doesn’t seem to be proper. Not sure if it is in encrypted form?

For Doron>> Problem description
For disabling system keys (Ctrl+Alt+Del, WinApp, Alt+Esc, Alt+tab etc) my application sets a flag in the keyboard driver. However when the USB keyboard is unplugged and plugged in again, the system keys are enabled again because the flag in the driver is reset. This behavior is seen only with Win XP embedded SP2, it is fixed in SP3. I’m trying to provide a workaround for the application on XP Embedded SP2.

Deepak H N wrote:

For disabling system keys (Ctrl+Alt+Del, WinApp, Alt+Esc, Alt+tab etc) my
application sets a flag in the keyboard driver.

Sigh…

What reg key path or apis are you using when opening the hkey?

d

tiny phone keyboard + fat thumbs = you do the muth

-----Original Message-----
From: xxxxx@wipro.com
Sent: Friday, February 19, 2010 2:52 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Accessing registry from keyboard driver

Thanks Vijay and Doron. Please find my inputs to your queries, below.

For Vijay >> Writing to registry (done from application) and reading (done from keyboard driver) is successful, but the value read doesn’t seem to be proper. Not sure if it is in encrypted form?

For Doron>> Problem description
For disabling system keys (Ctrl+Alt+Del, WinApp, Alt+Esc, Alt+tab etc) my application sets a flag in the keyboard driver. However when the USB keyboard is unplugged and plugged in again, the system keys are enabled again because the flag in the driver is reset. This behavior is seen only with Win XP embedded SP2, it is fixed in SP3. I’m trying to provide a workaround for the application on XP Embedded SP2.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Normally I’d agree with the sigh, but if you read down he’s talking about XP embedded. For embedded scenarios i’d say he’s free to disable all of the vowel keys on the keyboard if that what the scenario needs :slight_smile:

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, February 19, 2010 7:09 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Accessing registry from keyboard driver

Deepak H N wrote:

For disabling system keys (Ctrl+Alt+Del, WinApp, Alt+Esc, Alt+tab etc)
my application sets a flag in the keyboard driver.

Sigh…


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Peter Wieland wrote:

Normally I’d agree with the sigh, but if you read down he’s talking about XP embedded. For embedded scenarios i’d say he’s free to disable all of the vowel keys on the keyboard if that what the scenario needs :slight_smile:

W trd tht nd hd prtty gd sccss.

Mrktng dd nt spcfy whthr tht ppld t th “y” ky.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>scenarios i’d say he’s free to disable all of the vowel keys on the keyboard if that what the scenario

needs :slight_smile:

Disabling “S” is also great - “LITHP is utheful for proceththing lithtth”

:slight_smile:


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com