Block Read and Write Access to USB Drive

Using USB drives to transmit data is still a very convenient way for many of us, despite how popular the cloud storage services are in the internet age. It’s easy and practical but is also hard to control how it behaves especially when you plug in one from the unknown source and that contains stuff you don’t know. You also want to prevent your sensitive files from being copied out to the USB drive without your permission. Since the security of USB is fundamentally broken, it would be nice having an easy way to better control and protect your confidential files in your computer against the USB drive.

With the EaseFilter Control Filter Driver, it is simple to control the read and write access to the USB drive. We provide you the volume control flag to give you the option to block the USB read or write.

//This is the volume control flag
/// <summary>
/// Get a notification when a USB was plugged in.
/// </summary>
VOLUME_ATTACHED_NOTIFICATION = 0x00000002,
/// <summary>
/// Get a notification when a USB was unplugged.
/// </summary>
VOLUME_DETACHED_NOTIFICATION = 0x00000004,
/// <summary>
///Block the read from the USB disk.
/// </summary>
BLOCK_USB_READ = 0x00000010,
/// <summary>
///Block the write to the USB disk
/// </summary>
BLOCK_USB_WRITE = 0x00000020,

//Here is an example to block the USB read and write with below settings:
uint volumeControlFlag = (uint)(BLOCK_USB_READ | BLOCK_USB_WRITE) 
boolean retVal = FilterAPI.SetVolumeControlFlag(volumeControlFlag);

There are another option which allows you to prevent your files from being copied out to the USB drive.

//Set up a filter rule, disable the flag 'ALLOW_COPY_PROTECTED_FILES_TO_USB' in the control flag for the filter rule as below:
uint accessFlags = ALLOW_MAX_RIGHT_ACCESS & (~ALLOW_COPY_PROTECTED_FILES_TO_USB);
FilterAPI.AddFileFilterRule(accessFlags, "c:\\myProtectFolder", false,0 );