diff options
Diffstat (limited to 'src/burn/engine/embedded.cpp')
-rw-r--r-- | src/burn/engine/embedded.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/burn/engine/embedded.cpp b/src/burn/engine/embedded.cpp index 1c295d59..58af5574 100644 --- a/src/burn/engine/embedded.cpp +++ b/src/burn/engine/embedded.cpp | |||
@@ -36,12 +36,13 @@ static HRESULT OnEmbeddedProgress( | |||
36 | // function definitions | 36 | // function definitions |
37 | 37 | ||
38 | /******************************************************************* | 38 | /******************************************************************* |
39 | EmbeddedLaunchChildProcess - | 39 | EmbeddedRunBundle - |
40 | 40 | ||
41 | *******************************************************************/ | 41 | *******************************************************************/ |
42 | extern "C" HRESULT EmbeddedRunBundle( | 42 | extern "C" HRESULT EmbeddedRunBundle( |
43 | __in LPCWSTR wzExecutablePath, | 43 | __in_z LPCWSTR wzExecutablePath, |
44 | __in LPCWSTR wzArguments, | 44 | __in_z LPWSTR sczBaseCommand, |
45 | __in_z_opt LPCWSTR wzUserArgs, | ||
45 | __in PFN_GENERICMESSAGEHANDLER pfnGenericMessageHandler, | 46 | __in PFN_GENERICMESSAGEHANDLER pfnGenericMessageHandler, |
46 | __in LPVOID pvContext, | 47 | __in LPVOID pvContext, |
47 | __out DWORD* pdwExitCode | 48 | __out DWORD* pdwExitCode |
@@ -68,8 +69,15 @@ extern "C" HRESULT EmbeddedRunBundle( | |||
68 | hr = PipeCreatePipes(&connection, FALSE, &hCreatedPipesEvent); | 69 | hr = PipeCreatePipes(&connection, FALSE, &hCreatedPipesEvent); |
69 | ExitOnFailure(hr, "Failed to create embedded pipe."); | 70 | ExitOnFailure(hr, "Failed to create embedded pipe."); |
70 | 71 | ||
71 | hr = StrAllocFormattedSecure(&sczCommand, L"%ls -%ls %ls %ls %u", wzArguments, BURN_COMMANDLINE_SWITCH_EMBEDDED, connection.sczName, connection.sczSecret, dwCurrentProcessId); | 72 | hr = StrAllocFormatted(&sczCommand, L"%ls -%ls %ls %ls %u", sczBaseCommand, BURN_COMMANDLINE_SWITCH_EMBEDDED, connection.sczName, connection.sczSecret, dwCurrentProcessId); |
72 | ExitOnFailure(hr, "Failed to allocate embedded command."); | 73 | ExitOnFailure(hr, "Failed to append embedded args."); |
74 | |||
75 | // Always add user supplied arguments last. | ||
76 | if (wzUserArgs) | ||
77 | { | ||
78 | hr = StrAllocConcatFormattedSecure(&sczCommand, L" %ls", wzUserArgs); | ||
79 | ExitOnFailure(hr, "Failed to append user args."); | ||
80 | } | ||
73 | 81 | ||
74 | if (!::CreateProcessW(wzExecutablePath, sczCommand, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) | 82 | if (!::CreateProcessW(wzExecutablePath, sczCommand, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) |
75 | { | 83 | { |