Determining the physical device object name and drive letter.

Hello everybody! I wrote a wdf upper filter driver for the usb device and I need to know a physical device object name for install driver ( I use addfilter.exe for install). Is it possible to somehow programmatically determine the physical device object name for my device? After installing the driver, I need to get a drive letter of my device with a filter driver in the user level. Is there a way to get exactly the letter of my device?

On Jan 24, 2019, at 9:13 AM, Alexey_Yerakhavets wrote:
>
> Hello everybody! I wrote a wdf upper filter driver for the usb device and I need to know a physical device object name for install driver ( I use addfilter.exe for install). Is it possible to somehow programmatically determine the physical device object name for my device?

It’s not impossible to find that, but what good would it do you? How do you intend to use it?

> After installing the driver, I need to get a drive letter of my device with a filter driver in the user level. Is there a way to get exactly the letter of my device?

Presumably, you know the VID/PID of the device, otherwise you couldn’t have installed yourself. It is possible – although tedious – to map a VID/PID to a drive letter.

https://www.techtalkz.com/threads/how-to-map-drive-letter-eg-h-to-usb-vid-pid.243742/

Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

To install the filter, you only need to know the physical device object name of the disk( Device\00000061). And my driver should work with any flash drive, and not which I prepared in advance.

I need a drive letter to back up data so that I don’t have to choose the path to the device, but set the path automatically to the USB flash drive.