From 8b55203c8b5a66362464f0738380932ac49918be Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 11 Jan 2024 00:17:24 -0800 Subject: [PATCH] Correctly prefix the functions exposed from burnpipe.h --- src/burn/engine/burnpipe.cpp | 50 ++++++------ src/burn/engine/burnpipe.h | 20 ++--- src/burn/engine/core.cpp | 6 +- src/burn/engine/elevation.cpp | 82 ++++++++++---------- src/burn/engine/embedded.cpp | 12 +-- src/burn/engine/engine.cpp | 18 ++--- src/burn/engine/externalengine.cpp | 4 +- src/burn/test/BurnUnitTest/ElevationTest.cpp | 18 ++--- src/burn/test/BurnUnitTest/EmbeddedTest.cpp | 10 +-- src/burn/test/BurnUnitTest/ExitCodeTest.cpp | 10 +-- 10 files changed, 115 insertions(+), 115 deletions(-) diff --git a/src/burn/engine/burnpipe.cpp b/src/burn/engine/burnpipe.cpp index 297dc77a4..d106e7ae4 100644 --- a/src/burn/engine/burnpipe.cpp +++ b/src/burn/engine/burnpipe.cpp @@ -13,10 +13,10 @@ static HRESULT ChildPipeConnected( /******************************************************************* - PipeConnectionInitialize - initialize pipe connection data. + BurnPipeConnectionInitialize - initialize pipe connection data. *******************************************************************/ -void PipeConnectionInitialize( +void BurnPipeConnectionInitialize( __in BURN_PIPE_CONNECTION* pConnection ) { @@ -27,10 +27,10 @@ void PipeConnectionInitialize( } /******************************************************************* - PipeConnectionUninitialize - free data in a pipe connection. + BurnPipeConnectionUninitialize - free data in a pipe connection. *******************************************************************/ -void PipeConnectionUninitialize( +void BurnPipeConnectionUninitialize( __in BURN_PIPE_CONNECTION* pConnection ) { @@ -41,14 +41,14 @@ void PipeConnectionUninitialize( ReleaseStr(pConnection->sczSecret); ReleaseStr(pConnection->sczName); - PipeConnectionInitialize(pConnection); + BurnPipeConnectionInitialize(pConnection); } /******************************************************************* - PipeSendMessage - + BurnPipeSendMessage - *******************************************************************/ -extern "C" HRESULT PipeSendMessage( +extern "C" HRESULT BurnPipeSendMessage( __in HANDLE hPipe, __in DWORD dwMessage, __in_bcount_opt(cbData) LPVOID pvData, @@ -64,7 +64,7 @@ extern "C" HRESULT PipeSendMessage( hr = PipeWriteMessage(hPipe, dwMessage, pvData, cbData); ExitOnFailure(hr, "Failed to write send message to pipe."); - hr = PipePumpMessages(hPipe, pfnCallback, pvContext, &result); + hr = BurnPipePumpMessages(hPipe, pfnCallback, pvContext, &result); ExitOnFailure(hr, "Failed to pump messages during send message to pipe."); *pdwResult = result.dwResult; @@ -74,10 +74,10 @@ extern "C" HRESULT PipeSendMessage( } /******************************************************************* - PipePumpMessages - + BurnPipePumpMessages - *******************************************************************/ -extern "C" HRESULT PipePumpMessages( +extern "C" HRESULT BurnPipePumpMessages( __in HANDLE hPipe, __in_opt PFN_PIPE_MESSAGE_CALLBACK pfnCallback, __in_opt LPVOID pvContext, @@ -111,7 +111,7 @@ extern "C" HRESULT PipePumpMessages( if (!msg.pvData || sizeof(DWORD) != msg.cbData) { hr = E_INVALIDARG; - ExitOnRootFailure(hr, "No status returned to PipePumpMessages()"); + ExitOnRootFailure(hr, "No status returned to BurnPipePumpMessages()"); } pResult->dwResult = *static_cast(msg.pvData); @@ -121,12 +121,12 @@ extern "C" HRESULT PipePumpMessages( iData = 0; hr = BuffReadNumber(static_cast(msg.pvData), msg.cbData, &iData, &pResult->dwResult); - ExitOnFailure(hr, "Failed to read returned result to PipePumpMessages()"); + ExitOnFailure(hr, "Failed to read returned result to BurnPipePumpMessages()"); if (sizeof(DWORD) * 2 == msg.cbData) { hr = BuffReadNumber(static_cast(msg.pvData), msg.cbData, &iData, (DWORD*)&pResult->fRestart); - ExitOnFailure(hr, "Failed to read returned restart to PipePumpMessages()"); + ExitOnFailure(hr, "Failed to read returned restart to BurnPipePumpMessages()"); } ExitFunction1(hr = S_OK); // exit loop. @@ -165,10 +165,10 @@ extern "C" HRESULT PipePumpMessages( } /******************************************************************* - PipeCreateNameAndSecret - + BurnPipeCreateNameAndSecret - *******************************************************************/ -extern "C" HRESULT PipeCreateNameAndSecret( +extern "C" HRESULT BurnPipeCreateNameAndSecret( __out_z LPWSTR *psczConnectionName, __out_z LPWSTR *psczSecret ) @@ -205,10 +205,10 @@ extern "C" HRESULT PipeCreateNameAndSecret( } /******************************************************************* - PipeCreatePipes - create the pipes and event to signal child process. + BurnPipeCreatePipes - create the pipes and event to signal child process. *******************************************************************/ -extern "C" HRESULT PipeCreatePipes( +extern "C" HRESULT BurnPipeCreatePipes( __in BURN_PIPE_CONNECTION* pConnection, __in BOOL fCompanion ) @@ -287,10 +287,10 @@ extern "C" HRESULT PipeCreatePipes( } /******************************************************************* - PipeWaitForChildConnect - + BurnPipeWaitForChildConnect - *******************************************************************/ -extern "C" HRESULT PipeWaitForChildConnect( +extern "C" HRESULT BurnPipeWaitForChildConnect( __in BURN_PIPE_CONNECTION* pConnection ) { @@ -335,10 +335,10 @@ extern "C" HRESULT PipeWaitForChildConnect( } /******************************************************************* - PipeTerminateLoggingPipe - + BurnPipeTerminateLoggingPipe - *******************************************************************/ -extern "C" HRESULT PipeTerminateLoggingPipe( +extern "C" HRESULT BurnPipeTerminateLoggingPipe( __in HANDLE hLoggingPipe, __in DWORD dwParentExitCode ) @@ -361,10 +361,10 @@ extern "C" HRESULT PipeTerminateLoggingPipe( } /******************************************************************* - PipeTerminateChildProcess - + BurnPipeTerminateChildProcess - *******************************************************************/ -extern "C" HRESULT PipeTerminateChildProcess( +extern "C" HRESULT BurnPipeTerminateChildProcess( __in BURN_PIPE_CONNECTION* pConnection, __in DWORD dwParentExitCode, __in BOOL fRestart @@ -425,11 +425,11 @@ extern "C" HRESULT PipeTerminateChildProcess( } /******************************************************************* - PipeChildConnect - Called from the child process to connect back + BurnPipeChildConnect - Called from the child process to connect back to the pipe provided by the parent process. *******************************************************************/ -extern "C" HRESULT PipeChildConnect( +extern "C" HRESULT BurnPipeChildConnect( __in BURN_PIPE_CONNECTION* pConnection, __in BOOL fCompanion ) diff --git a/src/burn/engine/burnpipe.h b/src/burn/engine/burnpipe.h index c878ad94b..4cf1e23ae 100644 --- a/src/burn/engine/burnpipe.h +++ b/src/burn/engine/burnpipe.h @@ -40,13 +40,13 @@ typedef HRESULT (*PFN_PIPE_MESSAGE_CALLBACK)( // Common functions. -void PipeConnectionInitialize( +void BurnPipeConnectionInitialize( __in BURN_PIPE_CONNECTION* pConnection ); -void PipeConnectionUninitialize( +void BurnPipeConnectionUninitialize( __in BURN_PIPE_CONNECTION* pConnection ); -HRESULT PipeSendMessage( +HRESULT BurnPipeSendMessage( __in HANDLE hPipe, __in DWORD dwMessage, __in_bcount_opt(cbData) LPVOID pvData, @@ -55,7 +55,7 @@ HRESULT PipeSendMessage( __in_opt LPVOID pvContext, __out DWORD* pdwResult ); -HRESULT PipePumpMessages( +HRESULT BurnPipePumpMessages( __in HANDLE hPipe, __in_opt PFN_PIPE_MESSAGE_CALLBACK pfnCallback, __in_opt LPVOID pvContext, @@ -63,29 +63,29 @@ HRESULT PipePumpMessages( ); // Parent functions. -HRESULT PipeCreateNameAndSecret( +HRESULT BurnPipeCreateNameAndSecret( __out_z LPWSTR *psczConnectionName, __out_z LPWSTR *psczSecret ); -HRESULT PipeCreatePipes( +HRESULT BurnPipeCreatePipes( __in BURN_PIPE_CONNECTION* pConnection, __in BOOL fCompanion ); -HRESULT PipeWaitForChildConnect( +HRESULT BurnPipeWaitForChildConnect( __in BURN_PIPE_CONNECTION* pConnection ); -HRESULT PipeTerminateLoggingPipe( +HRESULT BurnPipeTerminateLoggingPipe( __in HANDLE hLoggingPipe, __in DWORD dwParentExitCode ); -HRESULT PipeTerminateChildProcess( +HRESULT BurnPipeTerminateChildProcess( __in BURN_PIPE_CONNECTION* pConnection, __in DWORD dwParentExitCode, __in BOOL fRestart ); // Child functions. -HRESULT PipeChildConnect( +HRESULT BurnPipeChildConnect( __in BURN_PIPE_CONNECTION* pConnection, __in BOOL fCompanion ); diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index 8903b5b2f..6d6d99d5e 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp @@ -227,7 +227,7 @@ extern "C" HRESULT CoreInitializeConstants( hr = StrAllocString(&pRegistration->sczBundlePackageAncestors, pRegistration->sczId, 0); ExitOnFailure(hr, "Failed to copy self to bundle package ancestors."); } - + for (DWORD i = 0; i < pEngineState->packages.cPackages; ++i) { BURN_PACKAGE* pPackage = pEngineState->packages.rgPackages + i; @@ -2285,7 +2285,7 @@ static HRESULT DetectPackage( { HRESULT hr = S_OK; BOOL fBegan = FALSE; - + fBegan = TRUE; hr = UserExperienceOnDetectPackageBegin(&pEngineState->userExperience, pPackage->sczId); ExitOnRootFailure(hr, "BA aborted detect package begin."); @@ -2423,7 +2423,7 @@ static DWORD WINAPI LoggingThreadProc( BURN_ENGINE_STATE* pEngineState = reinterpret_cast(lpThreadParameter); BURN_PIPE_RESULT result = { }; - hr = PipePumpMessages(pEngineState->companionConnection.hLoggingPipe, NULL, NULL, &result); + hr = BurnPipePumpMessages(pEngineState->companionConnection.hLoggingPipe, NULL, NULL, &result); ExitOnFailure(hr, "Failed to pump logging messages for elevated process."); hr = (HRESULT)result.dwResult; diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 10ae74a44..f357a8fc3 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp @@ -423,10 +423,10 @@ extern "C" HRESULT ElevationElevate( hr = UserExperienceOnElevateBegin(&pEngineState->userExperience); ExitOnRootFailure(hr, "BA aborted elevation requirement."); - hr = PipeCreateNameAndSecret(&pEngineState->companionConnection.sczName, &pEngineState->companionConnection.sczSecret); + hr = BurnPipeCreateNameAndSecret(&pEngineState->companionConnection.sczName, &pEngineState->companionConnection.sczSecret); ExitOnFailure(hr, "Failed to create pipe name and client token."); - hr = PipeCreatePipes(&pEngineState->companionConnection, TRUE); + hr = BurnPipeCreatePipes(&pEngineState->companionConnection, TRUE); ExitOnFailure(hr, "Failed to create pipe and cache pipe."); LogId(REPORT_STANDARD, MSG_LAUNCH_ELEVATED_ENGINE_STARTING); @@ -441,7 +441,7 @@ extern "C" HRESULT ElevationElevate( { LogId(REPORT_STANDARD, MSG_LAUNCH_ELEVATED_ENGINE_SUCCESS); - hr = PipeWaitForChildConnect(&pEngineState->companionConnection); + hr = BurnPipeWaitForChildConnect(&pEngineState->companionConnection); if (HRESULT_FROM_WIN32(ERROR_NO_DATA) == hr) { hr = E_SUSPECTED_AV_INTERFERENCE; @@ -466,7 +466,7 @@ extern "C" HRESULT ElevationElevate( LExit: if (FAILED(hr)) { - PipeConnectionUninitialize(&pEngineState->companionConnection); + BurnPipeConnectionUninitialize(&pEngineState->companionConnection); } UserExperienceOnElevateComplete(&pEngineState->userExperience, hr); @@ -503,7 +503,7 @@ extern "C" HRESULT ElevationApplyInitialize( ExitOnFailure(hr, "Failed to write variables."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE, pbData, cbData, ProcessApplyInitializeMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE, pbData, cbData, ProcessApplyInitializeMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send message to per-machine process."); hr = (HRESULT)dwResult; @@ -534,7 +534,7 @@ extern "C" HRESULT ElevationApplyUninitialize( DWORD dwResult = 0; // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_UNINITIALIZE, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_UNINITIALIZE, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send message to per-machine process."); hr = (HRESULT)dwResult; @@ -592,7 +592,7 @@ extern "C" HRESULT ElevationSessionBegin( ExitOnFailure(hr, "Failed to write variables."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SESSION_BEGIN, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SESSION_BEGIN, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send message to per-machine process."); hr = (HRESULT)dwResult; @@ -638,7 +638,7 @@ extern "C" HRESULT ElevationSessionEnd( ExitOnFailure(hr, "Failed to write registration type to message buffer."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SESSION_END, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SESSION_END, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send message to per-machine process."); hr = (HRESULT)dwResult; @@ -663,7 +663,7 @@ HRESULT ElevationSaveState( DWORD dwResult = 0; // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE, pbBuffer, cbBuffer, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE, pbBuffer, cbBuffer, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send message to per-machine process."); hr = (HRESULT)dwResult; @@ -687,7 +687,7 @@ extern "C" HRESULT ElevationCachePreparePackage( ExitOnFailure(hr, "Failed to write package id to message buffer."); // Send message. - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_PREPARE_PACKAGE, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_PREPARE_PACKAGE, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_CACHE_PREPARE_PACKAGE message to per-machine process."); hr = (HRESULT)dwResult; @@ -737,7 +737,7 @@ extern "C" HRESULT ElevationCacheCompletePayload( ExitOnFailure(hr, "Failed to write move flag to message buffer."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_COMPLETE_PAYLOAD, pbData, cbData, ProcessBurnCacheMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_COMPLETE_PAYLOAD, pbData, cbData, ProcessBurnCacheMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_CACHE_COMPLETE_PAYLOAD message to per-machine process."); hr = (HRESULT)dwResult; @@ -775,7 +775,7 @@ extern "C" HRESULT ElevationCacheVerifyPayload( ExitOnFailure(hr, "Failed to write payload id to message buffer."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_VERIFY_PAYLOAD, pbData, cbData, ProcessBurnCacheMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_VERIFY_PAYLOAD, pbData, cbData, ProcessBurnCacheMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_CACHE_VERIFY_PAYLOAD message to per-machine process."); hr = (HRESULT)dwResult; @@ -798,7 +798,7 @@ extern "C" HRESULT ElevationCacheCleanup( DWORD dwResult = 0; // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_CLEANUP, NULL, 0, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CACHE_CLEANUP, NULL, 0, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_CACHE_CLEANUP message to per-machine process."); hr = (HRESULT)dwResult; @@ -828,7 +828,7 @@ extern "C" HRESULT ElevationProcessDependentRegistration( ExitOnFailure(hr, "Failed to write dependent provider key to message buffer."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_PROCESS_DEPENDENT_REGISTRATION, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_PROCESS_DEPENDENT_REGISTRATION, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_PROCESS_DEPENDENT_REGISTRATION message to per-machine process."); hr = (HRESULT)dwResult; @@ -888,7 +888,7 @@ extern "C" HRESULT ElevationExecuteRelatedBundle( context.pfnGenericMessageHandler = pfnGenericMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_RELATED_BUNDLE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_RELATED_BUNDLE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_RELATED_BUNDLE message to per-machine process."); hr = static_cast(dwResult); @@ -952,7 +952,7 @@ extern "C" HRESULT ElevationExecuteBundlePackage( context.pfnGenericMessageHandler = pfnGenericMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_BUNDLE_PACKAGE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_BUNDLE_PACKAGE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_BUNDLE_PACKAGE message to per-machine process."); hr = static_cast(dwResult); @@ -1007,7 +1007,7 @@ extern "C" HRESULT ElevationExecuteExePackage( context.pfnGenericMessageHandler = pfnGenericMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_EXE_PACKAGE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_EXE_PACKAGE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_EXE_PACKAGE message to per-machine process."); hr = static_cast(dwResult); @@ -1036,7 +1036,7 @@ extern "C" HRESULT ElevationMsiBeginTransaction( hr = BuffWriteString(&pbData, &cbData, pRollbackBoundary->sczLogPath); ExitOnFailure(hr, "Failed to write transaction log path to message buffer."); - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_BEGIN_MSI_TRANSACTION, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_BEGIN_MSI_TRANSACTION, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_BEGIN_MSI_TRANSACTION message to per-machine process."); hr = static_cast(dwResult); @@ -1072,7 +1072,7 @@ extern "C" HRESULT ElevationMsiCommitTransaction( context.pfnMessageHandler = pfnMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_COMMIT_MSI_TRANSACTION message to per-machine process."); hr = static_cast(dwResult); @@ -1109,7 +1109,7 @@ extern "C" HRESULT ElevationMsiRollbackTransaction( context.pfnMessageHandler = pfnMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_ROLLBACK_MSI_TRANSACTION message to per-machine process."); hr = static_cast(dwResult); @@ -1196,7 +1196,7 @@ extern "C" HRESULT ElevationExecuteMsiPackage( context.pfnMessageHandler = pfnMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSI_PACKAGE, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSI_PACKAGE, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSI_PACKAGE message to per-machine process."); hr = static_cast(dwResult); @@ -1276,7 +1276,7 @@ extern "C" HRESULT ElevationExecuteMspPackage( context.pfnMessageHandler = pfnMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSP_PACKAGE, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSP_PACKAGE, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSP_PACKAGE message to per-machine process."); hr = static_cast(dwResult); @@ -1328,7 +1328,7 @@ extern "C" HRESULT ElevationExecuteMsuPackage( context.pfnGenericMessageHandler = pfnGenericMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSU_PACKAGE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSU_PACKAGE, pbData, cbData, ProcessGenericExecuteMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSU_PACKAGE message to per-machine process."); hr = static_cast(dwResult); @@ -1381,7 +1381,7 @@ extern "C" HRESULT ElevationUninstallMsiCompatiblePackage( context.pfnMessageHandler = pfnMessageHandler; context.pvContext = pvContext; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_UNINSTALL_MSI_COMPATIBLE_PACKAGE, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_UNINSTALL_MSI_COMPATIBLE_PACKAGE, pbData, cbData, ProcessMsiPackageMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_UNINSTALL_MSI_COMPATIBLE_PACKAGE message to per-machine process."); hr = static_cast(dwResult); @@ -1421,7 +1421,7 @@ extern "C" HRESULT ElevationExecutePackageProviderAction( } // Send the message. - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_PROVIDER, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_PROVIDER, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_PROVIDER message to per-machine process."); LExit: @@ -1461,7 +1461,7 @@ extern "C" HRESULT ElevationExecutePackageDependencyAction( } // Send the message. - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_DEPENDENCY, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_DEPENDENCY, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_DEPENDENCY message to per-machine process."); LExit: @@ -1488,7 +1488,7 @@ extern "C" HRESULT ElevationCleanCompatiblePackage( ExitOnFailure(hr, "Failed to write compatible package id to message buffer."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CLEAN_COMPATIBLE_PACKAGE, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CLEAN_COMPATIBLE_PACKAGE, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_CLEAN_COMPATIBLE_PACKAGE message to per-machine process."); hr = (HRESULT)dwResult; @@ -1518,7 +1518,7 @@ extern "C" HRESULT ElevationCleanPackage( ExitOnFailure(hr, "Failed to write clean package id to message buffer."); // send message - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE message to per-machine process."); hr = (HRESULT)dwResult; @@ -1552,7 +1552,7 @@ extern "C" HRESULT ElevationLaunchApprovedExe( ExitOnFailure(hr, "Failed to write approved exe WaitForInputIdle timeout to message buffer."); // Send the message. - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE, pbData, cbData, ProcessLaunchApprovedExeMessages, &context, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE, pbData, cbData, ProcessLaunchApprovedExeMessages, &context, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE message to per-machine process."); hr = (HRESULT)dwResult; @@ -1617,7 +1617,7 @@ extern "C" HRESULT ElevationChildPumpMessages( hCacheThread = ::CreateThread(NULL, 0, ElevatedChildCacheThreadProc, &cacheContext, 0, NULL); ExitOnNullWithLastError(hCacheThread, hr, "Failed to create elevated cache thread."); - hr = PipePumpMessages(hPipe, ProcessElevatedChildMessage, &context, &result); + hr = BurnPipePumpMessages(hPipe, ProcessElevatedChildMessage, &context, &result); ExitOnFailure(hr, "Failed to pump messages in child process."); // Wait for the cache thread and verify it gets the right result but don't fail if things @@ -1705,7 +1705,7 @@ static DWORD WINAPI ElevatedChildCacheThreadProc( ExitOnFailure(hr, "Failed to initialize COM."); fComInitialized = TRUE; - hr = PipePumpMessages(pContext->hPipe, ProcessElevatedChildCacheMessage, pContext, &result); + hr = BurnPipePumpMessages(pContext->hPipe, ProcessElevatedChildCacheMessage, pContext, &result); ExitOnFailure(hr, "Failed to pump messages in child process."); hr = (HRESULT)result.dwResult; @@ -3552,7 +3552,7 @@ static HRESULT CALLBACK BurnCacheMessageHandler( } // send message - hr = PipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send burn cache message to per-user process."); hr = dwResult; @@ -3589,7 +3589,7 @@ static DWORD CALLBACK ElevatedProgressRoutine( ExitOnFailure(hr, "Failed to write total bytes transferred progress to message buffer."); // send message - hr = PipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send progress routine message to per-user process."); LExit: @@ -3664,7 +3664,7 @@ static int GenericExecuteMessageHandler( } // send message - hr = PipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, reinterpret_cast(&nResult)); + hr = BurnPipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, reinterpret_cast(&nResult)); ExitOnFailure(hr, "Failed to send message to per-user process."); LExit: @@ -3751,7 +3751,7 @@ static int MsiExecuteMessageHandler( } // send message - hr = PipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, (DWORD*)&nResult); + hr = BurnPipeSendMessage(hPipe, dwMessage, pbData, cbData, NULL, NULL, (DWORD*)&nResult); ExitOnFailure(hr, "Failed to send msi message to per-user process."); LExit: @@ -3891,7 +3891,7 @@ static HRESULT OnLaunchApprovedExe( hr = BuffWriteNumber(&pbSendData, &cbSendData, dwProcessId); ExitOnFailure(hr, "Failed to write the approved exe process id to message buffer."); - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE_PROCESSID, pbSendData, cbSendData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE_PROCESSID, pbSendData, cbSendData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE_PROCESSID message to per-user process."); LExit: @@ -4032,7 +4032,7 @@ static HRESULT ElevatedOnPauseAUBegin( HRESULT hr = S_OK; DWORD dwResult = 0; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_BEGIN, NULL, 0, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_BEGIN, NULL, 0, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_BEGIN message to per-user process."); LExit: @@ -4052,7 +4052,7 @@ static HRESULT ElevatedOnPauseAUComplete( hr = BuffWriteNumber(&pbSendData, &cbSendData, hrStatus); ExitOnFailure(hr, "Failed to write the pause au status to message buffer."); - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_COMPLETE, pbSendData, cbSendData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_COMPLETE, pbSendData, cbSendData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_COMPLETE message to per-user process."); LExit: @@ -4068,7 +4068,7 @@ static HRESULT ElevatedOnSystemRestorePointBegin( HRESULT hr = S_OK; DWORD dwResult = 0; - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_SYSTEM_RESTORE_POINT_BEGIN, NULL, 0, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_SYSTEM_RESTORE_POINT_BEGIN, NULL, 0, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_SYSTEM_RESTORE_POINT_BEGIN message to per-user process."); LExit: @@ -4088,7 +4088,7 @@ static HRESULT ElevatedOnSystemRestorePointComplete( hr = BuffWriteNumber(&pbSendData, &cbSendData, hrStatus); ExitOnFailure(hr, "Failed to write the system restore point status to message buffer."); - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_SYSTEM_RESTORE_POINT_COMPLETE, pbSendData, cbSendData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_SYSTEM_RESTORE_POINT_COMPLETE, pbSendData, cbSendData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_SYSTEM_RESTORE_POINT_COMPLETE message to per-user process."); LExit: @@ -4110,7 +4110,7 @@ static HRESULT ElevatedOnExecuteActionComplete( hr = BuffWriteNumber(&pbSendData, &cbSendData, restart); ExitOnFailure(hr, "Failed to write the restart type to message buffer."); - hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE, pbSendData, cbSendData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE, pbSendData, cbSendData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE message to per-user process."); LExit: diff --git a/src/burn/engine/embedded.cpp b/src/burn/engine/embedded.cpp index 1e0759d14..e0e9ffd96 100644 --- a/src/burn/engine/embedded.cpp +++ b/src/burn/engine/embedded.cpp @@ -55,16 +55,16 @@ extern "C" HRESULT EmbeddedRunBundle( PROCESS_INFORMATION pi = { }; BURN_PIPE_RESULT result = { }; - PipeConnectionInitialize(pConnection); + BurnPipeConnectionInitialize(pConnection); BURN_EMBEDDED_CALLBACK_CONTEXT context = { }; context.pfnGenericMessageHandler = pfnGenericMessageHandler; context.pvContext = pvContext; - hr = PipeCreateNameAndSecret(&pConnection->sczName, &pConnection->sczSecret); + hr = BurnPipeCreateNameAndSecret(&pConnection->sczName, &pConnection->sczSecret); ExitOnFailure(hr, "Failed to create embedded pipe name and client token."); - hr = PipeCreatePipes(pConnection, FALSE); + hr = BurnPipeCreatePipes(pConnection, FALSE); ExitOnFailure(hr, "Failed to create embedded pipe."); hr = StrAllocFormatted(&sczCommand, L"%ls -%ls %ls %ls %u", sczBaseCommand, BURN_COMMANDLINE_SWITCH_EMBEDDED, pConnection->sczName, pConnection->sczSecret, dwCurrentProcessId); @@ -84,10 +84,10 @@ extern "C" HRESULT EmbeddedRunBundle( pConnection->hProcess = pi.hProcess; pi.hProcess = NULL; - hr = PipeWaitForChildConnect(pConnection); + hr = BurnPipeWaitForChildConnect(pConnection); ExitOnFailure(hr, "Failed to wait for embedded process to connect to pipe."); - hr = PipePumpMessages(pConnection->hPipe, ProcessEmbeddedMessages, &context, &result); + hr = BurnPipePumpMessages(pConnection->hPipe, ProcessEmbeddedMessages, &context, &result); ExitOnFailure(hr, "Failed to process messages from embedded message."); // Get the return code from the embedded process. @@ -99,7 +99,7 @@ extern "C" HRESULT EmbeddedRunBundle( ReleaseHandle(pi.hProcess); StrSecureZeroFreeString(sczCommand); - PipeConnectionUninitialize(pConnection); + BurnPipeConnectionUninitialize(pConnection); return hr; } diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index b093ec9be..f5ea5332e 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp @@ -303,7 +303,7 @@ extern "C" HRESULT EngineRun( // end per-machine process if running if (!fRunElevated && INVALID_HANDLE_VALUE != engineState.companionConnection.hPipe) { - PipeTerminateChildProcess(&engineState.companionConnection, *pdwExitCode, engineState.fRestart); + BurnPipeTerminateChildProcess(&engineState.companionConnection, *pdwExitCode, engineState.fRestart); } else if (engineState.fRestart) { @@ -405,8 +405,8 @@ static HRESULT InitializeEngineState( pEngineState->internalCommand.automaticUpdates = BURN_AU_PAUSE_ACTION_IFELEVATED; ::InitializeCriticalSection(&pEngineState->userExperience.csEngineActive); - PipeConnectionInitialize(&pEngineState->companionConnection); - PipeConnectionInitialize(&pEngineState->embeddedConnection); + BurnPipeConnectionInitialize(&pEngineState->companionConnection); + BurnPipeConnectionInitialize(&pEngineState->embeddedConnection); // Retain whether bundle was initially run elevated. ProcElevated(::GetCurrentProcess(), &pEngineState->internalCommand.fInitiallyElevated); @@ -443,8 +443,8 @@ static void UninitializeEngineState( ReleaseHandle(pEngineState->elevatedLoggingContext.hLogEvent); ReleaseHandle(pEngineState->elevatedLoggingContext.hFinishedEvent); - PipeConnectionUninitialize(&pEngineState->embeddedConnection); - PipeConnectionUninitialize(&pEngineState->companionConnection); + BurnPipeConnectionUninitialize(&pEngineState->embeddedConnection); + BurnPipeConnectionUninitialize(&pEngineState->companionConnection); ReleaseStr(pEngineState->sczBundleEngineWorkingPath) ReleaseHandle(pEngineState->hMessageWindowThread); @@ -690,7 +690,7 @@ static HRESULT RunElevated( ExitOnFailure(hr, "Failed to open elevated log."); // connect to per-user process - hr = PipeChildConnect(&pEngineState->companionConnection, TRUE); + hr = BurnPipeChildConnect(&pEngineState->companionConnection, TRUE); ExitOnFailure(hr, "Failed to connect to unelevated process."); // Set up the context for the logging thread then @@ -741,7 +741,7 @@ static HRESULT RunEmbedded( HRESULT hr = S_OK; // Connect to parent process. - hr = PipeChildConnect(&pEngineState->embeddedConnection, FALSE); + hr = BurnPipeChildConnect(&pEngineState->embeddedConnection, FALSE); ExitOnFailure(hr, "Failed to connect to parent of embedded process."); // Do not register the bundle to automatically restart if embedded. @@ -965,7 +965,7 @@ static HRESULT LogStringOverPipe( hr = BuffWriteStringAnsi(&pbData, &cbData, szString); ExitOnFailure(hr, "Failed to prepare logging pipe message."); - hr = PipeSendMessage(hPipe, static_cast(BURN_PIPE_MESSAGE_TYPE_LOG), pbData, cbData, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, static_cast(BURN_PIPE_MESSAGE_TYPE_LOG), pbData, cbData, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send logging message over the pipe."); hr = (HRESULT)dwResult; @@ -1048,7 +1048,7 @@ static DWORD WINAPI ElevatedLoggingThreadProc( LogRedirect(NULL, NULL); // No more messages will be logged over the pipe. { - HRESULT hrTerminate = PipeTerminateLoggingPipe(pContext->hPipe, hr); + HRESULT hrTerminate = BurnPipeTerminateLoggingPipe(pContext->hPipe, hr); if (FAILED(hrTerminate)) { TraceError(hrTerminate, "Failed to terminate logging pipe."); diff --git a/src/burn/engine/externalengine.cpp b/src/burn/engine/externalengine.cpp index 77af79cee..df01d53bc 100644 --- a/src/burn/engine/externalengine.cpp +++ b/src/burn/engine/externalengine.cpp @@ -221,7 +221,7 @@ HRESULT ExternalEngineSendEmbeddedError( hr = BuffWriteNumber(&pbData, &cbData, dwUIHint); ExitOnFailure(hr, "Failed to write UI hint to message buffer."); - hr = PipeSendMessage(pEngineState->embeddedConnection.hPipe, BURN_EMBEDDED_MESSAGE_TYPE_ERROR, pbData, cbData, ProcessUnknownEmbeddedMessages, NULL, &dwResult); + hr = BurnPipeSendMessage(pEngineState->embeddedConnection.hPipe, BURN_EMBEDDED_MESSAGE_TYPE_ERROR, pbData, cbData, ProcessUnknownEmbeddedMessages, NULL, &dwResult); ExitOnFailure(hr, "Failed to send embedded message over pipe."); *pnResult = static_cast(dwResult); @@ -256,7 +256,7 @@ HRESULT ExternalEngineSendEmbeddedProgress( hr = BuffWriteNumber(&pbData, &cbData, dwOverallProgressPercentage); ExitOnFailure(hr, "Failed to write overall progress percentage to message buffer."); - hr = PipeSendMessage(pEngineState->embeddedConnection.hPipe, BURN_EMBEDDED_MESSAGE_TYPE_PROGRESS, pbData, cbData, ProcessUnknownEmbeddedMessages, NULL, &dwResult); + hr = BurnPipeSendMessage(pEngineState->embeddedConnection.hPipe, BURN_EMBEDDED_MESSAGE_TYPE_PROGRESS, pbData, cbData, ProcessUnknownEmbeddedMessages, NULL, &dwResult); ExitOnFailure(hr, "Failed to send embedded progress message over pipe."); *pnResult = static_cast(dwResult); diff --git a/src/burn/test/BurnUnitTest/ElevationTest.cpp b/src/burn/test/BurnUnitTest/ElevationTest.cpp index 857873b6b..77aac4232 100644 --- a/src/burn/test/BurnUnitTest/ElevationTest.cpp +++ b/src/burn/test/BurnUnitTest/ElevationTest.cpp @@ -63,7 +63,7 @@ namespace Bootstrapper ShelFunctionOverride(ElevateTest_ShellExecuteExW); CoreFunctionOverride(NULL, ThrdWaitForCompletion); - PipeConnectionInitialize(pConnection); + BurnPipeConnectionInitialize(pConnection); // // per-user side setup @@ -72,13 +72,13 @@ namespace Bootstrapper TestThrowOnFailure(hr, L"Failed to elevate."); // post execute message - hr = PipeSendMessage(pConnection->hPipe, TEST_PARENT_SENT_MESSAGE_ID, NULL, 0, ProcessParentMessages, NULL, &dwResult); + hr = BurnPipeSendMessage(pConnection->hPipe, TEST_PARENT_SENT_MESSAGE_ID, NULL, 0, ProcessParentMessages, NULL, &dwResult); TestThrowOnFailure(hr, "Failed to post execute message to per-machine process."); // // initiate termination // - hr = PipeTerminateChildProcess(pConnection, 666, FALSE); + hr = BurnPipeTerminateChildProcess(pConnection, 666, FALSE); TestThrowOnFailure(hr, L"Failed to terminate elevated process."); // check flags @@ -86,7 +86,7 @@ namespace Bootstrapper } finally { - PipeConnectionUninitialize(pConnection); + BurnPipeConnectionUninitialize(pConnection); } } }; @@ -127,7 +127,7 @@ static DWORD CALLBACK ElevateTest_ThreadProc( BURN_PIPE_CONNECTION connection = { }; BURN_PIPE_RESULT result = { }; - PipeConnectionInitialize(&connection); + BurnPipeConnectionInitialize(&connection); StrAlloc(&connection.sczName, MAX_PATH); StrAlloc(&connection.sczSecret, MAX_PATH); @@ -140,15 +140,15 @@ static DWORD CALLBACK ElevateTest_ThreadProc( } // set up connection with per-user process - hr = PipeChildConnect(&connection, TRUE); + hr = BurnPipeChildConnect(&connection, TRUE); ExitOnFailure(hr, "Failed to connect to per-user process."); // pump messages - hr = PipePumpMessages(connection.hPipe, ProcessChildMessages, static_cast(connection.hPipe), &result); + hr = BurnPipePumpMessages(connection.hPipe, ProcessChildMessages, static_cast(connection.hPipe), &result); ExitOnFailure(hr, "Failed while pumping messages in child 'process'."); LExit: - PipeConnectionUninitialize(&connection); + BurnPipeConnectionUninitialize(&connection); ReleaseStr(sczArguments); return FAILED(hr) ? (DWORD)hr : result.dwResult; @@ -199,7 +199,7 @@ static HRESULT ProcessChildMessages( { case TEST_PARENT_SENT_MESSAGE_ID: // send test message - hr = PipeSendMessage(hPipe, TEST_CHILD_SENT_MESSAGE_ID, (LPVOID)TEST_MESSAGE_DATA, sizeof(TEST_MESSAGE_DATA), NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(hPipe, TEST_CHILD_SENT_MESSAGE_ID, (LPVOID)TEST_MESSAGE_DATA, sizeof(TEST_MESSAGE_DATA), NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to send message to per-machine process."); break; diff --git a/src/burn/test/BurnUnitTest/EmbeddedTest.cpp b/src/burn/test/BurnUnitTest/EmbeddedTest.cpp index 7560fe25e..8d70cbabf 100644 --- a/src/burn/test/BurnUnitTest/EmbeddedTest.cpp +++ b/src/burn/test/BurnUnitTest/EmbeddedTest.cpp @@ -133,7 +133,7 @@ static DWORD CALLBACK EmbeddedTest_ThreadProc( engineState.internalCommand.mode = BURN_MODE_EMBEDDED; - PipeConnectionInitialize(pConnection); + BurnPipeConnectionInitialize(pConnection); StrAlloc(&pConnection->sczName, MAX_PATH); StrAlloc(&pConnection->sczSecret, MAX_PATH); @@ -145,11 +145,11 @@ static DWORD CALLBACK EmbeddedTest_ThreadProc( } // set up connection with parent bundle runner - hr = PipeChildConnect(pConnection, FALSE); + hr = BurnPipeChildConnect(pConnection, FALSE); ExitOnFailure(hr, "Failed to connect to parent bundle runner."); // post unknown message - hr = PipeSendMessage(pConnection->hPipe, TEST_UNKNOWN_MESSAGE_ID, NULL, 0, NULL, NULL, &dwResult); + hr = BurnPipeSendMessage(pConnection->hPipe, TEST_UNKNOWN_MESSAGE_ID, NULL, 0, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to post unknown message to parent bundle runner."); if (E_NOTIMPL != dwResult) @@ -162,7 +162,7 @@ static DWORD CALLBACK EmbeddedTest_ThreadProc( ExitOnFailure(hr, "Failed to post known message to parent bundle runner."); LExit: - PipeConnectionUninitialize(pConnection); + BurnPipeConnectionUninitialize(pConnection); ReleaseStr(sczArguments); return FAILED(hr) ? (DWORD)hr : dwResult; @@ -179,7 +179,7 @@ static int EmbeddedTest_GenericMessageHandler( if (GENERIC_EXECUTE_MESSAGE_ERROR == pMessage->type) { // post unknown message - HRESULT hr = PipeSendMessage(pContext->connection.hPipe, TEST_UNKNOWN_MESSAGE_ID, NULL, 0, NULL, NULL, &dwResult); + HRESULT hr = BurnPipeSendMessage(pContext->connection.hPipe, TEST_UNKNOWN_MESSAGE_ID, NULL, 0, NULL, NULL, &dwResult); ExitOnFailure(hr, "Failed to post unknown message to embedded bundle."); if (E_NOTIMPL != dwResult) diff --git a/src/burn/test/BurnUnitTest/ExitCodeTest.cpp b/src/burn/test/BurnUnitTest/ExitCodeTest.cpp index 465ee04ba..4ff78c5ab 100644 --- a/src/burn/test/BurnUnitTest/ExitCodeTest.cpp +++ b/src/burn/test/BurnUnitTest/ExitCodeTest.cpp @@ -130,7 +130,7 @@ static void LoadEngineState( // // initiate termination // - hr = PipeTerminateChildProcess(pConnection, 0, FALSE); + hr = BurnPipeTerminateChildProcess(pConnection, 0, FALSE); TestThrowOnFailure(hr, L"Failed to terminate elevated process."); // check results @@ -150,7 +150,7 @@ static void LoadEngineState( finally { VariablesUninitialize(&engineState.variables); - PipeConnectionUninitialize(pConnection); + BurnPipeConnectionUninitialize(pConnection); } } @@ -241,14 +241,14 @@ static DWORD CALLBACK ExitCodeTest_ElevationThreadProc( } // set up connection with per-user process - hr = PipeChildConnect(pConnection, TRUE); + hr = BurnPipeChildConnect(pConnection, TRUE); ExitOnFailure(hr, "Failed to connect to per-user process."); hr = ElevationChildPumpMessages(pConnection->hPipe, pConnection->hCachePipe, &engineState.approvedExes, &engineState.cache, &engineState.containers, &engineState.packages, &engineState.payloads, &engineState.variables, &engineState.registration, &engineState.userExperience, &hLock, &dwChildExitCode, &fRestart, &fApplying); ExitOnFailure(hr, "Failed while pumping messages in child 'process'."); LExit: - PipeConnectionUninitialize(pConnection); + BurnPipeConnectionUninitialize(pConnection); VariablesUninitialize(&engineState.variables); ReleaseStr(sczArguments); @@ -358,7 +358,7 @@ static void LoadEngineState( VariableInitialize(&pEngineState->variables); - PipeConnectionInitialize(&pEngineState->companionConnection); + BurnPipeConnectionInitialize(&pEngineState->companionConnection); hr = CacheInitialize(&pEngineState->cache, &pEngineState->internalCommand); TestThrowOnFailure(hr, "CacheInitialize failed.");