Commit 55fe39e0 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

comdlg32: Do not crash with PageSetupDlg(NULL).

parent d1d0c97c
......@@ -3383,6 +3383,11 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) {
PageSetupDataA *pda;
PRINTDLGA pdlg;
if (setupdlg == NULL) {
COMDLG32_SetCommDlgExtendedError(CDERR_INITIALIZATION);
return FALSE;
}
/* TRACE */
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";
......@@ -3399,11 +3404,8 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) {
setupdlg->hDevNames,
setupdlg->hInstance, setupdlg->Flags, flagstr);
}
/* Checking setupdlg structure */
if (setupdlg == NULL) {
COMDLG32_SetCommDlgExtendedError(CDERR_INITIALIZATION);
return FALSE;
}
if(setupdlg->lStructSize != sizeof(PAGESETUPDLGA)) {
COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE);
return FALSE;
......@@ -3488,6 +3490,12 @@ BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW setupdlg) {
PRINTDLGW pdlg;
FIXME("Unicode implementation is not done yet\n");
if (setupdlg == NULL) {
COMDLG32_SetCommDlgExtendedError(CDERR_INITIALIZATION);
return FALSE;
}
if(TRACE_ON(commdlg)) {
char flagstr[1000] = "";
const struct pd_flags *pflag = psd_flags;
......
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