3.1.6.2 File Is Moved from Local Machine to Remote Machine

If a file is moved from the local machine to a remote machine, the following procedure SHOULD be followed:

  • The ObjectID of the target file SHOULD be retrieved by sending an FSCTL_CREATE_OR_GET_OBJECT_ID request.<15>

  • If this step is successful, the VolumeID of the target file's volume MUST be retrieved by sending a request for an instance of the FileFsObjectIdInformation class, as specified in [MS-FSCC] section 2.5.6, and by interpreting the ObjectId field of the returned FILE_FS_OBJECTID_INFORMATION structure as the VolumeID. If the connection to the remote machine is using the [MS-SMB] protocol, this request MUST be sent by specifying FileFsObjectIdInformation as the InformationLevel of a TRANS2_QUERY_FS_INFORMATION request, specified in [MS-SMB] section 2.2.6.3.1. Otherwise, the connection to the remote machine is using the [MS-SMB2] protocol, and this request MUST be sent by specifying FileFsObjectidInformation as the FileInfoClass of an SMB2_QUERY_INFO request, specified in [MS-SMB2] section 2.2.37.<16>

  • If the preceding step is successful, an entry MUST be added to the MoveTable (section 3.1.1) for the source file's ObjectID. The MachineID field of that entry MUST be the target machine's MachineID. The FileLocation field of that entry MUST be composed of the target volume's VolumeID and the target file's ObjectID.

  • If the preceding step is successful, the FileID of the source file MUST be set on the target file by sending an FSCTL_SET_OBJECT_ID_EXTENDED request for the target file. In this request, the CrossVolumeMoveFlag MUST be set to 1, and the VolumeID and ObjectID fields MUST be those of the corresponding components of the source file's FileID.