Sunday, 25 August 2013

Using IoRegisterPlugPlayNotification and then using IoGetDeviceObjectpointer on DEVICE_INTERFACE_CHANGE_NOTIFICATION.SymbolicLinkName

Using IoRegisterPlugPlayNotification and then using
IoGetDeviceObjectpointer on
DEVICE_INTERFACE_CHANGE_NOTIFICATION.SymbolicLinkName

Hi I am using
"IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange,PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES,(
PVOID
)&GUID_DEVINTERFACE_USB_HUB,DriverObject,PnPMonitorInterfaceChangeCallback,NULL,&pvInterfaceNotification)"
in my DriverEntry to register the
callback(PnPMonitorInterfaceChangeCallback) for any addition/removal of
usb interface. Inside my callback function, I aim to use
IoGetDeviceObjectPointer(((PDEVICE_INTERFACE_CHANGE_NOTIFICATION)NotificationStructure)->SymbolicLinkName,GENERIC_READ,pSomeFileObject,pSomeDeviceObject
).
This call(IoGetDeviceObjectPointer) is causing a bug check saying that "it
referenced memory at location x which cannot be y(read)". Have someone
tried to do any such thing before and can provide some suggestion?

No comments:

Post a Comment