From 8a8a25695351ee542f08886a9d0957c78c6af366 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 28 Apr 2021 18:30:00 -0500 Subject: Clean up 32-bit assumptions. --- global.json | 2 +- src/be/utilbe.vcxproj | 6 +++--- src/ca/FormatFiles.cpp | 2 +- src/ca/XmlConfig.cpp | 11 +++-------- src/ca/XmlFile.cpp | 7 ++----- src/ca/utilca.vcxproj | 4 ++-- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/global.json b/global.json index bd2257b6..697f5687 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "msbuild-sdks": { - "WixToolset.Sdk": "4.0.0-build-0212" + "WixToolset.Sdk": "4.0.0-build-0213" }, "sdk": { "allowPrerelease": false diff --git a/src/be/utilbe.vcxproj b/src/be/utilbe.vcxproj index c02b51a5..683b376a 100644 --- a/src/be/utilbe.vcxproj +++ b/src/be/utilbe.vcxproj @@ -69,9 +69,9 @@ - - - + + + diff --git a/src/ca/FormatFiles.cpp b/src/ca/FormatFiles.cpp index 464b92d6..d1533999 100644 --- a/src/ca/FormatFiles.cpp +++ b/src/ca/FormatFiles.cpp @@ -203,7 +203,7 @@ extern "C" UINT __stdcall WixExecFormatFiles( hr = FileGetTime(sczFilePath, NULL, NULL, &filetime); ExitOnFailure(hr, "Failed to get modified time of file : %ls", sczFilePath); - hr = FileWrite(sczFilePath, FILE_ATTRIBUTE_NORMAL, pbData, static_cast(cbData), NULL); + hr = FileWrite(sczFilePath, FILE_ATTRIBUTE_NORMAL, pbData, cbData, NULL); ExitOnFailure(hr, "Failed to write file content: %ls", sczFilePath); hr = FileSetTime(sczFilePath, NULL, NULL, &filetime); diff --git a/src/ca/XmlConfig.cpp b/src/ca/XmlConfig.cpp index 959f95b0..a1ec9d6f 100644 --- a/src/ca/XmlConfig.cpp +++ b/src/ca/XmlConfig.cpp @@ -171,7 +171,7 @@ static HRESULT ReadXmlConfigTable( ExitOnFailure(hr, "failed to get component name for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); // Get the component's state - if (0 < lstrlenW(pwzData)) + if (pwzData && *pwzData) { hr = StringCchCopyW((*ppxfcTail)->wzComponent, countof((*ppxfcTail)->wzComponent), pwzData); ExitOnFailure(hr, "failed to copy component id"); @@ -1041,7 +1041,6 @@ extern "C" UINT __stdcall ExecXmlConfigRollback( LPWSTR pwzFileName = NULL; LPBYTE pbData = NULL; DWORD_PTR cbData = 0; - DWORD cbDataWritten = 0; FILETIME ft; @@ -1099,12 +1098,8 @@ extern "C" UINT __stdcall ExecXmlConfigRollback( ExitOnInvalidHandleWithLastError(hFile, hr, "failed to open file: %ls", pwzFileName); // Write out the old data - if (!::WriteFile(hFile, pbData, (DWORD)cbData, &cbDataWritten, NULL)) - { - ExitOnLastError(hr, "failed to write to file: %ls", pwzFileName); - } - - Assert(cbData == cbDataWritten); + hr = FileWriteHandle(hFile, pbData, cbData); + ExitOnFailure(hr, "failed to write to file: %ls", pwzFileName); ReleaseFile(hFile); diff --git a/src/ca/XmlFile.cpp b/src/ca/XmlFile.cpp index 95f18411..04a4ae98 100644 --- a/src/ca/XmlFile.cpp +++ b/src/ca/XmlFile.cpp @@ -854,7 +854,6 @@ extern "C" UINT __stdcall ExecXmlFileRollback( LPWSTR pwzFileName = NULL; LPBYTE pbData = NULL; DWORD_PTR cbData = 0; - DWORD cbDataWritten = 0; FILETIME ft; @@ -913,10 +912,8 @@ extern "C" UINT __stdcall ExecXmlFileRollback( ExitOnInvalidHandleWithLastError(hFile, hr, "failed to open file: %ls", pwzFileName); // Write out the old data - if (!::WriteFile(hFile, pbData, (DWORD)cbData, &cbDataWritten, NULL)) - ExitOnLastError(hr, "failed to write to file: %ls", pwzFileName); - - Assert(cbData == cbDataWritten); + hr = FileWriteHandle(hFile, pbData, cbData); + ExitOnFailure(hr, "failed to write to file: %ls", pwzFileName); ReleaseFile(hFile); diff --git a/src/ca/utilca.vcxproj b/src/ca/utilca.vcxproj index 88f35673..7b64db95 100644 --- a/src/ca/utilca.vcxproj +++ b/src/ca/utilca.vcxproj @@ -96,8 +96,8 @@ - - + + -- cgit v1.2.3-55-g6feb