cleanup w->a cross calls in printdrv

James Hawkins truiken at gmail.com
Sat Aug 28 15:27:12 CDT 2004


I want to send this through wine-devel first to see if there are any
problems with it.  In gdi_private.h I had to change the parameters
that pStartDoc accepted from DOCINFOA to DOCINFOW.  I know I shouldn't
change public api headers, but this one is private so the change seems
acceptable.  If it's not let me know.  Another problem that might
popup is the way the DOCINFOW struct is filled in the StartDocA
function:

    len = MultiByteToWideChar( CP_ACP, 0, doc->lpszDocName, -1, NULL, 0 );
    docName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
    MultiByteToWideChar( CP_ACP, 0, doc->lpszDocName, -1, docName, len );

    docW.lpszDocName = docName;  <--- is this assignment a problem?

    if(docName)
        HeapFree( GetProcessHeap(), 0, (LPWSTR)docName );

The reason why I had to make a docName variable is because
docW.lpszDocName is a LPCWSTR so there were warnings when i had
docW.lpszDocName directly in the call to MultiByteToWideChar.

Changelog
    * cleanup w->a cross calls in StartDoc

-- 
James Hawkins
-------------- next part --------------
A non-text attachment was scrubbed...
Name: printdrv-wa-clean.diff
Type: text/x-patch
Size: 4389 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20040828/e81482d8/printdrv-wa-clean.bin


More information about the wine-devel mailing list