2.1.4.11 Algorithm for Posting a USN Change for a File
The inputs for this algorithm are:
-
File: The file this change occurs on.
-
Reason: A 32-bit unsigned integer describing the change that occurred to the file, as specified in [MS-FSCC] section 2.3.42.
-
FileName: The pathname, relative to Volume.RootDirectory, of the file this change occurs on.
The algorithm MUST return at this point without taking any actions under any of the following conditions:
-
If the object store does not support USN change journals.
-
If File.Volume.IsUsnJournalActive is FALSE.
-
If Reason is zero.
Pseudocode for the algorithm is as follows:
-
Set FileNameLength to the length, in bytes, of FileName.
-
Set RecordLength to BlockAlign(FieldOffset(USN_RECORD.FileName) + FileNameLength, 8).
-
Set File.Volume.LastUsn to File.Volume.LastUsn + RecordLength.
-
Set File.Usn to File.Volume.LastUsn.