Fixed a bug in the new Engxxx objects code.

svn path=/trunk/; revision=3314
This commit is contained in:
Eugene Ingerman 2002-08-04 18:21:59 +00:00
parent 7325b379e2
commit c724d71f77
3 changed files with 13 additions and 2 deletions

View file

@ -64,7 +64,7 @@ PVOID AccessInternalObject(ULONG Handle)
} }
pEngObj = GDIHandles[Handle].pEngObj; pEngObj = GDIHandles[Handle].pEngObj;
return (PVOID)((PCHAR)pEngObj + sizeof( ENGOBJ ) + pEngObj->UserSize); return (PVOID)pEngObj;
} }
PVOID AccessUserObject(ULONG Handle) PVOID AccessUserObject(ULONG Handle)
@ -104,3 +104,10 @@ PVOID AccessInternalObjectFromUserObject(PVOID UserObject)
return AccessInternalObject( AccessHandleFromUserObject( UserObject ) ); return AccessInternalObject( AccessHandleFromUserObject( UserObject ) );
} }
VOID InitEngHandleTable( void )
{
ULONG i;
for( i=1; i < MAX_GDI_HANDLES; i++ ){
GDIHandles[ i ].pEngObj == NULL;
}
}

View file

@ -110,6 +110,8 @@ PVOID AccessInternalObject(ULONG Handle);
PVOID AccessInternalObjectFromUserObject(PVOID UserObject); PVOID AccessInternalObjectFromUserObject(PVOID UserObject);
ULONG AccessHandleFromUserObject(PVOID UserObject); ULONG AccessHandleFromUserObject(PVOID UserObject);
VOID InitEngHandleTable( void );
#endif /* __WIN32K_OBJECT_H */ #endif /* __WIN32K_OBJECT_H */
/* EOF */ /* EOF */

View file

@ -1,7 +1,7 @@
/* /*
* GDIOBJ.C - GDI object manipulation routines * GDIOBJ.C - GDI object manipulation routines
* *
* $Id: gdiobj.c,v 1.14 2002/07/22 07:55:48 ei Exp $ * $Id: gdiobj.c,v 1.15 2002/08/04 18:21:59 ei Exp $
* *
*/ */
@ -400,6 +400,8 @@ InitGdiObjectHandleTable (void)
//gdi handle table can hold 0x4000 handles //gdi handle table can hold 0x4000 handles
HandleTable = GDIOBJ_iAllocHandleTable (GDI_HANDLE_NUMBER); HandleTable = GDIOBJ_iAllocHandleTable (GDI_HANDLE_NUMBER);
DPRINT("HandleTable: %x\n", HandleTable ); DPRINT("HandleTable: %x\n", HandleTable );
InitEngHandleTable();
} }
VOID CreateStockObjects(void) VOID CreateStockObjects(void)