Commit 4e527045 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

gdi32: Don't crash in StartDoc on NULL DOCINFO.

parent a9183c7e
......@@ -2155,16 +2155,29 @@ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc )
{
DC_ATTR *dc_attr;
ABORTPROC proc;
DOCINFOW info;
TRACE("%p %p\n", hdc, doc);
if (doc)
{
info = *doc;
}
else
{
memset( &info, 0, sizeof(info) );
info.cbSize = sizeof(info);
}
TRACE("DocName %s, Output %s, Datatype %s, fwType %#lx\n",
debugstr_w(doc->lpszDocName), debugstr_w(doc->lpszOutput),
debugstr_w(doc->lpszDatatype), doc->fwType);
debugstr_w(info.lpszDocName), debugstr_w(info.lpszOutput),
debugstr_w(info.lpszDatatype), info.fwType);
if (!(dc_attr = get_dc_attr( hdc ))) return SP_ERROR;
proc = (ABORTPROC)(UINT_PTR)dc_attr->abort_proc;
if (proc && !proc( hdc, 0 )) return 0;
return NtGdiStartDoc( hdc, doc, NULL, 0 );
return NtGdiStartDoc( hdc, &info, NULL, 0 );
}
/***********************************************************************
......@@ -2176,6 +2189,8 @@ INT WINAPI StartDocA( HDC hdc, const DOCINFOA *doc )
DOCINFOW docW;
INT ret, len;
if (!doc) return StartDocW(hdc, NULL);
docW.cbSize = doc->cbSize;
if (doc->lpszDocName)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment