[BROWSEUI][SHELL32] Treat OnWinEvent's result parameter as optional. CORE-14443

Windows's explorer can call it with NULL.
This commit is contained in:
Thomas Faber 2018-03-08 10:28:33 +01:00
parent 84a9284a3f
commit 0aed0fd167
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
8 changed files with 44 additions and 19 deletions

View file

@ -49,8 +49,11 @@ LRESULT CMenuToolbarBase::OnWinEventWrap(UINT uMsg, WPARAM wParam, LPARAM lParam
HRESULT CMenuToolbarBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
{
NMHDR * hdr;
HRESULT hr;
LRESULT result;
*theResult = 0;
if (theResult)
*theResult = 0;
switch (uMsg)
{
case WM_COMMAND:
@ -75,7 +78,10 @@ HRESULT CMenuToolbarBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
return S_OK;
case NM_CUSTOMDRAW:
return OnCustomDraw(reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr), theResult);
hr = OnCustomDraw(reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr), &result);
if (theResult)
*theResult = result;
return hr;
case TBN_GETINFOTIP:
return OnGetInfoTip(reinterpret_cast<LPNMTBGETINFOTIP>(hdr));