From 87d4eb75dc69f404c8bc8cdaff58c02a71474bd3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 2 Nov 2013 12:41:38 +0000 Subject: [PATCH] [WIN32K] - Don't ASSERT the correct ConsoleCtrlInfoLength in NtUserConsoleControl - Move GreSetObjectOwnerEx out of the SEH block. svn path=/trunk/; revision=60829 --- reactos/win32ss/user/ntuser/ntstubs.c | 29 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/reactos/win32ss/user/ntuser/ntstubs.c b/reactos/win32ss/user/ntuser/ntstubs.c index ab165f45f89..ff1c07c7bbd 100644 --- a/reactos/win32ss/user/ntuser/ntstubs.c +++ b/reactos/win32ss/user/ntuser/ntstubs.c @@ -560,9 +560,14 @@ NtUserConsoleControl( { case GuiConsoleWndClassAtom: { + if (ConsoleCtrlInfoLength != sizeof(ATOM)) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + break; + } + _SEH2_TRY { - ASSERT(ConsoleCtrlInfoLength == sizeof(ATOM)); ProbeForRead(ConsoleCtrlInfo, ConsoleCtrlInfoLength, 1); gaGuiConsoleWndClass = *(ATOM*)ConsoleCtrlInfo; } @@ -577,17 +582,18 @@ NtUserConsoleControl( case ConsoleMakePalettePublic: { + HPALETTE hPalette; + + if (ConsoleCtrlInfoLength != sizeof(HPALETTE)) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + break; + } + _SEH2_TRY { - ASSERT(ConsoleCtrlInfoLength == sizeof(HPALETTE)); ProbeForRead(ConsoleCtrlInfo, ConsoleCtrlInfoLength, 1); - /* - * Make the palette handle public - Use the extended - * function introduced by Timo in revision 60725. - */ - GreSetObjectOwnerEx(*(HPALETTE*)ConsoleCtrlInfo, - GDI_OBJ_HMGR_PUBLIC, - GDIOBJFLAG_IGNOREPID); + hPalette = *(HPALETTE*)ConsoleCtrlInfo; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -595,6 +601,11 @@ NtUserConsoleControl( } _SEH2_END; + /* Make the palette handle public */ + GreSetObjectOwnerEx(hPalette, + GDI_OBJ_HMGR_PUBLIC, + GDIOBJFLAG_IGNOREPID); + break; }