title: Drive/Partition and unique drive ID in Windows API
body: <p>Alright, I'm looking to create a program that can take a unique drive ID (serial number?), and put it into a database where it associates the ID with some files. If I want to find a file on something like a flashdrive (which can change drive letter), I attach the flashdrive, my program scans for it's unique ID, looks up the files based on something like a stl::map, and converts the unique ID to a drive letter.</p>
  
  <p>The program would also need to recognise partitions as well (obviously), so maybe uniqueid+partitionnumber on the device.</p>
  
  <p>Any ideas on how I can go about this? I'm looking at the source code for EnumDisk (Windows code sample) but the included demo .exe doesn't seem to work under Windows 7 (said it was compatible without rebuilding from source).</p>
  
  <p>Any takers?</p>
  
  <p>P.S. I get this error from ENumDisk.exe 
  'CreateFile failed with error: 5'</p>
  
  <p>P.S.S. Oh, and I want the program to be able to scan drives that are from other filesystems and get <em>their</em> serial IDs. I know that's a tall order but this is my eventual aim.</p>