Removable disk and IRP_MN_QUERY_CAPABILITIES

Hello folks,

My upper filter for disk drives does IRP_MN_QUERY_CAPABILITIES during AddDevice, to know whether the disk is removable or not. This works most of the time, but sometimes when I plug some USB pen drive, the “removable” flag in DEVICE_CAPABILITIES is not set.

At first I thought it could be my mistake, but devmgmt doesn’t show the CM_DEVCAP_REMOVABLE either. It doesn’t happen all the time though.

I think it’s safe to query capabilities during AddDevice, isn’t it? If yes, any ideas about what could be the problem?

Thanks guys.

Is it happened in the same hardware? It could be possible that a driver for this hardware contains a bug. Usually, not always so, this flag set up by hardware driver.

Igor Sharovar

Yes, it has happened with the same hardware that worked a couple of hours ago :-\

BTW, if it helps, suddendly my breakpoints don’t trigger Windbg…

I think it’s my mistake.

I was gettint the CM_DEVCAP_REMOVABLE flag when filtering the usb class, and I guess CM_DEVCAP_REMOVABLE is never set for the “disk drive” class, am I right?