[RESEND] [ole] Avoid converting variants if it is not needed

Alessandro Pignotti a.pignotti at sssup.it
Thu Mar 8 10:38:26 CST 2012


Hi Everyone,

This patch implements an optimization in an OLE code path: when a
variant argument type is the same as the expected type it will not be
converted, but used as it is.

This patch looks big, but it's basically just the footprint of moving
some code inside an if-else.

The rationale behind this, beside optimization, is that even if MSDN
states that memory used for BSTRs should be allocated using
SysAllocString I've found a code sample that seems to be using plain
HeapAlloc for it. With this optimization such variant is never copied
and so the broken behavior of the application does not cause problems.

Regards,
Alessandro Pignotti

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Avoid-converting-variants-if-it-is-not-needed.patch
Type: text/x-patch
Size: 8724 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120308/30c79788/attachment.bin>


More information about the wine-patches mailing list