diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c index 6c454ae4d87..62dc07c62a6 100644 --- a/win32ss/user/ntuser/menu.c +++ b/win32ss/user/ntuser/menu.c @@ -4580,6 +4580,13 @@ BOOL WINAPI IntTrackPopupMenuEx( PMENU menu, UINT wFlags, int x, int y, BOOL ret = FALSE; PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); + if (lpTpm && lpTpm->cbSize != sizeof(*lpTpm)) + { + ERR("Invalid TPMPARAMS size: got %u, expected %zu\n", lpTpm->cbSize, sizeof(*lpTpm)); + EngSetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if (pti != pWnd->head.pti) { ERR("Must be the same pti!\n");