Skip to content

Commit

Permalink
fix turbostack bugs, simplify uihandler
Browse files Browse the repository at this point in the history
  • Loading branch information
WitherOrNot committed Mar 28, 2024
1 parent 4888f2e commit c5d4fd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cbsexploder/cbsexploder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void PrintUsage(LPCWSTR exename) {

int wmain(int argc, LPCWSTR* argv)
{
printf("cbsexploder 0.0.2 by witherornot\n");
printf("cbsexploder 0.0.3 by witherornot\n");

if (ProcessOptions(argc, argv, TRUE)) {
PrintUsage(argv[0]);
Expand All @@ -201,7 +201,8 @@ int wmain(int argc, LPCWSTR* argv)
ASRT_NL(GetFullPathNameW(g_options.logPath, MAX_PATH, fullLogPath, NULL), "ERROR: Log path %s is invalid", g_options.logPath);
SetEnvironmentVariableW(L"COMPONENT_BASED_SERVICING_LOGFILE", g_options.logPath);

CHK_NL_HR(CoInitialize(NULL), "ERROR: CoInitialize Failed [HR = %08x]");
CHK_NL_HR(CoInitializeEx(NULL, COINIT_MULTITHREADED), "ERROR: CoInitialize Failed [HR = %08x]");
CHK_NL_HR(CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT_INTEGRITY, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0, NULL), "ERROR: CoInitializeSecurity Failed [HR = %08x]");
CHK_NL_HR(CoGetMalloc(1, &g_alloc), "ERROR: CoGetMalloc Failed [HR = %08x]");

if (LoadServicingStackLocal()) {
Expand Down
4 changes: 2 additions & 2 deletions cbsexploder/uihandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ HRESULT UIHandler::EnteringStage(UINT unk1, CbsOperationStage stage, int unk2, i
}

HRESULT UIHandler::Progress(CbsInstallState state, UINT cur, UINT total, int* pUnk) {
ConLog("Progress: %.1f%% [Current Status: %s]", 100.0 * cur / total, PkgStateAsStr(state));
printf("\rProgress: %.1f%%", 100.0 * cur / total);
return S_OK;
}

Expand All @@ -60,6 +60,6 @@ HRESULT UIHandler::ProgressEx(CbsInstallState state, UINT cur, UINT total, UINT
}

HRESULT UIHandler::Terminate() {
ConLog("Operations finished, waiting for cleanup...");
ConLog("\nOperations finished, waiting for cleanup...");
return S_OK;
}

0 comments on commit c5d4fd1

Please sign in to comment.