Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

OSR Seminars


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 10  
07 Mar 18 11:21
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 84
full instance ID path from devices

I have two keyboards plugged in which have the same hardware id. I know that I need the serial number but with which function can I get it? Or how can I get the instance name of a device? Thanks Manfred
  Message 2 of 10  
07 Mar 18 11:31
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10209
full instance ID path from devices

From a driver? From an app? What will you do with the information once you have it...IOW what bigger problem are you trying to solve? Btw, keyboards usually don't have serial numbers. d Bent from my phone ________________________________ From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> on behalf of xxxxx@x-publisher.com <xxxxx@lists.osr.com> Sent: Wednesday, March 7, 2018 8:21:15 AM To: Windows System Software Devs Interest List Subject: [ntdev] full instance ID path from devices I have two keyboards plugged in which have the same hardware id. I know that I need the serial number but with which function can I get it? Or how can I get the instance name of a device? Thanks Manfred --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=04%7C01%7CDoron.Holan%40microsoft.com%7C189 75f66f74f429ac83e08d58447707b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636560 364718094383%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-2&sdata=YVVZfepIPmp2U%2F94Y%2Fvh4MbNUrLhyehq5jmFVzLUqmQ%3D&re served=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=04%7C01%7CDoron.Holan%40microsoft.com%7C18975f66f74f429ac83e08d584477 07b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636560364718094383%7CUnknown%7CT WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdat a=m67WA2N0GkVVL4EldDU8lx82C%2BmVbaSbyDxLgAR1GcA%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=04%7C01%7CDoron.Holan%40microsoft.com%7C189 75f66f74f429ac83e08d58447707b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636560 364718094383%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-2&sdata=6ONNQEQhUsCxaQVuCJB2cRIhJzmPwme3c8rcc5LL%2BVo%3D&rese rved=0> --
  Message 3 of 10  
07 Mar 18 12:07
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 84
full instance ID path from devices

I iterate through the keyboards attached to my filter driver and need a unique identifier for customizing. I know there is the Keboard UnitId but this id is attached first if the user types something on the keyboard. What is with this function WdfDeviceAllocAndQueryPropertyEx? It seems that this does it but I didnt find an example how the DEVPROPKEY must be defined for DEVPKEY_Device_InstanceId.
  Message 4 of 10  
07 Mar 18 12:10
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 84
full instance ID path from devices

I get this "HID\\VID_046A&PID_0023&MI_00" "HID\\VID_046A&PID_0023&MI_00" and I need this "HID\\VID_046A&PID_0023&MI_00\\8&26101c2b&0&0000_0" "HID\\VID_046A&PID_0023&MI_00\\8&3483bdfa&0&0000_0"
  Message 5 of 10  
07 Mar 18 13:00
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11963
full instance ID path from devices

xxxxx@x-publisher.com wrote: > I iterate through the keyboards attached to my filter driver and need a unique identifier for customizing. > I know there is the Keboard UnitId but this id is attached first if the user types something on the keyboard. > > What is with this function WdfDeviceAllocAndQueryPropertyEx? It seems that this does it but I didnt find an example how the DEVPROPKEY must be defined for DEVPKEY_Device_InstanceId. "How it must be defined?"  I don't know what you mean by that.  The DEVPKEY GUIDs are all defined in <devpkey.h>.  You just use the name. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 6 of 10  
07 Mar 18 14:26
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10209
full instance ID path from devices

Why are you iterating through the keyboards outside of the context of pnp. If you want to filter all keyboards, install your filter as a class upper filter. Once you are in the pnp stack, you have access to the PDO and with the PDO you can call WdfDeviceOpenRegistryKey(PDO, PLUGPLAY_REGKEY_DEVICE, ...) (or WDM equivalent API) which gives you the per device storage you need for customizatiosn without opening or needing the full instance ID path=20 d -----Original Message----- From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> On Behalf Of xxxxx@x-publisher.com Sent: Wednesday, March 7, 2018 9:07 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: RE:[ntdev] full instance ID path from devices I iterate through the keyboards attached to my filter driver and need a unique identifier for customizing. I know there is the Keboard UnitId but this id is attached first if the user types something on the keyboard. What is with this function WdfDeviceAllocAndQueryPropertyEx? It seems that this does it but I didnt find an example how the DEVPROPKEY must be defined for DEVPKEY_Device_InstanceId. --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=04%7C01%7CDoron.Holan%40microsoft.com%7C572 fa51aa0924f3901c208d5844dc55f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636560 391922463250%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-2&sdata=I%2BYPDGYFyH%2Fm0vwAglJkknV3vD9vEUT2oivP5lwpxgI%3D&re served=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=04%7C01%7CDoron.Holan%40microsoft.com%7C572fa51aa0924f3901c208d5844dc 55f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636560391922463250%7CUnknown%7CT WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdat a=J1rQ0hpzXA2MHzpsx6yzLKrru8Khvu0YAAsf3QabRNQ%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=04%7C01%7CDoron.Holan%40microsoft.com%7C572 fa51aa0924f3901c208d5844dc55f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636560 391922463250%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-2&sdata=NGwjrkKQhgzifLiE66%2Bkf%2B3DC90yxS6HE78dXv10fRQ%3D&re served=0>
  Message 7 of 10  
