Best way to determine if two path reference to same file in Windows?

Open both files with CreateFile, call GetFileInformationByHandle for both, and compare dwVolumeSerialNumber, nFileIndexLow, nFileIndexHigh. If all three are equal they both point to the same file:

GetFileInformationByHandle function

BY_HANDLE_FILE_INFORMATION Structure

Leave a Comment