[syslinux] use SetFilePointerEx and other improvements

This commit is contained in:
Pete Batard 2016-06-06 19:39:53 +01:00
parent f31a90bba2
commit f1f620411c
3 changed files with 28 additions and 22 deletions

View file

@ -1138,6 +1138,7 @@ static BOOL SetupWinPE(char drive_letter)
const char* patch_str_rep[] = { "\\i386\\txtsetup.sif", "\\i386\\system32\\" };
const char *win_nt_bt_org = "$win_nt$.~bt", *win_nt_bt_rep = "i386";
const char *rdisk_zero = "rdisk(0)";
const LARGE_INTEGER liZero = { {0, 0} };
char setupsrcdev[64];
HANDLE handle = INVALID_HANDLE_VALUE;
DWORD i, j, size, rw_size, index = 0;
@ -1203,7 +1204,7 @@ static BOOL SetupWinPE(char drive_letter)
uprintf("Could not read file %s: %s\n", dst, WindowsErrorString());
goto out;
}
SetFilePointer(handle, 0, NULL, FILE_BEGIN);
SetFilePointerEx(handle, liZero, NULL, FILE_BEGIN);
// Patch setupldr.bin
uprintf("Patching file %s\n", dst);