Author: jimtabor Date: Tue Sep 4 15:30:49 2007 New Revision: 28838
URL: http://svn.reactos.org/svn/reactos?rev=28838&view=rev Log: Fix processid mask, update gdi handle entry, shift mask and VM memory alloc.
Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c trunk/reactos/include/reactos/win32k/ntgdihdl.h trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/dcutil.c
Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.c... ============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/misc.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c Tue Sep 4 15:30:49 2007 @@ -78,7 +78,7 @@ if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK ) return hGdiObj; PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj); return hGdiObj = (HGDIOBJ)(((LONG_PTR)(hGdiObj)) | - (Entry->Type << 16)); // Rebuild handle for Object + (Entry->Type << GDI_ENTRY_UPPER_SHIFT)); // Rebuild handle for Object }
/*
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgd... ============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Tue Sep 4 15:30:49 2007 @@ -161,8 +161,9 @@ typedef struct _GDI_TABLE_ENTRY { PVOID KernelData; /* Points to the kernel mode structure */ - HANDLE ProcessId; /* process id that created the object, 0 for stock objects */ - LONG Type; /* the first 16 bit is the object type including the stock obj flag, the last 16 bits is just the object type */ + SHORT ProcessId; /* process id that created the object, 0 for stock objects */ + SHORT nCount; /* usage count of object handles */ + LONG Type; /* the first 16 bit is the object type including the stock obj flag, the last 16 bits is just the object type */ PVOID UserData; /* Points to the user mode structure, usually NULL though */ } GDI_TABLE_ENTRY, *PGDI_TABLE_ENTRY;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Tue Sep 4 15:30:49 2007 @@ -2374,7 +2374,7 @@ &NewMem, 0, &MemSize, - MEM_COMMIT, + MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); KeEnterCriticalRegion(); {
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcutil.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcutil.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcutil.c Tue Sep 4 15:30:49 2007 @@ -89,7 +89,7 @@ { INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)dc->hSelf); PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - HANDLE ProcessId = (HANDLE)(((ULONG_PTR)(Entry->ProcessId)) & 0x0000ffff); + HANDLE ProcessId = (HANDLE)(((ULONG_PTR)(Entry->ProcessId)) & ~1); DC_ATTR lDc_AttrData;
if(Entry->UserData)