François Jacques francois.jacques at
Fri Feb 16 07:17:06 CST 2001


Where's HEAP_strudupAtoW called from? For all OLE/COM DLLs, strings should
be internally stored as OLECHAR* (wchar_t*) strings. I remember it wasn't
the case with typelib.c when I started playing with it. A side-effect of
that is that we had to HEAP_strdupAtoW / HEAP_strdupWtoA all over the place
in that file - making ASCII-based stored strings more expensive than
OLECHAR*-based strings (yeah yeah we're still converting back to ASCII
strings a lot, but that's for tracing - not run-time)

For all OLE/COM DLLs, I would internally store the strings as OLECHAR*
strings (or BSTR, as you wish...) wherever it makes sense to do it, e.g.
most places.


-----Message d'origine-----
De : James Hatheway <james at>
À : amohr at <amohr at>
Cc : WineHQ Devel <wine-devel at>
Date : 15 février, 2001 10:44
Objet : Re: VerQueryValue[A|W]

>> > To convert an ASCII string to Unicode, you can use the
>> > function HEAP_strdupAtoW, as in:
>> Wrong ;-)
>Yeah, I know, Huw already set me straight on that. ^_^
>> HEAP_str* is deprecated (the header file says so).
>> Use MultiByteToWideChar() or WideCharToMultiByte() instead.
>I'll admit I wrote the email when my brain wasn't quite
>working (by def'n anytime after 1am), thought to
>myself "what is that API again?", did a quick search in
>WINE, said to myself "oh HEAP_strdupAtoW"
>sent a quick email and went to bed. :)  That teaches me to
>send email without thinking.
>But that gets me to my point.  HEAP_strdupAtoW is used in
>this capacity 78 times in the WINE source tree (WtoA another
>182 times).  We should probably change it sometime, since a
>lot of people who are writing new code are sure to use
>the current code base as an example of "how to do things".
>Out of curiosity, why are we killing these macros?  They
>seem quite convenient.  If it is because they aren't in
>standard windows headers, can't we put them somewhere
>in include/wine?
>James Hatheway
>Software Designer - Macadamian Technologies, Inc.
>james at ~
>  "Man könnte froh sein, wenn die Luft so rein wäre wie das Bier"
>  "One could be happy if the air were as pure as the beer"

More information about the wine-devel mailing list