From 0611e2873488171628a4a2ee12e93d0376680011 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 13 Dec 2007 20:27:28 +0000 Subject: [PATCH] Up the handle count to 0x10000, reset adjustment to support change. Add device capabilities to handle table. svn path=/trunk/; revision=31204 --- reactos/include/reactos/win32k/ntgdihdl.h | 4 ++-- reactos/subsystems/win32/win32k/include/gdiobj.h | 10 +++++++--- reactos/subsystems/win32/win32k/objects/gdiobj.c | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/reactos/include/reactos/win32k/ntgdihdl.h b/reactos/include/reactos/win32k/ntgdihdl.h index 302eb12071e..445dc43dbe0 100644 --- a/reactos/include/reactos/win32k/ntgdihdl.h +++ b/reactos/include/reactos/win32k/ntgdihdl.h @@ -18,8 +18,8 @@ /* Base address where the handle table is mapped to */ #define GDI_HANDLE_TABLE_BASE_ADDRESS (0x400000) -/* GDI handle table can hold 0x4000 handles */ -#define GDI_HANDLE_COUNT 0x4000 +/* GDI handle table can hold 0x10000 handles */ +#define GDI_HANDLE_COUNT 0x10000 #define GDI_GLOBAL_PROCESS (0x0) /* Handle Masks and shifts */ diff --git a/reactos/subsystems/win32/win32k/include/gdiobj.h b/reactos/subsystems/win32/win32k/include/gdiobj.h index 7d23e4d8e61..e9b08c71d51 100644 --- a/reactos/subsystems/win32/win32k/include/gdiobj.h +++ b/reactos/subsystems/win32/win32k/include/gdiobj.h @@ -11,10 +11,14 @@ typedef struct _GDI_HANDLE_TABLE { - /* the table must be located at the beginning of this structure so it can be - properly mapped! */ +/* The table must be located at the beginning of this structure so it can be + * properly mapped! + */ +////////////////////////////////////////////////////////////////////////////// GDI_TABLE_ENTRY Entries[GDI_HANDLE_COUNT]; - + DEVCAPS DevCaps; // Device Capabilities + // Font data +////////////////////////////////////////////////////////////////////////////// PPAGED_LOOKASIDE_LIST LookasideLists; SLIST_HEADER FreeEntriesHead; diff --git a/reactos/subsystems/win32/win32k/objects/gdiobj.c b/reactos/subsystems/win32/win32k/objects/gdiobj.c index d08b98a86e0..fd449f3d693 100644 --- a/reactos/subsystems/win32/win32k/objects/gdiobj.c +++ b/reactos/subsystems/win32/win32k/objects/gdiobj.c @@ -238,7 +238,7 @@ void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) DPRINT1("reporting gdi handle abusers:\n"); /* step through GDI handle table and find out who our culprit is... */ - for ( i = RESERVE_ENTRIES_COUNT; i < GDI_HANDLE_COUNT; i++ ) + for ( i = RESERVE_ENTRIES_COUNT; i < GDI_HANDLE_COUNT-1; i++ ) { for ( j = 0; j < n; j++ ) { @@ -787,7 +787,7 @@ GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType) HandleUpper = GDI_HANDLE_GET_UPPER(hObj); /* Check that the handle index is valid. */ - if (HandleIndex >= GDI_HANDLE_COUNT) + if (HandleIndex >= GDI_HANDLE_COUNT-1) return NULL; Entry = &HandleTable->Entries[HandleIndex]; @@ -935,7 +935,7 @@ GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD Expected HandleUpper = GDI_HANDLE_GET_UPPER(hObj); /* Check that the handle index is valid. */ - if (HandleIndex >= GDI_HANDLE_COUNT) + if (HandleIndex >= GDI_HANDLE_COUNT-1) return NULL; /* Check if we have the requested type */