EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How can I attach a filter to USB drive?

If the device is already present in the system and has some drive letter, then you just attach the filter to the drive as you do with a regular drive.

However, if you want to track all (or any) inserted USB drives, you need to be notified when the device is attached to the system (USB disk is plugged to computer). You can do this by handling WM_DEVICECHANGE window message or by using RegisterDeviceNotification function of Windows API. The latter case is useful when you don't have a window handle (eg. in the service application). When using RegisterDeviceNotification, you will need to set a filter on what exactly devices you want to track. Internet search for "RegisterDeviceNotification) will reveal several useful articles, such as the one on CodeProject.

CallbackFilter 3 includes OnFilterAttachToFsVolume event which lets you know when the new device appears in the system. This is the alternative to the above mentioned ways to track device attachment.

Return to the list


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!