W->A dlls/commdlg/fontdlg.c

Tony Lambregts tony_lambregts at telusplanet.net
Sun Mar 16 13:38:31 CST 2003

On Dimi's Janitorial page he has the entry for:

dlls/commdlg/fontdlg.c: comdlg32: ChooseFontW: illegal call to HEAP_strdupWtoA

When I look at the actual call I see that it is inside a comment block (#if 
0... #endif) Although the actual implentation of ChooseFontW does not make 
direct W->A calls, this whole setup for ChooseFont(A/W) is IMO a mess and just 
not right.

     CHOOSEFONTA     cf_a;
     LOGFONTA	    lf_a;
     CHAR    	    style_a[LF_FACESIZE];

     cf_a.lpLogFont = &lf_a;
     cf_a.lpszStyle = style_a;

     if (ChooseFontWtoA(lpChFont, &cf_a) == FALSE)
	return FALSE;

     if (ChooseFontA(&cf_a) == FALSE)
     	if (cf_a.lpTemplateName != NULL)
     	    HeapFree(GetProcessHeap(), 0, (LPSTR)(cf_a.lpTemplateName));
	return FALSE;

     ChooseFontAtoW(&cf_a, lpChFont);

     return TRUE;

I would appreciate Any comments about this.


Tony Lambregts

More information about the wine-devel mailing list