37 modified files
reactos/subsys/win32k/eng
diff -u -r1.41 -r1.42
--- bitblt.c 6 Feb 2004 20:36:31 -0000 1.41
+++ bitblt.c 24 Feb 2004 13:27:02 -0000 1.42
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: bitblt.c,v 1.41 2004/02/06 20:36:31 gvg Exp $
+/* $Id: bitblt.c,v 1.42 2004/02/24 13:27:02 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -40,6 +40,7 @@
#include <include/object.h>
#include <include/dib.h>
#include <include/surface.h>
+#include <include/eng.h>
#include <include/inteng.h>
#define NDEBUG
@@ -519,11 +520,11 @@
/* Call the driver's DrvBitBlt if available */
if (NULL != DestGDI->BitBlt)
{
- ExAcquireFastMutex(DestGDI->DriverLock);
+ IntLockGDIDriver(DestGDI);
ret = DestGDI->BitBlt(DestObj, SourceObj, Mask, ClipRegion, ColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin,
Rop4);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
}
if (! ret)
@@ -837,10 +838,10 @@
/* Drv->StretchBlt (look at http://www.osr.com/ddk/graphics/ddifncs_3ew7.htm )
SURFOBJ *psoMask // optional, if it exists, then rop4=0xCCAA, otherwise rop4=0xCCCC */
// FIXME: MaskOrigin is always NULL !
- ExAcquireFastMutex(DestGDI->DriverLock);
+ IntLockGDIDriver(DestGDI);
ret = DestGDI->StretchBlt(DestObj, SourceObj, Mask, ClipRegion, ColorTranslation,
&ca, BrushOrigin, &OutputRect, &InputRect, NULL, Mode);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
}
if (! ret)
@@ -977,10 +978,10 @@
}
DestGDI = (SURFGDI*)AccessInternalObjectFromUserObject(DestObj);
- ExAcquireFastMutex(DestGDI->DriverLock);
+ IntLockGDIDriver(DestGDI);
if (! IntEngEnter(&EnterLeaveSource, NULL, &InputRect, TRUE, &Translate, &InputObj))
{
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
return FALSE;
}
@@ -1036,14 +1037,14 @@
if (OutputRect.right <= OutputRect.left || OutputRect.bottom <= OutputRect.top)
{
IntEngLeave(&EnterLeaveSource);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
return TRUE;
}
if (! IntEngEnter(&EnterLeaveDest, DestObj, &OutputRect, FALSE, &Translate, &OutputObj))
{
IntEngLeave(&EnterLeaveSource);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
return FALSE;
}
@@ -1138,7 +1139,7 @@
IntEngLeave(&EnterLeaveDest);
IntEngLeave(&EnterLeaveSource);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
/* Dummy BitBlt to let driver know that something has changed.
0x00AA0029 is the Rop for D (no-op) */
reactos/subsys/win32k/eng
diff -u -r1.20 -r1.21
--- copybits.c 16 Jan 2004 19:32:00 -0000 1.20
+++ copybits.c 24 Feb 2004 13:27:02 -0000 1.21
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: copybits.c,v 1.20 2004/01/16 19:32:00 gvg Exp $
+/* $Id: copybits.c,v 1.21 2004/02/24 13:27:02 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -75,9 +75,9 @@
if (DestGDI->CopyBits!=NULL)
{
- ExAcquireFastMutex(DestGDI->DriverLock);
+ IntLockGDIDriver(DestGDI);
ret = DestGDI->CopyBits(Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
MouseSafetyOnDrawEnd(Source, SourceGDI);
MouseSafetyOnDrawEnd(Dest, DestGDI);
@@ -93,9 +93,9 @@
if (SourceGDI->CopyBits!=NULL)
{
- ExAcquireFastMutex(DestGDI->DriverLock);
+ IntLockGDIDriver(DestGDI);
ret = SourceGDI->CopyBits(Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
MouseSafetyOnDrawEnd(Source, SourceGDI);
MouseSafetyOnDrawEnd(Dest, DestGDI);
reactos/subsys/win32k/eng
diff -u -r1.4 -r1.5
--- gradient.c 9 Feb 2004 22:16:50 -0000 1.4
+++ gradient.c 24 Feb 2004 13:27:02 -0000 1.5
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: gradient.c,v 1.4 2004/02/09 22:16:50 weiden Exp $
+/* $Id: gradient.c,v 1.5 2004/02/24 13:27:02 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -29,6 +29,7 @@
#include <ddk/winddi.h>
#include <ddk/ntddmou.h>
+#include <include/eng.h>
#include <include/object.h>
#include <include/paint.h>
#include <include/surface.h>
@@ -549,10 +550,10 @@
pco->rclBounds.right, pco->rclBounds.bottom);
if((psoDest->iType != STYPE_BITMAP) && SurfGDI->GradientFill)
{
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
Ret = SurfGDI->GradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh,
prclExtents, pptlDitherOrg, ulMode);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
MouseSafetyOnDrawEnd(psoDest, SurfGDI);
return Ret;
}
@@ -564,10 +565,10 @@
0x00AA0029 is the Rop for D (no-op) */
if(SurfGDI->BitBlt)
{
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->BitBlt(psoDest, NULL, NULL, pco, pxlo,
prclExtents, pptlDitherOrg, NULL, NULL, NULL, 0x00AA0029);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
MouseSafetyOnDrawEnd(psoDest, SurfGDI);
return TRUE;
}
reactos/subsys/win32k/eng
diff -u -r1.29 -r1.30
--- lineto.c 16 Jan 2004 19:32:00 -0000 1.29
+++ lineto.c 24 Feb 2004 13:27:02 -0000 1.30
@@ -16,12 +16,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: lineto.c,v 1.29 2004/01/16 19:32:00 gvg Exp $
+ * $Id: lineto.c,v 1.30 2004/02/24 13:27:02 weiden Exp $
*/
#include <ddk/winddi.h>
#include <ddk/ntddmou.h>
#include <include/inteng.h>
+#include <include/eng.h>
#include <include/dib.h>
#include "clip.h"
#include "objects.h"
@@ -521,9 +522,9 @@
if (NULL != SurfGDI->LineTo)
{
/* Call the driver's DrvLineTo */
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
ret = SurfGDI->LineTo(DestSurf, Clip, Brush, x1, y1, x2, y2, /*RectBounds*/&b, mix);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
}
#if 0
reactos/subsys/win32k/eng
diff -u -r1.61 -r1.62
--- mouse.c 19 Feb 2004 21:12:09 -0000 1.61
+++ mouse.c 24 Feb 2004 13:27:02 -0000 1.62
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: mouse.c,v 1.61 2004/02/19 21:12:09 weiden Exp $
+/* $Id: mouse.c,v 1.62 2004/02/24 13:27:02 weiden Exp $
*
* PROJECT: ReactOS kernel
* PURPOSE: Mouse
@@ -154,9 +154,9 @@
return FALSE;
}
CurInfo->SafetySwitch = TRUE;
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->MovePointer(SurfObj, -1, -1, NULL);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
ExReleaseFastMutex(&CurInfo->CursorMutex);
}
@@ -224,9 +224,9 @@
ObDereferenceObject(InputWindowStation);
return FALSE;
}
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
SetPointerRect(CurInfo, &PointerRect);
CurInfo->SafetySwitch = FALSE;
}
@@ -280,9 +280,9 @@
if(CurInfo->Enabled)
{
ExAcquireFastMutex(&CurInfo->CursorMutex);
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
SetPointerRect(CurInfo, &PointerRect);
ExReleaseFastMutex(&CurInfo->CursorMutex);
}
@@ -441,9 +441,9 @@
((mouse_ox != CurInfo->x) || (mouse_oy != CurInfo->y)))
{
ExAcquireFastMutex(&CurInfo->CursorMutex);
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
SetPointerRect(CurInfo, &PointerRect);
ExReleaseFastMutex(&CurInfo->CursorMutex);
mouse_cx = 0;
@@ -471,9 +471,9 @@
((mouse_ox != CurInfo->x) || (mouse_oy != CurInfo->y)))
{
ExAcquireFastMutex(&CurInfo->CursorMutex);
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
SetPointerRect(CurInfo, &PointerRect);
ExReleaseFastMutex(&CurInfo->CursorMutex);
}
reactos/subsys/win32k/eng
diff -u -r1.17 -r1.18
--- paint.c 16 Jan 2004 19:32:00 -0000 1.17
+++ paint.c 24 Feb 2004 13:27:02 -0000 1.18
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: paint.c,v 1.17 2004/01/16 19:32:00 gvg Exp $
+/* $Id: paint.c,v 1.18 2004/02/24 13:27:02 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -32,6 +32,7 @@
#include <include/object.h>
#include <include/paint.h>
#include <include/surface.h>
+#include <include/eng.h>
#include "objects.h"
#include <include/mouse.h>
@@ -141,9 +142,9 @@
ClipRegion->rclBounds.top, ClipRegion->rclBounds.right,
ClipRegion->rclBounds.bottom);
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
ret = SurfGDI->Paint(Surface, ClipRegion, Brush, BrushOrigin, Mix);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
MouseSafetyOnDrawEnd(Surface, SurfGDI);
return ret;
}
reactos/subsys/win32k/eng
diff -u -r1.10 -r1.11
--- transblt.c 16 Jan 2004 19:32:00 -0000 1.10
+++ transblt.c 24 Feb 2004 13:27:02 -0000 1.11
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: transblt.c,v 1.10 2004/01/16 19:32:00 gvg Exp $
+/* $Id: transblt.c,v 1.11 2004/02/24 13:27:02 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -32,6 +32,7 @@
#include <ddk/ntddmou.h>
#include <ntos/minmax.h>
#include <include/dib.h>
+#include <include/eng.h>
#include <include/object.h>
#include <include/surface.h>
@@ -96,10 +97,10 @@
// FIXME: Skip creating a TempSurf if we have the same BPP and palette
EngBitBlt(TempSurf, Source, NULL, NULL, ColorTranslation, &TempRect, &SourcePoint, NULL, NULL, NULL, 0);
- ExAcquireFastMutex(DestGDI->DriverLock);
+ IntLockGDIDriver(DestGDI);
ret = DestGDI->TransparentBlt(Dest, TempSurf, Clip, NULL, DestRect, SourceRect,
TransparentColor, Reserved);
- ExReleaseFastMutex(DestGDI->DriverLock);
+ IntUnLockGDIDriver(DestGDI);
MouseSafetyOnDrawEnd(Source, SourceGDI);
MouseSafetyOnDrawEnd(Dest, DestGDI);
reactos/subsys/win32k/include
diff -u -r1.19 -r1.20
--- class.h 7 Dec 2003 10:31:21 -0000 1.19
+++ class.h 24 Feb 2004 13:27:02 -0000 1.20
@@ -34,6 +34,12 @@
NTSTATUS FASTCALL
CleanupClassImpl(VOID);
+#define IntLockProcessClasses(W32Process) \
+ ExAcquireFastMutex(&W32Process->ClassListLock)
+
+#define IntUnLockProcessClasses(W32Process) \
+ ExReleaseFastMutex(&W32Process->ClassListLock)
+
NTSTATUS STDCALL
ClassReferenceClassByName(PWNDCLASS_OBJECT *Class,
LPCWSTR ClassName);
reactos/subsys/win32k/include
diff -u -r1.5 -r1.6
--- cursoricon.h 13 Dec 2003 22:38:29 -0000 1.5
+++ cursoricon.h 24 Feb 2004 13:27:02 -0000 1.6
@@ -23,6 +23,12 @@
PCURICON_OBJECT FASTCALL IntCreateCurIconHandle(PWINSTATION_OBJECT WinStaObject);
VOID FASTCALL IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process);
+#define IntLockProcessCursorIcons(W32Process) \
+ ExAcquireFastMutex(&W32Process->CursorIconListLock)
+
+#define IntUnLockProcessCursorIcons(W32Process) \
+ ExReleaseFastMutex(&W32Process->CursorIconListLock)
+
#endif /* _WIN32K_CURSORICON_H */
/* EOF */
reactos/subsys/win32k/include
diff -u -r1.7 -r1.8
--- eng.h 25 Dec 2003 00:28:09 -0000 1.7
+++ eng.h 24 Feb 2004 13:27:02 -0000 1.8
@@ -1,6 +1,12 @@
#ifndef _WIN32K_ENG_H
#define _WIN32K_ENG_H
+#define IntLockGDIDriver(SurfGDI) \
+ ExAcquireFastMutex(SurfGDI->DriverLock)
+
+#define IntUnLockGDIDriver(SurfGDI) \
+ ExReleaseFastMutex(SurfGDI->DriverLock)
+
BOOL STDCALL EngIntersectRect (PRECTL prcDst, PRECTL prcSrc1, PRECTL prcSrc2);
VOID FASTCALL EngDeleteXlate (XLATEOBJ *XlateObj);
BOOL STDCALL
reactos/subsys/win32k/include
diff -u -r1.1 -r1.2
--- hook.h 12 Dec 2003 14:22:36 -0000 1.1
+++ hook.h 24 Feb 2004 13:27:02 -0000 1.2
@@ -27,6 +27,12 @@
LRESULT FASTCALL HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam);
VOID FASTCALL HOOK_DestroyThreadHooks(PETHREAD Thread);
+#define IntLockHookTable(HookTable) \
+ ExAcquireFastMutex(&HookTable->Lock)
+
+#define IntUnLockHookTable(HookTable) \
+ ExReleaseFastMutex(&HookTable->Lock)
+
#endif /* _WIN32K_HOOK_H */
/* EOF */
reactos/subsys/win32k/include
diff -u -r1.3 -r1.4
--- hotkey.h 18 Nov 2003 20:49:39 -0000 1.3
+++ hotkey.h 24 Feb 2004 13:27:02 -0000 1.4
@@ -36,6 +36,12 @@
VOID
UnregisterThreadHotKeys(struct _ETHREAD *Thread);
+#define IntLockHotKeys(WinStaObject) \
+ ExAcquireFastMutex(&WinStaObject->HotKeyListLock)
+
+#define IntUnLockHotKeys(WinStaObject) \
+ ExReleaseFastMutex(&WinStaObject->HotKeyListLock)
+
#endif /* _WIN32K_HOTKEY_H */
/* EOF */
reactos/subsys/win32k/include
diff -u -r1.28 -r1.29
--- menu.h 22 Feb 2004 23:40:58 -0000 1.28
+++ menu.h 24 Feb 2004 13:27:02 -0000 1.29
@@ -44,8 +44,20 @@
PMENU_OBJECT FASTCALL
IntGetMenuObject(HMENU hMenu);
-VOID FASTCALL
-IntReleaseMenuObject(PMENU_OBJECT MenuObject);
+#define IntLockMenuItems(MenuObj) \
+ ExAcquireFastMutex(&MenuObj->MenuItemsLock)
+
+#define IntUnLockMenuItems(MenuObj) \
+ ExReleaseFastMutex(&MenuObj->MenuItemsLock)
+
+#define IntLockProcessMenus(W32Process) \
+ ExAcquireFastMutex(&W32Process->MenuListLock)
+
+#define IntUnLockProcessMenus(W32Process) \
+ ExReleaseFastMutex(&W32Process->MenuListLock)
+
+#define IntReleaseMenuObject(MenuObj) \
+ ObmDereferenceObject(MenuObj)
BOOL FASTCALL
IntFreeMenuItem(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem,
reactos/subsys/win32k/include
diff -u -r1.26 -r1.27
--- msgqueue.h 29 Dec 2003 10:09:33 -0000 1.26
+++ msgqueue.h 24 Feb 2004 13:27:02 -0000 1.27
@@ -170,6 +170,22 @@
LPARAM FASTCALL MsqSetMessageExtraInfo(LPARAM lParam);
LPARAM FASTCALL MsqGetMessageExtraInfo(VOID);
+#define IntLockMessageQueue(MsgQueue) \
+ ExAcquireFastMutex(&MsgQueue->Lock)
+
+#define IntUnLockMessageQueue(MsgQueue) \
+ ExReleaseFastMutex(&MsgQueue->Lock)
+
+#define IntLockHardwareMessageQueue(MsgQueue) \
+ ExAcquireFastMutex(&MsgQueue->HardwareLock)
+
+#define IntUnLockHardwareMessageQueue(MsgQueue) \
+ ExReleaseFastMutex(&MsgQueue->HardwareLock)
+
+/* check the queue status */
+#define MsqIsSignaled(MsgQueue) \
+ ((MsgQueue->WakeBits & MsgQueue->WakeMask) || (MsgQueue->ChangedBits & MsgQueue->ChangedMask))
+
#endif /* _WIN32K_MSGQUEUE_H */
/* EOF */
reactos/subsys/win32k/include
diff -u -r1.20 -r1.21
--- object.h 16 Jan 2004 19:32:00 -0000 1.20
+++ object.h 24 Feb 2004 13:27:02 -0000 1.21
@@ -47,6 +47,12 @@
} USER_HANDLE_TABLE, *PUSER_HANDLE_TABLE;
+#define ObmpLockHandleTable(HandleTable) \
+ ExAcquireFastMutex(&HandleTable->ListLock)
+
+#define ObmpUnlockHandleTable(HandleTable) \
+ ExReleaseFastMutex(&HandleTable->ListLock)
+
ULONG FASTCALL
ObmGetReferenceCount(
PVOID ObjectBody);
reactos/subsys/win32k/include
diff -u -r1.12 -r1.13
--- painting.h 18 Jan 2004 19:19:45 -0000 1.12
+++ painting.h 24 Feb 2004 13:27:02 -0000 1.13
@@ -16,4 +16,10 @@
BOOL STDCALL
NtUserValidateRgn(HWND hWnd, HRGN hRgn);
+#define IntLockWindowUpdate(Window) \
+ ExAcquireFastMutex(&Window->UpdateLock)
+
+#define IntUnLockWindowUpdate(Window) \
+ ExReleaseFastMutex(&Window->UpdateLock)
+
#endif /* _WIN32K_PAINTING_H */
reactos/subsys/win32k/include
diff -u -r1.5 -r1.6
--- prop.h 20 Nov 2003 15:35:33 -0000 1.5
+++ prop.h 24 Feb 2004 13:27:02 -0000 1.6
@@ -8,5 +8,11 @@
ATOM Atom;
} PROPERTY, *PPROPERTY;
+#define IntLockWindowProperties(Window) \
+ ExAcquireFastMutex(&Window->PropListLock)
+
+#define IntUnLockWindowProperties(Window) \
+ ExReleaseFastMutex(&Window->PropListLock)
+
#endif /* _WIN32K_PROP_H */
reactos/subsys/win32k/include
diff -u -r1.3 -r1.4
--- text.h 26 Dec 2003 00:31:22 -0000 1.3
+++ text.h 24 Feb 2004 13:27:02 -0000 1.4
@@ -6,4 +6,22 @@
BOOL FASTCALL IntIsFontRenderingEnabled(VOID);
VOID FASTCALL IntEnableFontRendering(BOOL Enable);
+#define IntLockProcessPrivateFonts(W32Process) \
+ ExAcquireFastMutex(&W32Process->PrivateFontListLock)
+
+#define IntUnLockProcessPrivateFonts(W32Process) \
+ ExReleaseFastMutex(&W32Process->PrivateFontListLock)
+
+#define IntLockGlobalFonts \
+ ExAcquireFastMutex(&FontListLock)
+
+#define IntUnLockGlobalFonts \
+ ExReleaseFastMutex(&FontListLock)
+
+#define IntLockFreeType \
+ ExAcquireFastMutex(&FreeTypeLock)
+
+#define IntUnLockFreeType \
+ ExReleaseFastMutex(&FreeTypeLock)
+
#endif /* _WIN32K_TEXT_H */
reactos/subsys/win32k/include
diff -u -r1.49 -r1.50
--- window.h 24 Feb 2004 01:30:57 -0000 1.49
+++ window.h 24 Feb 2004 13:27:02 -0000 1.50
@@ -128,10 +128,16 @@
WndObj->OwnerThread->ThreadsProcess->UniqueProcessId
#define IntLockRelatives(WndObj) \
- ExAcquireFastMutexUnsafe(&WndObj->RelativesLock)
+ ExAcquireFastMutex(&WndObj->RelativesLock)
#define IntUnLockRelatives(WndObj) \
- ExReleaseFastMutexUnsafe(&WndObj->RelativesLock)
+ ExReleaseFastMutex(&WndObj->RelativesLock)
+
+#define IntLockThreadWindows(Thread) \
+ ExAcquireFastMutex(&Thread->WindowListLock)
+
+#define IntUnLockThreadWindows(Thread) \
+ ExReleaseFastMutex(&Thread->WindowListLock)
PWINDOW_OBJECT FASTCALL
reactos/subsys/win32k/include
diff -u -r1.9 -r1.10
--- winpos.h 23 Dec 2003 21:33:25 -0000 1.9
+++ winpos.h 24 Feb 2004 13:27:02 -0000 1.10
@@ -20,11 +20,11 @@
BOOLEAN FASTCALL
WinPosShowWindow(HWND Wnd, INT Cmd);
USHORT FASTCALL
-WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, POINT WinPoint,
+WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, POINT *WinPoint,
PWINDOW_OBJECT* Window);
VOID FASTCALL WinPosActivateOtherWindow(PWINDOW_OBJECT Window);
PINTERNALPOS FASTCALL WinPosInitInternalPos(PWINDOW_OBJECT WindowObject,
- POINT pt, PRECT RestoreRect);
+ POINT *pt, PRECT RestoreRect);
#endif /* _WIN32K_WINPOS_H */
reactos/subsys/win32k/misc
diff -u -r1.9 -r1.10
--- object.c 24 Feb 2004 01:30:57 -0000 1.9
+++ object.c 24 Feb 2004 13:27:03 -0000 1.10
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: object.c,v 1.9 2004/02/24 01:30:57 weiden Exp $
+/* $Id: object.c,v 1.10 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -36,31 +36,13 @@
#define NDEBUG
#include <debug.h>
-/* FUNCTIONS *****************************************************************/
-
-PVOID FASTCALL
-HEADER_TO_BODY(PUSER_OBJECT_HEADER ObjectHeader)
-{
- return (((PUSER_OBJECT_HEADER)ObjectHeader) + 1);
-}
+#define HEADER_TO_BODY(ObjectHeader) \
+ ((PVOID)(((PUSER_OBJECT_HEADER)ObjectHeader) + 1))
-PUSER_OBJECT_HEADER FASTCALL
-BODY_TO_HEADER(PVOID ObjectBody)
-{
- return (((PUSER_OBJECT_HEADER)ObjectBody) - 1);
-}
+#define BODY_TO_HEADER(ObjectBody) \
+ ((PUSER_OBJECT_HEADER)(((PUSER_OBJECT_HEADER)ObjectBody) - 1))
-VOID STATIC FASTCALL
-ObmpLockHandleTable(PUSER_HANDLE_TABLE HandleTable)
-{
- ExAcquireFastMutex(&HandleTable->ListLock);
-}
-
-VOID STATIC FASTCALL
-ObmpUnlockHandleTable(PUSER_HANDLE_TABLE HandleTable)
-{
- ExReleaseFastMutex(&HandleTable->ListLock);
-}
+/* FUNCTIONS *****************************************************************/
VOID FASTCALL
ObmpPerformRetentionChecks(PUSER_OBJECT_HEADER ObjectHeader)
@@ -307,10 +289,7 @@
ObjectHeader = BODY_TO_HEADER(ObjectBody);
ObjectHeader->RefCount--;
- #if 0
- if(ObjectHeader->Type == otWindow)
- DbgPrint("Dereference 0x%x: %d\n", ((PWINDOW_OBJECT)ObjectBody)->Self, ObjectHeader->RefCount);
- #endif
+
ObmpPerformRetentionChecks(ObjectHeader);
}
@@ -333,10 +312,7 @@
{
return STATUS_INVALID_PARAMETER;
}
- #if 0
- if(ObjectType == otWindow)
- DbgPrint("Reference 0x%x: %d\n", ((PWINDOW_OBJECT)ObjectBody)->Self, ObjectHeader->RefCount);
- #endif
+
ObjectHeader->RefCount++;
return STATUS_SUCCESS;
reactos/subsys/win32k/ntuser
diff -u -r1.47 -r1.48
--- class.c 19 Feb 2004 21:12:09 -0000 1.47
+++ class.c 24 Feb 2004 13:27:03 -0000 1.48
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: class.c,v 1.47 2004/02/19 21:12:09 weiden Exp $
+/* $Id: class.c,v 1.48 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -66,7 +66,7 @@
PLIST_ENTRY CurrentEntry;
PW32PROCESS Process = PsGetWin32Process();
- ExAcquireFastMutexUnsafe (&Process->ClassListLock);
+ IntLockProcessClasses(Process);
CurrentEntry = Process->ClassListHead.Flink;
while (CurrentEntry != &Process->ClassListHead)
{
@@ -76,13 +76,13 @@
{
*Class = Current;
ObmReferenceObject(Current);
- ExReleaseFastMutexUnsafe (&Process->ClassListLock);
+ IntUnLockProcessClasses(Process);
return(STATUS_SUCCESS);
}
CurrentEntry = CurrentEntry->Flink;
}
- ExReleaseFastMutexUnsafe (&Process->ClassListLock);
+ IntUnLockProcessClasses(Process);
return(STATUS_NOT_FOUND);
}
@@ -418,9 +418,9 @@
DPRINT("Failed creating window class object\n");
return((RTL_ATOM)0);
}
- ExAcquireFastMutex(&PsGetWin32Process()->ClassListLock);
+ IntLockProcessClasses(PsGetWin32Process());
InsertTailList(&PsGetWin32Process()->ClassListHead, &ClassObject->ListEntry);
- ExReleaseFastMutex(&PsGetWin32Process()->ClassListLock);
+ IntUnLockProcessClasses(PsGetWin32Process());
ObDereferenceObject(WinStaObject);
return(Atom);
}
reactos/subsys/win32k/ntuser
diff -u -r1.18 -r1.19
--- focus.c 24 Feb 2004 01:30:57 -0000 1.18
+++ focus.c 24 Feb 2004 13:27:03 -0000 1.19
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: focus.c,v 1.18 2004/02/24 01:30:57 weiden Exp $
+ * $Id: focus.c,v 1.19 2004/02/24 13:27:03 weiden Exp $
*/
#include <win32k/win32k.h>
@@ -26,6 +26,7 @@
#include <include/focus.h>
#include <include/error.h>
#include <include/winpos.h>
+#include <include/msgqueue.h>
#define NDEBUG
#include <win32k/debug1.h>
#include <debug.h>
@@ -174,18 +175,18 @@
/* FIXME: Call hooks. */
IntSetFocusMessageQueue(Window->MessageQueue);
- ExAcquireFastMutex(&Window->MessageQueue->Lock);
+ IntLockMessageQueue(Window->MessageQueue);
if (Window->MessageQueue)
{
Window->MessageQueue->ActiveWindow = hWnd;
}
- ExReleaseFastMutex(&Window->MessageQueue->Lock);
- ExAcquireFastMutex(&FocusWindow->MessageQueue->Lock);
+ IntUnLockMessageQueue(Window->MessageQueue);
+ IntLockMessageQueue(FocusWindow->MessageQueue);
if (FocusWindow->MessageQueue)
{
FocusWindow->MessageQueue->FocusWindow = hWndFocus;
}
- ExReleaseFastMutex(&FocusWindow->MessageQueue->Lock);
+ IntUnLockMessageQueue(FocusWindow->MessageQueue);
IntSendDeactivateMessages(hWndPrev, hWnd);
IntSendKillFocusMessages(hWndFocusPrev, hWndFocus);
@@ -278,9 +279,9 @@
/* FIXME: Call hooks. */
- ExAcquireFastMutex(&ThreadQueue->Lock);
+ IntLockMessageQueue(ThreadQueue);
ThreadQueue->ActiveWindow = hWnd;
- ExReleaseFastMutex(&ThreadQueue->Lock);
+ IntUnLockMessageQueue(ThreadQueue);
IntSendDeactivateMessages(hWndPrev, hWnd);
IntSendActivateMessages(hWndPrev, hWnd, FALSE);
@@ -305,9 +306,9 @@
return hWndPrev;
}
- ExAcquireFastMutex(&ThreadQueue->Lock);
+ IntLockMessageQueue(ThreadQueue);
ThreadQueue->FocusWindow = hWnd;
- ExReleaseFastMutex(&ThreadQueue->Lock);
+ IntUnLockMessageQueue(ThreadQueue);
IntSendKillFocusMessages(hWndPrev, hWnd);
IntSendSetFocusMessages(hWndPrev, hWnd);
@@ -411,9 +412,9 @@
}
hWndPrev = ThreadQueue->CaptureWindow;
IntSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
- ExAcquireFastMutex(&ThreadQueue->Lock);
+ IntLockMessageQueue(ThreadQueue);
ThreadQueue->CaptureWindow = hWnd;
- ExReleaseFastMutex(&ThreadQueue->Lock);
+ IntUnLockMessageQueue(ThreadQueue);
return hWndPrev;
}
reactos/subsys/win32k/ntuser
diff -u -r1.5 -r1.6
--- hook.c 19 Feb 2004 21:12:09 -0000 1.5
+++ hook.c 24 Feb 2004 13:27:03 -0000 1.6
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: hook.c,v 1.5 2004/02/19 21:12:09 weiden Exp $
+/* $Id: hook.c,v 1.6 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -106,9 +106,9 @@
Hook->HookId = HookId;
RtlInitUnicodeString(&Hook->ModuleName, NULL);
- ExAcquireFastMutex(&Table->Lock);
+ IntLockHookTable(Table);
InsertHeadList(&Table->Hooks[HOOKID_TO_INDEX(HookId)], &Hook->Chain);
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
return Hook;
}
@@ -142,7 +142,7 @@
PHOOK Hook;
PLIST_ENTRY Elem;
- ExAcquireFastMutex(&Table->Lock);
+ IntLockHookTable(Table);
Hook = IntGetFirstHook(Table, HookId);
while (NULL != Hook && NULL == Hook->Proc)
{
@@ -150,7 +150,7 @@
Hook = (Elem == &Table->Hooks[HOOKID_TO_INDEX(HookId)]
? NULL : CONTAINING_RECORD(Elem, HOOK, Chain));
}
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
return Hook;
}
@@ -163,18 +163,18 @@
int HookId = Hook->HookId;
PLIST_ENTRY Elem;
- ExAcquireFastMutex(&Table->Lock);
+ IntLockHookTable(Table);
Elem = Hook->Chain.Flink;
while (Elem != &Table->Hooks[HOOKID_TO_INDEX(HookId)])
{
Hook = CONTAINING_RECORD(Elem, HOOK, Chain);
if (NULL != Hook->Proc)
{
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
return Hook;
}
}
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
if (NULL != GlobalHooks && Table != GlobalHooks) /* now search through the global table */
{
@@ -206,7 +206,7 @@
return;
}
- ExAcquireFastMutex(&Table->Lock);
+ IntLockHookTable(Table);
if (0 != Table->Counts[HOOKID_TO_INDEX(Hook->HookId)])
{
Hook->Proc = NULL; /* chain is in use, just mark it and return */
@@ -215,7 +215,7 @@
{
IntFreeHook(Table, Hook, WinStaObj);
}
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
}
/* release a hook chain, removing deleted hooks if the use count drops to 0 */
@@ -230,12 +230,12 @@
return;
}
- ExAcquireFastMutex(&Table->Lock);
+ IntLockHookTable(Table);
/* use count shouldn't already be 0 */
ASSERT(0 != Table->Counts[HOOKID_TO_INDEX(HookId)]);
if (0 == Table->Counts[HOOKID_TO_INDEX(HookId)])
{
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
return;
}
if (0 == --Table->Counts[HOOKID_TO_INDEX(HookId)])
@@ -251,7 +251,7 @@
}
}
}
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
}
LRESULT FASTCALL
@@ -281,14 +281,14 @@
return 0;
}
- ExAcquireFastMutex(&Table->Lock);
+ IntLockHookTable(Table);
Table->Counts[HOOKID_TO_INDEX(HookId)]++;
- ExReleaseFastMutex(&Table->Lock);
+ IntUnLockHookTable(Table);
if (Table != GlobalHooks && GlobalHooks != NULL)
{
- ExAcquireFastMutex(&GlobalHooks->Lock);
+ IntLockHookTable(GlobalHooks);
GlobalHooks->Counts[HOOKID_TO_INDEX(HookId)]++;
- ExReleaseFastMutex(&GlobalHooks->Lock);
+ IntUnLockHookTable(GlobalHooks);
}
Result = IntCallHookProc(HookId, Code, wParam, lParam, Hook->Proc,
@@ -334,7 +334,7 @@
DPRINT1("Invalid window station????\n");
return;
}
- ExAcquireFastMutex(&GlobalHooks->Lock);
+ IntLockHookTable(GlobalHooks);
for (HookId = WH_MINHOOK; HookId <= WH_MAXHOOK; HookId++)
{
/* only low-level keyboard/mouse global hooks can be owned by a thread */
@@ -355,7 +355,7 @@
break;
}
}
- ExReleaseFastMutex(&GlobalHooks->Lock);
+ IntUnLockHookTable(GlobalHooks);
ObDereferenceObject(WinStaObj);
}
}
reactos/subsys/win32k/ntuser
diff -u -r1.7 -r1.8
--- hotkey.c 19 Feb 2004 21:12:09 -0000 1.7
+++ hotkey.c 24 Feb 2004 13:27:03 -0000 1.8
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: hotkey.c,v 1.7 2004/02/19 21:12:09 weiden Exp $
+/* $Id: hotkey.c,v 1.8 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -80,7 +80,7 @@
return FALSE;
}
- ExAcquireFastMutex (&WinStaObject->HotKeyListLock);
+ IntLockHotKeys(WinStaObject);
Entry = WinStaObject->HotKeyListHead.Flink;
while (Entry != &WinStaObject->HotKeyListHead)
@@ -100,7 +100,7 @@
if (id != NULL)
*id = HotKeyItem->id;
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
return TRUE;
}
@@ -108,7 +108,7 @@
Entry = Entry->Flink;
}
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
return FALSE;
}
@@ -128,7 +128,7 @@
if(!WinStaObject)
return;
- ExAcquireFastMutex (&WinStaObject->HotKeyListLock);
+ IntLockHotKeys(WinStaObject);
Entry = WinStaObject->HotKeyListHead.Flink;
while (Entry != &WinStaObject->HotKeyListHead)
@@ -144,7 +144,7 @@
}
}
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
}
@@ -161,7 +161,7 @@
if(!WinStaObject)
return;
- ExAcquireFastMutex (&WinStaObject->HotKeyListLock);
+ IntLockHotKeys(WinStaObject);
Entry = WinStaObject->HotKeyListHead.Flink;
while (Entry != &WinStaObject->HotKeyListHead)
@@ -177,7 +177,7 @@
}
}
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
}
@@ -234,12 +234,12 @@
return FALSE;
}
- ExAcquireFastMutex (&WinStaObject->HotKeyListLock);
+ IntLockHotKeys(WinStaObject);
/* Check for existing hotkey */
if (IsHotKey (WinStaObject, fsModifiers, vk))
{
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
IntReleaseWindowObject(Window);
return FALSE;
}
@@ -247,7 +247,7 @@
HotKeyItem = ExAllocatePoolWithTag (PagedPool, sizeof(HOT_KEY_ITEM), TAG_HOTKEY);
if (HotKeyItem == NULL)
{
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
IntReleaseWindowObject(Window);
return FALSE;
}
@@ -261,7 +261,7 @@
InsertHeadList (&WinStaObject->HotKeyListHead,
&HotKeyItem->ListEntry);
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
IntReleaseWindowObject(Window);
return TRUE;
@@ -293,7 +293,7 @@
return FALSE;
}
- ExAcquireFastMutex (&WinStaObject->HotKeyListLock);
+ IntLockHotKeys(WinStaObject);
Entry = WinStaObject->HotKeyListHead.Flink;
while (Entry != &WinStaObject->HotKeyListHead)
@@ -306,7 +306,7 @@
{
RemoveEntryList (&HotKeyItem->ListEntry);
ExFreePool (HotKeyItem);
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
IntReleaseWindowObject(Window);
return TRUE;
@@ -315,7 +315,7 @@
Entry = Entry->Flink;
}
- ExReleaseFastMutex (&WinStaObject->HotKeyListLock);
+ IntUnLockHotKeys(WinStaObject);
IntReleaseWindowObject(Window);
return FALSE;
reactos/subsys/win32k/ntuser
diff -u -r1.24 -r1.25
--- keyboard.c 19 Feb 2004 21:12:09 -0000 1.24
+++ keyboard.c 24 Feb 2004 13:27:03 -0000 1.25
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: keyboard.c,v 1.24 2004/02/19 21:12:09 weiden Exp $
+/* $Id: keyboard.c,v 1.25 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -67,6 +67,12 @@
BYTE QueueKeyStateTable[256];
+#define IntLockQueueState \
+ ExAcquireFastMutex(&QueueStateLock)
+
+#define IntUnLockQueueState \
+ ExReleaseFastMutex(&QueueStateLock)
+
/* FUNCTIONS *****************************************************************/
/* Initialization -- Right now, just zero the key state and init the lock */
@@ -314,12 +320,12 @@
{
DWORD ret = 0;
- ExAcquireFastMutex(&QueueStateLock);
+ IntLockQueueState;
if( key < 0x100 ) {
ret = ((DWORD)(QueueKeyStateTable[key] & KS_DOWN_BIT) << 8 ) |
(QueueKeyStateTable[key] & KS_LOCK_BIT);
}
- ExReleaseFastMutex(&QueueStateLock);
+ IntUnLockQueueState;
return ret;
}
@@ -332,7 +338,7 @@
HKL dwhkl ) {
int ToUnicodeResult = 0;
- ExAcquireFastMutex(&QueueStateLock);
+ IntLockQueueState;
ToUnicodeResult = ToUnicodeInner( wVirtKey,
wScanCode,
lpKeyState,
@@ -341,7 +347,7 @@
wFlags,
PsGetWin32Thread() ?
PsGetWin32Thread()->KeyboardLayout : 0 );
- ExReleaseFastMutex(&QueueStateLock);
+ IntUnLockQueueState;
return ToUnicodeResult;
}
@@ -618,7 +624,7 @@
ScanCode = (lpMsg->lParam >> 16) & 0xff;
- ExAcquireFastMutex(&QueueStateLock);
+ IntLockQueueState;
UState = ToUnicodeInner(lpMsg->wParam, HIWORD(lpMsg->lParam) & 0xff,
QueueKeyStateTable, wp, 2, 0,
@@ -681,7 +687,7 @@
Result = TRUE;
}
- ExReleaseFastMutex(&QueueStateLock);
+ IntUnLockQueueState;
return Result;
}
@@ -692,12 +698,12 @@
{
BOOL Result = TRUE;
- ExAcquireFastMutex(&QueueStateLock);
+ IntLockQueueState;
if (lpKeyState) {
if(!NT_SUCCESS(MmCopyToCaller(lpKeyState, QueueKeyStateTable, 256)))
Result = FALSE;
}
- ExReleaseFastMutex(&QueueStateLock);
+ IntUnLockQueueState;
return Result;
}
@@ -708,12 +714,12 @@
{
BOOL Result = TRUE;
- ExAcquireFastMutex(&QueueStateLock);
+ IntLockQueueState;
if (lpKeyState) {
if(! NT_SUCCESS(MmCopyFromCaller(QueueKeyStateTable, lpKeyState, 256)))
Result = FALSE;
}
- ExReleaseFastMutex(&QueueStateLock);
+ IntUnLockQueueState;
return Result;
}
@@ -964,7 +970,7 @@
return;
}
- ExAcquireFastMutex(&QueueStateLock);
+ IntLockQueueState;
/* arty -- handle numpad -- On real windows, the actual key produced
* by the messaging layer is different based on the state of numlock. */
@@ -1017,6 +1023,6 @@
else Msg->message = WM_KEYUP;
}
- ExReleaseFastMutex(&QueueStateLock);
+ IntUnLockQueueState;
}
/* EOF */
reactos/subsys/win32k/ntuser
diff -u -r1.49 -r1.50
--- menu.c 23 Feb 2004 21:18:45 -0000 1.49
+++ menu.c 24 Feb 2004 13:27:03 -0000 1.50
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: menu.c,v 1.49 2004/02/23 21:18:45 gvg Exp $
+/* $Id: menu.c,v 1.50 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -163,12 +163,6 @@
return MenuObject;
}
-VOID FASTCALL
-IntReleaseMenuObject(PMENU_OBJECT MenuObject)
-{
- ObmDereferenceObject(MenuObject);
-}
-
BOOL FASTCALL
IntFreeMenuItem(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem,
BOOL RemoveFromList, BOOL bRecurse)
@@ -243,15 +237,15 @@
if(MenuObject)
{
/* remove all menu items */
- ExAcquireFastMutexUnsafe (&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
IntDeleteMenuItems(MenuObject, bRecurse); /* do not destroy submenus */
- ExReleaseFastMutexUnsafe (&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
if(RemoveFromProcess)
{
- ExAcquireFastMutexUnsafe(&MenuObject->W32Process->MenuListLock);
+ IntLockProcessMenus(MenuObject->W32Process);
RemoveEntryList(&MenuObject->ListEntry);
- ExReleaseFastMutexUnsafe(&MenuObject->W32Process->MenuListLock);
+ IntUnLockProcessMenus(MenuObject->W32Process);
}
ObmCloseHandle(MenuObject->W32Process->WindowStation->HandleTable, MenuObject->MenuInfo.Self);
@@ -301,9 +295,9 @@
ExInitializeFastMutex(&MenuObject->MenuItemsLock);
/* Insert menu item into process menu handle list */
- ExAcquireFastMutexUnsafe(&Win32Process->MenuListLock);
+ IntLockProcessMenus(Win32Process);
InsertTailList(&Win32Process->MenuListHead, &MenuObject->ListEntry);
- ExReleaseFastMutexUnsafe(&Win32Process->MenuListLock);
+ IntUnLockProcessMenus(Win32Process);
return MenuObject;
}
@@ -317,8 +311,8 @@
if(!Source->MenuInfo.MenuItemCount)
return FALSE;
- ExAcquireFastMutexUnsafe(&Destination->MenuItemsLock);
- ExAcquireFastMutexUnsafe(&Source->MenuItemsLock);
+ IntLockMenuItems(Destination);
+ IntLockMenuItems(Source);
MenuItem = Source->MenuItemList;
while(MenuItem)
@@ -370,8 +364,8 @@
MenuItem = MenuItem->Next;
}
- ExReleaseFastMutexUnsafe(&Source->MenuItemsLock);
- ExReleaseFastMutexUnsafe(&Destination->MenuItemsLock);
+ IntUnLockMenuItems(Source);
+ IntUnLockMenuItems(Destination);
return TRUE;
}
@@ -413,9 +407,9 @@
ExInitializeFastMutex(&MenuObject->MenuItemsLock);
/* Insert menu item into process menu handle list */
- ExAcquireFastMutexUnsafe(&Process->MenuListLock);
+ IntLockProcessMenus(Process);
InsertTailList(&Process->MenuListHead, &MenuObject->ListEntry);
- ExReleaseFastMutexUnsafe(&Process->MenuListLock);
+ IntUnLockProcessMenus(Process);
IntCloneMenuItems(MenuObject, Source);
@@ -1142,15 +1136,15 @@
if(!SubMenuObject || (SubMenuObject == MenuObject))
break;
- ExAcquireFastMutexUnsafe(&SubMenuObject->MenuItemsLock);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(SubMenuObject);
+ IntUnLockMenuItems(MenuObject);
(*gismc)++;
sres = IntGetMenuDefaultItem(SubMenuObject, fByPos, gmdiFlags, gismc);
(*gismc)--;
- ExReleaseFastMutexUnsafe(&SubMenuObject->MenuItemsLock);
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(SubMenuObject);
+ IntLockMenuItems(MenuObject);
IntReleaseMenuObject(SubMenuObject);
if(sres > (UINT)-1)
@@ -1239,18 +1233,18 @@
KeAttachProcess(Process);
}
- ExAcquireFastMutexUnsafe(&Win32Process->MenuListLock);
+ IntLockProcessMenus(Win32Process);
while (Win32Process->MenuListHead.Flink != &(Win32Process->MenuListHead) &&
Win32Process->MenuListHead.Flink != LastHead)
{
LastHead = Win32Process->MenuListHead.Flink;
MenuObject = CONTAINING_RECORD(Win32Process->MenuListHead.Flink, MENU_OBJECT, ListEntry);
- ExReleaseFastMutexUnsafe(&Win32Process->MenuListLock);
+ IntUnLockProcessMenus(Win32Process);
IntDestroyMenuObject(MenuObject, FALSE, TRUE);
- ExAcquireFastMutexUnsafe(&Win32Process->MenuListLock);
+ IntLockProcessMenus(Win32Process);
}
- ExReleaseFastMutexUnsafe(&Win32Process->MenuListLock);
+ IntUnLockProcessMenus(Win32Process);
if (CurrentProcess != Process)
{
@@ -1283,9 +1277,9 @@
if(Buffer)
{
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
res = IntBuildMenuItemList(MenuObject, Buffer, nBufSize);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
}
else
{
@@ -1314,9 +1308,9 @@
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
return (DWORD)-1;
}
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
res = IntCheckMenuItem(MenuObject, uIDCheckItem, uCheck);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
IntReleaseMenuObject(MenuObject);
return res;
}
@@ -1421,9 +1415,9 @@
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
return res;
}
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
res = IntEnableMenuItem(MenuObject, uIDEnableItem, uEnable);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
IntReleaseMenuObject(MenuObject);
return res;
@@ -1466,9 +1460,9 @@
return FALSE;
}
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
Res = IntInsertMenuItem(MenuObject, uItem, fByPosition, &ItemInfo);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
IntReleaseMenuObject(MenuObject);
return Res;
@@ -1505,9 +1499,9 @@
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
return res;
}
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
res = IntGetMenuDefaultItem(MenuObject, fByPos, gmdiFlags, &gismc);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
IntReleaseMenuObject(MenuObject);
return res;
}
@@ -1586,9 +1580,9 @@
}
if(WindowObject->IDMenu == (UINT)hmenu)
{
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
res = IntHiliteMenuItem(WindowObject, MenuObject, uItemHilite, uHilite);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
}
IntReleaseMenuObject(MenuObject);
IntReleaseWindowObject(WindowObject);
@@ -1697,7 +1691,7 @@
IntReleaseWindowObject(WindowObject);
}
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
mi = MenuObject->MenuItemList;
for (i = 0; NULL != mi; i++)
{
@@ -1707,7 +1701,7 @@
}
mi = mi->Next;
}
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
IntReleaseMenuObject(MenuObject);
@@ -1857,9 +1851,9 @@
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
return FALSE;
}
- ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntLockMenuItems(MenuObject);
res = IntSetMenuDefaultItem(MenuObject, uItem, fByPos);
- ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ IntUnLockMenuItems(MenuObject);
IntReleaseMenuObject(MenuObject);
return res;
reactos/subsys/win32k/ntuser
diff -u -r1.51 -r1.52
--- message.c 24 Feb 2004 01:30:57 -0000 1.51
+++ message.c 24 Feb 2004 13:27:03 -0000 1.52
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: message.c,v 1.51 2004/02/24 01:30:57 weiden Exp $
+/* $Id: message.c,v 1.52 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -1018,7 +1018,7 @@
Queue = PsGetWin32Thread()->MessageQueue;
- ExAcquireFastMutex(&Queue->Lock);
+ IntLockMessageQueue(Queue);
Result = MAKELONG(Queue->ChangedBits, Queue->WakeBits);
if (ClearChanges)
@@ -1026,7 +1026,7 @@
Queue->ChangedBits = 0;
}
- ExReleaseFastMutex(&Queue->Lock);
+ IntUnLockMessageQueue(Queue);
return Result;
}
reactos/subsys/win32k/ntuser
diff -u -r1.70 -r1.71
--- msgqueue.c 24 Feb 2004 01:30:57 -0000 1.70
+++ msgqueue.c 24 Feb 2004 13:27:03 -0000 1.71
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: msgqueue.c,v 1.70 2004/02/24 01:30:57 weiden Exp $
+/* $Id: msgqueue.c,v 1.71 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -68,13 +68,16 @@
static PAGED_LOOKASIDE_LIST MessageLookasideList;
-/* FUNCTIONS *****************************************************************/
+#define IntLockSystemMessageQueue(OldIrql) \
+ KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql)
-/* check the queue status */
-inline BOOL MsqIsSignaled( PUSER_MESSAGE_QUEUE Queue )
-{
- return ((Queue->WakeBits & Queue->WakeMask) || (Queue->ChangedBits & Queue->ChangedMask));
-}
+#define IntUnLockSystemMessageQueue(OldIrql) \
+ KeReleaseSpinLock(&SystemMessageQueueLock, OldIrql)
+
+#define IntUnLockSystemHardwareMessageQueueLock(Wait) \
+ KeReleaseMutex(&HardwareMessageQueueLock, Wait)
+
+/* FUNCTIONS *****************************************************************/
/* set some queue bits */
inline VOID MsqSetQueueBits( PUSER_MESSAGE_QUEUE Queue, WORD Bits )
@@ -94,23 +97,23 @@
VOID FASTCALL
MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue)
{
- ExAcquireFastMutex(&Queue->Lock);
+ IntLockMessageQueue(Queue);
Queue->PaintCount++;
Queue->PaintPosted = TRUE;
KeSetEvent(&Queue->NewMessages, IO_NO_INCREMENT, FALSE);
- ExReleaseFastMutex(&Queue->Lock);
+ IntUnLockMessageQueue(Queue);
}
VOID FASTCALL
MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue)
{
- ExAcquireFastMutex(&Queue->Lock);
+ IntLockMessageQueue(Queue);
Queue->PaintCount--;
if (Queue->PaintCount == 0)
{
Queue->PaintPosted = FALSE;
}
- ExReleaseFastMutex(&Queue->Lock);
+ IntUnLockMessageQueue(Queue);
}
@@ -144,7 +147,7 @@
KeQueryTickCount(&LargeTickCount);
Msg->time = LargeTickCount.u.LowPart;
- KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql);
+ IntLockSystemMessageQueue(OldIrql);
/* only insert WM_MOUSEMOVE messages if not already in system message queue */
if((Msg->message == WM_MOUSEMOVE) && RemMouseMoveMsg)
@@ -167,7 +170,7 @@
{
if (SystemMessageQueueCount == SYSTEM_MESSAGE_QUEUE_SIZE)
{
- KeReleaseSpinLock(&SystemMessageQueueLock, OldIrql);
+ IntUnLockSystemMessageQueue(OldIrql);
return;
}
SystemMessageQueue[SystemMessageQueueTail] = *Msg;
@@ -177,7 +180,7 @@
(SystemMessageQueueTail + 1) % SYSTEM_MESSAGE_QUEUE_SIZE;
SystemMessageQueueCount++;
}
- KeReleaseSpinLock(&SystemMessageQueueLock, OldIrql);
+ IntUnLockSystemMessageQueue(OldIrql);
KeSetEvent(&HardwareMessageEvent, IO_NO_INCREMENT, FALSE);
}
@@ -253,7 +256,7 @@
Msg == WM_XBUTTONDOWN)
{
USHORT Hit = WinPosWindowFromPoint(ScopeWin,
- Message->Msg.pt,
+ &Message->Msg.pt,
&Window);
/*
**Make sure that we have a window that is not already in focus
@@ -312,7 +315,7 @@
}
else
{
- *HitTest = WinPosWindowFromPoint(ScopeWin, Message->Msg.pt, &Window);
+ *HitTest = WinPosWindowFromPoint(ScopeWin, &Message->Msg.pt, &Window);
if(!Window)
{
/* change the cursor on desktop background */
@@ -346,10 +349,10 @@
* old queue */
RemoveEntryList(&Message->ListEntry);
}
- ExAcquireFastMutex(&Window->MessageQueue->HardwareLock);
+ IntLockHardwareMessageQueue(Window->MessageQueue);
InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
- ExReleaseFastMutex(&Window->MessageQueue->HardwareLock);
+ IntUnLockHardwareMessageQueue(Window->MessageQueue);
KeSetEvent(&Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
IntReleaseWindowObject(Window);
*Freed = FALSE;
@@ -359,10 +362,10 @@
if (hWnd != NULL && Window->Self != hWnd &&
!IntIsChildWindow(hWnd, Window->Self))
{
- ExAcquireFastMutex(&Window->MessageQueue->HardwareLock);
+ IntLockHardwareMessageQueue(Window->MessageQueue);
InsertTailList(&Window->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
- ExReleaseFastMutex(&Window->MessageQueue->HardwareLock);
+ IntUnLockHardwareMessageQueue(Window->MessageQueue);
KeSetEvent(&Window->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
IntReleaseWindowObject(Window);
*Freed = FALSE;
@@ -463,7 +466,7 @@
while (NT_SUCCESS(WaitStatus) && STATUS_WAIT_0 != WaitStatus);
/* Process messages in the message queue itself. */
- ExAcquireFastMutex(&MessageQueue->HardwareLock);
+ IntLockHardwareMessageQueue(MessageQueue);
CurrentEntry = MessageQueue->HardwareMessagesListHead.Flink;
while (CurrentEntry != &MessageQueue->HardwareMessagesListHead)
{
@@ -483,8 +486,8 @@
{
RemoveEntryList(&Current->ListEntry);
}
- ExReleaseFastMutex(&MessageQueue->HardwareLock);
- KeReleaseMutex(&HardwareMessageQueueLock, FALSE);
+ IntUnLockHardwareMessageQueue(MessageQueue);
+ IntUnLockSystemHardwareMessageQueueLock(FALSE);
*Message = Current;
IntReleaseWindowObject(DesktopWindow);
return(TRUE);
@@ -494,12 +497,12 @@
RemoveEntryList(&Current->ListEntry);
}
}
- ExReleaseFastMutex(&MessageQueue->HardwareLock);
+ IntUnLockHardwareMessageQueue(MessageQueue);
/* Now try the global queue. */
/* Transfer all messages from the DPC accessible queue to the main queue. */
- KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql);
+ IntLockSystemMessageQueue(OldIrql);
while (SystemMessageQueueCount > 0)
{
PUSER_MESSAGE UserMsg;
@@ -510,13 +513,13 @@
SystemMessageQueueHead =
(SystemMessageQueueHead + 1) % SYSTEM_MESSAGE_QUEUE_SIZE;
SystemMessageQueueCount--;
- KeReleaseSpinLock(&SystemMessageQueueLock, OldIrql);
+ IntUnLockSystemMessageQueue(OldIrql);
UserMsg = ExAllocateFromPagedLookasideList(&MessageLookasideList);
/* What to do if out of memory? For now we just panic a bit in debug */
ASSERT(UserMsg);
UserMsg->Msg = Msg;
InsertTailList(&HardwareMessageQueueHead, &UserMsg->ListEntry);
- KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql);
+ IntLockSystemMessageQueue(OldIrql);
}
/*
* we could set this to -1 conditionally if we find one, but
@@ -524,7 +527,7 @@
*/
SystemMessageQueueMouseMove = -1;
HardwareMessageQueueStamp++;
- KeReleaseSpinLock(&SystemMessageQueueLock, OldIrql);
+ IntUnLockSystemMessageQueue(OldIrql);
/* Process messages in the queue until we find one to return. */
CurrentEntry = HardwareMessageQueueHead.Flink;
@@ -547,13 +550,13 @@
if (Accept)
{
/* Check for no more messages in the system queue. */
- KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql);
+ IntLockSystemMessageQueue(OldIrql);
if (SystemMessageQueueCount == 0 &&
IsListEmpty(&HardwareMessageQueueHead))
{
KeClearEvent(&HardwareMessageEvent);
}
- KeReleaseSpinLock(&SystemMessageQueueLock, OldIrql);
+ IntUnLockSystemMessageQueue(OldIrql);
/*
If we aren't removing the message then add it to the private
@@ -561,12 +564,12 @@
*/
if (!Remove)
{
- ExAcquireFastMutex(&MessageQueue->HardwareLock);
+ IntLockHardwareMessageQueue(MessageQueue);
InsertTailList(&MessageQueue->HardwareMessagesListHead,
&Current->ListEntry);
- ExReleaseFastMutex(&MessageQueue->HardwareLock);
+ IntUnLockHardwareMessageQueue(MessageQueue);
}
- KeReleaseMutex(&HardwareMessageQueueLock, FALSE);
+ IntUnLockSystemHardwareMessageQueueLock(FALSE);
*Message = Current;
IntReleaseWindowObject(DesktopWindow);
return(TRUE);
@@ -581,13 +584,13 @@
}
IntReleaseWindowObject(DesktopWindow);
/* Check if the system message queue is now empty. */
- KeAcquireSpinLock(&SystemMessageQueueLock, &OldIrql);
+ IntLockSystemMessageQueue(OldIrql);
if (SystemMessageQueueCount == 0 && IsListEmpty(&HardwareMessageQueueHead))
{
KeClearEvent(&HardwareMessageEvent);
}
- KeReleaseSpinLock(&SystemMessageQueueLock, OldIrql);
- KeReleaseMutex(&HardwareMessageQueueLock, FALSE);
+ IntUnLockSystemMessageQueue(OldIrql);
+ IntUnLockSystemHardwareMessageQueueLock(FALSE);
return(FALSE);
}
@@ -687,11 +690,11 @@
ObmDereferenceObject(Window);
ObDereferenceObject (Thread);
-// ExAcquireFastMutex(&pThread->MessageQueue->Lock);
+// IntLockMessageQueue(pThread->MessageQueue);
// InsertHeadList(&pThread->MessageQueue->PostedMessagesListHead,
// &Message->ListEntry);
// KeSetEvent(&pThread->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
-// ExReleaseFastMutex(&pThread->MessageQueue->Lock);
+// IntUnLockMessageQueue(pThread->MessageQueue);
}
@@ -732,11 +735,11 @@
while (!IsListEmpty(&MessageQueue->SentMessagesListHead))
{
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
ListEntry = RemoveHeadList(&MessageQueue->SentMessagesListHead);
Message = CONTAINING_RECORD(ListEntry, USER_SENT_MESSAGE_NOTIFY,
ListEntry);
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
IntCallSentMessageCallback(Message->CompletionCallback,
Message->hWnd,
@@ -760,7 +763,7 @@
LRESULT Result;
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage;
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
if (IsListEmpty(&MessageQueue->SentMessagesListHead))
{
ExReleaseFastMutex(&MessageQueue->Lock);
@@ -768,7 +771,7 @@
}
Entry = RemoveHeadList(&MessageQueue->SentMessagesListHead);
Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry);
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
/* Call the window procedure. */
Result = IntSendMessage(Message->Msg.hwnd,
@@ -811,11 +814,11 @@
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage)
{
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
InsertTailList(&MessageQueue->NotifyMessagesListHead,
&NotifyMessage->ListEntry);
KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
}
LRESULT FASTCALL
@@ -841,10 +844,10 @@
Message->CompletionQueue = NULL;
Message->CompletionCallback = NULL;
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
InsertTailList(&MessageQueue->SentMessagesListHead, &Message->ListEntry);
KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
ThreadQueue = PsGetWin32Thread()->MessageQueue;
WaitObjects[1] = &ThreadQueue->NewMessages;
@@ -866,21 +869,21 @@
VOID FASTCALL
MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, PUSER_MESSAGE Message)
{
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
InsertTailList(&MessageQueue->PostedMessagesListHead,
&Message->ListEntry);
KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
}
VOID FASTCALL
MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode)
{
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
MessageQueue->QuitPosted = TRUE;
MessageQueue->QuitExitCode = ExitCode;
KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
}
BOOLEAN STDCALL
@@ -903,7 +906,7 @@
Remove, Message));
}
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
CurrentEntry = MessageQueue->PostedMessagesListHead.Flink;
ListHead = &MessageQueue->PostedMessagesListHead;
while (CurrentEntry != ListHead)
@@ -919,13 +922,13 @@
{
RemoveEntryList(&CurrentMessage->ListEntry);
}
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
*Message = CurrentMessage;
return(TRUE);
}
CurrentEntry = CurrentEntry->Flink;
}
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
return(FALSE);
}
reactos/subsys/win32k/ntuser
diff -u -r1.73 -r1.74
--- painting.c 24 Feb 2004 01:30:57 -0000 1.73
+++ painting.c 24 Feb 2004 13:27:03 -0000 1.74
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: painting.c,v 1.73 2004/02/24 01:30:57 weiden Exp $
+ * $Id: painting.c,v 1.74 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -65,7 +65,7 @@
{
if (!(ParentWindow->Style & WS_CLIPCHILDREN))
{
- ExAcquireFastMutex(&ParentWindow->UpdateLock);
+ IntLockWindowUpdate(ParentWindow);
if (ParentWindow->UpdateRegion != 0)
{
INT OffsetX, OffsetY;
@@ -82,7 +82,7 @@
/* FIXME: If the resulting region is empty, remove fake posted paint message */
NtGdiOffsetRgn(ValidRegion, -OffsetX, -OffsetY);
}
- ExReleaseFastMutex(&ParentWindow->UpdateLock);
+ IntUnLockWindowUpdate(ParentWindow);
}
OldWindow = ParentWindow;
ParentWindow = IntGetParentObject(ParentWindow);
@@ -107,7 +107,7 @@
{
if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
{
- ExAcquireFastMutex(&Window->UpdateLock);
+ IntLockWindowUpdate(Window);
if (Window->NCUpdateRegion)
{
IntValidateParent(Window, Window->NCUpdateRegion);
@@ -116,7 +116,7 @@
Window->NCUpdateRegion = NULL;
Window->Flags &= ~WINDOWOBJECT_NEED_NCPAINT;
MsqDecPaintCountQueue(Window->MessageQueue);
- ExReleaseFastMutex(&Window->UpdateLock);
+ IntUnLockWindowUpdate(Window);
IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0);
}
@@ -144,7 +144,7 @@
Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
{
IntSendMessage(hWnd, WM_PAINT, 0, 0);
- ExAcquireFastMutex(&Window->UpdateLock);
+ IntLockWindowUpdate(Window);
if (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)
{
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
@@ -153,7 +153,7 @@
MsqDecPaintCountQueue(Window->MessageQueue);
}
}
- ExReleaseFastMutex(&Window->UpdateLock);
+ IntUnLockWindowUpdate(Window);
}
}
}
@@ -232,7 +232,7 @@
* Save current state of pending updates
*/
- ExAcquireFastMutex(&Window->UpdateLock);
+ IntLockWindowUpdate(Window);
HadPaintMessage = Window->UpdateRegion != NULL ||
Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT;
HadNCPaintMessage = Window->Flags & WINDOWOBJECT_NEED_NCPAINT;
@@ -399,7 +399,7 @@
MsqIncPaintCountQueue(Window->MessageQueue);
}
- ExReleaseFastMutex(&Window->UpdateLock);
+ IntUnLockWindowUpdate(Window);
}
/*
@@ -612,17 +612,17 @@
#if 0
DPRINT1("PAINTING BUG: Thread marked as containing dirty windows, but no dirty windows found!\n");
#endif
- ExAcquireFastMutex(&MessageQueue->Lock);
+ IntLockMessageQueue(MessageQueue);
MessageQueue->PaintPosted = 0;
MessageQueue->PaintCount = 0;
- ExReleaseFastMutex(&MessageQueue->Lock);
+ IntUnLockMessageQueue(MessageQueue);
return FALSE;
}
Window = IntGetWindowObject(Message->hwnd);
if (Window != NULL)
{
- ExAcquireFastMutex(&Window->UpdateLock);
+ IntLockWindowUpdate(Window);
if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT)
{
Message->message = WM_NCPAINT;
@@ -648,7 +648,7 @@
}
}
}
- ExReleaseFastMutex(&Window->UpdateLock);
+ IntUnLockWindowUpdate(Window);
IntReleaseWindowObject(Window);
return TRUE;
@@ -726,7 +726,7 @@
return NULL;
}
- ExAcquireFastMutex(&Window->UpdateLock);
+ IntLockWindowUpdate(Window);
if (Window->UpdateRegion != NULL)
{
MsqDecPaintCountQueue(Window->MessageQueue);
@@ -742,7 +742,7 @@
{
NtUserGetClientRect(Window, &lPs->rcPaint);
}
- ExReleaseFastMutex(&Window->UpdateLock);
+ IntUnLockWindowUpdate(Window);
if (Window->Flags & WINDOWOBJECT_NEED_ERASEBKGND)
{
reactos/subsys/win32k/ntuser
diff -u -r1.8 -r1.9
--- prop.c 22 Feb 2004 14:09:51 -0000 1.8
+++ prop.c 24 Feb 2004 13:27:03 -0000 1.9
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: prop.c,v 1.8 2004/02/22 14:09:51 weiden Exp $
+/* $Id: prop.c,v 1.9 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -100,7 +100,7 @@
}
/* copy list */
- ExAcquireFastMutexUnsafe(&WindowObject->PropListLock);
+ IntLockWindowProperties(WindowObject);
li = (PROPLISTITEM *)Buffer;
ListEntry = WindowObject->PropListHead.Flink;
@@ -113,7 +113,7 @@
Status = MmCopyToCaller(li, &listitem, sizeof(PROPLISTITEM));
if(!NT_SUCCESS(Status))
{
- ExReleaseFastMutexUnsafe(&WindowObject->PropListLock);
+ IntUnLockWindowProperties(WindowObject);
IntReleaseWindowObject(WindowObject);
return Status;
}
@@ -124,13 +124,13 @@
ListEntry = ListEntry->Flink;
}
- ExReleaseFastMutexUnsafe(&WindowObject->PropListLock);
+ IntUnLockWindowProperties(WindowObject);
}
else
{
- ExAcquireFastMutexUnsafe(&WindowObject->PropListLock);
+ IntLockWindowProperties(WindowObject);
Cnt = WindowObject->PropListItems * sizeof(PROPLISTITEM);
- ExReleaseFastMutexUnsafe(&WindowObject->PropListLock);
+ IntUnLockWindowProperties(WindowObject);
}
IntReleaseWindowObject(WindowObject);
@@ -160,12 +160,12 @@
return NULL;
}
- ExAcquireFastMutexUnsafe(&WindowObject->PropListLock);
+ IntLockWindowProperties(WindowObject);
Prop = IntGetProp(WindowObject, Atom);
if (Prop == NULL)
{
- ExReleaseFastMutexUnsafe(&WindowObject->PropListLock);
+ IntUnLockWindowProperties(WindowObject);
IntReleaseWindowObject(WindowObject);
return(NULL);
}
@@ -173,7 +173,7 @@
RemoveEntryList(&Prop->PropListEntry);
ExFreePool(Prop);
WindowObject->PropListItems--;
- ExReleaseFastMutexUnsafe(&WindowObject->PropListLock);
+ IntUnLockWindowProperties(WindowObject);
IntReleaseWindowObject(WindowObject);
return(Data);
}
@@ -191,9 +191,9 @@
return FALSE;
}
- ExAcquireFastMutexUnsafe(&WindowObject->PropListLock);
+ IntLockWindowProperties(WindowObject);
Prop = IntGetProp(WindowObject, Atom);
- ExReleaseFastMutexUnsafe(&WindowObject->PropListLock);
+ IntUnLockWindowProperties(WindowObject);
if (Prop != NULL)
{
Data = Prop->Data;
@@ -238,9 +238,9 @@
return FALSE;
}
- ExAcquireFastMutexUnsafe(&Wnd->PropListLock);
+ IntLockWindowProperties(Wnd);
ret = IntSetProp(Wnd, Atom, Data);
- ExReleaseFastMutexUnsafe(&Wnd->PropListLock);
+ IntUnLockWindowProperties(Wnd);
return ret;
}
reactos/subsys/win32k/ntuser
diff -u -r1.23 -r1.24
--- timer.c 19 Feb 2004 21:12:09 -0000 1.23
+++ timer.c 24 Feb 2004 13:27:03 -0000 1.24
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: timer.c,v 1.23 2004/02/19 21:12:09 weiden Exp $
+/* $Id: timer.c,v 1.24 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -62,6 +62,12 @@
static CLIENT_ID MsgTimerThreadId;
+#define IntLockTimerList \
+ ExAcquireFastMutex(&Mutex)
+
+#define IntUnLockTimerList \
+ ExReleaseFastMutex(&Mutex)
+
/* FUNCTIONS *****************************************************************/
@@ -140,7 +146,7 @@
PMSG_TIMER_ENTRY MsgTimer;
PLIST_ENTRY EnumEntry;
- ExAcquireFastMutex(&Mutex);
+ IntLockTimerList;
EnumEntry = SysTimerListHead.Flink;
while (EnumEntry != &SysTimerListHead)
@@ -173,7 +179,7 @@
}
}
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
}
UINT_PTR FASTCALL
@@ -190,7 +196,7 @@
ThreadID = PsGetCurrentThreadId();
KeQuerySystemTime(&CurrentTime);
- ExAcquireFastMutex(&Mutex);
+ IntLockTimerList;
if((hWnd == NULL) && !SystemTimer)
{
@@ -199,12 +205,12 @@
if(Index == (ULONG) -1)
{
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
return 0;
}
HintIndex = ++Index;
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
return Index;
}
else
@@ -212,15 +218,15 @@
WindowObject = IntGetWindowObject(hWnd);
if(!WindowObject)
{
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return 0;
}
if(WindowObject->OwnerThread != PsGetCurrentThread())
{
+ IntUnLockTimerList;
IntReleaseWindowObject(WindowObject);
- ExReleaseFastMutex(&Mutex);
SetLastWin32Error(ERROR_ACCESS_DENIED);
return 0;
}
@@ -263,7 +269,7 @@
NewTimer = ExAllocatePoolWithTag(PagedPool, sizeof(MSG_TIMER_ENTRY), TAG_TIMER);
if(!NewTimer)
{
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return 0;
}
@@ -322,7 +328,7 @@
}
}
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
return Ret;
}
@@ -333,16 +339,16 @@
PMSG_TIMER_ENTRY MsgTimer;
PWINDOW_OBJECT WindowObject;
- ExAcquireFastMutex(&Mutex);
+ IntLockTimerList;
/* handle-less timer? */
if((hWnd == NULL) && !SystemTimer)
{
if(!RtlAreBitsSet(&HandleLessTimersBitMap, uIDEvent - 1, 1))
{
+ IntUnLockTimerList;
/* bit was not set */
/* FIXME: set the last error */
- ExReleaseFastMutex(&Mutex);
return FALSE;
}
@@ -353,14 +359,14 @@
WindowObject = IntGetWindowObject(hWnd);
if(!WindowObject)
{
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return FALSE;
}
if(WindowObject->OwnerThread != PsGetCurrentThread())
{
+ IntUnLockTimerList;
IntReleaseWindowObject(WindowObject);
- ExReleaseFastMutex(&Mutex);
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
}
@@ -369,7 +375,7 @@
MsgTimer = IntRemoveTimer(hWnd, uIDEvent, PsGetCurrentThreadId(), SystemTimer);
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
if(MsgTimer == NULL)
{
@@ -409,11 +415,11 @@
KEBUGCHECK(0);
}
- ExAcquireFastMutex(&Mutex);
+ ThreadsToDereferenceCount = ThreadsToDereferencePos = 0;
+
+ IntLockTimerList;
KeQuerySystemTime(&CurrentTime);
-
- ThreadsToDereferenceCount = ThreadsToDereferencePos = 0;
for (EnumEntry = TimerListHead.Flink;
EnumEntry != &TimerListHead;
@@ -552,7 +558,7 @@
}
}
- ExReleaseFastMutex(&Mutex);
+ IntUnLockTimerList;
for (i = 0; i < ThreadsToDereferencePos; i++)
ObDereferenceObject(ThreadsToDereference[i]);
reactos/subsys/win32k/ntuser
diff -u -r1.191 -r1.192
--- window.c 24 Feb 2004 01:30:57 -0000 1.191
+++ window.c 24 Feb 2004 13:27:03 -0000 1.192
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: window.c,v 1.191 2004/02/24 01:30:57 weiden Exp $
+/* $Id: window.c,v 1.192 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -390,9 +390,9 @@
IntUnlinkWindow(Window);
- ExAcquireFastMutexUnsafe (&ThreadData->WindowListLock);
+ IntLockThreadWindows(ThreadData);
RemoveEntryList(&Window->ThreadListEntry);
- ExReleaseFastMutexUnsafe (&ThreadData->WindowListLock);
+ IntUnLockThreadWindows(ThreadData);
IntDestroyScrollBar(Window, SB_VERT);
IntDestroyScrollBar(Window, SB_HORZ);
@@ -482,24 +482,24 @@
Win32Thread = Thread->Win32Thread;
Win32Process = Thread->ThreadsProcess->Win32Process;
- ExAcquireFastMutexUnsafe(&Win32Thread->WindowListLock);
+ IntLockThreadWindows(Win32Thread);
LastHead = NULL;
while (Win32Thread->WindowListHead.Flink != &(Win32Thread->WindowListHead) &&
Win32Thread->WindowListHead.Flink != LastHead)
{
LastHead = Win32Thread->WindowListHead.Flink;
Window = CONTAINING_RECORD(Win32Thread->WindowListHead.Flink, WINDOW_OBJECT, ThreadListEntry);
- ExReleaseFastMutexUnsafe(&Win32Thread->WindowListLock);
+ IntUnLockThreadWindows(Win32Thread);
WinPosShowWindow(Window->Self, SW_HIDE);
IntDestroyWindow(Window, Win32Process, Win32Thread, FALSE);
- ExAcquireFastMutexUnsafe(&Win32Thread->WindowListLock);
+ IntLockThreadWindows(Win32Thread);
}
if (Win32Thread->WindowListHead.Flink == LastHead)
{
/* Window at head of list was not removed, should never happen, infinite loop */
KEBUGCHECK(0);
}
- ExReleaseFastMutexUnsafe(&Win32Thread->WindowListLock);
+ IntUnLockThreadWindows(Win32Thread);
}
@@ -1009,7 +1009,7 @@
ObDereferenceObject(Thread);
- ExAcquireFastMutex(&HandleTable->ListLock);
+ ObmpLockHandleTable(HandleTable);
Current = HandleTable->ListHead.Flink;
while ( Current != &HandleTable->ListHead )
@@ -1031,7 +1031,7 @@
Current = Current->Flink;
}
- ExReleaseFastMutex(&HandleTable->ListLock);
+ ObmpUnlockHandleTable(HandleTable);
}
else
{
@@ -1383,10 +1383,10 @@
}
/* Insert the window into the thread's window list. */
- ExAcquireFastMutexUnsafe (&PsGetWin32Thread()->WindowListLock);
+ IntLockThreadWindows(PsGetWin32Thread());
InsertTailList (&PsGetWin32Thread()->WindowListHead,
&WindowObject->ThreadListEntry);
- ExReleaseFastMutexUnsafe (&PsGetWin32Thread()->WindowListLock);
+ IntUnLockThreadWindows(PsGetWin32Thread());
/* Allocate a DCE for this window. */
if (dwStyle & CS_OWNDC)
@@ -1668,14 +1668,14 @@
WinPosActivateOtherWindow(Window);
}
}
- ExAcquireFastMutex(&Window->MessageQueue->Lock);
+ IntLockMessageQueue(Window->MessageQueue);
if (Window->MessageQueue->ActiveWindow == Window->Self)
Window->MessageQueue->ActiveWindow = NULL;
if (Window->MessageQueue->FocusWindow == Window->Self)
Window->MessageQueue->FocusWindow = NULL;
if (Window->MessageQueue->CaptureWindow == Window->Self)
Window->MessageQueue->CaptureWindow = NULL;
- ExReleaseFastMutex(&Window->MessageQueue->Lock);
+ IntUnLockMessageQueue(Window->MessageQueue);
/* Call hooks */
#if 0 /* FIXME */
@@ -2858,7 +2858,7 @@
Size.x = WindowObject->WindowRect.left;
Size.y = WindowObject->WindowRect.top;
- InternalPos = WinPosInitInternalPos(WindowObject, Size,
+ InternalPos = WinPosInitInternalPos(WindowObject, &Size,
&WindowObject->WindowRect);
if (InternalPos)
{
@@ -3373,7 +3373,7 @@
pt.x = X;
pt.y = Y;
- Hit = WinPosWindowFromPoint(DesktopWindow, pt, &Window);
+ Hit = WinPosWindowFromPoint(DesktopWindow, &pt, &Window);
if(Window)
{
reactos/subsys/win32k/ntuser
diff -u -r1.98 -r1.99
--- winpos.c 24 Feb 2004 01:30:58 -0000 1.98
+++ winpos.c 24 Feb 2004 13:27:03 -0000 1.99
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: winpos.c,v 1.98 2004/02/24 01:30:58 weiden Exp $
+/* $Id: winpos.c,v 1.99 2004/02/24 13:27:03 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -178,7 +178,7 @@
}
PINTERNALPOS FASTCALL
-WinPosInitInternalPos(PWINDOW_OBJECT WindowObject, POINT pt, PRECT RestoreRect)
+WinPosInitInternalPos(PWINDOW_OBJECT WindowObject, POINT *pt, PRECT RestoreRect)
{
PWINDOW_OBJECT Parent;
INT XInc, YInc;
@@ -233,11 +233,11 @@
}
if (WindowObject->Style & WS_MINIMIZE)
{
- WindowObject->InternalPos->IconPos = pt;
+ WindowObject->InternalPos->IconPos = *pt;
}
else if (WindowObject->Style & WS_MAXIMIZE)
{
- WindowObject->InternalPos->MaxPos = pt;
+ WindowObject->InternalPos->MaxPos = *pt;
}
else if (RestoreRect != NULL)
{
@@ -255,7 +255,7 @@
Size.x = WindowObject->WindowRect.left;
Size.y = WindowObject->WindowRect.top;
- InternalPos = WinPosInitInternalPos(WindowObject, Size,
+ InternalPos = WinPosInitInternalPos(WindowObject, &Size,
&WindowObject->WindowRect);
if (InternalPos)
@@ -1357,12 +1357,12 @@
}
USHORT FASTCALL
-WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, POINT WinPoint,
+WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, POINT *WinPoint,
PWINDOW_OBJECT* Window)
{
HWND DesktopWindowHandle;
PWINDOW_OBJECT DesktopWindow;
- POINT Point = WinPoint;
+ POINT Point = *WinPoint;
USHORT HitTest;
*Window = NULL;
@@ -1417,7 +1417,7 @@
Size.x = Window->WindowRect.left;
Size.y = Window->WindowRect.top;
- InternalPos = WinPosInitInternalPos(Window, Size,
+ InternalPos = WinPosInitInternalPos(Window, &Size,
&Window->WindowRect);
if(InternalPos)
{
reactos/subsys/win32k/objects
diff -u -r1.33 -r1.34
--- color.c 16 Jan 2004 19:32:00 -0000 1.33
+++ color.c 24 Feb 2004 13:27:03 -0000 1.34
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: color.c,v 1.33 2004/01/16 19:32:00 gvg Exp $ */
+/* $Id: color.c,v 1.34 2004/02/24 13:27:03 weiden Exp $ */
// FIXME: Use PXLATEOBJ logicalToSystem instead of int *mapping
@@ -31,6 +31,7 @@
#include <win32k/ntuser.h>
#include "../eng/handle.h"
#include <include/inteng.h>
+#include <include/eng.h>
#include <include/color.h>
#include <include/palette.h>
#include <include/error.h>
@@ -333,9 +334,9 @@
} else {
if(SurfGDI->SetPalette)
{
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
success = SurfGDI->SetPalette(dc->PDev, sysPtr, 0, 0, sysGDI->NumColors);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
}
}
reactos/subsys/win32k/objects
diff -u -r1.47 -r1.48
--- cursoricon.c 10 Feb 2004 23:40:01 -0000 1.47
+++ cursoricon.c 24 Feb 2004 13:27:03 -0000 1.48
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: cursoricon.c,v 1.47 2004/02/10 23:40:01 gvg Exp $ */
+/* $Id: cursoricon.c,v 1.48 2004/02/24 13:27:03 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
@@ -146,9 +146,9 @@
if (NULL != CurInfo->CurrentCursorObject && CurInfo->ShowingCursor)
{
/* Remove the cursor if it was displayed */
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->MovePointer(SurfObj, -1, -1, &PointerRect);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
SetPointerRect(CurInfo, &PointerRect);
}
@@ -220,7 +220,7 @@
CurInfo->CurrentCursorObject = NULL;
}
- ExAcquireFastMutex(SurfGDI->DriverLock);
+ IntLockGDIDriver(SurfGDI);
SurfGDI->PointerStatus = SurfGDI->SetPointerShape(SurfObj, soMask, soColor, XlateObj,
NewCursor->IconInfo.xHotspot,
NewCursor->IconInfo.yHotspot,
@@ -228,7 +228,7 @@
CurInfo->y,
&PointerRect,
SPS_CHANGE);
- ExReleaseFastMutex(SurfGDI->DriverLock);
+ IntUnLockGDIDriver(SurfGDI);
if(SurfGDI->PointerStatus == SPS_DECLINE)
{
@@ -287,7 +287,7 @@
ULONG i;
HandleTable = (PUSER_HANDLE_TABLE)WinStaObject->SystemCursor.CurIconHandleTable;
- ExAcquireFastMutex(&HandleTable->ListLock);
+ ObmpLockHandleTable(HandleTable);
CurrentEntry = HandleTable->ListHead.Flink;
while(CurrentEntry != &HandleTable->ListHead)
@@ -303,14 +303,14 @@
continue;
}
ObmReferenceObject(Object);
- ExReleaseFastMutex(&HandleTable->ListLock);
+ ObmpUnlockHandleTable(HandleTable);
return Object;
}
}
CurrentEntry = CurrentEntry->Flink;
}
- ExReleaseFastMutex(&HandleTable->ListLock);
+ ObmpUnlockHandleTable(HandleTable);
return NULL;
}
@@ -334,9 +334,9 @@
Win32Process = PsGetWin32Process();
- ExAcquireFastMutex(&Win32Process->CursorIconListLock);
+ IntLockProcessCursorIcons(Win32Process);
InsertTailList(&Win32Process->CursorIconListHead, &Object->ListEntry);
- ExReleaseFastMutex(&Win32Process->CursorIconListLock);
+ IntUnLockProcessCursorIcons(Win32Process);
Object->Self = Handle;
Object->Process = PsGetWin32Process();
@@ -373,9 +373,9 @@
if(Object->Process && RemoveFromProcess)
{
- ExAcquireFastMutex(&Object->Process->CursorIconListLock);
+ IntLockProcessCursorIcons(Object->Process);
RemoveEntryList(&Object->ListEntry);
- ExReleaseFastMutex(&Object->Process->CursorIconListLock);
+ IntUnLockProcessCursorIcons(Object->Process);
}
ObmDereferenceObject(Object);
@@ -401,7 +401,7 @@
if(!(WinStaObject = Win32Process->WindowStation))
return;
- ExAcquireFastMutex(&Win32Process->CursorIconListLock);
+ IntLockProcessCursorIcons(Win32Process);
CurrentEntry = Win32Process->CursorIconListHead.Flink;
while(CurrentEntry != &Win32Process->CursorIconListHead)
{
@@ -411,7 +411,7 @@
IntDestroyCurIconObject(WinStaObject, Current->Self, FALSE);
CurrentEntry = NextEntry;
}
- ExReleaseFastMutex(&Win32Process->CursorIconListLock);
+ IntUnLockProcessCursorIcons(Win32Process);
}
/*
reactos/subsys/win32k/objects
diff -u -r1.77 -r1.78
--- text.c 22 Feb 2004 08:35:21 -0000 1.77
+++ text.c 24 Feb 2004 13:27:03 -0000 1.78
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: text.c,v 1.77 2004/02/22 08:35:21 navaraf Exp $ */
+/* $Id: text.c,v 1.78 2004/02/24 13:27:03 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
@@ -184,9 +184,9 @@
ZwClose(FileHandle);
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
error = FT_New_Memory_Face(library, buffer, size, 0, &face);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error == FT_Err_Unknown_File_Format)
{
DPRINT1("Unknown font file format\n");
@@ -226,17 +226,17 @@
{
PW32PROCESS Win32Process = PsGetWin32Process();
- ExAcquireFastMutex(&Win32Process->PrivateFontListLock);
+ IntLockProcessPrivateFonts(Win32Process);
InsertTailList(&Win32Process->PrivateFontListHead, &entry->ListEntry);
FontsLoaded++;
- ExReleaseFastMutex(&Win32Process->PrivateFontListLock);
+ IntUnLockProcessPrivateFonts(Win32Process);
}
else
{
- ExAcquireFastMutex(&FontListLock);
+ IntLockGlobalFonts;
InsertTailList(&FontListHead, &entry->ListEntry);
FontsLoaded++;
- ExReleaseFastMutex(&FontListLock);
+ IntUnLockGlobalFonts;
}
return 1;
@@ -637,9 +637,9 @@
}
if (!found)
DPRINT1("WARNING: Could not find desired charmap!\n");
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
error = FT_Set_Charmap(face, found);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
DPRINT1("WARNING: Could not set the charmap!\n");
}
@@ -650,7 +650,7 @@
else
RenderMode = FT_RENDER_MODE_MONO;
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
error = FT_Set_Pixel_Sizes(
face,
/* FIXME should set character height if neg */
@@ -658,7 +658,7 @@
- TextObj->logfont.lfHeight :
TextObj->logfont.lfHeight),
TextObj->logfont.lfWidth);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
{
DPRINT1("Error in setting pixel sizes: %u\n", error);
@@ -752,10 +752,10 @@
for (i = 0; i < Count; i++)
{
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
glyph_index = FT_Get_Char_Index(face, *TempText);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
{
@@ -768,9 +768,9 @@
if (use_kerning && previous && glyph_index)
{
FT_Vector delta;
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
TextWidth += delta.x >> 6;
}
@@ -802,10 +802,10 @@
for (i = 0; i < Count; i++)
{
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
glyph_index = FT_Get_Char_Index(face, *String);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
{
@@ -821,17 +821,17 @@
if (use_kerning && previous && glyph_index)
{
FT_Vector delta;
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
TextLeft += delta.x >> 6;
}
if (glyph->format == ft_glyph_format_outline)
{
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
error = FT_Render_Glyph(glyph, RenderMode);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
{
EngDeleteXlate(XlateObj);
@@ -1054,12 +1054,12 @@
return FALSE;
}
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
FT_Set_Charmap(face, found);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
}
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
FT_Set_Pixel_Sizes(face,
/* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ?
@@ -1073,7 +1073,7 @@
FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
SafeBuffer[i] = face->glyph->advance.x >> 6;
}
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
TEXTOBJ_UnlockText(dc->w.hFont);
MmCopyToCaller(Buffer, SafeBuffer, BufferSize);
ExFreePool(SafeBuffer);
@@ -1201,23 +1201,23 @@
DPRINT1("WARNING: Could not find desired charmap!\n");
}
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
error = FT_Set_Charmap(face, found);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
{
DPRINT1("WARNING: Could not set the charmap!\n");
}
}
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
error = FT_Set_Pixel_Sizes(face,
/* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ?
- TextObj->logfont.lfHeight :
TextObj->logfont.lfHeight),
TextObj->logfont.lfWidth);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
{
DPRINT1("Error in setting pixel sizes: %u\n", error);
@@ -1228,10 +1228,10 @@
for (i = 0; i < Count; i++)
{
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
glyph_index = FT_Get_Char_Index(face, *String);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (error)
{
DPRINT1("WARNING: Failed to load and render glyph! [index: %u]\n", glyph_index);
@@ -1242,9 +1242,9 @@
if (use_kerning && previous && glyph_index)
{
FT_Vector delta;
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
TotalWidth += delta.x >> 6;
}
@@ -1536,14 +1536,14 @@
if (NT_SUCCESS(Status))
{
Face = FontGDI->face;
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
Error = FT_Set_Pixel_Sizes(Face,
/* FIXME should set character height if neg */
(TextObj->logfont.lfHeight < 0 ?
- TextObj->logfont.lfHeight :
TextObj->logfont.lfHeight),
TextObj->logfont.lfWidth);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (0 != Error)
{
DPRINT1("Error in setting pixel sizes: %u\n", Error);
@@ -1552,9 +1552,9 @@
else
{
memcpy(&SafeTm, &FontGDI->TextMetric, sizeof(TEXTMETRICW));
- ExAcquireFastMutex(&FreeTypeLock);
+ IntLockFreeType;
pOS2 = FT_Get_Sfnt_Table(Face, ft_sfnt_os2);
- ExReleaseFastMutex(&FreeTypeLock);
+ IntUnLockFreeType;
if (NULL == pOS2)
{
DPRINT1("Can't find OS/2 table - not TT font?\n");
@@ -1695,7 +1695,7 @@
/* find font in private fonts */
Win32Process = PsGetWin32Process();
- ExAcquireFastMutex(&Win32Process->PrivateFontListLock);
+ IntLockProcessPrivateFonts(Win32Process);
Entry = Win32Process->PrivateFontListHead.Flink;
while(Entry != &Win32Process->PrivateFontListHead)
@@ -1710,10 +1710,10 @@
}
Entry = Entry->Flink;
}
- ExReleaseFastMutex(&Win32Process->PrivateFontListLock);
+ IntUnLockProcessPrivateFonts(Win32Process);
/* find font in system fonts */
- ExAcquireFastMutex(&FontListLock);
+ IntLockGlobalFonts;
Entry = FontListHead.Flink;
while(Entry != &FontListHead)
@@ -1749,7 +1749,10 @@
}
- ExReleaseFastMutex((Private ? &Win32Process->PrivateFontListLock : &FontListLock));
+ if(Private)
+ IntUnLockProcessPrivateFonts(Win32Process);
+ else
+ IntUnLockGlobalFonts;
ASSERT(! NT_SUCCESS(Status) || NULL != TextObj->GDIFontHandle);
CVSspam 0.2.8