title: How do you read the 128-bit NTFS FILE_ID for a directory and/or file?
body: <p>So NTFS uses a 128-bit Guid to identify files and directories, you can view this information easily enough:</p>
  
  <pre>
  C:\Temp>C:\Windows\System32\fsutil.exe objectid query .
  Object ID :        ab3ffba83c67df118130e0cb4e9d4076
  BirthVolume ID :   ca38ec6abfe0ca4baa9b54a543fdd84f
  BirthObjectId ID : ab3ffba83c67df118130e0cb4e9d4076
  Domain ID :        00000000000000000000000000000000
  </pre>
  
  <p>So this is obvious enough, but how does one retrieve this information programmatically?  Looking at the WinApi for OpenFileById(...) you should be able to get this information.  One would expect this to be done in the "<a href="http://www.microsoft.com/downloads/details.aspx?familyid=1DECC547-AB00-4963-A360-E4130EC079B8&amp;displaylang=en" rel="noreferrer">Win32 FileID API Library</a>", yet the method there (<a href="http://msdn.microsoft.com/en-us/library/aa364953(v=VS.85).aspx" rel="noreferrer">GetFileInformationByHandleEx</a>) returns a <a href="http://msdn.microsoft.com/en-us/library/aa364226(v=VS.85).aspx" rel="noreferrer">FILE_ID_BOTH_DIR_INFO</a> structure.  This structure defines a FileId; however, it is a LARGE_INTEGER (64bit) not the full 128 bit identifier.</p>
  
  <p>I'm guessing one could use WMI for this, is that where I should turn?</p>