comdlg32: Validate more parameters in PrintDlgEx.

This commit is contained in:
Detlef Riekenberg 2012-03-18 22:14:18 +01:00 committed by Alexandre Julliard
parent 65ab4b2cf0
commit c2aeac3cc0
1 changed files with 28 additions and 0 deletions

View File

@ -3785,6 +3785,20 @@ HRESULT WINAPI PrintDlgExA(LPPRINTDLGEXA lppd)
if (!IsWindow(lppd->hwndOwner))
return E_HANDLE;
if (lppd->nStartPage != START_PAGE_GENERAL)
{
if (!lppd->nPropertyPages)
return E_INVALIDARG;
FIXME("custom property sheets (%d at %p) not supported\n", lppd->nPropertyPages, lppd->lphPropertyPages);
}
/* Use PD_NOPAGENUMS or set nMaxPageRanges and lpPageRanges */
if (!(lppd->Flags & PD_NOPAGENUMS) && (!lppd->nMaxPageRanges || !lppd->lpPageRanges))
{
return E_INVALIDARG;
}
if (lppd->Flags & PD_RETURNDEFAULT)
{
PRINTER_INFO_2A *pbuf;
@ -3909,6 +3923,20 @@ HRESULT WINAPI PrintDlgExW(LPPRINTDLGEXW lppd)
return E_HANDLE;
}
if (lppd->nStartPage != START_PAGE_GENERAL)
{
if (!lppd->nPropertyPages)
return E_INVALIDARG;
FIXME("custom property sheets (%d at %p) not supported\n", lppd->nPropertyPages, lppd->lphPropertyPages);
}
/* Use PD_NOPAGENUMS or set nMaxPageRanges and lpPageRanges */
if (!(lppd->Flags & PD_NOPAGENUMS) && (!lppd->nMaxPageRanges || !lppd->lpPageRanges))
{
return E_INVALIDARG;
}
if (lppd->Flags & PD_RETURNDEFAULT) {
PRINTER_INFO_2W *pbuf;
DRIVER_INFO_2W *dbuf;