How to get a physical SLOT number of the PCI card in the WDM driver

zhaozj2021-02-16  50

How to get the physical SLOT number of the PCI card in the WDM driver?

The system provides a function IOGETDEVICEPROPERTY () to implement this feature. The declaration of this function is as follows:

NTSTATUSIoGetDeviceProperty (IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength);

The physical SLOT number of the PCI card when the parameter deviceproperty = DevicePropertyuinumber is the PCI card. Examples are as follows:

Ulong Uluinumber; IOGETDEVICEPROPERTY (PDO, DevicePropertyUinumber, SizeOf (Ulong), (PVOID) & ULUNUMBER, & ULLENGTH); PDO parameters can be passed from Bus Driver in your functionally driven AddDevice routine.

转载请注明原文地址:https://www.9cbs.com/read-18151.html

New Post(0)