Don't use invalid pointer in file dialog hook procedure in wxMSW.
We can receive WM_NOTIFY for other than CDN_XXX messages if we have a native control as our immediate child (which can happen with "extra" controls) and the LPARAM is not a pointer to OFNOTIFY at all in this case, so don't try to use it as such. This fixes a crash when adding a "bare" extra control, see #16003. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -171,6 +171,9 @@ wxFileDialogHookFunction(HWND hDlg,
|
||||
#endif // __WXWINCE__
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR* const pNM = reinterpret_cast<NMHDR*>(lParam);
|
||||
if ( pNM->code >= CDN_FIRST && pNM->code < CDN_LAST )
|
||||
{
|
||||
OFNOTIFY* const
|
||||
pNotifyCode = reinterpret_cast<OFNOTIFY *>(lParam);
|
||||
@@ -190,6 +193,7 @@ wxFileDialogHookFunction(HWND hDlg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
|
Reference in New Issue
Block a user