Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Keyboard Upperfilter installation

MakMak Member Posts: 50

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?

Comments

  • MakMak Member Posts: 50

    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}

  • MakMak Member Posts: 50

    Can be closed. I use SetupDiOpenClassRegKey.

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,428
    via Email
    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://community.osr.com/&data=02|01|[email protected]|eb8f5a0534184c5b050008d656b1854f|72f988bf86f141af91ab2d7cd011db47|1|1|636791717793553185&sdata=c75lxvMA2452Vt46OOi/2RYZmrJBOdmFBgLn0I7dM4M=&reserved=0
    Mak commented on Keyboard Upperfilter installation

    Can be closed. I use SetupDiOpenClassRegKey.
    d
  • MakMak Member Posts: 50

    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"

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,428
    via Email
    There isn't an API to get the Services key root, you must use an absolute path.

    d
    d
  • MakMak Member Posts: 50

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

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,428
    via Email
    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
    d
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 12,914
    via Email
    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, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 25 Feb 2019 OSR Seminar Space
Developing Minifilters 8 April 2019 OSR Seminar Space