CreateStorage Method
Creates the virtual disk.
Syntax
public void createStorage();
Remarks
This method creates the virtual disk (without mounting points) based on the following properties and configuration settings, which cannot be changed once the virtual storage has been created:
- StorageType
- StorageCharacteristics
- StorageGUID (if applicable)
- SectorSize
After the virtual disk is created, use the MountMedia method to "insert storage media" into the virtual disk drive, and use the AddMountingPoint method to create one or more mounting points for it.
The Initialize method must have been called by some class instance in the application prior to calling this method.
Note: This method cannot be called within events.
Virtual Disks, Media, and Mounting Points
When applications call the CreateStorage method, a virtual disk is created. Virtual disks are created without any "media" in them (like a CD drive without a CD inserted), and without any mounting points (drive letters, UNC paths, etc.).
After creating a virtual disk, applications should call MountMedia to "insert" virtual storage media into the virtual disk. This call will cause the class's events to start firing; applications must handle these events correctly, or the MountMedia call will fail.
Once media has been mounted in the virtual disk, applications should use the AddMountingPoint method to add one or more mounting points for the virtual disk. These mounting points make the virtual disk available for use. Once it's formatted, the system and third-party applications can start accessing it.
Note that applications can technically call AddMountingPoint before MountMedia (except for plug-and-play virtual disks with non-removable media; see StorageType), but any attempts to access a virtual disk with no media mounted will result in a "no media" error.