[core] report Windows edition

* Also use build number to detect Windows Server 2019 and Windows 11
  since Microsoft are COMPLETE ASSES about their version reporting.
* Also fix a compilation warning.
This commit is contained in:
Pete Batard 2021-09-26 16:20:46 +01:00
parent 2761c72187
commit d203c91403
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 86 additions and 10 deletions

View file

@ -730,7 +730,7 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
num_sectors_to_clear = (DWORD)((add1MB ? 2048 : 0) + MAX_SECTORS_TO_CLEAR);
uprintf("Erasing %d sectors", num_sectors_to_clear);
pZeroBuf = calloc(SectorSize, num_sectors_to_clear);
pZeroBuf = calloc(SectorSize, (size_t)num_sectors_to_clear);
if (pZeroBuf == NULL) {
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | ERROR_NOT_ENOUGH_MEMORY;
goto out;