CBFSConnect.MountMedia method


Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

CBFSConnect     See also    


Mounts a media, making it accessible for reading and writing.


    procedure MountMedia(Timeout: Integer);

[C++ (Lib)]
    void MountMedia(unsigned long Timeout);

[C++ (VCL)]
    void __fastcall MountMedia(long Timeout);

[C++ (.NET)]
    void MountMedia(long Timeout);

    void MountMedia(int Timeout);

    Sub MountMedia(ByVal Timeout As Integer)

    void mountMedia(int timeout);


  • Timeout - specifies the timeout, after which the call to callback function will be cancelled by the driver, and timeout error will be reported to the system.


Use this method to mount new media to the created storage. Call this method after calling CreateStorage. For non-PnP storages you can add mounting points before or after calling MountMedia. For PnP storages you need to call MountMedia before adding any mounting points.

Timeout is specified in milliseconds. The value of 0 (zero) means "timeout is not used", i.e. "callbacks work as long as they need". It's good idea to set timeout to 0 when you do debugging of your callback functions. Remember to set timeout to some reasonable value (for example, 30 seconds) for release version. If the non-zero value less than 3000 ms is passed in Timeout, an error with ERROR_IMPLEMENTATION_LIMIT (1292, 0x50C) error code is reported.

CreateStorage() method creates a virtual drive without a "media" in it, much like a CD-drive without a CD inserted. This virtual drive is created without a drive letter, so by calling the AddMountingPoint method you can add a drive letter for the drive (for example "Z:"). After that the virtual drive will be visible in Explorer (as well as in other programs), but an attempt to access it will cause the "no media" error.
By calling MountMedia() method you tell CBFS Connect to "insert" a virtual media to the virtual drive. Right after this CBFS Connect starts calling your callbacks.

Call from...

This method may be called only from outside of callback / event handlers.

Extended error logging

If an error happens, this method throws an exception and puts additional information to Windows system log as described here.

See also

CreateStorage     AddMountingPoint     UnmountMedia     DeleteStorage