comdlg32: Validate more parameters in PrintDlgEx.
This commit is contained in:
parent
65ab4b2cf0
commit
c2aeac3cc0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue