[misc] add arbitrary buffer allocation to GetResource()

* If duplicate is TRUE and len is non-zero, then a buffer of len size,
  padded with zeroes, is allocated for the resource.
This commit is contained in:
Pete Batard 2020-02-19 12:41:13 +00:00
parent 841b79f45d
commit b8579c04da
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
6 changed files with 27 additions and 12 deletions

View file

@ -2,7 +2,7 @@
* Rufus: The Reliable USB Formatting Utility
* DOS boot file extraction, from the FAT12 floppy image in diskcopy.dll
* (MS WinME DOS) or from the embedded FreeDOS resource files
* Copyright © 2011-2017 Pete Batard <pete@akeo.ie>
* Copyright © 2011-2020 Pete Batard <pete@akeo.ie>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -317,6 +317,7 @@ static BOOL ExtractMSDOS(const char* path)
goto out;
}
DiskImageSize = 0;
DiskImage = (BYTE*)GetResource(hDLL, MAKEINTRESOURCEA(1), "BINFILE", "disk image", &DiskImageSize, TRUE);
if (DiskImage == NULL)
goto out;