how to obtain device and function numbers in a wdm function driver

Hi,

I am writing a function wdm driver. I want to know bus, device and
function numbers. I got the bus number by calling IoGetDeviceProperty
with property parameter as DevicePropertyBusNumber. But I do not
understand how to obtain device and function numbers.

I called IoGetDeviceProperty with property parameter as
DevicePropertyLocationInformation. It returned me an array of size 66
bytes. I do not know how to decode it.

Please help.

Thanks,

Aparna

For a PCI device (and you should of course make sure or know a priori
that your device is a PCI device) you should use DevicePropertyAddress,
which will return a ULONG where the upper 16 bits are the device number
and the lower 7 bits are the function number. Location information is
irrelevant.


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Aparna Argade
Sent: Wednesday, March 15, 2006 7:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] how to obtain device and function numbers in a wdm
function driver

Hi,

I am writing a function wdm driver. I want to know bus, device and
function numbers. I got the bus number by calling IoGetDeviceProperty
with property parameter as DevicePropertyBusNumber. But I do not
understand how to obtain device and function numbers.

I called IoGetDeviceProperty with property parameter as
DevicePropertyLocationInformation. It returned me an array of size 66
bytes. I do not know how to decode it.

Please help.

Thanks,

Aparna


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer