3.4.5.2.34.6 IVdsVolumeMF::DeleteAccessPath (Opnum 8)

The DeleteAccessPath method removes the access path from the current volume.

 HRESULT DeleteAccessPath(
   [in, max_is(MAX_PATH - 1), string] 
     WCHAR* pwszPath,
   [in] long bForce
 );

pwszPath: A Unicode string indicating the access path, for example, "C:\myfolder\mydocuments".

bForce: A Boolean that determines whether an access is deleted unconditionally, even if the volume is in use. This parameter is meaningful only when the access path is a drive letter.

Return Values: The method MUST return zero or a non-error HRESULT (as specified in [MS-ERREF]) to indicate success, or return an implementation-specific nonzero error code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service Remote Protocol, see section 2.2.3.

When the server receives this message, it MUST validate the following parameters:

  • Verify that pwszPath is not NULL.

  • Verify that the access path that pwszPath specifies is an access point to the volume.

The server MUST then perform the following in sequence:<132>

  • Attempt to get exclusive access to the volume. If the server fails to get exclusive access to the volume, and the bForce parameter is not set to a non-zero value, then the server MUST return VDS_E_DEVICE_IN_USE.

  • Delete the access point from the volume.

  • If the server determines that a mount point was removed from the volume, for each callback object that is registered in the list of callback objects, the server MUST call the callback object's IVdsAdviseSink::OnNotify() method by using a VDS_NOTIFICATION structure that has the following attributes:

    • objectType member is VDS_NTT_MOUNT_POINT.

    • MountPoint member is a VDS_MOUNT_POINT_NOTIFICATION with the following attributes:

      • ulEvent is VDS_NF_MOUNT_POINTS_CHANGE.

      • volumeId is the VDS_OBJECT_ID of the volume object whose mount point was removed.

  • If the server determines that a drive letter was removed from the volume, for each callback object that is registered in the list of callback objects, the server MUST call the callback object's IVdsAdviseSink::OnNotify() method by using a VDS_NOTIFICATION structure that has the following attributes:

    • objectType member is VDS_NTT_DRIVE_LETTER.

    • Letter member is a VDS_DRIVE_LETTER_NOTIFICATION that has the following attributes:

      • ulEvent is VDS_NF_DRIVE_LETTER_FREE.

      • wcLetter is the drive letter that was removed from the volume.

      • volumeId is the VDS_OBJECT_ID of the volume object whose drive letter was removed.

  • Return an HRESULT indicating failure or success.