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