From 87424486ea409b4cb749dcb03387d6a5dba1bd27 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 17 Apr 2015 18:06:39 +0000 Subject: [PATCH] [WIN32K:NTUSER] - Fix range check in NtUserSetWindowFNID. Patch by Samuel Serapion. - Update comment on an old hack CORE-7212 #resolve svn path=/trunk/; revision=67228 --- reactos/win32ss/user/ntuser/window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index c4abda900d4..fa2cbf2be84 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -3992,9 +3992,10 @@ NtUserSetWindowFNID(HWND hWnd, // From user land we only set these. if (fnID != FNID_DESTROY) - { // Hacked so we can mark desktop~! - if ( (/*(fnID < FNID_BUTTON)*/ (fnID < FNID_FIRST) && (fnID > FNID_GHOST)) || - Wnd->fnid != 0 ) + { + /* HACK: The minimum should be FNID_BUTTON, but menu code relies on this */ + if (fnID < FNID_FIRST || fnID > FNID_GHOST || + Wnd->fnid != 0) { EngSetLastError(ERROR_INVALID_PARAMETER); RETURN( FALSE);