mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:41:12 +00:00
Check for valid dialog info before using it.
This commit is contained in:
parent
cff4b6d09c
commit
bb05bb62ee
1 changed files with 6 additions and 6 deletions
|
@ -211,15 +211,14 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
return 0;
|
||||
|
||||
case DM_SETDEFID:
|
||||
if (dlgInfo->flags & DF_END) return 1;
|
||||
DEFDLG_SetDefButton( hwnd, dlgInfo,
|
||||
wParam ? GetDlgItem( hwnd, wParam ) : 0 );
|
||||
if (dlgInfo && !(dlgInfo->flags & DF_END))
|
||||
DEFDLG_SetDefButton( hwnd, dlgInfo, wParam ? GetDlgItem( hwnd, wParam ) : 0 );
|
||||
return 1;
|
||||
|
||||
case DM_GETDEFID:
|
||||
if (dlgInfo && !(dlgInfo->flags & DF_END))
|
||||
{
|
||||
HWND hwndDefId;
|
||||
if (dlgInfo->flags & DF_END) return 0;
|
||||
if (dlgInfo->idResult)
|
||||
return MAKELONG( dlgInfo->idResult, DC_HASDEFID );
|
||||
if ((hwndDefId = DEFDLG_FindDefButton( hwnd )))
|
||||
|
@ -228,7 +227,8 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
return 0;
|
||||
|
||||
case WM_NEXTDLGCTL:
|
||||
{
|
||||
if (dlgInfo)
|
||||
{
|
||||
HWND hwndDest = (HWND)wParam;
|
||||
if (!lParam)
|
||||
hwndDest = GetNextDlgTabItem(hwnd, GetFocus(), wParam);
|
||||
|
@ -252,7 +252,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
|
||||
case WM_GETFONT:
|
||||
return dlgInfo->hUserFont;
|
||||
return dlgInfo ? dlgInfo->hUserFont : 0;
|
||||
|
||||
case WM_CLOSE:
|
||||
PostMessageA( hwnd, WM_COMMAND, IDCANCEL,
|
||||
|
|
Loading…
Reference in a new issue