summaryrefslogtreecommitdiff
path: root/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-06-03 17:50:22 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-06-07 19:44:36 -0500
commit8810aa8908ed7887616d86dd5fb821fcfa92f444 (patch)
tree8bc05667c36cc0d3db73504c867e85b01f1a79b0 /src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp
parent266b097c0b0a13dd4934f55f61cad62ffcbb953d (diff)
downloadwix-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.cpp30
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
33static HRESULT LogUserSid();
33static void CALLBACK BafThmUtilTestingTraceError( 34static 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
497LExit: 500LExit:
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
507static 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
523LExit:
524 ReleaseMem(pTokenUser);
525
526 if (sczSid)
527 {
528 ::LocalFree(sczSid);
529 }
530
531 return hr;
532}
533
504static void CALLBACK BafThmUtilTestingTraceError( 534static void CALLBACK BafThmUtilTestingTraceError(
505 __in_z LPCSTR /*szFile*/, 535 __in_z LPCSTR /*szFile*/,
506 __in int /*iLine*/, 536 __in int /*iLine*/,