Quantcast

Qustion about wixca: XmlConfig:ReadXmlConfigTable, XmlFile:ReadXmlFileTable

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Qustion about wixca: XmlConfig:ReadXmlConfigTable, XmlFile:ReadXmlFileTable

Hoover, Jacob

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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Qustion about wixca: XmlConfig:ReadXmlConfigTable, XmlFile:ReadXmlFileTable

Bob Arnson-6
On 05-May-12 19:32, Hoover, Jacob wrote:

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?

Yes. Depending on the error, the destination might not have any useful data. Please file a bug so we can track it.

-- 
sig://boB
http://joyofsetup.com/

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Qustion about wixca: XmlConfig:ReadXmlConfigTable, XmlFile:ReadXmlFileTable

Hoover, Jacob

https://sourceforge.net/tracker/?func=detail&aid=3524147&group_id=105970&atid=642714

 

 

Logged, though the more I think of it if an allocation fails the probability of the error message being able to print is quite low. I’d guess in the case where the string copy fails for a reason other than an out of memory error this would still be valid.

 

From: Bob Arnson [mailto:[hidden email]]
Sent: Sunday, May 06, 2012 11:41 AM
To: [hidden email]
Subject: Re: [WiX-devs] Qustion about wixca: XmlConfig:ReadXmlConfigTable, XmlFile:ReadXmlFileTable

 

On 05-May-12 19:32, Hoover, Jacob wrote:

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?

Yes. Depending on the error, the destination might not have any useful data. Please file a bug so we can track it.


-- 
sig://boB
http://joyofsetup.com/

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-devs
Loading...