Query regarding the GUID_TARGET_DEVICE_REMOVE_COMPLETE vs GUID_IO_MEDIA_REMOVAL

  • Thread starter Thread starter skri
  • Start date Start date
S

skri

Guest
Hi,

I have question regarding the event handling of USB drive. In my driver code i am getting disk device object pointer for USB device and then registering target device change PNP notification on the file object.

IoGetDeviceObjectPointer(DrvName, FILE_READ_ATTRIBUTES, &pFileObj, &pDevObj);

...

IoRegisterPlugPlayNotification(EventCategoryTargetDeviceChange,.., pFileObj,..);

When i do surprise remove the USB drive from the system, i am not getting the GUID_TARGET_DEVICE_REMOVE_COMPLETE event as per this doc Handling a GUID_TARGET_DEVICE_REMOVE_COMPLETE Event - Windows drivers but getting event GUID_IO_MEDIA_ARRIVAL.

Why this strange behavior, is there anything wrong in my PNP registration.?

Thanks,

Poo




Continue reading...
 
Back
Top