On Tue, Nov 19, 2002 at 09:10:31PM +0100, Stefan Leichter wrote:
Changelog
replaced CreateDCA by CreateDCW in LoadImageW to Get rid of W->A calls
Index: wine/windows/cursoricon.c
RCS file: /home/wine/wine/windows/cursoricon.c,v retrieving revision 1.56 diff -u -r1.56 cursoricon.c --- wine/windows/cursoricon.c 13 Nov 2002 19:43:53 -0000 1.56 +++ wine/windows/cursoricon.c 18 Nov 2002 21:38:42 -0000 @@ -72,6 +72,8 @@
static HDC screen_dc;
+static WCHAR DISPLAYW[] = {'D','I','S','P','L','A','Y',0};
/**********************************************************************
- ICONCACHE for cursors/icons loaded with LR_SHARED.
@@ -2052,7 +2054,7 @@ return BITMAP_Load( hinst, name, loadflags );
case IMAGE_ICON:
if (!screen_dc) screen_dc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL ); if (screen_dc) { UINT palEnts = GetSystemPaletteEntries(screen_dc, 0, 0, NULL);
I don't see the point of this at all. Why does it matter that we're calling CreateDCA here? it's not as if we're losing information by converting a Unicode to an Ascii string.
Huw.
On November 19, 2002 04:19 pm, Huw D M Davies wrote:
I don't see the point of this at all. Why does it matter that we're calling CreateDCA here? it's not as if we're losing information by converting a Unicode to an Ascii string.
Personally, I think it's much easier to say, as a policy thing: Don't have W->A calls! It's easier to detect (using winapi_check), it's easier to enforce, and it's less confusing for developers (especially new ones).
Also, the way things are going, this makes sense from a runtime standpoint, as calling an A function will most likely result in an additional runtime A->W conversion down the road.
And last, but not least, there is a lot of code in Wine that calls W functions with string constants, so it's not like a new thing, it's accepted practice.