Keyboard Upperfilter installation

I use SetupDiGetClassDevs and SetupDiEnumDeviceInfo to find the device and then I call
DWORD RequiredSize = 0;
BOOL bReturn = SetupDiGetDeviceRegistryProperty(devInfo,
&devInfoData, SPDRP_UPPERFILTERS, NULL, NULL, 0, &RequiredSize);
The bReturn is now 0 and GetLastError returns 13 (ERROR_INVALID_DATA). I call the functions elevated. Can anybody help?

Oh, I see what is wrong but is it possible to set the registry entry with SetupDI functions or should I do it with the RegEnumKey functions?
the upperfilters sit under this registry key:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4d36e96b-e325-11ce-bfc1-08002be10318}

Can be closed. I use SetupDiOpenClassRegKey.

Are you attempting to install a class or device specific upper filter?

Bent from my phone


From: Mak
Sent: Friday, November 30, 2018 2:49:35 AM
To: Doron Holan
Subject: Re: [NTDEV] Keyboard Upperfilter installation

OSR https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.osr.com%2F&data=02|01|doron.holan%40microsoft.com|eb8f5a0534184c5b050008d656b1854f|72f988bf86f141af91ab2d7cd011db47|1|1|636791717793553185&sdata=c75lxvMA2452Vt46OOi%2F2RYZmrJBOdmFBgLn0I7dM4M%3D&reserved=0
Mak commented on Keyboard Upperfilter installation

Can be closed. I use SetupDiOpenClassRegKey.

I write a Class specific upper filter at the first step. Later I must add it to specific devices and I know that I must do this with the inf file.
Now I have an further problem. I want to add some entries in the Service Registry of my filter. With which function can I get the Services HKEY?
“Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services”

There isn’t an API to get the Services key root, you must use an absolute path.

d

Is the absolute path stable? I see this path in the registry “Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services” too. What does this mean?

You want to use HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. CurrentControlSet is a symbolic link to the active control set (ControlSet001 on your machine)

d

On Nov 30, 2018, at 1:45 PM, Mak wrote:
>
> Is the absolute path stable? I see this path in the registry “Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services” too. What does this mean?

Good question. It used to be this was common knowledge, but because Windows is much more stable now than it once was, maybe it just doesn’t come up.

There are multiple control set hives, although only one is active. The “CurrentControlSet” key is just an alias pointing to the hive that is active, which probably points to ControlSet001 in your case. You should ALWAYS use the CurrentControlSet key to access the live registry set.

In the old days, when there was a successful boot, that control set would be “frozen”, and it would create a copy (ControlSet002) and start using that. If things went belly up, at boot time you could select the “Last Known Good” option. What that did was move the CurrentControlSet alias from the live one (ControlSet002) to the last snapshot (ControlSet001).

People don’t need and don’t see the “Last Known Good” option any more, and I’m not sure the system even takes a snapshot any more.

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