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. --- src/ca/XmlConfig.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/ca/XmlConfig.cpp') 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); -- cgit v1.2.3-55-g6feb