From ccd0fe679107b59823523f5f9bfad4735fc476fc Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Mon, 20 Nov 2017 11:47:45 +0100 Subject: [PATCH] CxbxCreatePartitionHeaderFile : Prevent NULL-pointer error --- src/CxbxKrnl/EmuFile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CxbxKrnl/EmuFile.cpp b/src/CxbxKrnl/EmuFile.cpp index 06e2e7cea..1175f0db9 100644 --- a/src/CxbxKrnl/EmuFile.cpp +++ b/src/CxbxKrnl/EmuFile.cpp @@ -100,7 +100,8 @@ void CxbxCreatePartitionHeaderFile(std::string filename, bool partition0 = false // If this is partition 0, install the partiton table if (partition0) { - WriteFile(hf, &BackupPartTbl, sizeof(XboxPartitionTable), NULL, 0); + DWORD NumberOfBytesWritten = 0; + WriteFile(hf, &BackupPartTbl, sizeof(XboxPartitionTable), &NumberOfBytesWritten, 0); } SetFilePointer(hf, 512 * ONE_KB, 0, FILE_BEGIN);