UnmountMedia Method

Unmounts media from the virtual drive.

Syntax

ANSI (Cross Platform)
int UnmountMedia(int bForceUnmount);

Unicode (Windows)
INT UnmountMedia(BOOL bForceUnmount);
#define MID_CBFS_UNMOUNTMEDIA 40

CBFSCONNECT_EXTERNAL int CBFSCONNECT_CALL CBFSConnect_CBFS_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method unmounts the virtual storage media from the virtual drive. The virtual drive itself, as well as any existing mounting points, remain present.

If ForceUnmount is true, all open files are forcefully closed. If ForceUnmount is false and open files or directories are detected, this method fails with an error.

This method must not be called for plug-and-play virtual drives with non-removable media (see StorageType); attempting to do so will cause the call will fail with an "access denied" error.

Note: This method can only be called after creating a virtual drive, and cannot be called within events.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 C++ Edition - Version 20.0 [Build 8348]