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
S_OK
The method completed successfully.
VDS_E_OPERATION_DENIED
0x8004240AL
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.
VDS_E_PATH_NOT_FOUND
0x80042416L
The specified path is not found.
VDS_E_DEVICE_IN_USE
0x80042413L
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.
VDS_E_OBJECT_STATUS_FAILED
0x80042431L
The volume failed.
VDS_E_PACK_OFFLINE
0x80042444L
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

See also

IVdsVolumeMF

IVdsVolumeMF::AddAccessPath

IVdsVolumeMF::QueryAccessPaths