VIRTUAL DEVICE DRIVER (WDKVirtualVolume)

Introduction

This is the Virtvol sample driver.  This version of the driver has been modified to support the driver frameworks. This driver basically creates a nonpaged pool and exposes that as a storage media. User can find the device in the disk manager and format the media to use as FAT or NTFS volume. In addition, Virtvol integrates with Mount Manager, so that it is not necessary for you to assign a drive letter, the system will do this automatically.

Running the Sample

First, you should build this sample as normal. Then please follow the following steps to install this driver:

  1. Copy inf and sys files to directory
  2. Copy Wdf DLL to same directory
  3. Open device manager.
  4. Right-click on machine name and pick Add Legacy Hardware
  5. Install manually
  6. Have Disk, navigate to directory and install.
  7. Done.

Alternatively, you can copy the files over as above and then run devcon.exe: DEVCON.EXE INSTALL virtvol.inf virtvol

The devcon.exe application can be found in the WDK in the tools directory.

Finally, please validate if you’ve installed the driver successfully.

  

Remove devices:

You can run devcon.exe: DEVCON.EXE -remove virtvol.inf virtvol to remove the devices.

 

Using the Code

The main logic of this code is:

  1. Add a single instance of a VirtVol to the system.
  2. Register with the mount manager the existence of this volume.
  3. Locate the drive by observing File Explorer.
  4. Use the volume as-is.

More Information

·        The location for complete information on the KMDF framework is:
http://msdn.microsoft.com/en-us/windows/hardware/gg463279

       The location of how to interact with the mount manager is:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff562298(v=VS.85).aspx