So NTFS uses 128-bit Guid to identify files and directories, you can easily view this information:
C: \ Temp> C: \ Windows \ System32 \ fsutil.exe objectid query.
Object ID: ab3ffba83c67df118130e0cb4e9d4076
BirthVolume ID: ca38ec6abfe0ca4baa9b54a543fdd84f
BirthObjectId ID: ab3ffba83c67df118130e0cb4e9d4076
Domain ID: 00000000000000000000000000000000
So, this is fairly obvious, but how to get this information programmatically? Looking at WinApi for OpenFileById (...), you can get this information. One would expect this to be done in the Win32 FileID API Library , but the method ( GetFileInformationByHandleEx ) returns the FILE_ID_BOTH_DIR_INFO structure. This structure defines FileId; however, this is LARGE_INTEGER (64 bits), not a full 128-bit identifier.
I guess you can use WMI for this, this is where should I turn?
source share