The Win32_DiskPartition WMI Win32_DiskPartition is what I need. Now, to figure out how to use WMI to get this information from the drive letter.
Win32_LogicalDisk also useful. An example of MSDN and https://stackoverflow.com/a/167379/
Update: Hmm, that doesn't work! In any case, not in the Windows installer ( WMI is not in Windows PE ), so I use a different QueryDosDevice answer (for example, \\.\PhysicalDisk1\Partition0 ) and hack it together. This sucks Microsoft, take the damn way in your installer.
Answer: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS works to get Disk ID . And DeviceIoControl IOCTL_DISK_GET_PARTITION_INFO_EX (thanks TLama) gets me a Partition ID .
unixman83 Feb 16 '12 at 13:25 2012-02-16 13:25
source share