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.