Vincent Béron wrote:
Le ven 13/08/2004 à 20:42, Alexandre Julliard a écrit :
ChangeSet ID: 13294 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@wine.codeweavers.com 2004/08/13 19:42:35
Modified files: dlls/commdlg : fontdlg.c
Log message: Jacek Caban jack@itma.pwr.wroc.pl Fix a bug in passing parameters to CFn_WMInitDialog and CFn_WMCommand in FormatCharDlgProcW.
Patch: http://cvs.winehq.org/patch.py?id=13294
Old revision New revision Changes Path 1.69 1.70 +2 -5 wine/dlls/commdlg/fontdlg.c
At least the last part of this patch looks wrong.
return CFn_WMCommand(hDlg, wParam, lParam, lpcf32a);
return CFn_WMCommand(hDlg, wParam, lParam,
(LPCHOOSEFONTW)lpcf32w);
This cast is absolutely non-sense, as lpcf32w is already a LPCHOOSEFONTW. Aslo, CFn_WMCommand expects a LPCHOOSEFONTA as its fourth parameter, not a LPCHOOSEFONTW.
It should be LPCHOOSEFONTA. Sory for that.
Maybe just changing the cast to LPCHOOSEFONTA would work, but a quick glance in CFn_WMCommand told me it uses some A fields of that structure, so maybe it's not enough and we'll need to actually do a conversion (or transform CFn_WMCommand to expect a LPCHOOSEFONTW).
I've tested this usng notepad and it works fine. Absolutely non-sense was cast that my patch changes. It didn't work without my patch. Applications failed with segmentation fault.
Vincent
I've attached patch.
Thanks, Jacek