diff options
author | Rob Mensching <rob@firegiant.com> | 2024-01-11 00:00:27 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2024-01-11 18:24:06 -0800 |
commit | 8cfd711f775e8501836162538998b5b6d8efbf89 (patch) | |
tree | 3083faee64b5be16062a93ed4e4b6668fc4f64c8 /src/burn/engine/elevation.cpp | |
parent | 4e7b7c0059d76498d1c24f348dbf6d5799203fe0 (diff) | |
download | wix-8cfd711f775e8501836162538998b5b6d8efbf89.tar.gz wix-8cfd711f775e8501836162538998b5b6d8efbf89.tar.bz2 wix-8cfd711f775e8501836162538998b5b6d8efbf89.zip |
Update Burn to use pipeutil for low-level pipe operations
Diffstat (limited to 'src/burn/engine/elevation.cpp')
-rw-r--r-- | src/burn/engine/elevation.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 63a76c2c..10ae74a4 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
@@ -129,43 +129,43 @@ static HRESULT WaitForElevatedChildCacheThread( | |||
129 | __in DWORD dwExpectedExitCode | 129 | __in DWORD dwExpectedExitCode |
130 | ); | 130 | ); |
131 | static HRESULT ProcessApplyInitializeMessages( | 131 | static HRESULT ProcessApplyInitializeMessages( |
132 | __in BURN_PIPE_MESSAGE* pMsg, | 132 | __in PIPE_MESSAGE* pMsg, |
133 | __in_opt LPVOID pvContext, | 133 | __in_opt LPVOID pvContext, |
134 | __out DWORD* pdwResult | 134 | __out DWORD* pdwResult |
135 | ); | 135 | ); |
136 | static HRESULT ProcessBurnCacheMessages( | 136 | static HRESULT ProcessBurnCacheMessages( |
137 | __in BURN_PIPE_MESSAGE* pMsg, | 137 | __in PIPE_MESSAGE* pMsg, |
138 | __in LPVOID pvContext, | 138 | __in LPVOID pvContext, |
139 | __out DWORD* pdwResult | 139 | __out DWORD* pdwResult |
140 | ); | 140 | ); |
141 | static HRESULT ProcessGenericExecuteMessages( | 141 | static HRESULT ProcessGenericExecuteMessages( |
142 | __in BURN_PIPE_MESSAGE* pMsg, | 142 | __in PIPE_MESSAGE* pMsg, |
143 | __in LPVOID pvContext, | 143 | __in LPVOID pvContext, |
144 | __out DWORD* pdwResult | 144 | __out DWORD* pdwResult |
145 | ); | 145 | ); |
146 | static HRESULT ProcessMsiPackageMessages( | 146 | static HRESULT ProcessMsiPackageMessages( |
147 | __in BURN_PIPE_MESSAGE* pMsg, | 147 | __in PIPE_MESSAGE* pMsg, |
148 | __in_opt LPVOID pvContext, | 148 | __in_opt LPVOID pvContext, |
149 | __out DWORD* pdwResult | 149 | __out DWORD* pdwResult |
150 | ); | 150 | ); |
151 | static HRESULT ProcessLaunchApprovedExeMessages( | 151 | static HRESULT ProcessLaunchApprovedExeMessages( |
152 | __in BURN_PIPE_MESSAGE* pMsg, | 152 | __in PIPE_MESSAGE* pMsg, |
153 | __in_opt LPVOID pvContext, | 153 | __in_opt LPVOID pvContext, |
154 | __out DWORD* pdwResult | 154 | __out DWORD* pdwResult |
155 | ); | 155 | ); |
156 | static HRESULT ProcessProgressRoutineMessage( | 156 | static HRESULT ProcessProgressRoutineMessage( |
157 | __in BURN_PIPE_MESSAGE* pMsg, | 157 | __in PIPE_MESSAGE* pMsg, |
158 | __in LPPROGRESS_ROUTINE pfnProgress, | 158 | __in LPPROGRESS_ROUTINE pfnProgress, |
159 | __in LPVOID pvContext, | 159 | __in LPVOID pvContext, |
160 | __out DWORD* pdwResult | 160 | __out DWORD* pdwResult |
161 | ); | 161 | ); |
162 | static HRESULT ProcessElevatedChildMessage( | 162 | static HRESULT ProcessElevatedChildMessage( |
163 | __in BURN_PIPE_MESSAGE* pMsg, | 163 | __in PIPE_MESSAGE* pMsg, |
164 | __in_opt LPVOID pvContext, | 164 | __in_opt LPVOID pvContext, |
165 | __out DWORD* pdwResult | 165 | __out DWORD* pdwResult |
166 | ); | 166 | ); |
167 | static HRESULT ProcessElevatedChildCacheMessage( | 167 | static HRESULT ProcessElevatedChildCacheMessage( |
168 | __in BURN_PIPE_MESSAGE* pMsg, | 168 | __in PIPE_MESSAGE* pMsg, |
169 | __in_opt LPVOID pvContext, | 169 | __in_opt LPVOID pvContext, |
170 | __out DWORD* pdwResult | 170 | __out DWORD* pdwResult |
171 | ); | 171 | ); |
@@ -1739,7 +1739,7 @@ LExit: | |||
1739 | } | 1739 | } |
1740 | 1740 | ||
1741 | static HRESULT ProcessApplyInitializeMessages( | 1741 | static HRESULT ProcessApplyInitializeMessages( |
1742 | __in BURN_PIPE_MESSAGE* pMsg, | 1742 | __in PIPE_MESSAGE* pMsg, |
1743 | __in_opt LPVOID pvContext, | 1743 | __in_opt LPVOID pvContext, |
1744 | __out DWORD* pdwResult | 1744 | __out DWORD* pdwResult |
1745 | ) | 1745 | ) |
@@ -1752,7 +1752,7 @@ static HRESULT ProcessApplyInitializeMessages( | |||
1752 | HRESULT hrBA = S_OK; | 1752 | HRESULT hrBA = S_OK; |
1753 | 1753 | ||
1754 | // Process the message. | 1754 | // Process the message. |
1755 | switch (pMsg->dwMessage) | 1755 | switch (pMsg->dwMessageType) |
1756 | { | 1756 | { |
1757 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_BEGIN: | 1757 | case BURN_ELEVATION_MESSAGE_TYPE_APPLY_INITIALIZE_PAUSE_AU_BEGIN: |
1758 | pContext->fPauseCompleteNeeded = TRUE; | 1758 | pContext->fPauseCompleteNeeded = TRUE; |
@@ -1801,7 +1801,7 @@ LExit: | |||
1801 | } | 1801 | } |
1802 | 1802 | ||
1803 | static HRESULT ProcessBurnCacheMessages( | 1803 | static HRESULT ProcessBurnCacheMessages( |
1804 | __in BURN_PIPE_MESSAGE* pMsg, | 1804 | __in PIPE_MESSAGE* pMsg, |
1805 | __in LPVOID pvContext, | 1805 | __in LPVOID pvContext, |
1806 | __out DWORD* pdwResult | 1806 | __out DWORD* pdwResult |
1807 | ) | 1807 | ) |
@@ -1813,7 +1813,7 @@ static HRESULT ProcessBurnCacheMessages( | |||
1813 | BOOL fProgressRoutine = FALSE; | 1813 | BOOL fProgressRoutine = FALSE; |
1814 | 1814 | ||
1815 | // Process the message. | 1815 | // Process the message. |
1816 | switch (pMsg->dwMessage) | 1816 | switch (pMsg->dwMessageType) |
1817 | { | 1817 | { |
1818 | case BURN_ELEVATION_MESSAGE_TYPE_BURN_CACHE_BEGIN: | 1818 | case BURN_ELEVATION_MESSAGE_TYPE_BURN_CACHE_BEGIN: |
1819 | // read message parameters | 1819 | // read message parameters |
@@ -1872,7 +1872,7 @@ LExit: | |||
1872 | } | 1872 | } |
1873 | 1873 | ||
1874 | static HRESULT ProcessGenericExecuteMessages( | 1874 | static HRESULT ProcessGenericExecuteMessages( |
1875 | __in BURN_PIPE_MESSAGE* pMsg, | 1875 | __in PIPE_MESSAGE* pMsg, |
1876 | __in LPVOID pvContext, | 1876 | __in LPVOID pvContext, |
1877 | __out DWORD* pdwResult | 1877 | __out DWORD* pdwResult |
1878 | ) | 1878 | ) |
@@ -1885,7 +1885,7 @@ static HRESULT ProcessGenericExecuteMessages( | |||
1885 | LPWSTR* rgwzFiles = NULL; | 1885 | LPWSTR* rgwzFiles = NULL; |
1886 | GENERIC_EXECUTE_MESSAGE message = { }; | 1886 | GENERIC_EXECUTE_MESSAGE message = { }; |
1887 | 1887 | ||
1888 | if (BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE == pMsg->dwMessage) | 1888 | if (BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE == pMsg->dwMessageType) |
1889 | { | 1889 | { |
1890 | hr = ProcessExecuteActionCompleteMessage((BYTE*)pMsg->pvData, pMsg->cbData, &pContext->restart, pdwResult); | 1890 | hr = ProcessExecuteActionCompleteMessage((BYTE*)pMsg->pvData, pMsg->cbData, &pContext->restart, pdwResult); |
1891 | ExitOnFailure(hr, "Failed to process BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE message."); | 1891 | ExitOnFailure(hr, "Failed to process BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE message."); |
@@ -1897,7 +1897,7 @@ static HRESULT ProcessGenericExecuteMessages( | |||
1897 | ExitOnFailure(hr, "Failed to allowed results."); | 1897 | ExitOnFailure(hr, "Failed to allowed results."); |
1898 | 1898 | ||
1899 | // Process the message. | 1899 | // Process the message. |
1900 | switch (pMsg->dwMessage) | 1900 | switch (pMsg->dwMessageType) |
1901 | { | 1901 | { |
1902 | case BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PROGRESS: | 1902 | case BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PROGRESS: |
1903 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; | 1903 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; |
@@ -1979,7 +1979,7 @@ LExit: | |||
1979 | } | 1979 | } |
1980 | 1980 | ||
1981 | static HRESULT ProcessMsiPackageMessages( | 1981 | static HRESULT ProcessMsiPackageMessages( |
1982 | __in BURN_PIPE_MESSAGE* pMsg, | 1982 | __in PIPE_MESSAGE* pMsg, |
1983 | __in_opt LPVOID pvContext, | 1983 | __in_opt LPVOID pvContext, |
1984 | __out DWORD* pdwResult | 1984 | __out DWORD* pdwResult |
1985 | ) | 1985 | ) |
@@ -1993,7 +1993,7 @@ static HRESULT ProcessMsiPackageMessages( | |||
1993 | LPWSTR sczMessage = NULL; | 1993 | LPWSTR sczMessage = NULL; |
1994 | BOOL fRestartManager = FALSE; | 1994 | BOOL fRestartManager = FALSE; |
1995 | 1995 | ||
1996 | if (BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE == pMsg->dwMessage) | 1996 | if (BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE == pMsg->dwMessageType) |
1997 | { | 1997 | { |
1998 | hr = ProcessExecuteActionCompleteMessage((BYTE*)pMsg->pvData, pMsg->cbData, &pContext->restart, pdwResult); | 1998 | hr = ProcessExecuteActionCompleteMessage((BYTE*)pMsg->pvData, pMsg->cbData, &pContext->restart, pdwResult); |
1999 | ExitOnFailure(hr, "Failed to process BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE message."); | 1999 | ExitOnFailure(hr, "Failed to process BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_ACTION_COMPLETE message."); |
@@ -2024,7 +2024,7 @@ static HRESULT ProcessMsiPackageMessages( | |||
2024 | ExitOnFailure(hr, "Failed to read UI flags."); | 2024 | ExitOnFailure(hr, "Failed to read UI flags."); |
2025 | 2025 | ||
2026 | // Process the rest of the message. | 2026 | // Process the rest of the message. |
2027 | switch (pMsg->dwMessage) | 2027 | switch (pMsg->dwMessageType) |
2028 | { | 2028 | { |
2029 | case BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PROGRESS: | 2029 | case BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PROGRESS: |
2030 | // read message parameters | 2030 | // read message parameters |
@@ -2093,7 +2093,7 @@ LExit: | |||
2093 | } | 2093 | } |
2094 | 2094 | ||
2095 | static HRESULT ProcessLaunchApprovedExeMessages( | 2095 | static HRESULT ProcessLaunchApprovedExeMessages( |
2096 | __in BURN_PIPE_MESSAGE* pMsg, | 2096 | __in PIPE_MESSAGE* pMsg, |
2097 | __in_opt LPVOID pvContext, | 2097 | __in_opt LPVOID pvContext, |
2098 | __out DWORD* pdwResult | 2098 | __out DWORD* pdwResult |
2099 | ) | 2099 | ) |
@@ -2104,7 +2104,7 @@ static HRESULT ProcessLaunchApprovedExeMessages( | |||
2104 | DWORD dwProcessId = 0; | 2104 | DWORD dwProcessId = 0; |
2105 | 2105 | ||
2106 | // Process the message. | 2106 | // Process the message. |
2107 | switch (pMsg->dwMessage) | 2107 | switch (pMsg->dwMessageType) |
2108 | { | 2108 | { |
2109 | case BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE_PROCESSID: | 2109 | case BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE_PROCESSID: |
2110 | // read message parameters | 2110 | // read message parameters |
@@ -2126,7 +2126,7 @@ LExit: | |||
2126 | } | 2126 | } |
2127 | 2127 | ||
2128 | static HRESULT ProcessProgressRoutineMessage( | 2128 | static HRESULT ProcessProgressRoutineMessage( |
2129 | __in BURN_PIPE_MESSAGE* pMsg, | 2129 | __in PIPE_MESSAGE* pMsg, |
2130 | __in LPPROGRESS_ROUTINE pfnProgress, | 2130 | __in LPPROGRESS_ROUTINE pfnProgress, |
2131 | __in LPVOID pvContext, | 2131 | __in LPVOID pvContext, |
2132 | __out DWORD* pdwResult | 2132 | __out DWORD* pdwResult |
@@ -2156,7 +2156,7 @@ LExit: | |||
2156 | } | 2156 | } |
2157 | 2157 | ||
2158 | static HRESULT ProcessElevatedChildMessage( | 2158 | static HRESULT ProcessElevatedChildMessage( |
2159 | __in BURN_PIPE_MESSAGE* pMsg, | 2159 | __in PIPE_MESSAGE* pMsg, |
2160 | __in_opt LPVOID pvContext, | 2160 | __in_opt LPVOID pvContext, |
2161 | __out DWORD* pdwResult | 2161 | __out DWORD* pdwResult |
2162 | ) | 2162 | ) |
@@ -2167,7 +2167,7 @@ static HRESULT ProcessElevatedChildMessage( | |||
2167 | BOOTSTRAPPER_APPLY_RESTART restart = BOOTSTRAPPER_APPLY_RESTART_NONE; | 2167 | BOOTSTRAPPER_APPLY_RESTART restart = BOOTSTRAPPER_APPLY_RESTART_NONE; |
2168 | BOOL fSendRestart = FALSE; | 2168 | BOOL fSendRestart = FALSE; |
2169 | 2169 | ||
2170 | switch (pMsg->dwMessage) | 2170 | switch (pMsg->dwMessageType) |
2171 | { | 2171 | { |
2172 | case BURN_ELEVATION_MESSAGE_TYPE_BEGIN_MSI_TRANSACTION: | 2172 | case BURN_ELEVATION_MESSAGE_TYPE_BEGIN_MSI_TRANSACTION: |
2173 | hrResult = OnMsiBeginTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | 2173 | hrResult = OnMsiBeginTransaction(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); |
@@ -2263,7 +2263,7 @@ static HRESULT ProcessElevatedChildMessage( | |||
2263 | break; | 2263 | break; |
2264 | 2264 | ||
2265 | default: | 2265 | default: |
2266 | ExitWithRootFailure(hr, E_INVALIDARG, "Unexpected elevated message sent to child process, msg: %u", pMsg->dwMessage); | 2266 | ExitWithRootFailure(hr, E_INVALIDARG, "Unexpected elevated message sent to child process, msg: %u", pMsg->dwMessageType); |
2267 | } | 2267 | } |
2268 | 2268 | ||
2269 | if (fSendRestart) | 2269 | if (fSendRestart) |
@@ -2279,7 +2279,7 @@ LExit: | |||
2279 | } | 2279 | } |
2280 | 2280 | ||
2281 | static HRESULT ProcessElevatedChildCacheMessage( | 2281 | static HRESULT ProcessElevatedChildCacheMessage( |
2282 | __in BURN_PIPE_MESSAGE* pMsg, | 2282 | __in PIPE_MESSAGE* pMsg, |
2283 | __in_opt LPVOID pvContext, | 2283 | __in_opt LPVOID pvContext, |
2284 | __out DWORD* pdwResult | 2284 | __out DWORD* pdwResult |
2285 | ) | 2285 | ) |
@@ -2288,7 +2288,7 @@ static HRESULT ProcessElevatedChildCacheMessage( | |||
2288 | BURN_ELEVATION_CHILD_MESSAGE_CONTEXT* pContext = static_cast<BURN_ELEVATION_CHILD_MESSAGE_CONTEXT*>(pvContext); | 2288 | BURN_ELEVATION_CHILD_MESSAGE_CONTEXT* pContext = static_cast<BURN_ELEVATION_CHILD_MESSAGE_CONTEXT*>(pvContext); |
2289 | HRESULT hrResult = S_OK; | 2289 | HRESULT hrResult = S_OK; |
2290 | 2290 | ||
2291 | switch (pMsg->dwMessage) | 2291 | switch (pMsg->dwMessageType) |
2292 | { | 2292 | { |
2293 | case BURN_ELEVATION_MESSAGE_TYPE_CACHE_PREPARE_PACKAGE: | 2293 | case BURN_ELEVATION_MESSAGE_TYPE_CACHE_PREPARE_PACKAGE: |
2294 | hrResult = OnCachePreparePackage(pContext->pCache, pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | 2294 | hrResult = OnCachePreparePackage(pContext->pCache, pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); |
@@ -2313,7 +2313,7 @@ static HRESULT ProcessElevatedChildCacheMessage( | |||
2313 | 2313 | ||
2314 | default: | 2314 | default: |
2315 | hr = E_INVALIDARG; | 2315 | hr = E_INVALIDARG; |
2316 | ExitOnRootFailure(hr, "Unexpected elevated cache message sent to child process, msg: %u", pMsg->dwMessage); | 2316 | ExitOnRootFailure(hr, "Unexpected elevated cache message sent to child process, msg: %u", pMsg->dwMessageType); |
2317 | } | 2317 | } |
2318 | 2318 | ||
2319 | *pdwResult = (DWORD)hrResult; | 2319 | *pdwResult = (DWORD)hrResult; |