Commit 93475667 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

commdlg: Fix PrintDlg parameter checks.

parent 97194ec0
......@@ -107,6 +107,8 @@ BOOL16 WINAPI PrintDlg16( LPPRINTDLG16 lppd )
PRINTDLGA pd32;
BOOL ret;
if (!lppd) return PrintDlgA(NULL); /* generate failure with CDERR_INITIALIZATION */
pd32.lStructSize = sizeof(pd32);
pd32.Flags = lppd->Flags & ~(PD_ENABLEPRINTTEMPLATE | PD_ENABLEPRINTTEMPLATEHANDLE |
PD_ENABLESETUPTEMPLATE | PD_ENABLESETUPTEMPLATEHANDLE |
......@@ -128,6 +130,9 @@ BOOL16 WINAPI PrintDlg16( LPPRINTDLG16 lppd )
if (lppd->Flags & PD_ENABLESETUPHOOK)
FIXME( "custom setup hook %p no longer supported\n", lppd->lpfnSetupHook );
/* Generate failure with CDERR_STRUCTSIZE, when needed */
if (lppd->lStructSize != sizeof(PRINTDLG16)) pd32.lStructSize--;
if ((ret = PrintDlgA( &pd32 )))
{
lppd->hDC = HDC_16( pd32.hDC );
......
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