Does anybody know whether the BY_HANDLE_FILE_INFORMATION structure provided by Windows, is affected by a defragmentation of an NTFS disk?
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363788%28v=vs.85%29.aspx
No, defragmentation (of data, or of MFT) doesn't change any of these values. FILE_INFORMATION structure only returns information from several NTFS file attributes ($FILE_NAME, $STANDARD_INFORMATION), and FileIndex, which can't change in NTFS. Defragmentation of MFT can change location of file records, defragmentation of file data can change content of $DATA attribute, but doesn't change these file attributes.