3.4.5.2.2.3 Processing Details

The server MUST check for the changes in the underlying object store and update FileMetadataTable as follows:

  • If an entry in the FileMetadataTable with ObjectStoreID already exists and the file is deleted from the object store, delete this entry from FileMetadataTable.

  • If an entry in the FileMetadataTable with ObjectStoreID already exists and the file is not deleted from the object store, update the metadata entry.

    • If there is a change in file content, generate a GUID and assign it to FileStreamId.

  • Otherwise, create an entry, initialize it as follows, and add the entry to FileMetadataTable.

    • Find an entry with the ObjectStoreID of the parent and set ParentId to FileId of this entry.

    • Set ObjectStoreID as the unique identifier of the object store.

    • Generate a SYNC_GID structure and assign it to FileId.

    • Generate a GUID and assign it to FileStreamId.

    • Set FileAttributes to the object store attributes.

    • Set NamespaceChangeTime, AttributeChangeTime, CreatedTime, and ModifiedTime to the current time.

    • Set ContentSize as the file size.

    • Set FileName to the name of the file.

    • Set OriginatingDeviceName to the name of this device.

The server MUST generate a change batch, as specified in [MS-FSVCA] section 3.1.4.2, by passing ‘TRUE’ to IsRecoverySynchronization as input if Session.SessionType is 0x04, or ‘FALSE’ if Session.SessionType is 0x02, corresponding to the files to be downloaded to the client, and set TotalFileCount and TotalFileSize with implementation-specific<10> values.

The server MUST create an entry in Session.ChangeBatchList and set ChangeBatch.MetaData and ChangeBatch.FileInfoList to the generated change batch.

The server MUST create an entry in Session.ChangeBatchList and initialize it as follows:

  • Set ChangeBatch.MetaData.SyncMetadata to the generated change batch.

  • Construct a VECTOR_FILE_METADATA_ENTRY structure and add a FILE_METADATA_ENTRY entry for each file in the generated changed batch using FileMetadataTable. Set ChangeBatch.MetaData.Files to the generated VECTOR_FILE_METADATA_ENTRY.

  • For each file in the generated change batch, if CHANGE_SET_ENTRY.SyncChange (as specified in [MS-FSVCA] section 2.16) is 0x00000000, add an entry in FileInfoList.