diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-06-03 17:50:22 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-06-07 19:44:36 -0500 |
commit | 8810aa8908ed7887616d86dd5fb821fcfa92f444 (patch) | |
tree | 8bc05667c36cc0d3db73504c867e85b01f1a79b0 /src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | |
parent | 266b097c0b0a13dd4934f55f61cad62ffcbb953d (diff) | |
download | wix-8810aa8908ed7887616d86dd5fb821fcfa92f444.tar.gz wix-8810aa8908ed7887616d86dd5fb821fcfa92f444.tar.bz2 wix-8810aa8908ed7887616d86dd5fb821fcfa92f444.zip |
Update Burn algorithm for picking elevated temp path to use SystemTemp.
Diffstat (limited to 'src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp')
-rw-r--r-- | src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp index 3cf994fc..bc942dc8 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | |||
@@ -30,6 +30,7 @@ static THEME_ASSIGN_CONTROL_ID vrgInitControls[] = { | |||
30 | { BAFTHMUTILTESTING_CONTROL_PROGRESSBAR_STANDARD, L"StandardProgressBar" }, | 30 | { BAFTHMUTILTESTING_CONTROL_PROGRESSBAR_STANDARD, L"StandardProgressBar" }, |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static HRESULT LogUserSid(); | ||
33 | static void CALLBACK BafThmUtilTestingTraceError( | 34 | static void CALLBACK BafThmUtilTestingTraceError( |
34 | __in_z LPCSTR szFile, | 35 | __in_z LPCSTR szFile, |
35 | __in int iLine, | 36 | __in int iLine, |
@@ -494,6 +495,8 @@ HRESULT WINAPI CreateBAFunctions( | |||
494 | pResults->pvBAFunctionsProcContext = pBAFunctions; | 495 | pResults->pvBAFunctionsProcContext = pBAFunctions; |
495 | pBAFunctions = NULL; | 496 | pBAFunctions = NULL; |
496 | 497 | ||
498 | LogUserSid(); | ||
499 | |||
497 | LExit: | 500 | LExit: |
498 | ReleaseObject(pBAFunctions); | 501 | ReleaseObject(pBAFunctions); |
499 | ReleaseObject(pEngine); | 502 | ReleaseObject(pEngine); |
@@ -501,6 +504,33 @@ LExit: | |||
501 | return hr; | 504 | return hr; |
502 | } | 505 | } |
503 | 506 | ||
507 | static HRESULT LogUserSid() | ||
508 | { | ||
509 | HRESULT hr = S_OK; | ||
510 | TOKEN_USER* pTokenUser = NULL; | ||
511 | LPWSTR sczSid = NULL; | ||
512 | |||
513 | hr = ProcTokenUser(::GetCurrentProcess(), &pTokenUser); | ||
514 | BalExitOnFailure(hr, "Failed to get user from process token."); | ||
515 | |||
516 | if (!::ConvertSidToStringSidW(pTokenUser->User.Sid, &sczSid)) | ||
517 | { | ||
518 | BalExitWithLastError(hr, "Failed to convert sid to string."); | ||
519 | } | ||
520 | |||
521 | BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Current User SID: %ls", sczSid); | ||
522 | |||
523 | LExit: | ||
524 | ReleaseMem(pTokenUser); | ||
525 | |||
526 | if (sczSid) | ||
527 | { | ||
528 | ::LocalFree(sczSid); | ||
529 | } | ||
530 | |||
531 | return hr; | ||
532 | } | ||
533 | |||
504 | static void CALLBACK BafThmUtilTestingTraceError( | 534 | static void CALLBACK BafThmUtilTestingTraceError( |
505 | __in_z LPCSTR /*szFile*/, | 535 | __in_z LPCSTR /*szFile*/, |
506 | __in int /*iLine*/, | 536 | __in int /*iLine*/, |