When looking in to extending wixca to be able to read Xml settings, I
noticed something I thought was a bit strange. The ExitOnFailure1 calls
following StringCchCopyW and StrAllocString are using the variable that
we are attempting to populate. Would not make more sense to be using
pwzData instead to show the value we were trying to copy/allocate?
// Get the Element Path
hr = WcaGetRecordFormattedString(hRec, xfqElementPath,
&(*ppxfcTail)->pwzElementPath);
ExitOnFailure1(hr, "failed to get Element Path for XmlConfig:
%ls", (*ppxfcTail)->wzId);
// Get the Verify Path
hr = WcaGetRecordFormattedString(hRec, xfqVerifyPath,
&(*ppxfcTail)->pwzVerifyPath);
ExitOnFailure1(hr, "failed to get Verify Path for XmlConfig:
%ls", (*ppxfcTail)->wzId);
// Get the name
hr = WcaGetRecordFormattedString(hRec, xfqName, &pwzData);
ExitOnFailure1(hr, "failed to get Name for XmlConfig: %ls",
(*ppxfcTail)->wzId);
hr = StringCchCopyW((*ppxfcTail)->wzName,
countof((*ppxfcTail)->wzName), pwzData);
ExitOnFailure1(hr, "failed to copy name: %ls",
(*ppxfcTail)->wzName);
// Get the value
hr = WcaGetRecordFormattedString(hRec, xfqValue, &pwzData);
ExitOnFailure1(hr, "failed to get Value for XmlConfig: %ls",
(*ppxfcTail)->wzId);
hr = StrAllocString(&(*ppxfcTail)->pwzValue, pwzData, 0);
ExitOnFailure1(hr, "failed to allocate buffer for value: %ls",
(*ppxfcTail)->pwzValue);
// Get the component attributes
hr = WcaGetRecordInteger(hRec, xfqCompAttributes,
&(*ppxfcTail)->iCompAttributes);
ExitOnFailure1(hr, "failed to get component attributes for
XmlConfig: %ls", (*ppxfcTail)->wzId);
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-devs