IVdsVolumeMF::DeleteAccessPath method (vds.h)
[Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.]
Removes the access path from the current volume.
Syntax
HRESULT DeleteAccessPath(
[in] LPWSTR pwszPath,
[in] BOOL bForce
);
Parameters
[in] pwszPath
A string that contains the access path to be removed. An access path can be a drive letter or a path to an empty directory on an NTFS volume. If it is a drive letter, you must include a trailing backslash, for example, "F:". If it is a path to a directory, the trailing backslash is not required, for example, "C:\MyFolder\MyDocuments".
[in] bForce
If TRUE, the access path is deleted unconditionally, even if the volume is in use. This parameter is meaningful only when the access path is a drive letter.
Return value
This method can return standard HRESULT values, such as E_INVALIDARG or E_OUTOFMEMORY, and VDS-specific return values. It can also return converted system error codes using the HRESULT_FROM_WIN32 macro. Errors can originate from VDS itself or from the underlying VDS provider that is being used. Possible return values include the following.
Return code/value | Description |
---|---|
|
The method completed successfully. |
|
The path leads to the system volume, the boot volume, the crashdump volume, the hibernation volume, or the pagefile volume. You cannot remove the drive letter from these volumes. |
|
The specified path is not found. |
|
The access path was deleted successfully, however, an error occurred. VDS possibly failed to update the GUID partition table (GPT) attribute of a partition or failed to delete a default network share (such as F$) while deleting the drive letter. |
|
The volume failed. |
|
The pack containing the volume is not accessible. |
Remarks
If there are no open handles on the volume, the drive letter is removed immediately. However, if there are open handles on the volume, the volume cannot be locked and the drive letter is removed when the computer is restarted.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | vds.h |
Library | Uuid.lib |