I have been banging my head against this one for a while and need some feedback about a problem I am having. I have attached the patch to convert StartDocA to call StartDocW instead of the other way around. This patch results with StartDocW looking as follows
INT WINAPI StartDocW(HDC hdc, const DOCINFOW* doc) { INT ret = 0; DC *dc = DC_GetDCPtr( hdc );
TRACE("DocName = '%s' Output = '%s' Datatype = '%s'\n", debugstr_w(doc->lpszDocName), debugstr_w(doc->lpszOutput), debugstr_w(doc->lpszDatatype));
if(!dc) return SP_ERROR;
if (dc->funcs->pStartDoc) ret = dc->funcs->pStartDoc( dc->physDev, doc ); GDI_ReleaseObj( hdc ); return ret; }
The problem I am having is with this line.
if (dc->funcs->pStartDoc) ret = dc->funcs->pStartDoc( dc->physDev, doc );
With my patch in place I get the following error
printdrv.c: In function `StartDocW': printdrv.c:82: warning: passing arg 2 of pointer to function from incompatible pointer type
so obviously dc->funcs->pStartDoc points to a function that expects DOCINFOA* as its second parameter but I am at a loss on what to do. I have tried to trace down where "DC_GetDCPtr( hdc )" gets this information but I just ended up confused. Please help!
"Tony Lambregts" tony_lambregts@telusplanet.net wrote:
so obviously dc->funcs->pStartDoc points to a function that expects DOCINFOA* as its second parameter but I am at a loss on what to do. I have tried to trace down where "DC_GetDCPtr( hdc )" gets this information but I just ended up confused. Please help!
You also need to convert GDI driver function StartDoc to unicode. See include/gdi.h,DC_FUNCTIONS for the GDI diver entry points definition.
AFAICS only wineps currently implements support for it. See dlls/wineps/escape.c,PSDRV_StartDoc, which apparently also requires unicodification.
Dmitry Timoshkov wrote:
"Tony Lambregts" tony_lambregts@telusplanet.net wrote:
so obviously dc->funcs->pStartDoc points to a function that expects DOCINFOA* as its second parameter but I am at a loss on what to do. I have tried to trace down where "DC_GetDCPtr( hdc )" gets this information but I just ended up confused. Please help!
You also need to convert GDI driver function StartDoc to unicode. See include/gdi.h,DC_FUNCTIONS for the GDI diver entry points definition.
AFAICS only wineps currently implements support for it. See dlls/wineps/escape.c,PSDRV_StartDoc, which apparently also requires unicodification.
So if I change gdi.h like so and convert PSDRV_StartDoc to unicode I'm home free yes?
Index: include/gdi.h =================================================================== RCS file: /home/wine/wine/include/gdi.h,v retrieving revision 1.76 diff -u -r1.76 gdi.h --- include/gdi.h 3 Dec 2002 19:18:41 -0000 1.76 +++ include/gdi.h 24 Mar 2003 06:00:22 -0000 @@ -490,7 +490,7 @@ /* metafile.c */ extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh); extern HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh); -extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCSTR filename); +extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCWSTR filename);
/* region.c */ extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );
"Tony Lambregts" tony_lambregts@telusplanet.net wrote:
So if I change gdi.h like so and convert PSDRV_StartDoc to unicode I'm home free yes?
Yes.