summaryrefslogtreecommitdiff
path: root/src/burn/engine/logging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/logging.cpp')
-rw-r--r--src/burn/engine/logging.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp
index 1020d01f..68f0c35b 100644
--- a/src/burn/engine/logging.cpp
+++ b/src/burn/engine/logging.cpp
@@ -211,7 +211,7 @@ extern "C" void LoggingOpenFailed()
211 LPCWSTR* lpStrings = const_cast<LPCWSTR*>(&LOG_FAILED_EVENT_LOG_MESSAGE); 211 LPCWSTR* lpStrings = const_cast<LPCWSTR*>(&LOG_FAILED_EVENT_LOG_MESSAGE);
212 WORD wNumStrings = 1; 212 WORD wNumStrings = 1;
213 213
214 hr = LogOpen(NULL, L"Setup", L"_Failed", L"txt", FALSE, FALSE, NULL); 214 hr = LogOpen(NULL, L"Setup", L"_Failed", L"log", FALSE, FALSE, NULL);
215 if (SUCCEEDED(hr)) 215 if (SUCCEEDED(hr))
216 { 216 {
217 ExitFunction(); 217 ExitFunction();
@@ -965,19 +965,14 @@ static HRESULT GetNonSessionSpecificTempFolder(
965 ) 965 )
966{ 966{
967 HRESULT hr = S_OK; 967 HRESULT hr = S_OK;
968 WCHAR wzTempFolder[MAX_PATH] = { }; 968 LPWSTR sczTempFolder = NULL;
969 SIZE_T cchTempFolder = 0; 969 SIZE_T cchTempFolder = 0;
970 DWORD dwSessionId = 0; 970 DWORD dwSessionId = 0;
971 LPWSTR sczSessionId = 0; 971 LPWSTR sczSessionId = 0;
972 SIZE_T cchSessionId = 0; 972 SIZE_T cchSessionId = 0;
973 973
974 if (!::GetTempPathW(countof(wzTempFolder), wzTempFolder)) 974 hr = PathGetTempPath(&sczTempFolder, &cchTempFolder);
975 { 975 ExitOnFailure(hr, "Failed to get temp folder.");
976 ExitWithLastError(hr, "Failed to get temp folder.");
977 }
978
979 hr = ::StringCchLengthW(wzTempFolder, countof(wzTempFolder), reinterpret_cast<size_t*>(&cchTempFolder));
980 ExitOnFailure(hr, "Failed to get length of temp folder.");
981 976
982 // If our session id is in the TEMP path then remove that part so we get the non-session 977 // If our session id is in the TEMP path then remove that part so we get the non-session
983 // specific temporary folder. 978 // specific temporary folder.
@@ -989,17 +984,18 @@ static HRESULT GetNonSessionSpecificTempFolder(
989 hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId)); 984 hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId));
990 ExitOnFailure(hr, "Failed to get length of session id string."); 985 ExitOnFailure(hr, "Failed to get length of session id string.");
991 986
992 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId))) 987 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, sczTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId)))
993 { 988 {
994 cchTempFolder -= cchSessionId; 989 cchTempFolder -= cchSessionId;
995 } 990 }
996 } 991 }
997 992
998 hr = StrAllocString(psczNonSessionTempFolder, wzTempFolder, cchTempFolder); 993 hr = StrAllocString(psczNonSessionTempFolder, sczTempFolder, cchTempFolder);
999 ExitOnFailure(hr, "Failed to copy temp folder."); 994 ExitOnFailure(hr, "Failed to copy temp folder.");
1000 995
1001LExit: 996LExit:
1002 ReleaseStr(sczSessionId); 997 ReleaseStr(sczSessionId);
998 ReleaseStr(sczTempFolder);
1003 999
1004 return hr; 1000 return hr;
1005} 1001}