diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-06-07 17:28:18 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-06-09 13:47:53 -0500 |
commit | 881a6c9bd0c3b3134277605824dd5a9ceaaf176d (patch) | |
tree | 01d44474bea6f73d265a530510557f5e329291fc /src/burn/engine/core.h | |
parent | 9f360945ce3703677701b12267a42334bbe7dca1 (diff) | |
download | wix-881a6c9bd0c3b3134277605824dd5a9ceaaf176d.tar.gz wix-881a6c9bd0c3b3134277605824dd5a9ceaaf176d.tar.bz2 wix-881a6c9bd0c3b3134277605824dd5a9ceaaf176d.zip |
Update Burn command line parsing to handle unknown args separately.
Parse whole command line in InitializeEngineState but store the indices of unknown args. This allows the engine earlier access to the configuration from the command line, while still allowing CoreInitialize to sanitize the command line before logging it.
Diffstat (limited to 'src/burn/engine/core.h')
-rw-r--r-- | src/burn/engine/core.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/burn/engine/core.h b/src/burn/engine/core.h index 7e9d99bb..7b1be47e 100644 --- a/src/burn/engine/core.h +++ b/src/burn/engine/core.h | |||
@@ -77,6 +77,12 @@ enum BURN_AU_PAUSE_ACTION | |||
77 | 77 | ||
78 | // structs | 78 | // structs |
79 | 79 | ||
80 | typedef struct _BURN_ENGINE_COMMAND | ||
81 | { | ||
82 | LPWSTR sczSourceProcessPath; | ||
83 | LPWSTR sczOriginalSource; | ||
84 | } BURN_ENGINE_COMMAND; | ||
85 | |||
80 | typedef struct _BURN_ENGINE_STATE | 86 | typedef struct _BURN_ENGINE_STATE |
81 | { | 87 | { |
82 | // UX flow control | 88 | // UX flow control |
@@ -134,6 +140,9 @@ typedef struct _BURN_ENGINE_STATE | |||
134 | int argc; | 140 | int argc; |
135 | LPWSTR* argv; | 141 | LPWSTR* argv; |
136 | BOOL fInvalidCommandLine; | 142 | BOOL fInvalidCommandLine; |
143 | BURN_ENGINE_COMMAND internalCommand; | ||
144 | DWORD cUnknownArgs; | ||
145 | int* rgUnknownArgs; | ||
137 | } BURN_ENGINE_STATE; | 146 | } BURN_ENGINE_STATE; |
138 | 147 | ||
139 | typedef struct _BURN_APPLY_CONTEXT | 148 | typedef struct _BURN_APPLY_CONTEXT |
@@ -222,6 +231,29 @@ HRESULT CoreAppendFileHandleSelfToCommandLine( | |||
222 | void CoreCleanup( | 231 | void CoreCleanup( |
223 | __in BURN_ENGINE_STATE* pEngineState | 232 | __in BURN_ENGINE_STATE* pEngineState |
224 | ); | 233 | ); |
234 | HRESULT CoreParseCommandLine( | ||
235 | __in int argc, | ||
236 | __in LPWSTR* argv, | ||
237 | __in BOOTSTRAPPER_COMMAND* pCommand, | ||
238 | __in BURN_PIPE_CONNECTION* pCompanionConnection, | ||
239 | __in BURN_PIPE_CONNECTION* pEmbeddedConnection, | ||
240 | __inout BURN_MODE* pMode, | ||
241 | __inout BURN_AU_PAUSE_ACTION* pAutomaticUpdates, | ||
242 | __inout BOOL* pfDisableSystemRestore, | ||
243 | __inout_z LPWSTR* psczSourceProcessPath, | ||
244 | __inout_z LPWSTR* psczOriginalSource, | ||
245 | __inout HANDLE* phSectionFile, | ||
246 | __inout HANDLE* phSourceEngineFile, | ||
247 | __inout BOOL* pfDisableUnelevate, | ||
248 | __inout DWORD* pdwLoggingAttributes, | ||
249 | __inout_z LPWSTR* psczLogFile, | ||
250 | __inout_z LPWSTR* psczActiveParent, | ||
251 | __inout_z LPWSTR* psczIgnoreDependencies, | ||
252 | __inout_z LPWSTR* psczAncestors, | ||
253 | __inout BOOL* pfInvalidCommandLine, | ||
254 | __inout DWORD* pcUnknownArgs, | ||
255 | __inout int** prgUnknownArgs | ||
256 | ); | ||
225 | 257 | ||
226 | #if defined(__cplusplus) | 258 | #if defined(__cplusplus) |
227 | } | 259 | } |