08 Mar 18 03:21
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 84
full instance ID path from devices

@Doran: The reason is perhabs that I dont understand it all. What is wrong: DEVICE_OBJECT *pdo = WdfDeviceWdmGetPhysicalDevice(device); status = WdfDeviceOpenRegistryKey(WdfWdmDeviceGetWdfDeviceHandle(pdo), PLUGPLAY_REGKEY_DEVICE, STANDARD_RIGHTS_ALL, WDF_NO_OBJECT_ATTRIBUTES, &hKey); Device is the actual device.
  Message 8 of 10  
08 Mar 18 05:09
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 84
full instance ID path from devices

The following code (IoOpenDeviceRegistryKey) works but can anybody say where I can find this registry key "PLUGPLAY_REGKEY_DEVICE," in the registry? I have an filterdriver and get the pdo with: DEVICE_OBJECT *pdo = WdfDeviceWdmGetPhysicalDevice(device); IoOpenDeviceRegistryKey(pdo, PLUGPLAY_REGKEY_DEVICE, KEY_READ, &deviceParameterHandle);
  Message 9 of 10  
08 Mar 18 08:32
makrurisan makkeln
xxxxxx@x-publisher.com
Join Date: 12 Jan 2018
Posts To This List: 84
full instance ID path from devices

More precisely: What registry key I get with the following code: WdfDeviceWdmGetPhysicalDevice(device) status = IoOpenDeviceRegistryKey(pdo, PLUGPLAY_REGKEY_DEVICE | PLUGPLAY_REGKEY_CURRENT_HWPROFILE, KEY_READ, &deviceParameterHandle); Is it e.g. the following? Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_046A&PID_010D&M I_00 or is it: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID I call the above function from an Upperfilter device.
  Message 10 of 10  
08 Mar 18 10:09
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10209
full instance ID path from devices

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_046A&PID_010D&M I_00\<instance id>\Device Parameters Bent from my phone ________________________________ From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> on behalf of xxxxx@x-publisher.com <xxxxx@lists.osr.com> Sent: Thursday, March 8, 2018 5:32:22 AM To: Windows System Software Devs Interest List Subject: RE:[ntdev] full instance ID path from devices More precisely: What registry key I get with the following code: WdfDeviceWdmGetPhysicalDevice(device) status = IoOpenDeviceRegistryKey(pdo, PLUGPLAY_REGKEY_DEVICE | PLUGPLAY_REGKEY_CURRENT_HWPROFILE, KEY_READ, &deviceParameterHandle); Is it e.g. the following? Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_046A&PID_010D&M I_00 or is it: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID I call the above function from an Upperfilter device. --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=04%7C01%7CDoron.Holan%40microsoft.com%7Ca57 f672adecb4c3da65c08d584f90e74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636561 127588002881%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-2&sdata=O7KyfsqdxbFShT9u7iD8BQ6cyw4bmbEWhZrm0iR84Xs%3D&reserv ed=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=04%7C01%7CDoron.Holan%40microsoft.com%7Ca57f672adecb4c3da65c08d584f90 e74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636561127588002881%7CUnknown%7CT WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdat a=22FDIhid%2FZzaDBKDOsstpxBaVdzrUTcfGjftw7wGXps%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=04%7C01%7CDoron.Holan%40microsoft.com%7Ca57 f672adecb4c3da65c08d584f90e74%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636561 127588002881%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6 Ik1haWwifQ%3D%3D%7C-2&sdata=50ii4v7ma1awCBCyu5oEDO9TPVfai81W4gAVofKD4JQ%3D&reserv ed=0> --
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 17:49.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license