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 https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/handling-a-guid-target-device-remove-complete-event but
getting event GUID_IO_MEDIA_ARRIVAL.
Why this strange behavior, is there anything wrong in my PNP registration.?
Thanks,
Poo