3.4.5.2.34.3 IVdsVolumeMF::AddAccessPath (Opnum 5)

The AddAccessPath method adds an access path to the current volume.<129>

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

pwszPath: A null-terminated Unicode string that indicates the access path. A trailing backslash MUST be included if the access path is a drive letter (for example, "F:\").

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 parameter:

  • Verify that pwszPath is not NULL.

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

  • Add the access path to the volume.

  • If the server determines that a mounted folder path name was added to 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 assigned.<131>

  • If the server determines that a drive letter was added to 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_ASSIGN.

      • wcLetter is the drive letter that was assigned to the volume.

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

  • Return an HRESULT indicating failure or success.