Partager via


4.2 FSCTLs

The following is an example of an FSCTL_LMR_SET_LINK_TRACKING_INFORMATION request, which notifies a server of a moved file. This example demonstrates a file being moved from a remote machine to the local machine, as in section 3.1.6.3, or from a remote machine to a different remote machine, as in the first procedure in section 3.1.6.4.

 TargetFileObject = 0
  
 TargetLinkTrackingInformationLength = 32 // Decimal 50
  
 Type = 0
  
 VolumeId = 8e7e9c15f59b4cf9952b03616aa51ebe
  
 ObjectId = 6479f083cfb245c29c713f586d6e038f
  
 NetBIOSName = 54 65 73 74 4D 61 63 68 69 6E 65 0D 0A 00 // "TestMachine"
  

The following is a related example, also of an FSCTL_LMR_SET_LINK_TRACKING_INFORMATION request but for a file that is moved from a remote machine to the same remote machine, as in the second procedure in section 3.1.6.4, in the case where the connection to the remote machine is using the [MS-SMB] protocol.

 TargetFileObject = 108
  
 TargetLinkTrackingInformationLength = 0
  
 Type = 0
  
 VolumeId = 0
  
 ObjectId = 0
  
 NetBIOSName = 54 65 73 74 4D 61 63 68 69 6E 65 0D 0A 00 // "TestMachine"
  

The following is an example of an FSCTL_SET_OBJECT_ID_EXTENDED request, which sets the FileID to a file (this buffer is a VolumeID, followed by an ObjectID, followed by 16 bytes of zeros).

 ExtendedInfo = 
     8e7e9c15f59b4cf9952b03616aa51ebe \
     6479f083cfb245c29c713f586d6e038f \
     0000000000000000000000000000000
  

The following is an example of both an FSCTL_CREATE_OR_GET_OBJECT_ID reply and an FSCTL_GET_OBJECT_ID reply, which returns a file's ObjectID and FileID (the FileID is composed of the BirthVolumeId and BirthObjectId fields). In this example, the file has never been moved. As a consequence, the ObjectID and BirthObjectId fields are the same value. This also means that the CrossVolumeMoveFlag, stored as the low order bit of the first byte of the BirthVolumeId field, is zero.

 ObjectId = 6479f083cfb245c29c713f586d6e038f
  
 BirthVolumeId = 8e7e9c15f59b4cf9952b03616aa51ebe
  
 BirthObjectId = 6479f083cfb245c29c713f586d6e038f
  
 DomainId = 0