From 9bdf3730cd43e1af8a4ea9be6cf2fba77fcff2d2 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 1 Jul 2021 09:30:10 -0500 Subject: Add bundle option for command line variables to always be uppercase. Fixes #3777 --- src/burn/engine/variable.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/burn/engine/variable.cpp') diff --git a/src/burn/engine/variable.cpp b/src/burn/engine/variable.cpp index 6f818ff3..e2b1f1f2 100644 --- a/src/burn/engine/variable.cpp +++ b/src/burn/engine/variable.cpp @@ -294,6 +294,7 @@ extern "C" HRESULT VariablesParseFromXml( ) { HRESULT hr = S_OK; + IXMLDOMNode* pixnCommandLine = NULL; IXMLDOMNodeList* pixnNodes = NULL; IXMLDOMNode* pixnNode = NULL; DWORD cNodes = 0; @@ -307,6 +308,32 @@ extern "C" HRESULT VariablesParseFromXml( ::EnterCriticalSection(&pVariables->csAccess); + // select registration node + hr = XmlSelectSingleNode(pixnBundle, L"CommandLine", &pixnCommandLine); + if (S_FALSE == hr) + { + hr = E_NOTFOUND; + } + ExitOnFailure(hr, "Failed to select CommandLine node."); + + // @Variables + hr = XmlGetAttributeEx(pixnCommandLine, L"Variables", &scz); + ExitOnFailure(hr, "Failed to get CommandLine/@Variables."); + + if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"upperCase", -1)) + { + pVariables->commandLineType = BURN_VARIABLE_COMMAND_LINE_TYPE_UPPER_CASE; + } + else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"caseSensitive", -1)) + { + pVariables->commandLineType = BURN_VARIABLE_COMMAND_LINE_TYPE_CASE_SENSITIVE; + } + else + { + hr = E_INVALIDARG; + ExitOnFailure(hr, "Invalid value for CommandLine/@Variables: %ls", scz); + } + // select variable nodes hr = XmlSelectNodes(pixnBundle, L"Variable", &pixnNodes); ExitOnFailure(hr, "Failed to select variable nodes."); @@ -434,6 +461,7 @@ extern "C" HRESULT VariablesParseFromXml( LExit: ::LeaveCriticalSection(&pVariables->csAccess); + ReleaseObject(pixnCommandLine); ReleaseObject(pixnNodes); ReleaseObject(pixnNode); ReleaseStr(scz); -- cgit v1.2.3-55-g6feb