Author: hbelusca Date: Sat Dec 27 19:16:05 2014 New Revision: 65852
URL: http://svn.reactos.org/svn/reactos?rev=65852&view=rev Log: [WIN32K] - Put GDI initialization function(s) in a dedicated file. - Whitespace fixes...
Added: trunk/reactos/win32ss/gdi/ntgdi/init.c (with props) Modified: trunk/reactos/win32ss/CMakeLists.txt trunk/reactos/win32ss/gdi/eng/stubs.c trunk/reactos/win32ss/include/ntuser.h trunk/reactos/win32ss/user/ntuser/main.c trunk/reactos/win32ss/user/ntuser/ntuser.c
Modified: trunk/reactos/win32ss/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/CMakeLists.txt?rev=... ============================================================================== --- trunk/reactos/win32ss/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/win32ss/CMakeLists.txt [iso-8859-1] Sat Dec 27 19:16:05 2014 @@ -167,6 +167,7 @@ gdi/ntgdi/gdiobj.c gdi/ntgdi/gdipool.c gdi/ntgdi/icm.c + gdi/ntgdi/init.c gdi/ntgdi/line.c gdi/ntgdi/metafile.c gdi/ntgdi/palette.c
Modified: trunk/reactos/win32ss/gdi/eng/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/stubs.c?rev... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/stubs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/stubs.c [iso-8859-1] Sat Dec 27 19:16:05 2014 @@ -1538,16 +1538,6 @@ }
/* - * @implemented - */ -BOOL -APIENTRY -NtGdiInit(VOID) -{ - return TRUE; -} - -/* * @unimplemented */ ULONG
Added: trunk/reactos/win32ss/gdi/ntgdi/init.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/init.c?re... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/init.c (added) +++ trunk/reactos/win32ss/gdi/ntgdi/init.c [iso-8859-1] Sat Dec 27 19:16:05 2014 @@ -0,0 +1,25 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Win32k subsystem + * PURPOSE: Initialization of GDI + * FILE: win32ss/gdi/ntgdi/init.c + * PROGRAMER: + */ + +#include <win32k.h> + +#define NDEBUG +#include <debug.h> +#include <kdros.h> + +/* + * @implemented + */ +BOOL +APIENTRY +NtGdiInit(VOID) +{ + return TRUE; +} + +/* EOF */
Propchange: trunk/reactos/win32ss/gdi/ntgdi/init.c ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/win32ss/include/ntuser.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?re... ============================================================================== --- trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] Sat Dec 27 19:16:05 2014 @@ -973,6 +973,10 @@ DWORD dwInstalledEventHooks; PERUSERSERVERINFO; } SERVERINFO, *PSERVERINFO; + +#ifdef _M_IX86 +C_ASSERT(sizeof(SERVERINFO) <= PAGE_SIZE); +#endif
// Server event activity bits.
Modified: trunk/reactos/win32ss/user/ntuser/main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/main.c?... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/main.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/main.c [iso-8859-1] Sat Dec 27 19:16:05 2014 @@ -732,10 +732,6 @@ ResetCsrApiPort(); ResetCsrProcess(); } - -#ifdef _M_IX86 -C_ASSERT(sizeof(SERVERINFO) <= PAGE_SIZE); -#endif
// Return on failure #define NT_ROF(x) \
Modified: trunk/reactos/win32ss/user/ntuser/ntuser.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntuser.... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/ntuser.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/ntuser.c [iso-8859-1] Sat Dec 27 19:16:05 2014 @@ -2,13 +2,13 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * PURPOSE: ntuser init. and main funcs. - * FILE: subsystems/win32/win32k/ntuser/ntuser.c + * FILE: win32ss/user/ntuser/ntuser.c */
#include <win32k.h> DBG_DEFAULT_CHANNEL(UserMisc);
-/* GLOBALS *******************************************************************/ +/* GLOBALS ********************************************************************/
PTHREADINFO gptiCurrent = NULL; PPROCESSINFO gppiInputProvider = NULL; @@ -21,73 +21,72 @@ BOOL ClientPfnInit = FALSE; ATOM gaGuiConsoleWndClass;
-/* PRIVATE FUNCTIONS *********************************************************/ +/* PRIVATE FUNCTIONS **********************************************************/
static NTSTATUS FASTCALL InitUserAtoms(VOID) { - - gpsi->atomSysClass[ICLS_MENU] = 32768; - gpsi->atomSysClass[ICLS_DESKTOP] = 32769; - gpsi->atomSysClass[ICLS_DIALOG] = 32770; - gpsi->atomSysClass[ICLS_SWITCH] = 32771; - gpsi->atomSysClass[ICLS_ICONTITLE] = 32772; - gpsi->atomSysClass[ICLS_TOOLTIPS] = 32774; - - /* System Message Atom */ - AtomMessage = IntAddGlobalAtom(L"Message", TRUE); - gpsi->atomSysClass[ICLS_HWNDMESSAGE] = AtomMessage; - - /* System Context Help Id Atom */ - gpsi->atomContextHelpIdProp = IntAddGlobalAtom(L"SysCH", TRUE); - - gpsi->atomIconSmProp = IntAddGlobalAtom(L"SysICS", TRUE); - gpsi->atomIconProp = IntAddGlobalAtom(L"SysIC", TRUE); - - gpsi->atomFrostedWindowProp = IntAddGlobalAtom(L"SysFrostedWindow", TRUE); - - /* - * FIXME: AddPropW uses the global kernel atom table, thus leading to conflicts if we use - * the win32k atom table for this ones. What is the right thing to do ? - */ - // AtomWndObj = IntAddGlobalAtom(L"SysWNDO", TRUE); - NtAddAtom(L"SysWNDO", 14, &AtomWndObj); - AtomLayer = IntAddGlobalAtom(L"SysLayer", TRUE); - AtomFlashWndState = IntAddGlobalAtom(L"FlashWState", TRUE); - - return STATUS_SUCCESS; -} - -/* FUNCTIONS *****************************************************************/ + gpsi->atomSysClass[ICLS_MENU] = 32768; + gpsi->atomSysClass[ICLS_DESKTOP] = 32769; + gpsi->atomSysClass[ICLS_DIALOG] = 32770; + gpsi->atomSysClass[ICLS_SWITCH] = 32771; + gpsi->atomSysClass[ICLS_ICONTITLE] = 32772; + gpsi->atomSysClass[ICLS_TOOLTIPS] = 32774; + + /* System Message Atom */ + AtomMessage = IntAddGlobalAtom(L"Message", TRUE); + gpsi->atomSysClass[ICLS_HWNDMESSAGE] = AtomMessage; + + /* System Context Help Id Atom */ + gpsi->atomContextHelpIdProp = IntAddGlobalAtom(L"SysCH", TRUE); + + gpsi->atomIconSmProp = IntAddGlobalAtom(L"SysICS", TRUE); + gpsi->atomIconProp = IntAddGlobalAtom(L"SysIC", TRUE); + + gpsi->atomFrostedWindowProp = IntAddGlobalAtom(L"SysFrostedWindow", TRUE); + + /* + * FIXME: AddPropW uses the global kernel atom table, thus leading to conflicts if we use + * the win32k atom table for this ones. What is the right thing to do ? + */ + // AtomWndObj = IntAddGlobalAtom(L"SysWNDO", TRUE); + NtAddAtom(L"SysWNDO", 14, &AtomWndObj); + AtomLayer = IntAddGlobalAtom(L"SysLayer", TRUE); + AtomFlashWndState = IntAddGlobalAtom(L"FlashWState", TRUE); + + return STATUS_SUCCESS; +} + +/* FUNCTIONS ******************************************************************/
INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID) { - NTSTATUS Status; - - ExInitializeResourceLite(&UserLock); - - if (!UserCreateHandleTable()) - { - ERR("Failed creating handle table\n"); - return STATUS_INSUFFICIENT_RESOURCES; - } - - Status = InitSessionImpl(); - if (!NT_SUCCESS(Status)) - { - ERR("Error init session impl.\n"); - return Status; - } - - InitUserAtoms(); - - InitSysParams(); - - return STATUS_SUCCESS; + NTSTATUS Status; + + ExInitializeResourceLite(&UserLock); + + if (!UserCreateHandleTable()) + { + ERR("Failed creating handle table\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + Status = InitSessionImpl(); + if (!NT_SUCCESS(Status)) + { + ERR("Error init session impl.\n"); + return Status; + } + + InitUserAtoms(); + + InitSysParams(); + + return STATUS_SUCCESS; }
NTSTATUS @@ -110,7 +109,7 @@ Status = UserCreateWinstaDirectory(); if (!NT_SUCCESS(Status)) return Status;
- /* Initialize Video. */ + /* Initialize Video */ Status = InitVideo(); if (!NT_SUCCESS(Status)) return Status;
@@ -123,7 +122,7 @@ // Create ThreadInfo for this Thread! // {
- /* Initialize the current thread. */ + /* Initialize the current thread */ Status = UserCreateThreadInfo(PsGetCurrentThread()); if (!NT_SUCCESS(Status)) return Status;
@@ -135,10 +134,10 @@
if (gpsi->hbrGray == NULL) { - hPattern55AABitmap = GreCreateBitmap(8, 8, 1, 1, (LPBYTE)wPattern55AA); - gpsi->hbrGray = IntGdiCreatePatternBrush(hPattern55AABitmap); - GreDeleteObject(hPattern55AABitmap); - GreSetBrushOwner(gpsi->hbrGray, GDI_OBJ_HMGR_PUBLIC); + hPattern55AABitmap = GreCreateBitmap(8, 8, 1, 1, (LPBYTE)wPattern55AA); + gpsi->hbrGray = IntGdiCreatePatternBrush(hPattern55AABitmap); + GreDeleteObject(hPattern55AABitmap); + GreSetBrushOwner(gpsi->hbrGray, GDI_OBJ_HMGR_PUBLIC); }
return STATUS_SUCCESS; @@ -150,9 +149,9 @@ NTSTATUS APIENTRY NtUserInitialize( - DWORD dwWinVersion, - HANDLE hPowerRequestEvent, - HANDLE hMediaRequestEvent) + DWORD dwWinVersion, + HANDLE hPowerRequestEvent, + HANDLE hMediaRequestEvent) { NTSTATUS Status;
@@ -201,38 +200,40 @@ */ BOOL FASTCALL UserIsEntered(VOID) { - return ExIsResourceAcquiredExclusiveLite(&UserLock) - || ExIsResourceAcquiredSharedLite(&UserLock); + return ExIsResourceAcquiredExclusiveLite(&UserLock) || + ExIsResourceAcquiredSharedLite(&UserLock); }
BOOL FASTCALL UserIsEnteredExclusive(VOID) { - return ExIsResourceAcquiredExclusiveLite(&UserLock); + return ExIsResourceAcquiredExclusiveLite(&UserLock); }
VOID FASTCALL CleanupUserImpl(VOID) { - ExDeleteResourceLite(&UserLock); + ExDeleteResourceLite(&UserLock); }
VOID FASTCALL UserEnterShared(VOID) { - KeEnterCriticalRegion(); - ExAcquireResourceSharedLite(&UserLock, TRUE); + KeEnterCriticalRegion(); + ExAcquireResourceSharedLite(&UserLock, TRUE); }
VOID FASTCALL UserEnterExclusive(VOID) { - ASSERT_NOGDILOCKS(); - KeEnterCriticalRegion(); - ExAcquireResourceExclusiveLite(&UserLock, TRUE); - gptiCurrent = PsGetCurrentThreadWin32Thread(); + ASSERT_NOGDILOCKS(); + KeEnterCriticalRegion(); + ExAcquireResourceExclusiveLite(&UserLock, TRUE); + gptiCurrent = PsGetCurrentThreadWin32Thread(); }
VOID FASTCALL UserLeave(VOID) { - ASSERT_NOGDILOCKS(); - ASSERT(UserIsEntered()); - ExReleaseResourceLite(&UserLock); - KeLeaveCriticalRegion(); -} + ASSERT_NOGDILOCKS(); + ASSERT(UserIsEntered()); + ExReleaseResourceLite(&UserLock); + KeLeaveCriticalRegion(); +} + +/* EOF */