ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2008
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
460 discussions
Start a n
N
ew thread
[tkreuzer] 32498: fix build, sorry
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 27 02:25:24 2008 New Revision: 32498 URL:
http://svn.reactos.org/svn/reactos?rev=32498&view=rev
Log: fix build, sorry Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Wed Feb 27 02:25:24 2008 @@ -1058,7 +1058,7 @@ RtlCaptureStackBackTrace(1, GDI_STACK_LEVELS, (PVOID*)GDIHandleLocker[HandleIndex], NULL); } #else - _InterlockedIncrement(Object->ulShareCount); + _InterlockedIncrement((PLONG)&Object->ulShareCount); #endif } else
16 years, 10 months
1
0
0
0
[tkreuzer] 32497: Bye, bye, GDIOBJ header! You've served us well, but now the time has come for you to make room for BASEOBJECT. Also bye, bye, HandleTable parameter. You've never done any reasonable job, so no one will be missing you.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 27 02:09:20 2008 New Revision: 32497 URL:
http://svn.reactos.org/svn/reactos?rev=32497&view=rev
Log: Bye, bye, GDIOBJ header! You've served us well, but now the time has come for you to make room for BASEOBJECT. Also bye, bye, HandleTable parameter. You've never done any reasonable job, so no one will be missing you. Modified: trunk/reactos/subsystems/win32/win32k/eng/palette.c trunk/reactos/subsystems/win32/win32k/eng/surface.c trunk/reactos/subsystems/win32/win32k/include/bitmaps.h trunk/reactos/subsystems/win32/win32k/include/brush.h trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/include/gdiobj.h trunk/reactos/subsystems/win32/win32k/include/palette.h trunk/reactos/subsystems/win32/win32k/include/pen.h trunk/reactos/subsystems/win32/win32k/include/region.h trunk/reactos/subsystems/win32/win32k/include/text.h trunk/reactos/subsystems/win32/win32k/main/dllmain.c trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/misc.c trunk/reactos/subsystems/win32/win32k/ntuser/painting.c trunk/reactos/subsystems/win32/win32k/ntuser/windc.c trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c trunk/reactos/subsystems/win32/win32k/objects/brush.c trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c trunk/reactos/subsystems/win32/win32k/objects/color.c trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c trunk/reactos/subsystems/win32/win32k/objects/palobj.c trunk/reactos/subsystems/win32/win32k/objects/region.c trunk/reactos/subsystems/win32/win32k/objects/stockobj.c Modified: trunk/reactos/subsystems/win32/win32k/eng/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/palette.c (original) +++ trunk/reactos/subsystems/win32/win32k/eng/palette.c Wed Feb 27 02:09:20 2008 @@ -68,7 +68,7 @@ Palette = PALETTE_AllocPalette(Mode, NumColors, Colors, Red, Green, Blue); if (Palette != NULL) { - GDIOBJ_SetOwnership(GdiHandleTable, Palette, NULL); + GDIOBJ_SetOwnership(Palette, NULL); } return Palette; @@ -80,7 +80,7 @@ BOOL STDCALL EngDeletePalette(IN HPALETTE Palette) { - GDIOBJ_SetOwnership(GdiHandleTable, Palette, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(Palette, PsGetCurrentProcess()); return PALETTE_FreePalette(Palette); } Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/surface.c (original) +++ trunk/reactos/subsystems/win32/win32k/eng/surface.c Wed Feb 27 02:09:20 2008 @@ -379,7 +379,7 @@ if ( !NewBitmap ) return 0; - GDIOBJ_SetOwnership(GdiHandleTable, NewBitmap, NULL); + GDIOBJ_SetOwnership(NewBitmap, NULL); return NewBitmap; } @@ -400,7 +400,7 @@ if (NewSurface == NULL) return 0; - GDIOBJ_SetOwnership(GdiHandleTable, NewSurface, NULL); + GDIOBJ_SetOwnership(NewSurface, NULL); BitmapObj = BITMAPOBJ_LockBitmap(NewSurface); if (! BITMAPOBJ_InitBitsLock(BitmapObj)) @@ -512,7 +512,7 @@ BOOL STDCALL EngDeleteSurface(IN HSURF Surface) { - GDIOBJ_SetOwnership(GdiHandleTable, Surface, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(Surface, PsGetCurrentProcess()); BITMAPOBJ_FreeBitmap(Surface); return TRUE; } @@ -550,7 +550,7 @@ SURFOBJ * STDCALL EngLockSurface(IN HSURF Surface) { - BITMAPOBJ *bmp = GDIOBJ_ShareLockObj(GdiHandleTable, Surface, GDI_OBJECT_TYPE_BITMAP); + BITMAPOBJ *bmp = GDIOBJ_ShareLockObj(Surface, GDI_OBJECT_TYPE_BITMAP); if (bmp != NULL) return &bmp->SurfObj; @@ -577,7 +577,7 @@ if (Surface != NULL) { BITMAPOBJ *bmp = CONTAINING_RECORD(Surface, BITMAPOBJ, SurfObj); - GDIOBJ_UnlockObjByPtr(GdiHandleTable, bmp); + GDIOBJ_ShareUnlockObjByPtr((POBJ)bmp); } } Modified: trunk/reactos/subsystems/win32/win32k/include/bitmaps.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/bitmaps.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/bitmaps.h Wed Feb 27 02:09:20 2008 @@ -27,14 +27,14 @@ /* Internal interface */ #define BITMAPOBJ_AllocBitmap() \ - ((HBITMAP) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_BITMAP)) + ((HBITMAP) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_BITMAP)) #define BITMAPOBJ_FreeBitmap(hBMObj) \ - GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP) + GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP) /* NOTE: Use shared locks! */ #define BITMAPOBJ_LockBitmap(hBMObj) \ - ((PBITMAPOBJ) GDIOBJ_ShareLockObj (GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)) + ((PBITMAPOBJ) GDIOBJ_ShareLockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_BITMAP)) #define BITMAPOBJ_UnlockBitmap(pBMObj) \ - GDIOBJ_UnlockObjByPtr (GdiHandleTable, pBMObj) + GDIOBJ_ShareUnlockObjByPtr ((POBJ)pBMObj) BOOL INTERNAL_CALL BITMAP_Cleanup(PVOID ObjectBody); Modified: trunk/reactos/subsystems/win32/win32k/include/brush.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/brush.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/brush.h Wed Feb 27 02:09:20 2008 @@ -72,10 +72,10 @@ #define GDIBRUSH_IS_MASKING 0x8000 /* Pattern bitmap is used as transparent mask (?) */ #define GDIBRUSH_CACHED_IS_SOLID 0x80000000 -#define BRUSHOBJ_AllocBrush() ((HBRUSH) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_BRUSH)) -#define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) -#define BRUSHOBJ_LockBrush(hBrush) ((PGDIBRUSHOBJ)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) -#define BRUSHOBJ_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pBrush) +#define BRUSHOBJ_AllocBrush() ((HBRUSH) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_BRUSH)) +#define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) +#define BRUSHOBJ_LockBrush(hBrush) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) +#define BRUSHOBJ_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr((POBJ)pBrush) INT FASTCALL BRUSH_GetObject (PGDIBRUSHOBJ GdiObject, INT Count, LPLOGBRUSH Buffer); BOOL INTERNAL_CALL BRUSH_Cleanup(PVOID ObjectBody); Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h Wed Feb 27 02:09:20 2008 @@ -150,9 +150,9 @@ /* Internal functions *********************************************************/ #define DC_LockDc(hDC) \ - ((PDC) GDIOBJ_LockObj (GdiHandleTable, (HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC)) + ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC)) #define DC_UnlockDc(pDC) \ - GDIOBJ_UnlockObjByPtr (GdiHandleTable, pDC) + GDIOBJ_UnlockObjByPtr ((POBJ)pDC) NTSTATUS FASTCALL InitDcImpl(VOID); PGDIDEVICE FASTCALL IntEnumHDev(VOID); Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/gdiobj.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/gdiobj.h Wed Feb 27 02:09:20 2008 @@ -35,26 +35,8 @@ typedef BOOL (INTERNAL_CALL *GDICLEANUPPROC)(PVOID ObjectBody); -/*! - * GDI object header. This is a part of any GDI object. ROS specific header! -*/ -typedef struct _GDIOBJHDR -{ - PETHREAD LockingThread; /* only assigned if a thread is holding the lock! */ - ULONG Locks; -#ifdef GDI_DEBUG - const char* createdfile; - int createdline; - const char* lockfile; - int lockline; -#endif -} GDIOBJHDR, *PGDIOBJHDR; - -// -// Every GDI Object must have this standard type of header. -// It's for thread locking. -// This header is standalone, used only in gdiobj.c. -// +/* Every GDI Object must have this standard type of header. + * It's for thread locking. */ typedef struct _BASEOBJECT { HGDIOBJ hHmgr; @@ -64,22 +46,22 @@ PW32THREAD Tid; } BASEOBJECT, *POBJ; -BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle); -void INTERNAL_CALL GDIOBJ_SetOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle, PEPROCESS Owner); -void INTERNAL_CALL GDIOBJ_CopyOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ CopyFrom, HGDIOBJ CopyTo); -BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ *hObj); -VOID INTERNAL_CALL GDIOBJ_UnlockObjByPtr(PGDI_HANDLE_TABLE HandleTable, PGDIOBJ Object); +BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle); +VOID INTERNAL_CALL GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS Owner); +VOID INTERNAL_CALL GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo); +BOOL INTERNAL_CALL GDIOBJ_ConvertToStockObj(HGDIOBJ *hObj); +VOID INTERNAL_CALL GDIOBJ_UnlockObjByPtr(POBJ Object); +VOID INTERNAL_CALL GDIOBJ_ShareUnlockObjByPtr(POBJ Object); +BOOL INTERNAL_CALL GDIOBJ_ValidateHandle(HGDIOBJ hObj, ULONG ObjectType); +HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(ULONG ObjectType); +BOOL INTERNAL_CALL GDIOBJ_FreeObj (HGDIOBJ hObj, DWORD ObjectType); +PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ObjectType); +PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType); + +PVOID INTERNAL_CALL GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process); #define GDIOBJ_GetObjectType(Handle) \ GDI_HANDLE_GET_TYPE(Handle) - -BOOL INTERNAL_CALL GDIOBJ_ValidateHandle(HGDIOBJ hObj, ULONG ObjectType); -HGDIOBJ INTERNAL_CALL GDIOBJ_AllocObj(PGDI_HANDLE_TABLE HandleTable, ULONG ObjectType); -BOOL INTERNAL_CALL GDIOBJ_FreeObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType); -PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ObjectType); - -PVOID INTERNAL_CALL GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process); #define GDIOBJFLAG_DEFAULT (0x0) #define GDIOBJFLAG_IGNOREPID (0x1) Modified: trunk/reactos/subsystems/win32/win32k/include/palette.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/palette.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/palette.h Wed Feb 27 02:09:20 2008 @@ -64,9 +64,9 @@ ULONG Blue); HPALETTE FASTCALL PALETTE_AllocPaletteIndexedRGB(ULONG NumColors, CONST RGBQUAD *Colors); -#define PALETTE_FreePalette(hPalette) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE) -#define PALETTE_LockPalette(hPalette) ((PPALGDI)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)) -#define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pPalette) +#define PALETTE_FreePalette(hPalette) GDIOBJ_FreeObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE) +#define PALETTE_LockPalette(hPalette) ((PPALGDI)GDIOBJ_LockObj((HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)) +#define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr((POBJ)pPalette) BOOL INTERNAL_CALL PALETTE_Cleanup(PVOID ObjectBody); HPALETTE FASTCALL PALETTE_Init (VOID); Modified: trunk/reactos/subsystems/win32/win32k/include/pen.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/pen.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/pen.h Wed Feb 27 02:09:20 2008 @@ -6,13 +6,13 @@ /* Internal interface */ -#define PENOBJ_AllocPen() ((HPEN)GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_PEN)) -#define PENOBJ_FreePen(hBMObj) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) -#define PENOBJ_LockPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)) -#define PENOBJ_AllocExtPen() ((HPEN)GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_EXTPEN)) -#define PENOBJ_FreeExtPen(hBMObj) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN) -#define PENOBJ_LockExtPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN)) -#define PENOBJ_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pPenObj) +#define PENOBJ_AllocPen() ((HPEN)GDIOBJ_AllocObj(GDI_OBJECT_TYPE_PEN)) +#define PENOBJ_FreePen(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) +#define PENOBJ_LockPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)) +#define PENOBJ_AllocExtPen() ((HPEN)GDIOBJ_AllocObj(GDI_OBJECT_TYPE_EXTPEN)) +#define PENOBJ_FreeExtPen(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN) +#define PENOBJ_LockExtPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN)) +#define PENOBJ_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr((POBJ)pPenObj) INT STDCALL PEN_GetObject(PGDIBRUSHOBJ hPen, INT Count, PLOGPEN Buffer); Modified: trunk/reactos/subsystems/win32/win32k/include/region.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/region.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/region.h Wed Feb 27 02:09:20 2008 @@ -21,9 +21,9 @@ /* Functions ******************************************************************/ -#define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION) -#define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)) -#define RGNDATA_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pRgn) +#define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION) +#define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj((HGDIOBJ)hRgn, GDI_OBJECT_TYPE_REGION)) +#define RGNDATA_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr((POBJ)pRgn) HRGN FASTCALL RGNDATA_AllocRgn(INT n); BOOL INTERNAL_CALL RGNDATA_Cleanup(PVOID ObjectBody); Modified: trunk/reactos/subsystems/win32/win32k/include/text.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/text.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/text.h Wed Feb 27 02:09:20 2008 @@ -69,10 +69,10 @@ /* Internal interface */ #define TEXTOBJ_AllocText() \ - ((HFONT) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_FONT)) -#define TEXTOBJ_FreeText(hBMObj) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT) -#define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj (GdiHandleTable, (HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)) -#define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_UnlockObjByPtr (GdiHandleTable, pBMObj) + ((HFONT) GDIOBJ_AllocObj (GDI_OBJECT_TYPE_FONT)) +#define TEXTOBJ_FreeText(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT) +#define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)) +#define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_UnlockObjByPtr ((POBJ)pBMObj) NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle); NTSTATUS FASTCALL TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont); Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ma…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/main/dllmain.c (original) +++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c Wed Feb 27 02:09:20 2008 @@ -28,7 +28,7 @@ #include <debug.h> PGDI_HANDLE_TABLE INTERNAL_CALL GDIOBJ_iAllocHandleTable(OUT PSECTION_OBJECT *SectionObject); -BOOL INTERNAL_CALL GDI_CleanupForProcess (PGDI_HANDLE_TABLE HandleTable, struct _EPROCESS *Process); +BOOL INTERNAL_CALL GDI_CleanupForProcess (struct _EPROCESS *Process); /* FIXME */ PGDI_HANDLE_TABLE GdiHandleTable = NULL; PSECTION_OBJECT GdiTableSection = NULL; @@ -136,7 +136,7 @@ /* no process windows should exist at this point, or the function will assert! */ DestroyProcessClasses(Win32Process); - GDI_CleanupForProcess(GdiHandleTable, Process); + GDI_CleanupForProcess(Process); co_IntGraphicsCheck(FALSE); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c Wed Feb 27 02:09:20 2008 @@ -490,13 +490,13 @@ /* delete bitmaps */ if(bmpMask) { - GDIOBJ_SetOwnership(GdiHandleTable, bmpMask, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(bmpMask, PsGetCurrentProcess()); NtGdiDeleteObject(bmpMask); CurIcon->IconInfo.hbmMask = NULL; } if(bmpColor) { - GDIOBJ_SetOwnership(GdiHandleTable, bmpColor, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(bmpColor, PsGetCurrentProcess()); NtGdiDeleteObject(bmpColor); CurIcon->IconInfo.hbmColor = NULL; } @@ -597,7 +597,7 @@ CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx; CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy; BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmColor, NULL); + GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL); } if(CurIcon->IconInfo.hbmMask && (bmp = BITMAPOBJ_LockBitmap(CurIcon->IconInfo.hbmMask))) @@ -608,7 +608,7 @@ CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2; } BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL); + GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL); } } else @@ -1186,7 +1186,7 @@ CurIcon->Size.cx = bmp->SurfObj.sizlBitmap.cx; CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy; BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmColor, NULL); + GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL); } else { @@ -1198,7 +1198,7 @@ CurIcon->Size.cy = bmp->SurfObj.sizlBitmap.cy / 2; BITMAPOBJ_UnlockBitmap(bmp); - GDIOBJ_SetOwnership(GdiHandleTable, CurIcon->IconInfo.hbmMask, NULL); + GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL); } Ret = TRUE; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c Wed Feb 27 02:09:20 2008 @@ -1277,7 +1277,7 @@ BITMAPOBJ_UnlockBitmap(bmp); /* change the bitmap's ownership */ - GDIOBJ_SetOwnership(GdiHandleTable, hNewBitmap, NULL); + GDIOBJ_SetOwnership(hNewBitmap, NULL); } hOldBitmap = (HBITMAP)InterlockedExchange((LONG*)&WinStaObject->hbmWallpaper, (LONG)hNewBitmap); if(hOldBitmap != NULL) Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c Wed Feb 27 02:09:20 2008 @@ -211,7 +211,7 @@ if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion, hRgnWindow, RGN_AND) == NULLREGION) { - GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); NtGdiDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; if (!(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)) @@ -272,7 +272,7 @@ if ((HANDLE) 1 != TempRegion && NULL != TempRegion) { /* NOTE: The region can already be deleted! */ - GDIOBJ_FreeObj(GdiHandleTable, TempRegion, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); + GDIOBJ_FreeObj(TempRegion, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); } } @@ -398,13 +398,13 @@ if (Window->UpdateRegion == NULL) { Window->UpdateRegion = NtGdiCreateRectRgn(0, 0, 0, 0); - GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, NULL); + GDIOBJ_SetOwnership(Window->UpdateRegion, NULL); } if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion, hRgn, RGN_OR) == NULLREGION) { - GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); NtGdiDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; } @@ -424,7 +424,7 @@ if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion, hRgn, RGN_DIFF) == NULLREGION) { - GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); NtGdiDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; } @@ -801,7 +801,7 @@ if (hRgn != (HANDLE)1 && hRgn != NULL) { /* NOTE: The region can already by deleted! */ - GDIOBJ_FreeObj(GdiHandleTable, hRgn, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); + GDIOBJ_FreeObj(hRgn, GDI_OBJECT_TYPE_REGION | GDI_OBJECT_TYPE_SILENT); } } @@ -833,7 +833,7 @@ { IntGetClientRect(Window, &Ps.rcPaint); } - GDIOBJ_SetOwnership(GdiHandleTable, Window->UpdateRegion, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); /* The region is part of the dc now and belongs to the process! */ Window->UpdateRegion = NULL; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c Wed Feb 27 02:09:20 2008 @@ -590,7 +590,7 @@ SetDCHook(pdce->hDC, NULL, 0L); #endif - if (Force && !GDIOBJ_OwnedByCurrentProcess(GdiHandleTable, pdce->hDC)) + if (Force && !GDIOBJ_OwnedByCurrentProcess(pdce->hDC)) { DPRINT1("Change ownership for DCE!\n"); Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Wed Feb 27 02:09:20 2008 @@ -634,7 +634,7 @@ return 0; } - Bitmap = GDIOBJ_LockObj(GdiHandleTable, hBitmap, GDI_OBJECT_TYPE_BITMAP); + Bitmap = GDIOBJ_LockObj(hBitmap, GDI_OBJECT_TYPE_BITMAP); if (Bitmap == NULL) { return 0; @@ -657,14 +657,14 @@ { PBYTE buf; - resBitmap = GDIOBJ_LockObj(GdiHandleTable, res, GDI_OBJECT_TYPE_BITMAP); + resBitmap = GDIOBJ_LockObj(res, GDI_OBJECT_TYPE_BITMAP); if (resBitmap) { buf = ExAllocatePoolWithTag (PagedPool, bm.bmWidthBytes * abs(bm.bmHeight), TAG_BITMAP); if (buf == NULL) { - GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap); - GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap); + GDIOBJ_UnlockObjByPtr((POBJ)resBitmap); + GDIOBJ_UnlockObjByPtr((POBJ)Bitmap); NtGdiDeleteObject(res); return 0; } @@ -672,7 +672,7 @@ IntSetBitmapBits (resBitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf); ExFreePool (buf); resBitmap->flFlags = Bitmap->flFlags; - GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap); + GDIOBJ_UnlockObjByPtr((POBJ)resBitmap); } else { @@ -681,7 +681,7 @@ } } - GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap); + GDIOBJ_UnlockObjByPtr((POBJ)Bitmap); return res; } Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/brush.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/brush.c Wed Feb 27 02:09:20 2008 @@ -42,7 +42,7 @@ if(pBrush->flAttrs & (GDIBRUSH_IS_HATCH | GDIBRUSH_IS_BITMAP)) { ASSERT(pBrush->hbmPattern); - GDIOBJ_SetOwnership(GdiHandleTable, pBrush->hbmPattern, PsGetCurrentProcess()); + GDIOBJ_SetOwnership(pBrush->hbmPattern, PsGetCurrentProcess()); NtGdiDeleteObject(pBrush->hbmPattern); } @@ -366,7 +366,7 @@ BrushObject->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ - GDIOBJ_SetOwnership(GdiHandleTable, hPattern, NULL); + GDIOBJ_SetOwnership(hPattern, NULL); BRUSHOBJ_UnlockBrush(BrushObject); @@ -409,7 +409,7 @@ BrushObject->hbmPattern = hPattern; BrushObject->BrushAttr.lbColor = Color & 0xFFFFFF; - GDIOBJ_SetOwnership(GdiHandleTable, hPattern, NULL); + GDIOBJ_SetOwnership(hPattern, NULL); BRUSHOBJ_UnlockBrush(BrushObject); @@ -446,7 +446,7 @@ BrushObject->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ - GDIOBJ_SetOwnership(GdiHandleTable, hPattern, NULL); + GDIOBJ_SetOwnership(hPattern, NULL); BRUSHOBJ_UnlockBrush(BrushObject); Modified: trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c Wed Feb 27 02:09:20 2008 @@ -81,7 +81,7 @@ if (dc->w.hVisRgn == NULL) { dc->w.hVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0); - GDIOBJ_CopyOwnership(GdiHandleTable, hdc, dc->w.hVisRgn); + GDIOBJ_CopyOwnership(hdc, dc->w.hVisRgn); } retval = NtGdiCombineRgn(dc->w.hVisRgn, hrgn, 0, RGN_COPY); Modified: trunk/reactos/subsystems/win32/win32k/objects/color.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/color.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/color.c Wed Feb 27 02:09:20 2008 @@ -706,7 +706,7 @@ NtGdiUnrealizeObject(HGDIOBJ hgdiobj) { - GDIOBJHDR * ptr; + POBJ pObject; DWORD objectType; BOOL Ret = FALSE; @@ -714,15 +714,15 @@ if(!hgdiobj) return Ret; - ptr = GDIOBJ_LockObj(GdiHandleTable, hgdiobj, GDI_OBJECT_TYPE_DONTCARE); - if (ptr == 0) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return Ret; - } + pObject = GDIOBJ_LockObj(hgdiobj, GDI_OBJECT_TYPE_DONTCARE); + if (pObject == NULL) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return Ret; + } objectType = GDIOBJ_GetObjectType(hgdiobj); switch(objectType) - { + { /*
msdn.microsoft.com
, "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing, @@ -738,9 +738,9 @@ default: DPRINT1("Magic 0x%08x not implemented\n", objectType); break; - } - - GDIOBJ_UnlockObjByPtr(GdiHandleTable, ptr); + } + + GDIOBJ_UnlockObjByPtr(pObject); return Ret; } Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Wed Feb 27 02:09:20 2008 @@ -1019,7 +1019,7 @@ if(IsObjectDead((HGDIOBJ)DCHandle)) return TRUE; - if (!GDIOBJ_OwnedByCurrentProcess(GdiHandleTable, DCHandle)) + if (!GDIOBJ_OwnedByCurrentProcess(DCHandle)) { SetLastWin32Error(ERROR_INVALID_HANDLE); return FALSE; @@ -1669,7 +1669,7 @@ INT Result = 0; DWORD dwObjectType; - pGdiObject = GDIOBJ_LockObj(GdiHandleTable, Handle, GDI_OBJECT_TYPE_DONTCARE); + pGdiObject = GDIOBJ_LockObj(Handle, GDI_OBJECT_TYPE_DONTCARE); if (!pGdiObject) { SetLastWin32Error(ERROR_INVALID_HANDLE); @@ -1711,7 +1711,7 @@ break; } - GDIOBJ_UnlockObjByPtr(GdiHandleTable, pGdiObject); + GDIOBJ_UnlockObjByPtr(pGdiObject); return Result; } @@ -2375,7 +2375,7 @@ RtlCopyMemory(Buf, Driver->Buffer, Driver->MaximumLength); } - hDC = (HDC) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_DC); + hDC = (HDC) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_DC); if (hDC == NULL) { if(Buf) @@ -2546,7 +2546,7 @@ DC_FreeDcAttr(DCToFree); if(!IsObjectDead( DCToFree )) { - if (!GDIOBJ_FreeObj(GdiHandleTable, DCToFree, GDI_OBJECT_TYPE_DC)) + if (!GDIOBJ_FreeObj(DCToFree, GDI_OBJECT_TYPE_DC)) { DPRINT1("DC_FreeDC failed\n"); } @@ -2629,21 +2629,21 @@ { PDC DC; - GDIOBJ_SetOwnership(GdiHandleTable, hDC, Owner); + GDIOBJ_SetOwnership(hDC, Owner); DC = DC_LockDc(hDC); if (NULL != DC) { if (NULL != DC->w.hClipRgn) { - GDIOBJ_CopyOwnership(GdiHandleTable, hDC, DC->w.hClipRgn); + GDIOBJ_CopyOwnership(hDC, DC->w.hClipRgn); } if (NULL != DC->w.hVisRgn) { - GDIOBJ_CopyOwnership(GdiHandleTable, hDC, DC->w.hVisRgn); + GDIOBJ_CopyOwnership(hDC, DC->w.hVisRgn); } if (NULL != DC->w.hGCClipRgn) { - GDIOBJ_CopyOwnership(GdiHandleTable, hDC, DC->w.hGCClipRgn); + GDIOBJ_CopyOwnership(hDC, DC->w.hGCClipRgn); } DC_UnlockDc(DC); } Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Wed Feb 27 02:09:20 2008 @@ -166,7 +166,7 @@ if (ObjTypeInfo[ObjType].bUseLookaside) { ExInitializePagedLookasideList(HandleTable->LookasideLists + ObjType, NULL, NULL, 0, - ObjTypeInfo[ObjType].ulBodySize + sizeof(GDIOBJHDR), ObjTypeInfo[ObjType].Tag, 0); + ObjTypeInfo[ObjType].ulBodySize, ObjTypeInfo[ObjType].Tag, 0); } } @@ -179,10 +179,9 @@ } static __inline PPAGED_LOOKASIDE_LIST -FindLookasideList(PGDI_HANDLE_TABLE HandleTable, - ULONG TypeIndex) -{ - return HandleTable->LookasideLists + TypeIndex; +FindLookasideList(ULONG TypeIndex) +{ + return GdiHandleTable->LookasideLists + TypeIndex; } static __inline BOOL @@ -338,7 +337,7 @@ ULONG FASTCALL -InterlockedPopFreeEntry(PGDI_HANDLE_TABLE HandleTable) +InterlockedPopFreeEntry() { ULONG idxFirstFree, idxNextFree, idxPrev; PGDI_TABLE_ENTRY pFreeEntry; @@ -347,24 +346,24 @@ do { - idxFirstFree = HandleTable->FirstFree; + idxFirstFree = GdiHandleTable->FirstFree; if (idxFirstFree) { - pFreeEntry = HandleTable->Entries + idxFirstFree; + pFreeEntry = GdiHandleTable->Entries + idxFirstFree; ASSERT(((ULONG)pFreeEntry->KernelData & ~GDI_HANDLE_INDEX_MASK) == 0); idxNextFree = (ULONG)pFreeEntry->KernelData; - idxPrev = (ULONG)_InterlockedCompareExchange((LONG*)&HandleTable->FirstFree, idxNextFree, idxFirstFree); + idxPrev = (ULONG)_InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree, idxNextFree, idxFirstFree); } else { - idxFirstFree = HandleTable->FirstUnused; + idxFirstFree = GdiHandleTable->FirstUnused; idxNextFree = idxFirstFree + 1; if (idxNextFree >= GDI_HANDLE_COUNT) { DPRINT1("No more gdi handles left!\n"); return 0; } - idxPrev = (ULONG)_InterlockedCompareExchange((LONG*)&HandleTable->FirstUnused, idxNextFree, idxFirstFree); + idxPrev = (ULONG)_InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstUnused, idxNextFree, idxFirstFree); } } while (idxPrev != idxFirstFree); @@ -376,24 +375,24 @@ The entry must be unlocked and the base type field must be 0 */ VOID FASTCALL -InterlockedPushFreeEntry(PGDI_HANDLE_TABLE HandleTable, ULONG idxToFree) +InterlockedPushFreeEntry(ULONG idxToFree) { ULONG idxFirstFree, idxPrev; PGDI_TABLE_ENTRY pFreeEntry; DPRINT("Enter InterlockedPushFreeEntry\n"); - pFreeEntry = HandleTable->Entries + idxToFree; + pFreeEntry = GdiHandleTable->Entries + idxToFree; ASSERT((pFreeEntry->Type & GDI_ENTRY_BASETYPE_MASK) == 0); ASSERT(pFreeEntry->ProcessId == 0); pFreeEntry->UserData = NULL; do { - idxFirstFree = HandleTable->FirstFree; + idxFirstFree = GdiHandleTable->FirstFree; pFreeEntry->KernelData = (PVOID)idxFirstFree; - idxPrev = (ULONG)_InterlockedCompareExchange((LONG*)&HandleTable->FirstFree, idxToFree, idxFirstFree); + idxPrev = (ULONG)_InterlockedCompareExchange((LONG*)&GdiHandleTable->FirstFree, idxToFree, idxFirstFree); } while (idxPrev != idxFirstFree); } @@ -427,10 +426,10 @@ * \todo return the object pointer and lock it by default. */ HGDIOBJ INTERNAL_CALL -GDIOBJ_AllocObj(PGDI_HANDLE_TABLE HandleTable, ULONG ObjectType) +GDIOBJ_AllocObj(ULONG ObjectType) { PW32PROCESS W32Process; - PGDIOBJHDR newObject = NULL; + POBJ newObject = NULL; PPAGED_LOOKASIDE_LIST LookasideList = NULL; HANDLE CurrentProcessId, LockedProcessId; ULONG TypeIndex; @@ -449,7 +448,7 @@ TypeIndex = GDI_OBJECT_GET_TYPE_INDEX(ObjectType); if (ObjTypeInfo[TypeIndex].bUseLookaside) { - LookasideList = FindLookasideList(HandleTable, TypeIndex); + LookasideList = FindLookasideList(TypeIndex); if(LookasideList != NULL) { newObject = ExAllocateFromPagedLookasideList(LookasideList); @@ -458,37 +457,31 @@ else { newObject = ExAllocatePoolWithTag(PagedPool, - ObjTypeInfo[TypeIndex].ulBodySize + sizeof(GDIOBJHDR), + ObjTypeInfo[TypeIndex].ulBodySize, ObjTypeInfo[TypeIndex].Tag); } if(newObject != NULL) { UINT Index; PGDI_TABLE_ENTRY Entry; - PGDIOBJ ObjectBody; LONG TypeInfo; CurrentProcessId = PsGetCurrentProcessId(); LockedProcessId = (HANDLE)((ULONG_PTR)CurrentProcessId | 0x1); - newObject->LockingThread = NULL; - newObject->Locks = 0; - - ObjectBody = GDIHdrToBdy(newObject); - - RtlZeroMemory(ObjectBody, GetObjectSize(TypeIndex)); + RtlZeroMemory(newObject, GetObjectSize(TypeIndex)); /* On Windows the higher 16 bit of the type field don't contain the full type from the handle, but the base type. (type = BRSUH, PEN, EXTPEN, basetype = BRUSH) */ TypeInfo = (ObjectType & GDI_HANDLE_BASETYPE_MASK) | (ObjectType >> GDI_ENTRY_UPPER_SHIFT); - Index = InterlockedPopFreeEntry(HandleTable); + Index = InterlockedPopFreeEntry(); if (Index != 0) { HANDLE PrevProcId; - Entry = &HandleTable->Entries[Index]; + Entry = &GdiHandleTable->Entries[Index]; LockHandle: PrevProcId = _InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, LockedProcessId, 0); @@ -496,7 +489,7 @@ { HGDIOBJ Handle; - Entry->KernelData = ObjectBody; + Entry->KernelData = newObject; /* copy the reuse-counter */ TypeInfo |= Entry->Type & GDI_ENTRY_REUSE_MASK; @@ -518,7 +511,7 @@ } Handle = (HGDIOBJ)((Index & 0xFFFF) | (TypeInfo << GDI_ENTRY_UPPER_SHIFT)); - DPRINT("GDIOBJ_AllocObj: 0x%x ob: 0x%x\n", Handle, ObjectBody); + DPRINT("GDIOBJ_AllocObj: 0x%x ob: 0x%x\n", Handle, newObject); return Handle; } else @@ -548,7 +541,7 @@ } DPRINT1("Failed to insert gdi object into the handle table, no handles left!\n"); #ifdef GDI_DEBUG - IntDumpHandleTable(HandleTable); + IntDumpHandleTable(GdiHandleTable); #endif /* GDI_DEBUG */ } else @@ -569,7 +562,7 @@ * to the calling process. */ BOOL INTERNAL_CALL -GDIOBJ_FreeObj(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType) +GDIOBJ_FreeObj(HGDIOBJ hObj, DWORD ExpectedType) { PGDI_TABLE_ENTRY Entry; PPAGED_LOOKASIDE_LIST LookasideList; @@ -615,7 +608,7 @@ return FALSE; } - Entry = GDI_HANDLE_GET_ENTRY(HandleTable, hObj); + Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hObj); LockHandle: /* lock the object, we must not delete global objects, so don't exchange the locking @@ -627,11 +620,11 @@ ((Entry->Type << GDI_ENTRY_UPPER_SHIFT) == HandleUpper) && ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == (HandleUpper & GDI_ENTRY_BASETYPE_MASK)) ) { - PGDIOBJHDR GdiHdr; - - GdiHdr = GDIBdyToHdr(Entry->KernelData); - - if(GdiHdr->Locks == 0) + POBJ Object; + + Object = Entry->KernelData; + + if(Object->cExclusiveLock == 0) { BOOL Ret; PW32PROCESS W32Process = PsGetCurrentProcessWin32Process(); @@ -643,7 +636,7 @@ (void)_InterlockedExchangePointer((PVOID*)&Entry->ProcessId, NULL); /* push this entry to the free list */ - InterlockedPushFreeEntry(HandleTable, GDI_ENTRY_TO_INDEX(HandleTable, Entry)); + InterlockedPushFreeEntry(GDI_ENTRY_TO_INDEX(GdiHandleTable, Entry)); if(W32Process != NULL) { @@ -652,20 +645,20 @@ /* call the cleanup routine. */ TypeIndex = GDI_OBJECT_GET_TYPE_INDEX(HandleType); - Ret = RunCleanupCallback(GDIHdrToBdy(GdiHdr), TypeIndex); + Ret = RunCleanupCallback(Object, TypeIndex); /* Now it's time to free the memory */ if (ObjTypeInfo[TypeIndex].bUseLookaside) { - LookasideList = FindLookasideList(HandleTable, TypeIndex); + LookasideList = FindLookasideList(TypeIndex); if(LookasideList != NULL) { - ExFreeToPagedLookasideList(LookasideList, GdiHdr); + ExFreeToPagedLookasideList(LookasideList, Object); } } else { - ExFreePool(GdiHdr); + ExFreePool(Object); } return Ret; @@ -675,7 +668,7 @@ /* * The object is currently locked, so freeing is forbidden! */ - DPRINT1("GdiHdr->Locks: %d\n", GdiHdr->Locks); + DPRINT1("Object->cExclusiveLock = %d\n", Object->cExclusiveLock); #ifdef GDI_DEBUG // DPRINT1("Locked from:\n"); // KeRosDumpStackFrames(GDIHandleLocker[GDI_HANDLE_GET_INDEX(hObj)], GDI_STACK_LEVELS); @@ -758,7 +751,7 @@ if(!IsObjectDead(hObject)) { return NULL != hObject - ? GDIOBJ_FreeObj(GdiHandleTable, hObject, GDI_OBJECT_TYPE_DONTCARE) : FALSE; + ? GDIOBJ_FreeObj(hObject, GDI_OBJECT_TYPE_DONTCARE) : FALSE; } else { @@ -772,7 +765,7 @@ * \param Process - PID of the process that will be destroyed. */ BOOL INTERNAL_CALL -GDI_CleanupForProcess (PGDI_HANDLE_TABLE HandleTable, struct _EPROCESS *Process) +GDI_CleanupForProcess (struct _EPROCESS *Process) { PGDI_TABLE_ENTRY Entry, End; PEPROCESS CurrentProcess; @@ -795,8 +788,8 @@ we should delete it directly here! */ ProcId = Process->UniqueProcessId; - End = &HandleTable->Entries[GDI_HANDLE_COUNT]; - for(Entry = &HandleTable->Entries[RESERVE_ENTRIES_COUNT]; + End = &GdiHandleTable->Entries[GDI_HANDLE_COUNT]; + for(Entry = &GdiHandleTable->Entries[RESERVE_ENTRIES_COUNT]; Entry != End; Entry++, Index++) { @@ -811,7 +804,7 @@ simply ignore this fact here. */ ObjectHandle = (HGDIOBJ)(Index | (Entry->Type << GDI_ENTRY_UPPER_SHIFT)); - if(GDIOBJ_FreeObj(HandleTable, ObjectHandle, GDI_OBJECT_TYPE_DONTCARE) && + if(GDIOBJ_FreeObj(ObjectHandle, GDI_OBJECT_TYPE_DONTCARE) && W32Process->GDIObjects == 0) { /* there are no more gdi handles for this process, bail */ @@ -842,12 +835,12 @@ * \todo Get rid of the ExpectedType parameter! */ PGDIOBJ INTERNAL_CALL -GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType) +GDIOBJ_LockObj (HGDIOBJ hObj, DWORD ExpectedType) { ULONG HandleIndex; PGDI_TABLE_ENTRY Entry; HANDLE ProcessId, HandleProcessId, LockedProcessId, PrevProcId; - PGDIOBJ Object = NULL; + POBJ Object = NULL; ULONG HandleType, HandleUpper; HandleIndex = GDI_HANDLE_GET_INDEX(hObj); @@ -858,7 +851,7 @@ if (HandleIndex >= GDI_HANDLE_COUNT) return NULL; - Entry = &HandleTable->Entries[HandleIndex]; + Entry = &GdiHandleTable->Entries[HandleIndex]; /* Check if we have the requested type */ if ( (ExpectedType != GDI_OBJECT_TYPE_DONTCARE && @@ -921,32 +914,29 @@ if ( (Entry->KernelData != NULL) && ((Entry->Type << GDI_ENTRY_UPPER_SHIFT) == HandleUpper) ) { - PGDIOBJHDR GdiHdr = GDIBdyToHdr(Entry->KernelData); - PETHREAD Thread = PsGetCurrentThread(); - - if (GdiHdr->Locks == 0) + PW32THREAD Thread = PsGetCurrentThreadWin32Thread(); + Object = Entry->KernelData; + + if (Object->cExclusiveLock == 0) { - GdiHdr->LockingThread = Thread; - GdiHdr->Locks = 1; + Object->Tid = Thread; + Object->cExclusiveLock = 1; #ifdef GDI_DEBUG CaptureStackBackTace((PVOID*)GDIHandleLocker[GDI_HANDLE_GET_INDEX(hObj)], GDI_STACK_LEVELS); #endif } else { - _InterlockedIncrement((PLONG)&GdiHdr->Locks); - if (GdiHdr->LockingThread != Thread) + if (Object->Tid != Thread) { - _InterlockedDecrement((PLONG)&GdiHdr->Locks); - /* Unlock the handle table entry. */ (void)_InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); DelayExecution(); continue; } + _InterlockedIncrement((PLONG)&Object->cExclusiveLock); } - Object = Entry->KernelData; } else { @@ -991,12 +981,12 @@ * \todo Get rid of the ExpectedType parameter! */ PGDIOBJ INTERNAL_CALL -GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType) +GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ExpectedType) { ULONG HandleIndex; PGDI_TABLE_ENTRY Entry; HANDLE ProcessId, HandleProcessId, LockedProcessId, PrevProcId; - PGDIOBJ Object = NULL; + POBJ Object = NULL; ULONG_PTR HandleType, HandleUpper; HandleIndex = GDI_HANDLE_GET_INDEX(hObj); @@ -1017,7 +1007,7 @@ return NULL; } - Entry = &HandleTable->Entries[HandleIndex]; + Entry = &GdiHandleTable->Entries[HandleIndex]; ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1); HandleProcessId = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~1); @@ -1059,18 +1049,17 @@ if ( (Entry->KernelData != NULL) && (HandleUpper == (Entry->Type << GDI_ENTRY_UPPER_SHIFT)) ) { - PGDIOBJHDR GdiHdr = GDIBdyToHdr(Entry->KernelData); - -#ifdef GDI_DEBUG - if (_InterlockedIncrement((PLONG)&GdiHdr->Locks) == 1) + Object = (POBJ)Entry->KernelData; + +#ifdef GDI_DEBUG + if (_InterlockedIncrement((PLONG)&Object->ulShareCount) == 1) { memset(GDIHandleLocker[HandleIndex], 0x00, GDI_STACK_LEVELS * sizeof(ULONG)); RtlCaptureStackBackTrace(1, GDI_STACK_LEVELS, (PVOID*)GDIHandleLocker[HandleIndex], NULL); } #else - _InterlockedIncrement((PLONG)&GdiHdr->Locks); -#endif - Object = Entry->KernelData; + _InterlockedIncrement(Object->ulShareCount); +#endif } else { @@ -1110,23 +1099,25 @@ * \param Object Object pointer (as returned by GDIOBJ_LockObj). */ VOID INTERNAL_CALL -GDIOBJ_UnlockObjByPtr(PGDI_HANDLE_TABLE HandleTable, PGDIOBJ Object) -{ - PGDIOBJHDR GdiHdr = GDIBdyToHdr(Object); -#ifdef GDI_DEBUG - if (_InterlockedDecrement((PLONG)&GdiHdr->Locks) == 0) - { - memset(GDIHandleLocker[GDI_HANDLE_GET_INDEX(Object)], 0x00, GDI_STACK_LEVELS * sizeof(ULONG)); - RtlCaptureStackBackTrace(1, GDI_STACK_LEVELS, (PVOID*)GDIHandleLocker[GDI_HANDLE_GET_INDEX(Object)], NULL); - } -#else - if (_InterlockedDecrement((PLONG)&GdiHdr->Locks) < 0) - DPRINT1("Trying to unlock non-existant object\n"); -#endif +GDIOBJ_UnlockObjByPtr(POBJ Object) +{ + if (_InterlockedDecrement((PLONG)&Object->cExclusiveLock) < 0) + { + DPRINT1("Trying to unlock non-existant object\n"); + } +} + +VOID INTERNAL_CALL +GDIOBJ_ShareUnlockObjByPtr(POBJ Object) +{ + if (_InterlockedDecrement((PLONG)&Object->ulShareCount) < 0) + { + DPRINT1("Trying to unlock non-existant object\n"); + } } BOOL INTERNAL_CALL -GDIOBJ_OwnedByCurrentProcess(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle) +GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle) { PGDI_TABLE_ENTRY Entry; HANDLE ProcessId; @@ -1138,7 +1129,7 @@ { ProcessId = PsGetCurrentProcessId(); - Entry = GDI_HANDLE_GET_ENTRY(HandleTable, ObjectHandle); + Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, ObjectHandle); Ret = Entry->KernelData != NULL && (Entry->Type & ~GDI_ENTRY_REUSE_MASK) != 0 && (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1) == ProcessId; @@ -1150,7 +1141,7 @@ } BOOL INTERNAL_CALL -GDIOBJ_ConvertToStockObj(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ *phObj) +GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj) { /* * FIXME !!!!! THIS FUNCTION NEEDS TO BE FIXED - IT IS NOT SAFE WHEN OTHER THREADS @@ -1158,7 +1149,7 @@ */ PGDI_TABLE_ENTRY Entry; HANDLE ProcessId, LockedProcessId, PrevProcId; - PETHREAD Thread; + PW32THREAD Thread; HGDIOBJ hObj; #ifdef GDI_DEBUG ULONG Attempts = 0; @@ -1169,14 +1160,14 @@ DPRINT("GDIOBJ_ConvertToStockObj: hObj: 0x%08x\n", hObj); - Thread = PsGetCurrentThread(); + Thread = PsGetCurrentThreadWin32Thread(); if(!GDI_HANDLE_IS_STOCKOBJ(hObj)) { ProcessId = PsGetCurrentProcessId(); LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1); - Entry = GDI_HANDLE_GET_ENTRY(HandleTable, hObj); + Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hObj); LockHandle: /* lock the object, we must not convert stock objects, so don't check!!! */ @@ -1203,17 +1194,17 @@ PrevType = _InterlockedCompareExchange(&Entry->Type, NewType, OldType); if(PrevType == OldType && Entry->KernelData != NULL) { - PETHREAD PrevThread; - PGDIOBJHDR GdiHdr; + PW32THREAD PrevThread; + POBJ Object; /* We successfully set the stock object flag. KernelData should never be NULL here!!! */ ASSERT(Entry->KernelData); - GdiHdr = GDIBdyToHdr(Entry->KernelData); - - PrevThread = GdiHdr->LockingThread; - if(GdiHdr->Locks == 0 || PrevThread == Thread) + Object = Entry->KernelData; + + PrevThread = Object->Tid; + if(Object->cExclusiveLock == 0 || PrevThread == Thread) { /* dereference the process' object counter */ if(PrevProcId != GDI_GLOBAL_PROCESS) @@ -1249,10 +1240,7 @@ #ifdef GDI_DEBUG if(++Attempts > 20) { - if(GdiHdr->lockfile != NULL) - { DPRINT1("[%d]Locked by 0x%x (we're 0x%x)\n", Attempts, PrevThread, Thread); - } } #endif /* WTF?! The object is already locked by a different thread! @@ -1294,39 +1282,39 @@ } void INTERNAL_CALL -GDIOBJ_SetOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ ObjectHandle, PEPROCESS NewOwner) +GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS NewOwner) { PGDI_TABLE_ENTRY Entry; HANDLE ProcessId, LockedProcessId, PrevProcId; - PETHREAD Thread; + PW32THREAD Thread; #ifdef GDI_DEBUG ULONG Attempts = 0; #endif DPRINT("GDIOBJ_SetOwnership: hObj: 0x%x, NewProcess: 0x%x\n", ObjectHandle, (NewOwner ? PsGetProcessId(NewOwner) : 0)); - Thread = PsGetCurrentThread(); + Thread = PsGetCurrentThreadWin32Thread(); if(!GDI_HANDLE_IS_STOCKOBJ(ObjectHandle)) { ProcessId = PsGetCurrentProcessId(); LockedProcessId = (HANDLE)((ULONG_PTR)ProcessId | 0x1); - Entry = GDI_HANDLE_GET_ENTRY(HandleTable, ObjectHandle); + Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, ObjectHandle); LockHandle: /* lock the object, we must not convert stock objects, so don't check!!! */ PrevProcId = _InterlockedCompareExchangePointer((PVOID*)&Entry->ProcessId, ProcessId, LockedProcessId); if(PrevProcId == ProcessId) { - PETHREAD PrevThread; + PW32THREAD PrevThread; if((Entry->Type & ~GDI_ENTRY_REUSE_MASK) != 0 && Entry->KernelData != NULL) { - PGDIOBJHDR GdiHdr = GDIBdyToHdr(Entry->KernelData); - - PrevThread = GdiHdr->LockingThread; - if(GdiHdr->Locks == 0 || PrevThread == Thread) + POBJ Object = Entry->KernelData; + + PrevThread = Object->Tid; + if(Object->cExclusiveLock == 0 || PrevThread == Thread) { PEPROCESS OldProcess; PW32PROCESS W32Process; @@ -1427,10 +1415,10 @@ } void INTERNAL_CALL -GDIOBJ_CopyOwnership(PGDI_HANDLE_TABLE HandleTable, HGDIOBJ CopyFrom, HGDIOBJ CopyTo) +GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo) { PGDI_TABLE_ENTRY FromEntry; - PETHREAD Thread; + PW32THREAD Thread; HANDLE FromProcessId, FromLockedProcessId, FromPrevProcId; #ifdef GDI_DEBUG ULONG Attempts = 0; @@ -1438,11 +1426,11 @@ DPRINT("GDIOBJ_CopyOwnership: from: 0x%x, to: 0x%x\n", CopyFrom, CopyTo); - Thread = PsGetCurrentThread(); + Thread = PsGetCurrentThreadWin32Thread(); if(!GDI_HANDLE_IS_STOCKOBJ(CopyFrom) && !GDI_HANDLE_IS_STOCKOBJ(CopyTo)) { - FromEntry = GDI_HANDLE_GET_ENTRY(HandleTable, CopyFrom); + FromEntry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, CopyFrom); FromProcessId = (HANDLE)((ULONG_PTR)FromEntry->ProcessId & ~0x1); FromLockedProcessId = (HANDLE)((ULONG_PTR)FromProcessId | 0x1); @@ -1452,17 +1440,17 @@ FromPrevProcId = _InterlockedCompareExchangePointer((PVOID*)&FromEntry->ProcessId, FromProcessId, FromLockedProcessId); if(FromPrevProcId == FromProcessId) { - PETHREAD PrevThread; - PGDIOBJHDR GdiHdr; + PW32THREAD PrevThread; + POBJ Object; if((FromEntry->Type & ~GDI_ENTRY_REUSE_MASK) != 0 && FromEntry->KernelData != NULL) { - GdiHdr = GDIBdyToHdr(FromEntry->KernelData); + Object = FromEntry->KernelData; /* save the pointer to the calling thread so we know it was this thread that locked the object */ - PrevThread = GdiHdr->LockingThread; - if(GdiHdr->Locks == 0 || PrevThread == Thread) + PrevThread = Object->Tid; + if(Object->cExclusiveLock == 0 || PrevThread == Thread) { /* now let's change the ownership of the target object */ @@ -1472,14 +1460,14 @@ /* FIXME */ if(NT_SUCCESS(PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)FromPrevProcId & ~0x1), &ProcessTo))) { - GDIOBJ_SetOwnership(HandleTable, CopyTo, ProcessTo); + GDIOBJ_SetOwnership(CopyTo, ProcessTo); ObDereferenceObject(ProcessTo); } } else { /* mark the object as global */ - GDIOBJ_SetOwnership(HandleTable, CopyTo, NULL); + GDIOBJ_SetOwnership(CopyTo, NULL); } (void)_InterlockedExchangePointer((PVOID*)&FromEntry->ProcessId, FromPrevProcId); @@ -1580,7 +1568,7 @@ // INT Index; PGDI_TABLE_ENTRY Entry; - HANDLE handle = GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_CLIOBJ); + HANDLE handle = GDIOBJ_AllocObj(GDI_OBJECT_TYPE_CLIOBJ); // Need to change handle type based on ulType. Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)handle); Entry = &GdiHandleTable->Entries[Index]; @@ -1600,7 +1588,7 @@ IN HANDLE h ) { - return GDIOBJ_FreeObj(GdiHandleTable, h, GDI_OBJECT_TYPE_CLIOBJ); + return GDIOBJ_FreeObj(h, GDI_OBJECT_TYPE_CLIOBJ); } /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/objects/palobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/palobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/palobj.c Wed Feb 27 02:09:20 2008 @@ -63,7 +63,7 @@ HPALETTE NewPalette; PPALGDI PalGDI; - NewPalette = (HPALETTE) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_PALETTE); + NewPalette = (HPALETTE) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_PALETTE); if (NULL == NewPalette) { return NULL; @@ -112,7 +112,7 @@ PPALGDI PalGDI; unsigned i; - NewPalette = (HPALETTE) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_PALETTE); + NewPalette = (HPALETTE) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_PALETTE); if (NULL == NewPalette) { return NULL; Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c Wed Feb 27 02:09:20 2008 @@ -2088,7 +2088,7 @@ HRGN hReg; PROSRGNDATA pReg; - if ((hReg = (HRGN) GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_REGION))) + if ((hReg = (HRGN) GDIOBJ_AllocObj(GDI_OBJECT_TYPE_REGION))) { if (NULL != (pReg = RGNDATA_LockRgn(hReg))) { Modified: trunk/reactos/subsystems/win32/win32k/objects/stockobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/stockobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/stockobj.c Wed Feb 27 02:09:20 2008 @@ -149,7 +149,7 @@ { if (NULL != StockObjects[Object]) { - GDIOBJ_ConvertToStockObj(GdiHandleTable, &StockObjects[Object]); + GDIOBJ_ConvertToStockObj(&StockObjects[Object]); } } @@ -284,7 +284,7 @@ SysColorBrushes[i] = IntGdiCreateSolidBrush(SysColors[i]); if(SysColorBrushes[i] != NULL) { - GDIOBJ_ConvertToStockObj(GdiHandleTable, (HGDIOBJ*)&SysColorBrushes[i]); + GDIOBJ_ConvertToStockObj((HGDIOBJ*)&SysColorBrushes[i]); } } } @@ -301,7 +301,7 @@ SysColorPens[i] = IntGdiExtCreatePen(Pen.lopnStyle, Pen.lopnWidth.x, BS_SOLID, Pen.lopnColor, 0, 0, 0, NULL, 0, TRUE, NULL); if(SysColorPens[i] != NULL) { - GDIOBJ_ConvertToStockObj(GdiHandleTable, (HGDIOBJ*)&SysColorPens[i]); + GDIOBJ_ConvertToStockObj((HGDIOBJ*)&SysColorPens[i]); } } }
16 years, 10 months
1
0
0
0
[gbrunmar] 32496: Implemented IDirect3D9::CheckDeviceType()
by gbrunmar@svn.reactos.org
Author: gbrunmar Date: Wed Feb 27 00:33:04 2008 New Revision: 32496 URL:
http://svn.reactos.org/svn/reactos?rev=32496&view=rev
Log: Implemented IDirect3D9::CheckDeviceType() Added: trunk/reactos/dll/directx/d3d9/format.c (with props) trunk/reactos/dll/directx/d3d9/format.h (with props) Modified: trunk/reactos/dll/directx/d3d9/adapter.c trunk/reactos/dll/directx/d3d9/d3d9.rbuild trunk/reactos/dll/directx/d3d9/d3d9_create.c trunk/reactos/dll/directx/d3d9/d3d9_impl.c trunk/reactos/dll/directx/d3d9/d3d9_private.h Modified: trunk/reactos/dll/directx/d3d9/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/adapter.c…
============================================================================== --- trunk/reactos/dll/directx/d3d9/adapter.c (original) +++ trunk/reactos/dll/directx/d3d9/adapter.c Wed Feb 27 00:33:04 2008 @@ -12,6 +12,7 @@ #include <ddraw.h> #include <strsafe.h> #include <debug.h> +#include <d3dhal.h> #include "d3d9_private.h" #include "adapter.h" @@ -217,7 +218,7 @@ if (pSrcCaps->Caps2 & D3DCAPS2_PRESENT_INTERVAL_IMMEDIATE) pDstCaps->PresentationIntervals |= D3DPRESENT_INTERVAL_IMMEDIATE; - pDstCaps->PrimitiveMiscCaps = pSrcCaps->PrimitiveMiscCaps & ~D3DPMISCCAPS_SEPERATEFVFFOG; + pDstCaps->PrimitiveMiscCaps = pSrcCaps->PrimitiveMiscCaps & ~D3DPMISCCAPS_FOGINFVF; if (pSrcCaps->VertexProcessingCaps & D3DVTXPCAPS_FOGVERTEX) { @@ -232,14 +233,14 @@ HRESULT GetAdapterCaps(const LPDIRECT3D9_DISPLAYADAPTER_INT pDisplayAdapter, D3DDEVTYPE DeviceType, D3DCAPS9* pDstCaps) { HRESULT hResult = D3DERR_INVALIDDEVICE; - LPD3D9_DRIVERCAPS pDriverCaps = NULL; + D3DCAPS9* pDriverCaps = NULL; ZeroMemory(pDstCaps, sizeof(D3DCAPS9)); switch (DeviceType) { case D3DDEVTYPE_HAL: - pDriverCaps = &pDisplayAdapter->DriverCaps; + pDriverCaps = &pDisplayAdapter->DriverCaps.DriverCaps9; hResult = D3D_OK; break; @@ -257,7 +258,7 @@ if (pDriverCaps != NULL) { - CopyDriverCaps(&pDriverCaps->DriverCaps, pDstCaps); + CopyDriverCaps(pDriverCaps, pDstCaps); } if (SUCCEEDED(hResult)) Modified: trunk/reactos/dll/directx/d3d9/d3d9.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9.rbui…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9.rbuild (original) +++ trunk/reactos/dll/directx/d3d9/d3d9.rbuild Wed Feb 27 00:33:04 2008 @@ -11,11 +11,13 @@ <library>dxguid</library> <library>strsafe</library> <library>version</library> + <library>d3d8thk</library> <file>d3d9.c</file> <file>d3d9_helpers.c</file> <file>d3d9_impl.c</file> <file>d3d9_create.c</file> <file>adapter.c</file> + <file>format.c</file> <file>d3d9.rc</file> </module> Modified: trunk/reactos/dll/directx/d3d9/d3d9_create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_crea…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_create.c (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_create.c Wed Feb 27 00:33:04 2008 @@ -45,17 +45,50 @@ pDisplayAdapter->bInUseFlag = TRUE; } +static BOOL IsGDIDriver(HDC hDC) +{ + COLORREF NearestBlack = GetNearestColor(hDC, RGB(0, 0, 0)); + COLORREF NearestWhite = GetNearestColor(hDC, RGB(255, 255, 255)); + + if (NearestBlack != RGB(0, 0, 0) || NearestWhite != RGB(255, 255, 255)) + return TRUE; + + return FALSE; +} + static BOOL GetDirect3DAdapterInfo(IN OUT LPDIRECT3D9_DISPLAYADAPTER_INT pDisplayAdapter) { HDC hDC; - - /* Check if minimum DirectDraw is supported */ - if (IsDirectDrawSupported() == FALSE) - return FALSE; + LPD3D9_DEVICEDATA pDeviceData; /* Test DC creation for the display device */ if (NULL == (hDC = CreateDCA(NULL, pDisplayAdapter->szDeviceName, NULL, NULL))) return FALSE; + + pDeviceData = LocalAlloc(LMEM_ZEROINIT, sizeof(D3D9_DEVICEDATA)); + if (NULL == pDeviceData) + { + DPRINT1("Out of memory, could not initialize Direct3D adapter"); + DeleteDC(hDC); + return FALSE; + } + + pDeviceData->hDC = hDC; + pDeviceData->DisplayGuid = pDisplayAdapter->DisplayGuid; + pDeviceData->DeviceType = D3DDEVTYPE_HAL; + lstrcpynA(pDeviceData->szDeviceName, pDisplayAdapter->szDeviceName, CCHDEVICENAME); + pDeviceData->szDeviceName[CCHDEVICENAME-1] = '\0'; + + if (pDisplayAdapter->bInUseFlag) + { + pDeviceData->_UnknownA8h.DeviceType = D3DDEVTYPE_HAL; + } + else if (IsGDIDriver(hDC)) + { + pDeviceData->_UnknownA8h.DeviceType = D3DDEVTYPE_REF; + } + + //GetDeviceData(pDeviceData); DeleteDC(hDC); return TRUE; @@ -104,6 +137,10 @@ ++AdapterIndex; } + + /* Check if minimum DirectDraw is supported */ + if (IsDirectDrawSupported() == FALSE) + return FALSE; for (AdapterIndex = 0; AdapterIndex < pDirect3D9->NumDisplayAdapters; AdapterIndex++) { Modified: trunk/reactos/dll/directx/d3d9/d3d9_impl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_impl…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_impl.c (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_impl.c Wed Feb 27 00:33:04 2008 @@ -11,6 +11,7 @@ #include <debug.h> #include "d3d9_helpers.h" #include "adapter.h" +#include "format.h" /* IDirect3D9: IUnknown implementation */ static HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface, REFIID riid, LPVOID* ppvObject) @@ -340,12 +341,95 @@ return D3D_OK; } -static HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE CheckType, + +/*++ +* @name IDirect3D9::CheckDeviceType +* @implemented +* +* The function IDirect3D9Impl_CheckDeviceType checks if a specific D3DFORMAT is hardware accelerated +* on the specified display adapter. +* +* @param LPDIRECT3D iface +* Pointer to the IDirect3D object returned from Direct3DCreate9() +* +* @param UINT Adapter +* Adapter index to get information about. D3DADAPTER_DEFAULT is the primary display. +* The maximum value for this is the value returned by IDirect3D::GetAdapterCount(). +* +* @param D3DDEVTYPE DeviceType +* One of the D3DDEVTYPE enum members. +* +* @param D3DFORMAT DisplayFormat +* One of the D3DFORMAT enum members except D3DFMT_UNKNOWN for the display adapter mode to be checked. +* +* @param D3DFORMAT BackBufferFormat +* One of the D3DFORMAT enum membersfor the render target mode to be checked. D3DFMT_UNKNOWN is only allowed in windowed mode. +* +* @param BOOL Windowed +* If this value is TRUE, the D3DFORMAT check will be done for windowed mode and FALSE equals fullscreen mode. +* +* @return HRESULT +* If the format is hardware accelerated, the method returns D3D_OK. +* If the format isn't hardware accelerated or unsupported - the return value will be D3DERR_NOTAVAILABLE. +* If Adapter is out of range, DeviceType is invalid, +* DisplayFormat or BackBufferFormat is invalid - the return value will be D3DERR_INVALIDCALL. +* +*/ +static HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed) { - UNIMPLEMENTED - - return D3D_OK; + HRESULT hResult; + + LPDIRECT3D9_INT This = impl_from_IDirect3D9(iface); + LOCK_D3D9(); + + if (Adapter >= This->NumDisplayAdapters) + { + DPRINT1("Invalid Adapter number specified"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (DeviceType != D3DDEVTYPE_HAL && + DeviceType != D3DDEVTYPE_REF && + DeviceType != D3DDEVTYPE_SW) + { + DPRINT1("Invalid DeviceType specified"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (BackBufferFormat == D3DFMT_UNKNOWN && + Windowed == TRUE) + { + BackBufferFormat = DisplayFormat; + } + + if (DisplayFormat == D3DFMT_UNKNOWN && BackBufferFormat == D3DFMT_UNKNOWN) + { + DPRINT1("Invalid D3DFORMAT specified"); + UNLOCK_D3D9(); + return D3DERR_INVALIDCALL; + } + + if (FALSE == IsBackBufferFormat(BackBufferFormat)) + { + DPRINT1("Invalid D3DFORMAT specified"); + UNLOCK_D3D9(); + return D3DERR_NOTAVAILABLE; + } + + if (TRUE == Windowed && TRUE == IsExtendedFormat(DisplayFormat)) + { + DPRINT1("Extended diplay modes can only be used in fullscreen mode"); + UNLOCK_D3D9(); + return D3DERR_NOTAVAILABLE; + } + + hResult = CheckDeviceFormat(&This->DisplayAdapters[Adapter].DriverCaps, DisplayFormat, BackBufferFormat, Windowed); + + UNLOCK_D3D9(); + return hResult; } static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, Modified: trunk/reactos/dll/directx/d3d9/d3d9_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_priv…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_private.h (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_private.h Wed Feb 27 00:33:04 2008 @@ -9,13 +9,91 @@ #define _D3D9_PRIVATE_H_ #include <windows.h> +#include <ddraw.h> #define DX_D3D9_MAX_NUM_ADAPTERS 12 typedef struct _tagD3D9_DRIVERCAPS { - D3DCAPS9 DriverCaps; -} D3D9_DRIVERCAPS, FAR* LPD3D9_DRIVERCAPS; +/* 0x0000 */ D3DCAPS9 DriverCaps9; +/* 0x0130 */ DWORD dwDisplayWidth; +/* 0x0134 */ DWORD dwDisplayHeight; +/* 0x0138 */ D3DFORMAT RawDisplayFormat; +/* 0x013c */ D3DFORMAT DisplayFormat; +/* 0x0140 */ DWORD dwRefreshRate; +/* 0x0144 */ DWORD unknown0081; +/* 0x0148 */ DWORD dwSVBCaps; +/* 0x014c */ DWORD dwVSBCaps; +/* 0x0150 */ DWORD dwSVBCaps2; +/* 0x0154 */ DWORD unknown0085; +/* 0x0158 */ DWORD NumSupportedFormatOps; +/* 0x015c */ LPDDSURFACEDESC pSupportedFormatOps; +/* 0x0160 */ DWORD unknown0088; +/* 0x0164 */ DWORD NumSupportedExtendedModes; +/* 0x0168 */ D3DDISPLAYMODE* pSupportedExtendedModes; +/* 0x016c */ ULONG_PTR ulUniqueAdapterGroupId; +/* 0x0170 */ DWORD NumSupportedQueries; +/* 0x0174 */ D3DQUERYTYPE* pSupportedQueriesList; +} D3D9_DRIVERCAPS, FAR *LPD3D9_DRIVERCAPS; + +typedef struct _tagUnknownA8h +{ +/* 0x0000 */ DWORD DdCreateSurface; +/* 0x0004 */ DWORD DdDestroySurface; +/* 0x0008 */ DWORD DdLock; +/* 0x000c */ DWORD DdUnlock; +/* 0x0010 */ DWORD D3dContextCreate; +/* 0x0014 */ DWORD D3dContextDestroy; +/* 0x0018 */ DWORD unknown0100; +/* 0x001c */ DWORD unknown0101; +/* 0x0020 */ DWORD unknown0102; +/* 0x0024 */ DWORD D3dDrawPrimitives2; +/* 0x0028 */ DWORD DdGetDriverState; +/* 0x002c */ DWORD D3dValidateTextureStageState; +/* 0x0030 */ DWORD unknown0106; +/* 0x0034 */ DWORD unknown0107; +/* 0x0038 */ DWORD DdBlt; +/* 0x003c */ DWORD DdGetScanLine; +/* 0x0040 */ DWORD DdWaitForVerticalBlank; +/* 0x0044 */ DWORD DdFlip; +/* 0x0048 */ DWORD DdGetBltStatus; +/* 0x004c */ DWORD DdGetFlipStatus; +/* 0x0050 */ DWORD DdGetAvailDriverMemory; +/* 0x0054 */ DWORD unknown0115; +/* 0x0058 */ DWORD DdSetMode; +/* 0x005c */ DWORD DdSetExclusiveMode; +/* 0x0060 */ DWORD DdFlipToGDISurface; +/* 0x0064 */ DWORD unknown0119; +/* 0x0068 */ DWORD unknown0120; +/* 0x006c */ DWORD unknown0121; +/* 0x0070 */ DWORD unknown0122; +/* 0x0074 */ DWORD unknown0123; +/* 0x0078 */ DWORD unknown0124; +/* 0x007c */ DWORD DXVAGetGuids; +/* 0x0080 */ DWORD DXVAGetCompressedBufferInfo; +/* 0x0084 */ DWORD DXVAGetUncompressedFormats; +/* 0x0088 */ DWORD DXVAGetInternalInfo; +/* 0x008c */ DWORD DXVACreate; +/* 0x0090 */ DWORD DXVADestroy; +/* 0x0094 */ DWORD DXVABeginFrame; +/* 0x0098 */ DWORD DXVAEndFrame; +/* 0x009c */ DWORD DXVAExecute; +/* 0x00a0 */ DWORD DXVAQueryStatus; +/* 0x00a4 */ D3DDEVTYPE DeviceType; +} D3D9_UnknownA8h_INT; + +typedef struct _tagD3D9_DEVICEDATA +{ +/* 0x0000 */ D3D9_DRIVERCAPS DriverCaps; +/* 0x0178 */ D3D9_UnknownA8h_INT _UnknownA8h; +/* 0x0220 */ CHAR szDeviceName[CCHDEVICENAME]; +/* 0x0240 */ HDC hDC; +/* 0x0244 */ GUID DisplayGuid; +/* 0x0254 */ LPDWORD pUnknown0254; //D3D9_Unknown6BC_INT* pUnknown6BC; // hDirectDrawLocal +/* 0x0258 */ D3DDEVTYPE DeviceType; +/* 0x025c */ HMODULE hD3DRefDll; +/* 0x0260 */ DWORD unknown0152; +} D3D9_DEVICEDATA, FAR *LPD3D9_DEVICEDATA; typedef struct _tagDIRECT3D9DisplayAdapterInfo_ { @@ -32,24 +110,6 @@ /* 0x0134 */ D3DDISPLAYMODE* pSupportedD3DExtendedFormats; /* 0x0138 */ DWORD unknown000009; /* 0x013c */ D3D9_DRIVERCAPS DriverCaps; -/* 0x026c */ DWORD dwDisplayWidth; /* Current display res */ -/* 0x0270 */ DWORD dwDisplayHeight; /* Current display res */ -/* 0x0274 */ DWORD unknown000088; /* Current D3DFORMAT */ -/* 0x0278 */ DWORD unknown000089; /* Current D3DFORMAT - duplicate? */ -/* 0x027c */ DWORD MonitorFrequency; /* Current monitor frequency */ -/* 0x0280 */ DWORD unknown000091; -/* 0x0284 */ DWORD unknown000092; -/* 0x0288 */ DWORD unknown000093; -/* 0x028c */ DWORD unknown000094; -/* 0x0290 */ DWORD unknown000095; -/* 0x0294 */ DWORD unknown000096; -/* 0x0298 */ DWORD unknown000097; -/* 0x029c */ DWORD unknown000098; -/* 0x02a0 */ DWORD unknown000099; -/* 0x02a4 */ DWORD unknown000100; -/* 0x02a8 */ DWORD unknown000101; /*? 0xf7627000 */ -/* 0x02ac */ DWORD unknown000102; /*? 0x00000002 */ -/* 0x02b0 */ LPDWORD unknown000103; /*? 0x001552A0 */ /* 0x02b4 */ DWORD unknown000104; /* 0x02b8 */ DWORD unknown000105; } Direct3D9DisplayAdapterInfo_INT, FAR* LPDIRECT3D9_DISPLAYADAPTER_INT; Added: trunk/reactos/dll/directx/d3d9/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/format.c?…
============================================================================== --- trunk/reactos/dll/directx/d3d9/format.c (added) +++ trunk/reactos/dll/directx/d3d9/format.c Wed Feb 27 00:33:04 2008 @@ -1,0 +1,91 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/format.c + * PURPOSE: d3d9.dll D3DFORMAT helper functions + * PROGRAMERS: Gregor Brunmar <gregor (dot) brunmar (at) home (dot) se> + */ + +#include "format.h" +#include <ddrawi.h> + +BOOL IsBackBufferFormat(D3DFORMAT Format) +{ + return ((Format >= D3DFMT_A8R8G8B8) && (Format < D3DFMT_A1R5G5B5)) || + (IsExtendedFormat(Format)); +} + +BOOL IsExtendedFormat(D3DFORMAT Format) +{ + return (Format == D3DFMT_A2R10G10B10); +} + +BOOL IsSupportedFormatOp(LPD3D9_DRIVERCAPS pDriverCaps, D3DFORMAT DisplayFormat, DWORD FormatOp) +{ + const DWORD NumFormatOps = pDriverCaps->NumSupportedFormatOps; + DWORD FormatOpIndex; + + for (FormatOpIndex = 0; FormatOpIndex < NumFormatOps; FormatOpIndex++) + { + const LPDDSURFACEDESC pSurfaceDesc = &pDriverCaps->pSupportedFormatOps[FormatOpIndex]; + if (pSurfaceDesc->ddpfPixelFormat.dwFourCC == DisplayFormat && + (pSurfaceDesc->ddpfPixelFormat.dwOperations & FormatOp) == FormatOp) + { + return TRUE; + } + } + + return FALSE; +} + +HRESULT CheckDeviceFormat(LPD3D9_DRIVERCAPS pDriverCaps, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed) +{ + if (FALSE == IsSupportedFormatOp(pDriverCaps, DisplayFormat, D3DFORMAT_OP_DISPLAYMODE | D3DFORMAT_OP_3DACCELERATION)) + { + return D3DERR_NOTAVAILABLE; + } + + if (DisplayFormat != BackBufferFormat) + { + D3DFORMAT AdjustedDisplayFormat = DisplayFormat; + + if (DisplayFormat == D3DFMT_X8R8G8B8) + { + DisplayFormat = D3DFMT_A8R8G8B8; + } + else if (DisplayFormat == D3DFMT_X1R5G5B5) + { + DisplayFormat = D3DFMT_A1R5G5B5; + } + + if (AdjustedDisplayFormat == BackBufferFormat) + { + if (FALSE == IsSupportedFormatOp(pDriverCaps, AdjustedDisplayFormat, D3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET)) + { + return D3DERR_NOTAVAILABLE; + } + + return D3D_OK; + } + else if (FALSE == Windowed) + { + return D3DERR_NOTAVAILABLE; + } + + if (FALSE == IsSupportedFormatOp(pDriverCaps, BackBufferFormat, D3DFORMAT_OP_OFFSCREEN_RENDERTARGET) || + FALSE == IsSupportedFormatOp(pDriverCaps, BackBufferFormat, D3DFORMAT_OP_CONVERT_TO_ARGB) || + FALSE == IsSupportedFormatOp(pDriverCaps, BackBufferFormat, D3DFORMAT_MEMBEROFGROUP_ARGB)) + { + return D3DERR_NOTAVAILABLE; + } + } + else + { + if (FALSE == IsSupportedFormatOp(pDriverCaps, DisplayFormat, D3DFORMAT_OP_SAME_FORMAT_RENDERTARGET)) + { + return D3DERR_NOTAVAILABLE; + } + } + + return D3D_OK; +} Propchange: trunk/reactos/dll/directx/d3d9/format.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/d3d9/format.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/format.h?…
============================================================================== --- trunk/reactos/dll/directx/d3d9/format.h (added) +++ trunk/reactos/dll/directx/d3d9/format.h Wed Feb 27 00:33:04 2008 @@ -1,0 +1,23 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS ReactX + * FILE: dll/directx/d3d9/format.h + * PURPOSE: d3d9.dll D3DFORMAT helper functions + * PROGRAMERS: Gregor Brunmar <gregor (dot) brunmar (at) home (dot) se> + */ + +#ifndef _FORMAT_H_ +#define _FORMAT_H_ + +#include <d3d9.h> +#include "d3d9_private.h" + +BOOL IsBackBufferFormat(D3DFORMAT Format); + +BOOL IsExtendedFormat(D3DFORMAT Format); + +BOOL IsSupportedFormatOp(LPD3D9_DRIVERCAPS pDriverCaps, D3DFORMAT DisplayFormat, DWORD FormatOp); + +HRESULT CheckDeviceFormat(LPD3D9_DRIVERCAPS pDriverCaps, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed); + +#endif // _FORMAT_H_ Propchange: trunk/reactos/dll/directx/d3d9/format.h ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 10 months
1
0
0
0
[gbrunmar] 32495: Added D3DCAPS8 to d3dhal.h
by gbrunmar@svn.reactos.org
Author: gbrunmar Date: Wed Feb 27 00:18:32 2008 New Revision: 32495 URL:
http://svn.reactos.org/svn/reactos?rev=32495&view=rev
Log: Added D3DCAPS8 to d3dhal.h Modified: trunk/reactos/include/ddk/d3dhal.h Modified: trunk/reactos/include/ddk/d3dhal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/d3dhal.h?rev=3…
============================================================================== --- trunk/reactos/include/ddk/d3dhal.h (original) +++ trunk/reactos/include/ddk/d3dhal.h Wed Feb 27 00:18:32 2008 @@ -658,6 +658,63 @@ #define D3DGDI2_TYPE_GETD3DQUERY 0x00000022 #define D3DGDI2_TYPE_GETDDIVERSION 0x00000023 /* Returns DX9_DDI_VERSION, used to check which DDK version the driver is compiled against */ +typedef struct _D3DCAPS8 +{ + D3DDEVTYPE DeviceType; + UINT AdapterOrdinal; + DWORD Caps; + DWORD Caps2; + DWORD Caps3; + DWORD PresentationIntervals; + DWORD CursorCaps; + DWORD DevCaps; + DWORD PrimitiveMiscCaps; + DWORD RasterCaps; + DWORD ZCmpCaps; + DWORD SrcBlendCaps; + DWORD DestBlendCaps; + DWORD AlphaCmpCaps; + DWORD ShadeCaps; + DWORD TextureCaps; + DWORD TextureFilterCaps; + DWORD CubeTextureFilterCaps; + DWORD VolumeTextureFilterCaps; + DWORD TextureAddressCaps; + DWORD VolumeTextureAddressCaps; + DWORD LineCaps; + DWORD MaxTextureWidth; + DWORD MaxTextureHeight; + DWORD MaxVolumeExtent; + DWORD MaxTextureRepeat; + DWORD MaxTextureAspectRatio; + DWORD MaxAnisotropy; + float MaxVertexW; + float GuardBandLeft; + float GuardBandTop; + float GuardBandRight; + float GuardBandBottom; + float ExtentsAdjust; + DWORD StencilCaps; + DWORD FVFCaps; + DWORD TextureOpCaps; + DWORD MaxTextureBlendStages; + DWORD MaxSimultaneousTextures; + DWORD VertexProcessingCaps; + DWORD MaxActiveLights; + DWORD MaxUserClipPlanes; + DWORD MaxVertexBlendMatrices; + DWORD MaxVertexBlendMatrixIndex; + float MaxPointSize; + DWORD MaxPrimitiveCount; + DWORD MaxVertexIndex; + DWORD MaxStreams; + DWORD MaxStreamStride; + DWORD VertexShaderVersion; + DWORD MaxVertexShaderConst; + DWORD PixelShaderVersion; + float MaxPixelShaderValue; +} D3DCAPS8; + typedef struct _DD_GETFORMATCOUNTDATA { DD_GETDRIVERINFO2DATA gdi2;
16 years, 10 months
1
0
0
0
[cfinck] 32494: Don't define NDEBUG in the .rbuild file, but before the inclusion of debug.h (like we have it for all ROS components)
by cfinck@svn.reactos.org
Author: cfinck Date: Tue Feb 26 19:00:00 2008 New Revision: 32494 URL:
http://svn.reactos.org/svn/reactos?rev=32494&view=rev
Log: Don't define NDEBUG in the .rbuild file, but before the inclusion of debug.h (like we have it for all ROS components) Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.h trunk/reactos/drivers/input/kbdclass/kbdclass.rbuild trunk/reactos/drivers/input/mouclass/mouclass.h trunk/reactos/drivers/input/mouclass/mouclass.rbuild Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/kbdclass/kbd…
============================================================================== --- trunk/reactos/drivers/input/kbdclass/kbdclass.h (original) +++ trunk/reactos/drivers/input/kbdclass/kbdclass.h Tue Feb 26 19:00:00 2008 @@ -3,6 +3,8 @@ #include <ntddkbd.h> #include <stdio.h> #include <pseh/pseh.h> + +#define NDEBUG #include <debug.h> #define MAX_PATH 260 Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/kbdclass/kbd…
============================================================================== --- trunk/reactos/drivers/input/kbdclass/kbdclass.rbuild (original) +++ trunk/reactos/drivers/input/kbdclass/kbdclass.rbuild Tue Feb 26 19:00:00 2008 @@ -2,7 +2,6 @@ <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="kbdclass" type="kernelmodedriver" installbase="system32/drivers" installname="kbdclass.sys"> <bootstrap installbase="$(CDOUTPUT)" /> - <define name="NDEBUG" /> <library>pseh</library> <library>ntoskrnl</library> <library>hal</library> Modified: trunk/reactos/drivers/input/mouclass/mouclass.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/mouclass/mou…
============================================================================== --- trunk/reactos/drivers/input/mouclass/mouclass.h (original) +++ trunk/reactos/drivers/input/mouclass/mouclass.h Tue Feb 26 19:00:00 2008 @@ -3,6 +3,8 @@ #include <ntddkbd.h> #include <stdio.h> #include <pseh/pseh.h> + +#define NDEBUG #include <debug.h> #define MAX_PATH 260 Modified: trunk/reactos/drivers/input/mouclass/mouclass.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/mouclass/mou…
============================================================================== --- trunk/reactos/drivers/input/mouclass/mouclass.rbuild (original) +++ trunk/reactos/drivers/input/mouclass/mouclass.rbuild Tue Feb 26 19:00:00 2008 @@ -2,7 +2,6 @@ <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="mouclass" type="kernelmodedriver" installbase="system32/drivers" installname="mouclass.sys"> <include base="mouclass">.</include> - <define name="NDEBUG" /> <library>pseh</library> <library>ntoskrnl</library> <library>hal</library>
16 years, 10 months
1
0
0
0
[cwittich] 32493: some MSVC compat fixes
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Feb 26 18:23:57 2008 New Revision: 32493 URL:
http://svn.reactos.org/svn/reactos?rev=32493&view=rev
Log: some MSVC compat fixes Modified: trunk/reactos/boot/freeldr/freeldr/include/arch.h trunk/reactos/boot/freeldr/freeldr/include/disk.h trunk/reactos/boot/freeldr/freeldr/include/drivemap.h trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h trunk/reactos/boot/freeldr/freeldr/include/fs/fat.h trunk/reactos/boot/freeldr/freeldr/include/fs/iso.h trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h trunk/reactos/boot/freeldr/freeldr/include/linux.h trunk/reactos/boot/freeldr/freeldr/include/mm.h trunk/reactos/boot/freeldr/freeldr/include/video.h trunk/reactos/boot/freeldr/freeldr/include/winldr.h Modified: trunk/reactos/boot/freeldr/freeldr/include/arch.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch.h Tue Feb 26 18:23:57 2008 @@ -54,7 +54,7 @@ #ifndef ASM - +#include <pshpack1.h> typedef struct { unsigned long eax; @@ -72,7 +72,7 @@ unsigned long eflags; -} PACKED DWORDREGS; +} DWORDREGS; typedef struct { @@ -91,7 +91,7 @@ unsigned short flags, _upper_flags; -} PACKED WORDREGS; +} WORDREGS; typedef struct { @@ -118,7 +118,8 @@ unsigned short flags, _upper_flags; -} PACKED BYTEREGS; +} BYTEREGS; + typedef union { @@ -127,6 +128,7 @@ WORDREGS w; BYTEREGS b; } REGS; +#include <poppack.h> // Int386() // Modified: trunk/reactos/boot/freeldr/freeldr/include/disk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/disk.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/disk.h Tue Feb 26 18:23:57 2008 @@ -33,6 +33,7 @@ // // Extended disk geometry (Int13 / ah=48h) // +#include <pshpack1.h> typedef struct _EXTENDED_GEOMETRY { USHORT Size; @@ -43,7 +44,7 @@ ULONGLONG Sectors; USHORT BytesPerSector; ULONG PDPTE; -} __attribute__((packed)) EXTENDED_GEOMETRY, *PEXTENDED_GEOMETRY; +} EXTENDED_GEOMETRY, *PEXTENDED_GEOMETRY; // // Define the structure of a partition table entry @@ -61,7 +62,7 @@ ULONG SectorCountBeforePartition; // Number of sectors preceding the partition ULONG PartitionSectorCount; // Number of sectors in the partition -} PACKED PARTITION_TABLE_ENTRY, *PPARTITION_TABLE_ENTRY; +} PARTITION_TABLE_ENTRY, *PPARTITION_TABLE_ENTRY; // // Define the structure of the master boot record @@ -74,7 +75,8 @@ PARTITION_TABLE_ENTRY PartitionTable[4]; /* 0x1BE */ USHORT MasterBootRecordMagic; /* 0x1FE */ -} PACKED MASTER_BOOT_RECORD, *PMASTER_BOOT_RECORD; +} MASTER_BOOT_RECORD, *PMASTER_BOOT_RECORD; +#include <poppack.h> // // Partition type defines Modified: trunk/reactos/boot/freeldr/freeldr/include/drivemap.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/drivemap.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/drivemap.h Tue Feb 26 18:23:57 2008 @@ -21,13 +21,13 @@ #define __DRIVEMAP_H #ifdef __i386__ +#include <pshpack1.h> typedef struct { UCHAR DriveMapCount; // Count of drives currently mapped - CHAR DriveMap[8]; // Map of BIOS drives - -} PACKED DRIVE_MAP_LIST, *PDRIVE_MAP_LIST; +} DRIVE_MAP_LIST, *PDRIVE_MAP_LIST; +#include <poppack.h> VOID DriveMapMapDrivesInSection(PCSTR SectionName); BOOLEAN DriveMapIsValidDriveString(PCSTR DriveString); // Checks the drive string ("hd0") for validity Modified: trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h Tue Feb 26 18:23:57 2008 @@ -73,7 +73,11 @@ printk (KERN_DEBUG f, ## a); \ } while (0) #else -#define ext3_debug(f, a...) do {} while (0) + #ifdef __GNUC__ + #define ext3_debug(f, a...) do {} while (0) + #else + #define ext3_debug + #endif #endif /* Modified: trunk/reactos/boot/freeldr/freeldr/include/fs/fat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/fs/fat.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/fs/fat.h Tue Feb 26 18:23:57 2008 @@ -20,6 +20,7 @@ #ifndef __FAT_H #define __FAT_H +#include <pshpack1.h> typedef struct _FAT_BOOTSECTOR { UCHAR JumpBoot[3]; // Jump instruction to boot code @@ -47,7 +48,7 @@ USHORT BootSectorMagic; // 0xAA55 -} PACKED FAT_BOOTSECTOR, *PFAT_BOOTSECTOR; +} FAT_BOOTSECTOR, *PFAT_BOOTSECTOR; typedef struct _FAT32_BOOTSECTOR { @@ -83,7 +84,7 @@ USHORT BootSectorMagic; // 0xAA55 -} PACKED FAT32_BOOTSECTOR, *PFAT32_BOOTSECTOR; +} FAT32_BOOTSECTOR, *PFAT32_BOOTSECTOR; typedef struct _FATX_BOOTSECTOR { @@ -94,7 +95,7 @@ ULONG Unknown; /* Always 0? */ UCHAR Unused[494]; /* Actually size should be 4078 (boot block is 4096 bytes) */ -} PACKED FATX_BOOTSECTOR, *PFATX_BOOTSECTOR; +} FATX_BOOTSECTOR, *PFATX_BOOTSECTOR; /* * Structure of MSDOS directory entry @@ -113,7 +114,7 @@ USHORT Date; /* Date last modified */ USHORT ClusterLow; /* First cluster number low word */ ULONG Size; /* File size */ -} PACKED DIRENTRY, * PDIRENTRY; +} DIRENTRY, * PDIRENTRY; typedef struct { @@ -125,7 +126,7 @@ WCHAR Name5_10[6]; /* 6 more characters in name */ USHORT StartCluster; /* Starting cluster number */ WCHAR Name11_12[2]; /* Last 2 characters in name */ -} PACKED LFN_DIRENTRY, * PLFN_DIRENTRY; +} LFN_DIRENTRY, * PLFN_DIRENTRY; typedef struct { @@ -140,7 +141,8 @@ USHORT CreateDate; /* Date file was created */ USHORT LastAccessTime; /* Time file was last accessed */ USHORT LastAccessDate; /* Date file was last accessed */ -} PACKED FATX_DIRENTRY, * PFATX_DIRENTRY; +} FATX_DIRENTRY, * PFATX_DIRENTRY; +#include <poppack.h> typedef struct { Modified: trunk/reactos/boot/freeldr/freeldr/include/fs/iso.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/fs/iso.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/fs/iso.h Tue Feb 26 18:23:57 2008 @@ -20,7 +20,7 @@ #ifndef __ISO_H #define __ISO_H - +#include <pshpack1.h> struct _DIR_RECORD { UCHAR RecordLength; // 1 @@ -42,11 +42,8 @@ ULONG VolumeSequenceNumber; // 29-32 UCHAR FileIdLength; // 33 UCHAR FileId[1]; // 34 -} __attribute__((packed)); - +}; typedef struct _DIR_RECORD DIR_RECORD, *PDIR_RECORD; - - /* Volume Descriptor header*/ @@ -55,10 +52,8 @@ UCHAR VdType; // 1 UCHAR StandardId[5]; // 2-6 UCHAR VdVersion; // 7 -} __attribute__((packed)); - +}; typedef struct _VD_HEADER VD_HEADER, *PVD_HEADER; - /* Primary Volume Descriptor */ @@ -89,8 +84,8 @@ /* more data ... */ -} __attribute__((packed)); - +}; +#include <poppack.h> typedef struct _PVD PVD, *PPVD; Modified: trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/fs/ntfs.h Tue Feb 26 18:23:57 2008 @@ -59,6 +59,7 @@ #define NTFS_FILE_NAME_DOS 2 #define NTFS_FILE_NAME_WIN32_AND_DOS 3 +#include <pshpack1.h> typedef struct { UCHAR JumpBoot[3]; // Jump to the boot loader routine @@ -85,14 +86,14 @@ ULONGLONG VolumeSerialNumber; // Volume serial number UCHAR BootCodeAndData[430]; // The remainder of the boot sector USHORT BootSectorMagic; // 0xAA55 -} PACKED NTFS_BOOTSECTOR, *PNTFS_BOOTSECTOR; +} NTFS_BOOTSECTOR, *PNTFS_BOOTSECTOR; typedef struct { ULONG Magic; USHORT USAOffset; // Offset to the Update Sequence Array from the start of the ntfs record USHORT USACount; -} PACKED NTFS_RECORD, *PNTFS_RECORD; +} NTFS_RECORD, *PNTFS_RECORD; typedef struct { @@ -108,7 +109,7 @@ ULONG BytesAllocated; ULONGLONG BaseMFTRecord; USHORT NextAttributeInstance; -} PACKED NTFS_MFT_RECORD, *PNTFS_MFT_RECORD; +} NTFS_MFT_RECORD, *PNTFS_MFT_RECORD; typedef struct { @@ -127,7 +128,7 @@ ULONG ValueLength; USHORT ValueOffset; USHORT Flags; - } PACKED Resident; + } Resident; // Non-resident attributes struct { @@ -140,9 +141,9 @@ LONGLONG DataSize; LONGLONG InitializedSize; LONGLONG CompressedSize; - } PACKED NonResident; - } PACKED; -} PACKED NTFS_ATTR_RECORD, *PNTFS_ATTR_RECORD; + } NonResident; + }; +} NTFS_ATTR_RECORD, *PNTFS_ATTR_RECORD; typedef struct { @@ -151,7 +152,7 @@ ULONG AllocatedSize; UCHAR Flags; UCHAR Reserved[3]; -} PACKED NTFS_INDEX_HEADER, *PNTFS_INDEX_HEADER; +} NTFS_INDEX_HEADER, *PNTFS_INDEX_HEADER; typedef struct { @@ -161,7 +162,7 @@ UCHAR ClustersPerIndexBlock; UCHAR Reserved[3]; NTFS_INDEX_HEADER IndexHeader; -} PACKED NTFS_INDEX_ROOT, *PNTFS_INDEX_ROOT; +} NTFS_INDEX_ROOT, *PNTFS_INDEX_ROOT; typedef struct { @@ -178,7 +179,7 @@ UCHAR FileNameLength; UCHAR FileNameType; WCHAR FileName[0]; -} PACKED NTFS_FILE_NAME_ATTR, *PNTFS_FILE_NAME_ATTR; +} NTFS_FILE_NAME_ATTR, *PNTFS_FILE_NAME_ATTR; typedef struct { union @@ -186,20 +187,21 @@ struct { ULONGLONG IndexedFile; - } PACKED Directory; + } Directory; struct { USHORT DataOffset; USHORT DataLength; ULONG Reserved; - } PACKED ViewIndex; - } PACKED Data; + } ViewIndex; + } Data; USHORT Length; USHORT KeyLength; USHORT Flags; USHORT Reserved; NTFS_FILE_NAME_ATTR FileName; -} PACKED NTFS_INDEX_ENTRY, *PNTFS_INDEX_ENTRY; +} NTFS_INDEX_ENTRY, *PNTFS_INDEX_ENTRY; +#include <poppack.h> typedef struct { @@ -212,11 +214,13 @@ NTFS_ATTR_RECORD Record; } NTFS_ATTR_CONTEXT, *PNTFS_ATTR_CONTEXT; +#include <pshpack1.h> typedef struct { PNTFS_ATTR_CONTEXT DataContext; ULONGLONG Offset; -} PACKED NTFS_FILE_HANDLE, *PNTFS_FILE_HANDLE; +} NTFS_FILE_HANDLE, *PNTFS_FILE_HANDLE; +#include <poppack.h> BOOLEAN NtfsOpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector, ULONGLONG PartitionSectorCount); FILE* NtfsOpenFile(PCSTR FileName); Modified: trunk/reactos/boot/freeldr/freeldr/include/linux.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/linux.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/linux.h Tue Feb 26 18:23:57 2008 @@ -43,6 +43,7 @@ #define LINUX_MAX_INITRD_ADDRESS 0x38000000 +#include <pshpack1.h> typedef struct { UCHAR BootCode1[0x20]; @@ -61,7 +62,7 @@ USHORT RootDevice; USHORT BootFlag; // 0xAA55 -} PACKED LINUX_BOOTSECTOR, *PLINUX_BOOTSECTOR; +} LINUX_BOOTSECTOR, *PLINUX_BOOTSECTOR; typedef struct { @@ -122,7 +123,8 @@ ULONG InitrdAddressMax; // Highest legal initrd address -} PACKED LINUX_SETUPSECTOR, *PLINUX_SETUPSECTOR; +} LINUX_SETUPSECTOR, *PLINUX_SETUPSECTOR; +#include <poppack.h> VOID BootNewLinuxKernel(VOID); // Implemented in linux.S VOID BootOldLinuxKernel(ULONG KernelSize); // Implemented in linux.S Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/mm.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/mm.h Tue Feb 26 18:23:57 2008 @@ -29,13 +29,15 @@ BiosMemoryAcpiNvs } BIOS_MEMORY_TYPE; +#include <pshpack1.h> typedef struct { ULONGLONG BaseAddress; ULONGLONG Length; ULONG Type; ULONG Reserved; -} PACKED BIOS_MEMORY_MAP, *PBIOS_MEMORY_MAP; +} BIOS_MEMORY_MAP, *PBIOS_MEMORY_MAP; +#include <poppack.h> #if defined(__i386__) || defined(_PPC_) || defined(_MIPS_) || defined(_ARM_) @@ -52,11 +54,13 @@ #define HEAP_PAGES 0x400 #define STACK_PAGES 0x00 +#include <pshpack1.h> typedef struct { TYPE_OF_MEMORY PageAllocated; // Type of allocated memory (LoaderFree if this memory is free) ULONG PageAllocationLength; // Number of pages allocated (or zero if this isn't the first page in the chain) -} PACKED PAGE_LOOKUP_TABLE_ITEM, *PPAGE_LOOKUP_TABLE_ITEM; +} PAGE_LOOKUP_TABLE_ITEM, *PPAGE_LOOKUP_TABLE_ITEM; +#include <poppack.h> // // Define this to 1 if you want the entire contents Modified: trunk/reactos/boot/freeldr/freeldr/include/video.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/video.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/video.h Tue Feb 26 18:23:57 2008 @@ -20,12 +20,14 @@ #ifndef __VIDEO_H #define __VIDEO_H +#include <pshpack1.h> typedef struct { UCHAR Red; UCHAR Green; UCHAR Blue; -} PACKED PALETTE_ENTRY, *PPALETTE_ENTRY; +} PALETTE_ENTRY, *PPALETTE_ENTRY; +#include <poppack.h> extern PVOID VideoOffScreenBuffer; Modified: trunk/reactos/boot/freeldr/freeldr/include/winldr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/winldr.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/winldr.h Tue Feb 26 18:23:57 2008 @@ -1,111 +1,108 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer <brianp(a)sginet.com> - * Copyright (C) 2006 Aleksey Bragin <aleksey(a)reactos.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __WINLDR_H -#define __WINLDR_H - - -/////////////////////////////////////////////////////////////////////////////////////// -// -// ReactOS Loading Functions -// -/////////////////////////////////////////////////////////////////////////////////////// -VOID LoadAndBootWindows(PCSTR OperatingSystemName, WORD OperatingSystemVersion); - -/* Entry-point to kernel */ -typedef -VOID -NTAPI -(*KERNEL_ENTRY_POINT) (PLOADER_PARAMETER_BLOCK LoaderBlock); - - -// Some definitions -#define SECTOR_SIZE 512 - -// Descriptors -#define NUM_GDT 128 // Must be 128 -#define NUM_IDT 0x100 // only 16 are used though. Must be 0x100 - -// conversion.c -PVOID VaToPa(PVOID Va); -PVOID PaToVa(PVOID Pa); -VOID List_PaToVa(LIST_ENTRY *ListEntry); -VOID ConvertConfigToVA(PCONFIGURATION_COMPONENT_DATA Start); - -// peloader.c -BOOLEAN -WinLdrLoadImage(IN PCHAR FileName, - TYPE_OF_MEMORY MemoryType, - OUT PVOID *ImageBasePA); - - -BOOLEAN -WinLdrAllocateDataTableEntry(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock, - IN PCCH BaseDllName, - IN PCCH FullDllName, - IN PVOID BasePA, - OUT PLDR_DATA_TABLE_ENTRY *NewEntry); - -BOOLEAN -WinLdrScanImportDescriptorTable(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock, - IN PCCH DirectoryPath, - IN PLDR_DATA_TABLE_ENTRY ScanDTE); - -// winldr.c +/* + * FreeLoader + * Copyright (C) 1998-2003 Brian Palmer <brianp(a)sginet.com> + * Copyright (C) 2006 Aleksey Bragin <aleksey(a)reactos.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __WINLDR_H +#define __WINLDR_H + + +/////////////////////////////////////////////////////////////////////////////////////// +// +// ReactOS Loading Functions +// +/////////////////////////////////////////////////////////////////////////////////////// +VOID LoadAndBootWindows(PCSTR OperatingSystemName, WORD OperatingSystemVersion); + +/* Entry-point to kernel */ +typedef VOID (NTAPI *KERNEL_ENTRY_POINT) (PLOADER_PARAMETER_BLOCK LoaderBlock); + + +// Some definitions +#define SECTOR_SIZE 512 + +// Descriptors +#define NUM_GDT 128 // Must be 128 +#define NUM_IDT 0x100 // only 16 are used though. Must be 0x100 + +// conversion.c +PVOID VaToPa(PVOID Va); +PVOID PaToVa(PVOID Pa); +VOID List_PaToVa(LIST_ENTRY *ListEntry); +VOID ConvertConfigToVA(PCONFIGURATION_COMPONENT_DATA Start); + +// peloader.c +BOOLEAN +WinLdrLoadImage(IN PCHAR FileName, + TYPE_OF_MEMORY MemoryType, + OUT PVOID *ImageBasePA); + + +BOOLEAN +WinLdrAllocateDataTableEntry(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock, + IN PCCH BaseDllName, + IN PCCH FullDllName, + IN PVOID BasePA, + OUT PLDR_DATA_TABLE_ENTRY *NewEntry); + +BOOLEAN +WinLdrScanImportDescriptorTable(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock, + IN PCCH DirectoryPath, + IN PLDR_DATA_TABLE_ENTRY ScanDTE); + +// winldr.c PVOID WinLdrLoadModule(PCSTR ModuleName, ULONG *Size, - TYPE_OF_MEMORY MemoryType); - -// wlmemory.c -BOOLEAN -WinLdrTurnOnPaging(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, - ULONG PcrBasePage, - ULONG TssBasePage, - PVOID GdtIdt); - -// wlregistry.c -BOOLEAN WinLdrLoadAndScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, - IN LPCSTR DirectoryPath); - - -/* FIXME: Should be moved to NDK, and respective ACPI header files */ -typedef struct _ACPI_BIOS_DATA -{ - PHYSICAL_ADDRESS RSDTAddress; - ULONGLONG Count; - BIOS_MEMORY_MAP MemoryMap[1]; /* Count of BIOS memory map entries */ -} ACPI_BIOS_DATA, *PACPI_BIOS_DATA; - -#include <pshpack1.h> -typedef struct /* Root System Descriptor Pointer */ -{ - CHAR signature [8]; /* contains "RSD PTR " */ - UCHAR checksum; /* to make sum of struct == 0 */ - CHAR oem_id [6]; /* OEM identification */ - UCHAR revision; /* Must be 0 for 1.0, 2 for 2.0 */ - ULONG rsdt_physical_address; /* 32-bit physical address of RSDT */ - ULONG length; /* XSDT Length in bytes including hdr */ - ULONGLONG xsdt_physical_address; /* 64-bit physical address of XSDT */ - UCHAR extended_checksum; /* Checksum of entire table */ - CHAR reserved [3]; /* reserved field must be 0 */ -} RSDP_DESCRIPTOR, *PRSDP_DESCRIPTOR; -#include <poppack.h> - - -#endif // defined __WINLDR_H + TYPE_OF_MEMORY MemoryType); + +// wlmemory.c +BOOLEAN +WinLdrTurnOnPaging(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, + ULONG PcrBasePage, + ULONG TssBasePage, + PVOID GdtIdt); + +// wlregistry.c +BOOLEAN WinLdrLoadAndScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, + IN LPCSTR DirectoryPath); + + +/* FIXME: Should be moved to NDK, and respective ACPI header files */ +typedef struct _ACPI_BIOS_DATA +{ + PHYSICAL_ADDRESS RSDTAddress; + ULONGLONG Count; + BIOS_MEMORY_MAP MemoryMap[1]; /* Count of BIOS memory map entries */ +} ACPI_BIOS_DATA, *PACPI_BIOS_DATA; + +#include <pshpack1.h> +typedef struct /* Root System Descriptor Pointer */ +{ + CHAR signature [8]; /* contains "RSD PTR " */ + UCHAR checksum; /* to make sum of struct == 0 */ + CHAR oem_id [6]; /* OEM identification */ + UCHAR revision; /* Must be 0 for 1.0, 2 for 2.0 */ + ULONG rsdt_physical_address; /* 32-bit physical address of RSDT */ + ULONG length; /* XSDT Length in bytes including hdr */ + ULONGLONG xsdt_physical_address; /* 64-bit physical address of XSDT */ + UCHAR extended_checksum; /* Checksum of entire table */ + CHAR reserved [3]; /* reserved field must be 0 */ +} RSDP_DESCRIPTOR, *PRSDP_DESCRIPTOR; +#include <poppack.h> + + +#endif // defined __WINLDR_H
16 years, 10 months
1
0
0
0
[cwittich] 32492: only get the last error code when it is needed
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Feb 26 17:04:35 2008 New Revision: 32492 URL:
http://svn.reactos.org/svn/reactos?rev=32492&view=rev
Log: only get the last error code when it is needed Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcps…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.c (original) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.c Tue Feb 26 17:04:35 2008 @@ -37,7 +37,7 @@ { #ifdef DEBUG DWORD eMsgLen; - DWORD ErrNum = GetLastError(); + DWORD ErrNum; LPTSTR lpvSysMsg; TCHAR MessageBuffer[512]; FILE *hLogFile = NULL; @@ -47,6 +47,7 @@ if (PrintErrorMsg) { + ErrNum = GetLastError(); eMsgLen = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, ErrNum,
16 years, 10 months
1
0
0
0
[cwittich] 32491: fix formatting
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Feb 26 16:54:12 2008 New Revision: 32491 URL:
http://svn.reactos.org/svn/reactos?rev=32491&view=rev
Log: fix formatting Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/skel…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/skelserver.c (original) +++ trunk/reactos/base/services/tcpsvcs/skelserver.c Tue Feb 26 16:54:12 2008 @@ -59,53 +59,53 @@ while (!bShutDown) { - INT SelRet = 0; + INT SelRet = 0; - FD_ZERO(&ReadFDS); - FD_SET(ListeningSocket, &ReadFDS); + FD_ZERO(&ReadFDS); + FD_SET(ListeningSocket, &ReadFDS); - SelRet = select(0, &ReadFDS, NULL, NULL, &TimeVal); + SelRet = select(0, &ReadFDS, NULL, NULL, &TimeVal); if (SelRet == SOCKET_ERROR) { LogEvent(_T("select failed\n"), 0, TRUE); return; } - else if (SelRet > 0) - { - /* don't call FD_ISSET if bShutDown flag is set */ - if ((! bShutDown) || (FD_ISSET(ListeningSocket, &ReadFDS))) - { - Sock = accept(ListeningSocket, (SOCKADDR*)&Client, &nAddrSize); - if (Sock != INVALID_SOCKET) - { - _stprintf(buf, _T("Accepted connection to %s server from %s:%d\n"), - Name, inet_ntoa(Client.sin_addr), ntohs(Client.sin_port)); - LogEvent(buf, 0, FALSE); - _stprintf(buf, _T("Creating new thread for %s\n"), Name); - LogEvent(buf, 0, FALSE); + else if (SelRet > 0) + { + /* don't call FD_ISSET if bShutDown flag is set */ + if ((! bShutDown) || (FD_ISSET(ListeningSocket, &ReadFDS))) + { + Sock = accept(ListeningSocket, (SOCKADDR*)&Client, &nAddrSize); + if (Sock != INVALID_SOCKET) + { + _stprintf(buf, _T("Accepted connection to %s server from %s:%d\n"), + Name, inet_ntoa(Client.sin_addr), ntohs(Client.sin_port)); + LogEvent(buf, 0, FALSE); + _stprintf(buf, _T("Creating new thread for %s\n"), Name); + LogEvent(buf, 0, FALSE); - hThread = CreateThread(0, 0, Service, (void*)Sock, 0, &ThreadID); + hThread = CreateThread(0, 0, Service, (void*)Sock, 0, &ThreadID); - /* Check the return value for success. */ - if (hThread == NULL) - { - _stprintf(buf, _T("Failed to start worker thread for " - "the %s server....\n"), Name); - LogEvent(buf, 0, TRUE); - } - else - { - WaitForSingleObject(hThread, INFINITE); - CloseHandle(hThread); - } - } - else - { - LogEvent(_T("accept failed\n"), 0, TRUE); - return; - } - } - } + /* Check the return value for success. */ + if (hThread == NULL) + { + _stprintf(buf, _T("Failed to start worker thread for " + "the %s server....\n"), Name); + LogEvent(buf, 0, TRUE); + } + else + { + WaitForSingleObject(hThread, INFINITE); + CloseHandle(hThread); + } + } + else + { + LogEvent(_T("accept failed\n"), 0, TRUE); + return; + } + } + } } }
16 years, 10 months
1
0
0
0
[cwittich] 32490: don't try to wait on a NULL handle don't try to close a NULL handle
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Feb 26 16:48:22 2008 New Revision: 32490 URL:
http://svn.reactos.org/svn/reactos?rev=32490&view=rev
Log: don't try to wait on a NULL handle don't try to close a NULL handle Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c trunk/reactos/base/services/tcpsvcs/tcpsvcs.c Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/skel…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/skelserver.c (original) +++ trunk/reactos/base/services/tcpsvcs/skelserver.c Tue Feb 26 16:48:22 2008 @@ -93,10 +93,11 @@ "the %s server....\n"), Name); LogEvent(buf, 0, TRUE); } - - WaitForSingleObject(hThread, INFINITE); - - CloseHandle(hThread); + else + { + WaitForSingleObject(hThread, INFINITE); + CloseHandle(hThread); + } } else { Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcps…
============================================================================== --- trunk/reactos/base/services/tcpsvcs/tcpsvcs.c (original) +++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.c Tue Feb 26 16:48:22 2008 @@ -239,7 +239,8 @@ for(i = 0; i < NUM_SERVICES; i++) { - CloseHandle(hThread[i]); + if (hThread[i] != NULL) + CloseHandle(hThread[i]); } LogEvent(_T("Detaching Winsock2"), 0, FALSE);
16 years, 10 months
1
0
0
0
[hpoussin] 32489: Fix indentation, broken in r32487
by hpoussin@svn.reactos.org
Author: hpoussin Date: Tue Feb 26 16:39:22 2008 New Revision: 32489 URL:
http://svn.reactos.org/svn/reactos?rev=32489&view=rev
Log: Fix indentation, broken in r32487 Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
============================================================================== --- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c (original) +++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Tue Feb 26 16:39:22 2008 @@ -1740,8 +1740,8 @@ if (Status == STATUS_BUFFER_TOO_SMALL) { PnpEventSize += 0x400; - HeapFree(GetProcessHeap(), 0, PnpEvent); - PnpEvent = HeapAlloc(GetProcessHeap(), 0, PnpEventSize); + HeapFree(GetProcessHeap(), 0, PnpEvent); + PnpEvent = HeapAlloc(GetProcessHeap(), 0, PnpEventSize); if (PnpEvent == NULL) return ERROR_OUTOFMEMORY; continue;
16 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
46
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Results per page:
10
25
50
100
200