PVMF3->QueryVolumeGuidPathnames(&pVDSVolumePaths, &nPaths) Time to compare them and figure out which volumes are removable. Now you have a list of paths to removable devices, and you have a list of all volumes on the system. Now iterate through the packs and get all of the volumes in each pack: iterator iPacks = vPacks.begin() Now iterate through the list of providers getting the packs from each provider: pEnumProviders->Next(1, &pUnk, &cFetched) This source is missing parts for brevity, but I think I left enough to explain what's happening: pSvc->QueryProviders(VDS_QUERY_SOFTWARE_PROVIDERS, &pEnumProviders) Basically you load VDS, then get all software providers. Then use VDS to get a list of all VDS volumes on the machine. Can anyone help? My full source code is below, it's failing on the DeviceIoControl() call with IOCTL_DISK_SET_PARTITION_INFO_EX. I can manually partition the device using utilities such as diskpart, so I know the partition and file system types are supported by the device. But it's not clear what exactly is not supported. I'm able to create a partition, but when I try IOCTL_DISK_SET_PARTITION_INFO_EX to set the format type, it is failing with 0x32, ERROR_NOT_SUPPORTED. This will be done in batch, hopefully with 50+ devices at once, so drive letter access is not an option. The goal is to re-partition any arbitrary flash drive with a single partition taking the entire space and formatted FAT32 (later options NTFS and EXFAT). I'm stuck attempting to re-partition and format a USB flash drive using C++, any help would be great!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |