Author: jgardou
Date: Tue Feb 21 18:00:50 2012
New Revision: 55784
URL:
http://svn.reactos.org/svn/reactos?rev=55784&view=rev
Log:
[WIN32K]
- allocate FAST_MUTEX objects from non paged pool.
This should ix a bunch of weird testbot failures.
Any suggestion on the TAG is welcome
Modified:
trunk/reactos/subsystems/win32/win32k/include/tags.h
trunk/reactos/subsystems/win32/win32k/include/text.h
trunk/reactos/subsystems/win32/win32k/ntuser/timer.c
trunk/reactos/subsystems/win32/win32k/objects/freetype.c
Modified: trunk/reactos/subsystems/win32/win32k/include/tags.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/tags.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/tags.h [iso-8859-1] Tue Feb 21 18:00:50
2012
@@ -1,19 +1,20 @@
#pragma once
-#define TAG_STRING ' RTS' /* String */
-#define TAG_HOOK 'ohsU' /* Hook */
-#define TAG_MENUITEM 'emsU' /* Menu item */
-#define TAG_MSG 'GSEM' /* Message */
-#define TAG_USRMSG 'GSMU' /* User message */
-#define TAG_SBARINFO 'NIBS' /* Scrollbar info */
-#define TAG_TIMERBMP 'BMIT' /* Timers bitmap */
-#define TAG_WINSTA 'ATSW' /* Window station */
-#define TAG_FONT 'ETNF' /* Font entry */
-#define TAG_BEZIER 'RZEB' /* Bezier */
-#define TAG_SHAPE 'phSG' /* Shape */
-#define TAG_COLORMAP 'MLOC' /* Color map */
-#define TAG_GDIHNDTBLE 'bthG' /* GDI handle table */
-#define TAG_DIB ' BID' /* Dib */
+#define TAG_STRING ' RTS' /* String */
+#define TAG_HOOK 'ohsU' /* Hook */
+#define TAG_MENUITEM 'emsU' /* Menu item */
+#define TAG_MSG 'GSEM' /* Message */
+#define TAG_USRMSG 'GSMU' /* User message */
+#define TAG_SBARINFO 'NIBS' /* Scrollbar info */
+#define TAG_TIMERBMP 'BMIT' /* Timers bitmap */
+#define TAG_WINSTA 'ATSW' /* Window station */
+#define TAG_FONT 'ETNF' /* Font entry */
+#define TAG_BEZIER 'RZEB' /* Bezier */
+#define TAG_SHAPE 'phSG' /* Shape */
+#define TAG_COLORMAP 'MLOC' /* Color map */
+#define TAG_GDIHNDTBLE 'bthG' /* GDI handle table */
+#define TAG_DIB ' BID' /* Dib */
+#define TAG_INTERNAL_SYNC 'sync' /* Internal synchronization object. Waiting for
a better suggestion than 'sync' */
/* GDI objects from the handle table */
#define TAG_DC GDITAG_HMGR_LOOKASIDE_DC_TYPE
Modified: trunk/reactos/subsystems/win32/win32k/include/text.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] Tue Feb 21 18:00:50
2012
@@ -115,15 +115,3 @@
#define IntUnLockProcessPrivateFonts(W32Process) \
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&W32Process->PrivateFontListLock)
-
-#define IntLockGlobalFonts \
- ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&FontListLock)
-
-#define IntUnLockGlobalFonts \
- ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&FontListLock)
-
-#define IntLockFreeType \
- ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&FreeTypeLock)
-
-#define IntUnLockFreeType \
- ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&FreeTypeLock)
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Tue Feb 21 18:00:50
2012
@@ -21,7 +21,7 @@
/* Windows 2000 has room for 32768 window-less timers */
#define NUM_WINDOW_LESS_TIMERS 32768
-static FAST_MUTEX Mutex;
+static PFAST_MUTEX Mutex;
static RTL_BITMAP WindowLessTimersBitMap;
static PVOID WindowLessTimersBitMapBuffer;
static ULONG HintIndex = 1;
@@ -29,10 +29,10 @@
ERESOURCE TimerLock;
#define IntLockWindowlessTimerBitmap() \
- ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&Mutex)
+ ExEnterCriticalRegionAndAcquireFastMutexUnsafe(Mutex)
#define IntUnlockWindowlessTimerBitmap() \
- ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&Mutex)
+ ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(Mutex)
#define TimerEnterExclusive() \
{ \
@@ -584,8 +584,10 @@
InitTimerImpl(VOID)
{
ULONG BitmapBytes;
-
- ExInitializeFastMutex(&Mutex);
+
+ /* Allocate FAST_MUTEX from non paged pool */
+ Mutex = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX), TAG_INTERNAL_SYNC);
+ ExInitializeFastMutex(Mutex);
BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(NonPagedPool, BitmapBytes,
TAG_TIMERBMP);
Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Tue Feb 21
18:00:50 2012
@@ -32,11 +32,23 @@
/* The FreeType library is not thread safe, so we have
to serialize access to it */
-static FAST_MUTEX FreeTypeLock;
+static PFAST_MUTEX FreeTypeLock;
static LIST_ENTRY FontListHead;
-static FAST_MUTEX FontListLock;
+static PFAST_MUTEX FontListLock;
static BOOL RenderingEnabled = TRUE;
+
+#define IntLockGlobalFonts \
+ ExEnterCriticalRegionAndAcquireFastMutexUnsafe(FontListLock)
+
+#define IntUnLockGlobalFonts \
+ ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(FontListLock)
+
+#define IntLockFreeType \
+ ExEnterCriticalRegionAndAcquireFastMutexUnsafe(FreeTypeLock)
+
+#define IntUnLockFreeType \
+ ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(FreeTypeLock)
#define MAX_FONT_CACHE 256
@@ -128,8 +140,11 @@
InitializeListHead(&FontListHead);
InitializeListHead(&FontCacheListHead);
FontCacheNumEntries = 0;
- ExInitializeFastMutex(&FontListLock);
- ExInitializeFastMutex(&FreeTypeLock);
+ /* Fast Mutexes must be allocated from non paged pool */
+ FontListLock = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX),
TAG_INTERNAL_SYNC);
+ ExInitializeFastMutex(FontListLock);
+ FreeTypeLock = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX),
TAG_INTERNAL_SYNC);
+ ExInitializeFastMutex(FreeTypeLock);
ulError = FT_Init_FreeType(&library);
if (ulError)