commdlg: Fix PrintDlg parameter checks.
This commit is contained in:
parent
97194ec070
commit
93475667a0
|
@ -107,6 +107,8 @@ BOOL16 WINAPI PrintDlg16( LPPRINTDLG16 lppd )
|
||||||
PRINTDLGA pd32;
|
PRINTDLGA pd32;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
|
if (!lppd) return PrintDlgA(NULL); /* generate failure with CDERR_INITIALIZATION */
|
||||||
|
|
||||||
pd32.lStructSize = sizeof(pd32);
|
pd32.lStructSize = sizeof(pd32);
|
||||||
pd32.Flags = lppd->Flags & ~(PD_ENABLEPRINTTEMPLATE | PD_ENABLEPRINTTEMPLATEHANDLE |
|
pd32.Flags = lppd->Flags & ~(PD_ENABLEPRINTTEMPLATE | PD_ENABLEPRINTTEMPLATEHANDLE |
|
||||||
PD_ENABLESETUPTEMPLATE | PD_ENABLESETUPTEMPLATEHANDLE |
|
PD_ENABLESETUPTEMPLATE | PD_ENABLESETUPTEMPLATEHANDLE |
|
||||||
|
@ -128,6 +130,9 @@ BOOL16 WINAPI PrintDlg16( LPPRINTDLG16 lppd )
|
||||||
if (lppd->Flags & PD_ENABLESETUPHOOK)
|
if (lppd->Flags & PD_ENABLESETUPHOOK)
|
||||||
FIXME( "custom setup hook %p no longer supported\n", lppd->lpfnSetupHook );
|
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 )))
|
if ((ret = PrintDlgA( &pd32 )))
|
||||||
{
|
{
|
||||||
lppd->hDC = HDC_16( pd32.hDC );
|
lppd->hDC = HDC_16( pd32.hDC );
|
||||||
|
|
Loading…
Reference in New Issue