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 4  
02 Jan 18 06:29
coder lizzoe
xxxxxx@sina.com
Join Date: 12 Oct 2016
Posts To This List: 16
How to get a device's location information?

Hi, all I want to get a PCI device's location information, just like PCI bus 0, device 31, function 6 SetupDiGetDeviceRegistryProperty ( m_hDevInfo, &DeviceInfoData, SPDRP_LOCATION_INFORMATION, NULL, (PBYTE)DeviceLocation, buffersize, &buffersize ) This function can get the Location data as the italic string metioned above. But on deferent operating system language region settings, it can return in diferent language, like Japanese or Korean. Is there any way to get the three positional parameters directly? Or, I have to make a match for each language. xxxxx@sina.com
  Message 2 of 4  
02 Jan 18 13:35
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11957
How to get a device's location information?

xxxxx@sina.com wrote: > >     I want to get a PCI device's location information, just > like _/PCI bus 0, device 31, function 6/_ Why?  What will you do with this information? If you go hack the registry, you'll see that the LocationInformation registry value in the hardware key inside System\CurrentControlSet\Enum contains both the localized printf string used to format the information, plus the raw numbers themselves.  SetupDiOpenDevRegKey should be helpful. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 3 of 4  
02 Jan 18 14:23
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10209
How to get a device's location information?

PNP_LOCATION_INTERFACE:: GetLocationString will return the string without resorting to direct registry access. https://msdn.microsoft.com/en-us/library/windows/hardware/ff559634%28v=vs.85%29.a spx?f=255&MSPPError=-2147217396 you can also query for the location property instead of manually QI'ing for it. d -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com Sent: Tuesday, January 2, 2018 10:35 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: Re: [ntdev] How to get a device's location information? xxxxx@sina.com wrote: > > ? ? I want to get a PCI device's location information, just like?_/PCI? > bus?0,?device?31,?function?6/_ Why?? What will you do with this information? If you go hack the registry, you'll see that the LocationInformation registry value in the hardware key inside System\CurrentControlSet\Enum contains both the localized printf string used to format the information, plus the raw numbers themselves.? SetupDiOpenDevRegKey should be helpful. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc. --- 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=02%7C01%7CDoron.Holan%40microsoft.com%7Cff8 e9dd4d3cd4e992b5008d5520f8682%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636505 149238084784&sdata=ErqhXxrjovY0hgX%2BpsM8QTQGq3wK0DxUC1LMPdCVU2s%3D&reserved=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=02%7C01%7CDoron.Holan%40microsoft.com%7Cff8e9dd4d3cd4e992b5008d5520f8 682%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636505149238084784&sdata=GcMB12N nIeWv%2B0QBu5%2FgqO0W138KTwgBQR3Dligga%2BM%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=02%7C01%7CDoron.Holan%40microsoft.com%7Cff8 e9dd4d3cd4e992b5008d5520f8682%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636505 149238084784&sdata=1cp6x37b%2BSn2cEgq%2FgmQuJB2FtFiZIucOrtL4TLQzSE%3D&reserved=0>
  Message 4 of 4  
02 Jan 18 15:10
Scott Noone
xxxxxx@osr.com
Join Date:
Posts To This List: 1377
List Moderator
How to get a device's location information?

Have you tried SPDRP_BUSNUMBER and SPDRP_ADDRESS? These should given you the values*, though I have not personally used them. -scott OSR @OSRDrivers *The end of this MSDN page shows how to intepret DevicePropertyBusNumber and DeviceProperyAddress for PCI devices, which should be the same values you get back in user mode: https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/obtaining-device -configuration-information-at-irql---dispatch-level
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 23:29.


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