aboutsummaryrefslogtreecommitdiff
path: root/src/test
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
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')
-rw-r--r--src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp30
-rw-r--r--src/test/burn/TestData/Manual/BafThmutilTesting/precomp.h3
2 files changed, 33 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*/,
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.h b/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.h
index e7cd39dc..2e14786a 100644
--- a/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.h
+++ b/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.h
@@ -16,12 +16,15 @@
16#include <stdlib.h> 16#include <stdlib.h>
17#include <strsafe.h> 17#include <strsafe.h>
18#include <CommCtrl.h> 18#include <CommCtrl.h>
19#include <sddl.h>
19 20
20#include "dutil.h" 21#include "dutil.h"
21#include "dictutil.h" 22#include "dictutil.h"
22#include "fileutil.h" 23#include "fileutil.h"
23#include "locutil.h" 24#include "locutil.h"
25#include "memutil.h"
24#include "pathutil.h" 26#include "pathutil.h"
27#include "procutil.h"
25#include "strutil.h" 28#include "strutil.h"
26#include "thmutil.h" 29#include "thmutil.h"
27#include "regutil.h" 30#include "regutil.h"