Fix processid mask, update gdi handle entry, shift mask and VM memory alloc.

svn path=/trunk/; revision=28838
This commit is contained in:
James Tabor 2007-09-04 11:30:49 +00:00
parent e7b744d5c5
commit 59a03d6577
4 changed files with 6 additions and 5 deletions

View file

@ -78,7 +78,7 @@ GdiFixUpHandle(HGDIOBJ hGdiObj)
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
}
/*

View file

@ -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;

View file

@ -2374,7 +2374,7 @@ DC_AllocDC(PUNICODE_STRING Driver)
&NewMem,
0,
&MemSize,
MEM_COMMIT,
MEM_COMMIT|MEM_RESERVE,
PAGE_READWRITE);
KeEnterCriticalRegion();
{

View file

@ -89,7 +89,7 @@ ReadWriteVMDcAttr(PDC dc, FLONG Dirty, BOOL Write)
{
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)