diff options
Diffstat (limited to 'src/ca/XmlConfig.cpp')
-rw-r--r-- | src/ca/XmlConfig.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
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( | |||
171 | ExitOnFailure(hr, "failed to get component name for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); | 171 | ExitOnFailure(hr, "failed to get component name for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
172 | 172 | ||
173 | // Get the component's state | 173 | // Get the component's state |
174 | if (0 < lstrlenW(pwzData)) | 174 | if (pwzData && *pwzData) |
175 | { | 175 | { |
176 | hr = StringCchCopyW((*ppxfcTail)->wzComponent, countof((*ppxfcTail)->wzComponent), pwzData); | 176 | hr = StringCchCopyW((*ppxfcTail)->wzComponent, countof((*ppxfcTail)->wzComponent), pwzData); |
177 | ExitOnFailure(hr, "failed to copy component id"); | 177 | ExitOnFailure(hr, "failed to copy component id"); |
@@ -1041,7 +1041,6 @@ extern "C" UINT __stdcall ExecXmlConfigRollback( | |||
1041 | LPWSTR pwzFileName = NULL; | 1041 | LPWSTR pwzFileName = NULL; |
1042 | LPBYTE pbData = NULL; | 1042 | LPBYTE pbData = NULL; |
1043 | DWORD_PTR cbData = 0; | 1043 | DWORD_PTR cbData = 0; |
1044 | DWORD cbDataWritten = 0; | ||
1045 | 1044 | ||
1046 | FILETIME ft; | 1045 | FILETIME ft; |
1047 | 1046 | ||
@@ -1099,12 +1098,8 @@ extern "C" UINT __stdcall ExecXmlConfigRollback( | |||
1099 | ExitOnInvalidHandleWithLastError(hFile, hr, "failed to open file: %ls", pwzFileName); | 1098 | ExitOnInvalidHandleWithLastError(hFile, hr, "failed to open file: %ls", pwzFileName); |
1100 | 1099 | ||
1101 | // Write out the old data | 1100 | // Write out the old data |
1102 | if (!::WriteFile(hFile, pbData, (DWORD)cbData, &cbDataWritten, NULL)) | 1101 | hr = FileWriteHandle(hFile, pbData, cbData); |
1103 | { | 1102 | ExitOnFailure(hr, "failed to write to file: %ls", pwzFileName); |
1104 | ExitOnLastError(hr, "failed to write to file: %ls", pwzFileName); | ||
1105 | } | ||
1106 | |||
1107 | Assert(cbData == cbDataWritten); | ||
1108 | 1103 | ||
1109 | ReleaseFile(hFile); | 1104 | ReleaseFile(hFile); |
1110 | 1105 | ||