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.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


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: 11723
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: 10127
How to get a device's location information?

PNP_LOCATION_INTERFACE:: GetLocationString will return the string without r= esorting to direct registry access. https://msdn.microsoft.com/en-us/library/windows/hardware/ff559634%28v=3Dvs= .85%29.aspx?f=3D255&MSPPError=3D-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:bounce-644315-26293@lists.o= sr.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: > > =A0 =A0 I want to get a PCI device's location information, just like=A0_/= PCI=A0 > bus=A00,=A0device=A031,=A0function=A06/_ Why?=A0 What will you do with this information? If you go hack the registry, you'll see that the LocationInformation regist= ry value in the hardware key inside System\CurrentControlSet\Enum contains = both the localized printf string used to format the information, plus the r= aw numbers themselves.=A0 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/?u= rl=3Dhttp%3A%2F%2Fwww.osronline.com%2Fshowlists.cfm%3Flist%3Dntdev&data=3D0= 2%7C01%7CDoron.Holan%40microsoft.com%7Cff8e9dd4d3cd4e992b5008d5520f8682%7C7= 2f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636505149238084784&sdata=3DErqhXx= rjovY0hgX%2BpsM8QTQGq3wK0DxUC1LMPdCVU2s%3D&reserved=3D0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and softwar= e drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F= %2Fwww.osr.com%2Fseminars&data=3D02%7C01%7CDoron.Holan%40microsoft.com%7Cff= 8e9dd4d3cd4e992b5008d5520f8682%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7= C636505149238084784&sdata=3DGcMB12NnIeWv%2B0QBu5%2FgqO0W138KTwgBQR3Dligga%2= BM%3D&reserved=3D0> To unsubscribe, visit the List Server section of OSR Online at <https://na0= 1.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fwww.osronline.com%2F= page.cfm%3Fname%3DListServer&data=3D02%7C01%7CDoron.Holan%40microsoft.com%7= Cff8e9dd4d3cd4e992b5008d5520f8682%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C= 0%7C636505149238084784&sdata=3D1cp6x37b%2BSn2cEgq%2FgmQuJB2FtFiZIucOrtL4TLQ= zSE%3D&reserved=3D0>
  Message 4 of 4  
02 Jan 18 15:10
Scott Noone
xxxxxx@osr.com
Join Date:
Posts To This List: 1349
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 10:30.


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