[core] partitioning improvements

* Improve report and make sure we zero leftovers from the start of a partition
* Also add VDS error codes
* Also fix Coverity warnings
This commit is contained in:
Pete Batard 2019-04-27 16:04:47 +01:00
parent 1c39a80d72
commit 5f9e65707f
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
7 changed files with 521 additions and 58 deletions

View file

@ -318,6 +318,17 @@ interface IVdsAsync {
#define IVdsAsync_Release(This) (This)->lpVtbl->Release(This)
#endif
/* MinGW is unhappy about accessing partitions beside the first unless we redef */
typedef struct _DRIVE_LAYOUT_INFORMATION_EX4 {
DWORD PartitionStyle;
DWORD PartitionCount;
union {
DRIVE_LAYOUT_INFORMATION_MBR Mbr;
DRIVE_LAYOUT_INFORMATION_GPT Gpt;
} Type;
PARTITION_INFORMATION_EX PartitionEntry[MAX_PARTITIONS];
} DRIVE_LAYOUT_INFORMATION_EX4, *PDRIVE_LAYOUT_INFORMATION_EX4;
static __inline BOOL UnlockDrive(HANDLE hDrive) {
DWORD size;
return DeviceIoControl(hDrive, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, &size, NULL);