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
November 2007
----- 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
20 participants
888 discussions
Start a n
N
ew thread
[weiden] 30852: Check the GDI object type in GdiGetHandleUserData()
by weiden@svn.reactos.org
Author: weiden Date: Thu Nov 29 08:21:19 2007 New Revision: 30852 URL:
http://svn.reactos.org/svn/reactos?rev=30852&view=rev
Log: Check the GDI object type in GdiGetHandleUserData() Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h trunk/reactos/dll/win32/gdi32/misc/misc.c trunk/reactos/dll/win32/gdi32/objects/brush.c trunk/reactos/dll/win32/gdi32/objects/coord.c trunk/reactos/dll/win32/gdi32/objects/dc.c trunk/reactos/dll/win32/gdi32/objects/painting.c trunk/reactos/dll/win32/gdi32/objects/text.c Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/include/gd…
============================================================================== --- trunk/reactos/dll/win32/gdi32/include/gdi32p.h (original) +++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h Thu Nov 29 08:21:19 2007 @@ -122,6 +122,7 @@ BOOL GdiGetHandleUserData( HGDIOBJ hGdiObj, + DWORD ObjectType, PVOID *UserData ); Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/misc.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c Thu Nov 29 08:21:19 2007 @@ -115,10 +115,10 @@ return FALSE; } -BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, PVOID *UserData) +BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData) { PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj); - if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 && + if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == ObjectType && (Entry->Type << GDI_ENTRY_UPPER_SHIFT) == GDI_HANDLE_GET_UPPER(hGdiObj)) { HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1); @@ -152,7 +152,7 @@ PLDC GdiGetLDC(HDC hDC) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL; return Dc_Attr->pvLDC; } Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/br…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/brush.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/brush.c Thu Nov 29 08:21:19 2007 @@ -213,7 +213,7 @@ GetROP2(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->jROP2; } @@ -250,7 +250,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG) hdc) { @@ -277,7 +277,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (pt) { pt->x = Dc_Attr->ptlBrushOrigin.x; @@ -314,7 +314,7 @@ return FALSE; } #endif - if (GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) + if (GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) { PTEB pTeb = NtCurrentTeb(); if (lppt) Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/co…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/coord.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/coord.c Thu Nov 29 08:21:19 2007 @@ -98,8 +98,7 @@ INT i; PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (Dc_Attr->flXform & ( DEVICE_TO_WORLD_INVALID | // Force a full recalibration! PAGE_XLATE_CHANGED | // Changes or Updates have been made, @@ -126,8 +125,7 @@ INT i; PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (Dc_Attr->flXform & ( PAGE_XLATE_CHANGED | // Check for Changes and Updates PAGE_EXTENTS_CHANGED | @@ -155,8 +153,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if ( lpPoint ) { @@ -237,8 +234,7 @@ #endif PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; /* Check that graphics mode is GM_ADVANCED */ if ( Dc_Attr->iGraphicsMode != GM_ADVANCED ) return FALSE; @@ -255,8 +251,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if ((Dc_Attr->flXform & PAGE_EXTENTS_CHANGED) && (Dc_Attr->iMapMode == MM_ISOTROPIC)) // Something was updated, go to kernel. @@ -279,8 +274,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; lpPoint->x = Dc_Attr->ptlViewportOrg.x; lpPoint->y = Dc_Attr->ptlViewportOrg.y; if (Dc_Attr->dwLayout & LAYOUT_RTL) lpPoint->x = -lpPoint->x; @@ -298,8 +292,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; lpSize->cx = Dc_Attr->szlWindowExt.cx; lpSize->cy = Dc_Attr->szlWindowExt.cy; if (Dc_Attr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx; @@ -317,8 +310,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; lpPoint->x = Dc_Attr->ptlWindowOrg.x; lpPoint->y = Dc_Attr->ptlWindowOrg.y; return TRUE; @@ -357,8 +349,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (lpSize) { @@ -421,8 +412,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (lpPoint) { @@ -484,8 +474,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (lpSize) { @@ -556,8 +545,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (lpPoint) { @@ -583,8 +571,7 @@ ) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return GDI_ERROR; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return GDI_ERROR; return Dc_Attr->dwLayout; } Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/dc.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/dc.c Thu Nov 29 08:21:19 2007 @@ -65,7 +65,7 @@ PDC_ATTR Dc_Attr; PLDC pLDC; - GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr); + GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr); pLDC = LocalAlloc(LMEM_ZEROINIT, sizeof(LDC)); @@ -258,7 +258,7 @@ PDC_ATTR Dc_Attr; PLDC pLDC; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if ( Dc_Attr ) { @@ -330,7 +330,7 @@ PBRUSH_ATTR Brh_Attr; PTEB pTeb; - if ((!GdiGetHandleUserData(hObject, (PVOID) &Brh_Attr)) || + if ((!GdiGetHandleUserData(hObject, (DWORD)Type, (PVOID) &Brh_Attr)) || (Brh_Attr == NULL) ) break; pTeb = NtCurrentTeb(); @@ -387,7 +387,7 @@ HGDIOBJ hGO = NULL; PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return NULL; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL; switch (iType) { @@ -750,7 +750,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return CLR_INVALID; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return CLR_INVALID; return (COLORREF) Dc_Attr->ulPenClr; } @@ -765,7 +765,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return CLR_INVALID; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return CLR_INVALID; return (COLORREF) Dc_Attr->ulPenClr; } @@ -782,7 +782,7 @@ PDC_ATTR Dc_Attr; COLORREF OldColor = CLR_INVALID; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor; else { OldColor = (COLORREF) Dc_Attr->ulBrushClr; @@ -810,7 +810,7 @@ PDC_ATTR Dc_Attr; COLORREF OldColor = CLR_INVALID; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor; else { OldColor = (COLORREF) Dc_Attr->ulPenClr; @@ -834,7 +834,7 @@ GetBkColor(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->ulBackgroundClr; } @@ -851,7 +851,7 @@ PDC_ATTR Dc_Attr; COLORREF OldColor = CLR_INVALID; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor; #if 0 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -892,7 +892,7 @@ GetBkMode(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->lBkMode; } @@ -908,7 +908,7 @@ PDC_ATTR Dc_Attr; INT OldMode = 0; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldMode; #if 0 if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) { @@ -944,7 +944,7 @@ GetPolyFillMode(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->lFillMode; } @@ -978,7 +978,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc) { @@ -1004,7 +1004,7 @@ GetGraphicsMode(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->iGraphicsMode; } @@ -1023,7 +1023,7 @@ SetLastError(ERROR_INVALID_PARAMETER); return 0; } - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; if (iMode == Dc_Attr->iGraphicsMode) return iMode; @@ -1234,7 +1234,7 @@ GetMapMode(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->iMapMode; } @@ -1249,7 +1249,7 @@ ) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; #if 0 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -1274,7 +1274,7 @@ GetStretchBltMode(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->lStretchBltMode; } @@ -1307,7 +1307,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; oSMode = Dc_Attr->lStretchBltMode; Dc_Attr->lStretchBltMode = iStretchMode; @@ -1328,7 +1328,7 @@ GetHFONT(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return NULL; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL; return Dc_Attr->hlfntNew; } Modified: trunk/reactos/dll/win32/gdi32/objects/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/pa…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/painting.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/painting.c Thu Nov 29 08:21:19 2007 @@ -59,7 +59,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if ( Point ) { Modified: trunk/reactos/dll/win32/gdi32/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/text.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/text.c Thu Nov 29 08:21:19 2007 @@ -55,8 +55,7 @@ GdiGetCodePage(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; if (Dc_Attr->ulDirty_ & DIRTY_CHARSET) return LOWORD(NtGdiGetCharSet(hdc)); return LOWORD(Dc_Attr->iCS_CP); } @@ -73,8 +72,7 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hDc) != GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hDc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->lTextExtra; // return GetDCDWord( hDc, GdiGetTextCharExtra, 0); } @@ -444,8 +442,7 @@ return MFDRV_SetTextCharacterExtra( hDC, CharExtra ); // Wine port. } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)) return cExtra; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return cExtra; if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hDC) { @@ -470,8 +467,7 @@ GetTextAlign(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->lTextAlign; } @@ -485,8 +481,7 @@ GetTextColor(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->ulForegroundClr; } @@ -522,8 +517,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return OldMode; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldMode; OldMode = Dc_Attr->lTextAlign; Dc_Attr->lTextAlign = fMode; // Raw @@ -569,8 +563,7 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return OldColor; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor; OldColor = (COLORREF) Dc_Attr->ulForegroundClr; Dc_Attr->ulForegroundClr = (ULONG) crColor; @@ -606,8 +599,7 @@ return FALSE; } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || - (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc) {
17 years
1
0
0
0
[jimtabor] 30851: Fix typos again, use || and != this time.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Nov 29 06:48:32 2007 New Revision: 30851 URL:
http://svn.reactos.org/svn/reactos?rev=30851&view=rev
Log: Fix typos again, use || and != this time. Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c trunk/reactos/dll/win32/gdi32/objects/text.c Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/co…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/coord.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/coord.c Thu Nov 29 06:48:32 2007 @@ -98,8 +98,8 @@ INT i; PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if (Dc_Attr->flXform & ( DEVICE_TO_WORLD_INVALID | // Force a full recalibration! PAGE_XLATE_CHANGED | // Changes or Updates have been made, @@ -126,8 +126,8 @@ INT i; PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if (Dc_Attr->flXform & ( PAGE_XLATE_CHANGED | // Check for Changes and Updates PAGE_EXTENTS_CHANGED | @@ -155,8 +155,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if ( lpPoint ) { @@ -237,8 +237,8 @@ #endif PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)) return FALSE; /* Check that graphics mode is GM_ADVANCED */ if ( Dc_Attr->iGraphicsMode != GM_ADVANCED ) return FALSE; @@ -255,8 +255,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if ((Dc_Attr->flXform & PAGE_EXTENTS_CHANGED) && (Dc_Attr->iMapMode == MM_ISOTROPIC)) // Something was updated, go to kernel. @@ -279,8 +279,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; lpPoint->x = Dc_Attr->ptlViewportOrg.x; lpPoint->y = Dc_Attr->ptlViewportOrg.y; if (Dc_Attr->dwLayout & LAYOUT_RTL) lpPoint->x = -lpPoint->x; @@ -298,8 +298,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; lpSize->cx = Dc_Attr->szlWindowExt.cx; lpSize->cy = Dc_Attr->szlWindowExt.cy; if (Dc_Attr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx; @@ -317,8 +317,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; lpPoint->x = Dc_Attr->ptlWindowOrg.x; lpPoint->y = Dc_Attr->ptlWindowOrg.y; return TRUE; @@ -357,8 +357,8 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if (lpSize) { @@ -421,8 +421,8 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if (lpPoint) { @@ -484,8 +484,8 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if (lpSize) { @@ -556,8 +556,8 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if (lpPoint) { @@ -583,8 +583,8 @@ ) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return GDI_ERROR; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return GDI_ERROR; return Dc_Attr->dwLayout; } @@ -617,8 +617,8 @@ } } #endif - if (!GdiIsHandleValid((HGDIOBJ) hdc) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return GDI_ERROR; + if (!GdiIsHandleValid((HGDIOBJ) hdc) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return GDI_ERROR; return NtGdiSetLayout( hdc, -1, dwLayout); } @@ -629,8 +629,8 @@ STDCALL SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout) { - if (!GdiIsHandleValid((HGDIOBJ) hdc) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return GDI_ERROR; + if (!GdiIsHandleValid((HGDIOBJ) hdc) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return GDI_ERROR; return NtGdiSetLayout( hdc, wox, dwLayout); } Modified: trunk/reactos/dll/win32/gdi32/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/text.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/text.c Thu Nov 29 06:48:32 2007 @@ -55,8 +55,8 @@ GdiGetCodePage(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return 0; if (Dc_Attr->ulDirty_ & DIRTY_CHARSET) return LOWORD(NtGdiGetCharSet(hdc)); return LOWORD(Dc_Attr->iCS_CP); } @@ -73,8 +73,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hDc) == GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hDc) != GDI_OBJECT_TYPE_DC)) return 0; return Dc_Attr->lTextExtra; // return GetDCDWord( hDc, GdiGetTextCharExtra, 0); } @@ -444,8 +444,8 @@ return MFDRV_SetTextCharacterExtra( hDC, CharExtra ); // Wine port. } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC)) return cExtra; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)) return cExtra; if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hDC) { @@ -470,8 +470,8 @@ GetTextAlign(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return 0; return Dc_Attr->lTextAlign; } @@ -485,8 +485,8 @@ GetTextColor(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return 0; return Dc_Attr->ulForegroundClr; } @@ -502,9 +502,6 @@ { PDC_ATTR Dc_Attr; INT OldMode = 0; - - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return OldMode; #if 0 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -525,6 +522,9 @@ } } #endif + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return OldMode; + OldMode = Dc_Attr->lTextAlign; Dc_Attr->lTextAlign = fMode; // Raw if (Dc_Attr->dwLayout & LAYOUT_RTL) @@ -569,8 +569,8 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return OldColor; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return OldColor; OldColor = (COLORREF) Dc_Attr->ulForegroundClr; Dc_Attr->ulForegroundClr = (ULONG) crColor; @@ -606,8 +606,8 @@ return FALSE; } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && - (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) || + (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) return FALSE; if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc) {
17 years
1
0
0
0
[jimtabor] 30850: Fix typos and add check for DC type object.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Nov 29 06:32:23 2007 New Revision: 30850 URL:
http://svn.reactos.org/svn/reactos?rev=30850&view=rev
Log: Fix typos and add check for DC type object. Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c trunk/reactos/dll/win32/gdi32/objects/text.c Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/co…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/coord.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/coord.c Thu Nov 29 06:32:23 2007 @@ -98,7 +98,8 @@ INT i; PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if (Dc_Attr->flXform & ( DEVICE_TO_WORLD_INVALID | // Force a full recalibration! PAGE_XLATE_CHANGED | // Changes or Updates have been made, @@ -125,7 +126,8 @@ INT i; PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if (Dc_Attr->flXform & ( PAGE_XLATE_CHANGED | // Check for Changes and Updates PAGE_EXTENTS_CHANGED | @@ -153,7 +155,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if ( lpPoint ) { @@ -234,7 +237,8 @@ #endif PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC)) return FALSE; /* Check that graphics mode is GM_ADVANCED */ if ( Dc_Attr->iGraphicsMode != GM_ADVANCED ) return FALSE; @@ -251,7 +255,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if ((Dc_Attr->flXform & PAGE_EXTENTS_CHANGED) && (Dc_Attr->iMapMode == MM_ISOTROPIC)) // Something was updated, go to kernel. @@ -274,7 +279,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; lpPoint->x = Dc_Attr->ptlViewportOrg.x; lpPoint->y = Dc_Attr->ptlViewportOrg.y; if (Dc_Attr->dwLayout & LAYOUT_RTL) lpPoint->x = -lpPoint->x; @@ -292,7 +298,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; lpSize->cx = Dc_Attr->szlWindowExt.cx; lpSize->cy = Dc_Attr->szlWindowExt.cy; if (Dc_Attr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx; @@ -310,7 +317,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; lpPoint->x = Dc_Attr->ptlWindowOrg.x; lpPoint->y = Dc_Attr->ptlWindowOrg.y; return TRUE; @@ -349,13 +357,17 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if (lpSize) { lpSize->cx = Dc_Attr->szlWindowExt.cx; lpSize->cy = Dc_Attr->szlWindowExt.cy; } + + if ((Dc_Attr->ptlWindowExt.cx == nXExtent) && (Dc_Attr->ptlWindowExt.cy == nYExtent)) + return TRUE; if ((Dc_Attr->iMapMode == MM_ISOTROPIC) && (Dc_Attr->iMapMode == MM_ANISOTROPIC)) { @@ -409,7 +421,8 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if (lpPoint) { @@ -471,13 +484,14 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if (lpSize) { lpSize->cx = Dc_Attr->szlWindowExt.cx; lpSize->cy = Dc_Attr->szlWindowExt.cy; - if (Dc_Attr->dwLayout & LAYOUT_RTL) -lpSize->cx; + if (Dc_Attr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx; } if (Dc_Attr->dwLayout & LAYOUT_RTL) @@ -542,15 +556,17 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; if (lpPoint) { lpPoint->x = Dc_Attr->ptlViewportOrg.x; lpPoint->y = Dc_Attr->ptlViewportOrg.y; - if (Dc_Attr->dwLayout & LAYOUT_RTL) -lpPoint->x; + if (Dc_Attr->dwLayout & LAYOUT_RTL) lpPoint->x = -lpPoint->x; } Dc_Attr->flXform |= (PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID); + if (Dc_Attr->dwLayout & LAYOUT_RTL) X = -X; Dc_Attr->ptlViewportOrg.x = X; Dc_Attr->ptlViewportOrg.y = Y; return TRUE; @@ -567,7 +583,8 @@ ) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return GDI_ERROR; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return GDI_ERROR; return Dc_Attr->dwLayout; } @@ -600,7 +617,8 @@ } } #endif - if (!GdiIsHandleValid((HGDIOBJ) hdc)) return GDI_ERROR; + if (!GdiIsHandleValid((HGDIOBJ) hdc) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return GDI_ERROR; return NtGdiSetLayout( hdc, -1, dwLayout); } @@ -611,7 +629,8 @@ STDCALL SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout) { - if (!GdiIsHandleValid((HGDIOBJ) hdc)) return GDI_ERROR; + if (!GdiIsHandleValid((HGDIOBJ) hdc) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return GDI_ERROR; return NtGdiSetLayout( hdc, wox, dwLayout); } Modified: trunk/reactos/dll/win32/gdi32/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/text.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/text.c Thu Nov 29 06:32:23 2007 @@ -55,7 +55,8 @@ GdiGetCodePage(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return 0; if (Dc_Attr->ulDirty_ & DIRTY_CHARSET) return LOWORD(NtGdiGetCharSet(hdc)); return LOWORD(Dc_Attr->iCS_CP); } @@ -72,7 +73,8 @@ { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hDc) == GDI_OBJECT_TYPE_DC)) return 0; return Dc_Attr->lTextExtra; // return GetDCDWord( hDc, GdiGetTextCharExtra, 0); } @@ -442,7 +444,8 @@ return MFDRV_SetTextCharacterExtra( hDC, CharExtra ); // Wine port. } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return cExtra; + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC)) return cExtra; if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hDC) { @@ -467,7 +470,8 @@ GetTextAlign(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return 0; return Dc_Attr->lTextAlign; } @@ -481,7 +485,8 @@ GetTextColor(HDC hdc) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return 0; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return 0; return Dc_Attr->ulForegroundClr; } @@ -498,7 +503,8 @@ PDC_ATTR Dc_Attr; INT OldMode = 0; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldMode; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return OldMode; #if 0 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -521,7 +527,11 @@ #endif OldMode = Dc_Attr->lTextAlign; Dc_Attr->lTextAlign = fMode; // Raw - Dc_Attr->flTextAlign = fMode & 0x1f; + if (Dc_Attr->dwLayout & LAYOUT_RTL) + { + if(!(fMode & TA_CENTER)) fMode |= TA_RIGHT; + } + Dc_Attr->flTextAlign = fMode & (TA_BASELINE|TA_UPDATECP|TA_CENTER); return OldMode; } @@ -539,8 +549,6 @@ { PDC_ATTR Dc_Attr; COLORREF OldColor = CLR_INVALID; - - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor; #if 0 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -561,6 +569,9 @@ } } #endif + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return OldColor; + OldColor = (COLORREF) Dc_Attr->ulForegroundClr; Dc_Attr->ulForegroundClr = (ULONG) crColor; @@ -584,7 +595,6 @@ ) { PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; #if 0 if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -596,6 +606,9 @@ return FALSE; } #endif + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr) && + (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_DC)) return FALSE; + if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc) { if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
17 years
1
0
0
0
[tkreuzer] 30849: Another test for AddFontResourceEx
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Nov 29 02:45:23 2007 New Revision: 30849 URL:
http://svn.reactos.org/svn/reactos?rev=30849&view=rev
Log: Another test for AddFontResourceEx Modified: trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c Modified: trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/A…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c (original) +++ trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c Thu Nov 29 02:45:23 2007 @@ -4,6 +4,17 @@ Test_AddFontResourceEx(PTESTINFO pti) { WCHAR szFileName[MAX_PATH]; + + /* Test NULL filename */ + SetLastError(ERROR_SUCCESS); + /* Windows crashes, would need SEH here */ +// TEST(AddFontResourceExW(NULL, 0, 0) != 0); +// TEST(GetLastError() == ERROR_SUCCESS); + + /* Test "" filename */ + SetLastError(ERROR_SUCCESS); + TEST(AddFontResourceExW(L"", 0, 0) == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); GetEnvironmentVariableW(L"systemroot", szFileName, MAX_PATH); wcscat(szFileName, L"\\Fonts\\cour.ttf");
17 years
1
0
0
0
[tkreuzer] 30848: Query the gdi handle table for later use in tests
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Nov 29 02:41:11 2007 New Revision: 30848 URL:
http://svn.reactos.org/svn/reactos?rev=30848&view=rev
Log: Query the gdi handle table for later use in tests Modified: trunk/rostests/apitests/gdi32api/gdi32api.c trunk/rostests/apitests/gdi32api/gdi32api.h Modified: trunk/rostests/apitests/gdi32api/gdi32api.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/gdi32ap…
============================================================================== --- trunk/rostests/apitests/gdi32api/gdi32api.c (original) +++ trunk/rostests/apitests/gdi32api/gdi32api.c Thu Nov 29 02:41:11 2007 @@ -1,6 +1,7 @@ #include "gdi32api.h" HINSTANCE g_hInstance; +PGDI_TABLE_ENTRY GdiHandleTable; BOOL IsFunctionPresent(LPWSTR lpszFunction) @@ -14,6 +15,20 @@ LPSTR lpCmdLine, int nCmdShow) { + GDIQUERYPROC GdiQueryTable; + g_hInstance = hInstance; + + GdiQueryTable = (GDIQUERYPROC)GetProcAddress(GetModuleHandleW(L"GDI32.DLL"), "GdiQueryTable"); + if(!GdiQueryTable) + { + return -1; + } + GdiHandleTable = GdiQueryTable(); + if(!GdiHandleTable) + { + return -1; + } + return TestMain(L"gdi32api", L"gdi32.dll"); } Modified: trunk/rostests/apitests/gdi32api/gdi32api.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/gdi32ap…
============================================================================== --- trunk/rostests/apitests/gdi32api/gdi32api.h (original) +++ trunk/rostests/apitests/gdi32api/gdi32api.h Thu Nov 29 02:41:11 2007 @@ -5,6 +5,7 @@ #include "gdi.h" extern HINSTANCE g_hInstance; +extern PGDI_TABLE_ENTRY GdiHandleTable; #endif /* _GDITEST_H */
17 years
1
0
0
0
[tkreuzer] 30847: - some more tests for GetObject
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Nov 29 02:39:45 2007 New Revision: 30847 URL:
http://svn.reactos.org/svn/reactos?rev=30847&view=rev
Log: - some more tests for GetObject Modified: trunk/rostests/apitests/gdi32api/tests/GetStockObject.c Modified: trunk/rostests/apitests/gdi32api/tests/GetStockObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/GetStockObject.c (original) +++ trunk/rostests/apitests/gdi32api/tests/GetStockObject.c Thu Nov 29 02:39:45 2007 @@ -4,6 +4,7 @@ /* Test limits and error */ SetLastError(ERROR_SUCCESS); RTEST(GetStockObject(0) != NULL); + TEST(GetStockObject(20) != NULL); TEST(GetStockObject(21) != NULL); RTEST(GetStockObject(-1) == NULL); RTEST(GetStockObject(9) == NULL); @@ -14,12 +15,27 @@ RTEST((UINT)GetStockObject(WHITE_BRUSH) && GDI_HANDLE_STOCK_MASK); /* Test for correct types */ - RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); - RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT); - RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 0 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(LTGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(GRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DKGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); /* 6 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_PEN)) == GDI_OBJECT_TYPE_PEN); /* 7 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_PEN)) == GDI_OBJECT_TYPE_PEN); /* 8 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(OEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 10 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 11 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT); /* 12 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FONT)) == GDI_OBJECT_TYPE_FONT); /* 13 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEVICE_DEFAULT_FONT)) == GDI_OBJECT_TYPE_FONT); /* 14 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); /* 15 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 16 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_GUI_FONT)) == GDI_OBJECT_TYPE_FONT); /* 17 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 18 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); /* 19 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(20)) == GDI_OBJECT_TYPE_COLORSPACE); /* 20 */ + TEST(GDI_HANDLE_GET_TYPE(GetStockObject(21)) == GDI_OBJECT_TYPE_BITMAP); /* 21 */ return APISTATUS_NORMAL; }
17 years
1
0
0
0
[cfinck] 30846: Looks like my previous changes were already enough, so we can finally remove this hack :-) See issue #2779 for more details.
by cfinck@svn.reactos.org
Author: cfinck Date: Thu Nov 29 02:02:12 2007 New Revision: 30846 URL:
http://svn.reactos.org/svn/reactos?rev=30846&view=rev
Log: Looks like my previous changes were already enough, so we can finally remove this hack :-) See issue #2779 for more details. Modified: trunk/reactos/tools/tools.mak Modified: trunk/reactos/tools/tools.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/tools.mak?rev=30846&…
============================================================================== --- trunk/reactos/tools/tools.mak (original) +++ trunk/reactos/tools/tools.mak Thu Nov 29 02:02:12 2007 @@ -8,10 +8,6 @@ TOOLS_CFLAGS = -Wall -Wpointer-arith -Wno-strict-aliasing -D__REACTOS__ $(HOST_CFLAGS) TOOLS_CPPFLAGS = -Wall -Wpointer-arith -D__REACTOS__ $(HOST_CPPFLAGS) TOOLS_LFLAGS = $(HOST_LFLAGS) - -# HACK: Remove those lines once host tools don't use target headers anymore -TOOLS_CFLAGS += -D__i386__ -TOOLS_CPPFLAGS += -D__i386__ $(TOOLS_INT): | $(INTERMEDIATE) $(ECHO_MKDIR)
17 years
1
0
0
0
[fireball] 30845: - Cleanup kdb_cli's code: be consistent in used types, don't use unsigned vars and then check if it's below 0, don't use inline assembly if there are reactos intrinsics for this.
by fireball@svn.reactos.org
Author: fireball Date: Thu Nov 29 01:50:55 2007 New Revision: 30845 URL:
http://svn.reactos.org/svn/reactos?rev=30845&view=rev
Log: - Cleanup kdb_cli's code: be consistent in used types, don't use unsigned vars and then check if it's below 0, don't use inline assembly if there are reactos intrinsics for this. Modified: trunk/reactos/ntoskrnl/include/internal/ctype.h trunk/reactos/ntoskrnl/kdbg/kdb_cli.c Modified: trunk/reactos/ntoskrnl/include/internal/ctype.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ctype.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ctype.h Thu Nov 29 01:50:55 2007 @@ -40,5 +40,6 @@ extern inline int isdigit(int c); extern inline int isxdigit(int c); extern inline int isprint(int c); +extern inline int isalpha(int c); #endif Modified: trunk/reactos/ntoskrnl/kdbg/kdb_cli.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_cli.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb_cli.c (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb_cli.c Thu Nov 29 01:50:55 2007 @@ -483,8 +483,8 @@ else if (Argv[0][0] == 'c') /* cregs */ { ULONG Cr0, Cr2, Cr3, Cr4; - KDESCRIPTOR Gdtr, Ldtr, Idtr; - ULONG Tr; + KDESCRIPTOR Gdtr = {0}, Ldtr = {0}, Idtr = {0}; + ULONG Tr = 0; STATIC CONST PCHAR Cr0Bits[32] = { " PE", " MP", " EM", " TS", " ET", " NE", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, " WP", NULL, " AM", NULL, NULL, NULL, NULL, NULL, @@ -500,12 +500,12 @@ Cr4 = KdbCurrentTrapFrame->Cr4; /* Get descriptor table regs */ - asm volatile("sgdt %0" : : "m"(Gdtr.Limit)); - asm volatile("sldt %0" : : "m"(Ldtr.Limit)); - asm volatile("sidt %0" : : "m"(Idtr.Limit)); + Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&Gdtr.Limit); + Ke386GetLocalDescriptorTable(Ldtr.Limit); + Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&Idtr.Limit); /* Get the task register */ - asm volatile("str %0" : "=g"(Tr)); + Ke386GetTr(Tr); /* Display the control registers */ KdbpPrint("CR0 0x%08x ", Cr0); @@ -842,7 +842,8 @@ KDB_BREAKPOINT_TYPE Type; UCHAR Size = 0; KDB_ACCESS_TYPE AccessType = 0; - UINT AddressArgIndex, ConditionArgIndex, i; + ULONG AddressArgIndex, i; + LONG ConditionArgIndex; BOOLEAN Global = TRUE; if (Argv[0][2] == 'x') /* software breakpoint */ @@ -1188,8 +1189,8 @@ { return TRUE; } - KdbpPrint("Attached to process 0x%08x, thread 0x%08x.\n", (UINT)ul, - (UINT)KdbCurrentThread->Cid.UniqueThread); + KdbpPrint("Attached to process 0x%08x, thread 0x%08x.\n", (ULONG)ul, + (ULONG)KdbCurrentThread->Cid.UniqueThread); } else { @@ -1289,10 +1290,7 @@ STATIC BOOLEAN KdbpCmdGdtLdtIdt(ULONG Argc, PCHAR Argv[]) { - struct __attribute__((packed)) { - USHORT Limit; - ULONG Base; - } Reg; + KDESCRIPTOR Reg = {0}; ULONG SegDesc[2]; ULONG SegBase; ULONG SegLimit; @@ -1305,7 +1303,7 @@ if (Argv[0][0] == 'i') { /* Read IDTR */ - asm volatile("sidt %0" : : "m"(Reg)); + Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&Reg.Limit); if (Reg.Limit < 7) { @@ -1362,14 +1360,14 @@ if (Argv[0][0] == 'g') { /* Read GDTR */ - asm volatile("sgdt %0" : : "m"(Reg)); + Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&Reg.Limit); i = 8; } else { ASSERT(Argv[0][0] == 'l'); /* Read LDTR */ - asm volatile("sldt %0" : : "m"(Reg)); + Ke386GetLocalDescriptorTable(Reg.Limit); i = 0; ul = 1 << 2; } @@ -1567,7 +1565,7 @@ STATIC BOOLEAN KdbpCmdSet(ULONG Argc, PCHAR Argv[]) { - ULONG l; + LONG l; BOOLEAN First; PCHAR pend = 0; KDB_ENTER_CONDITION ConditionFirst = KdbDoNotEnter; @@ -1765,9 +1763,9 @@ STATIC BOOLEAN TerminalReportsSize = TRUE; CHAR c = '\0'; PCHAR p, p2; - UINT Length; - UINT i, j; - INT RowsPrintedByTerminal; + ULONG Length; + ULONG i, j; + LONG RowsPrintedByTerminal; ULONG ScanCode; va_list ap; @@ -2210,7 +2208,7 @@ * \retval TRUE Don't continue execution. * \retval FALSE Continue execution (leave KDB) */ -STATIC BOOL +STATIC BOOLEAN KdbpDoCommand( IN PCHAR Command) { @@ -2390,7 +2388,7 @@ HANDLE hFile = NULL; INT FileSize; PCHAR FileBuffer; - ULONG OldEflags; + ULONG OldEflags = 0; /* Initialize the object attributes */ RtlInitUnicodeString(&FileName, L"\\SystemRoot\\system32\\drivers\\etc\\KDBinit");
17 years
1
0
0
0
[weiden] 30844: Fix typo in RegpApplyRestrictions (patch submitted to WINE by Andrew Talbot)
by weiden@svn.reactos.org
Author: weiden Date: Thu Nov 29 01:37:23 2007 New Revision: 30844 URL:
http://svn.reactos.org/svn/reactos?rev=30844&view=rev
Log: Fix typo in RegpApplyRestrictions (patch submitted to WINE by Andrew Talbot) Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.c (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.c Thu Nov 29 01:37:23 2007 @@ -1721,7 +1721,7 @@ if ((dwFlags & RRF_RT_DWORD) == RRF_RT_DWORD) cbExpect = 4; - else if ((dwFlags & RRF_RT_DWORD) == RRF_RT_QWORD) + else if ((dwFlags & RRF_RT_QWORD) == RRF_RT_QWORD) cbExpect = 8; if (cbExpect && cbData != cbExpect)
17 years
1
0
0
0
[cfinck] 30843: Don't define the "min" and "max" macros in the general "typedefs.h", they conflict with the similar functions in the "std" namespace in C++ apps then. Instead just define them in widl, this is currently the only place where we need them.
by cfinck@svn.reactos.org
Author: cfinck Date: Thu Nov 29 01:01:17 2007 New Revision: 30843 URL:
http://svn.reactos.org/svn/reactos?rev=30843&view=rev
Log: Don't define the "min" and "max" macros in the general "typedefs.h", they conflict with the similar functions in the "std" namespace in C++ apps then. Instead just define them in widl, this is currently the only place where we need them. Modified: trunk/reactos/include/host/typedefs.h trunk/reactos/tools/widl/widltypes.h Modified: trunk/reactos/include/host/typedefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/host/typedefs.h?re…
============================================================================== --- trunk/reactos/include/host/typedefs.h (original) +++ trunk/reactos/include/host/typedefs.h Thu Nov 29 01:01:17 2007 @@ -227,9 +227,6 @@ typedef const UNICODE_STRING *PCUNICODE_STRING; /* Widely used macros */ -#define min(a, b) ((a) < (b) ? (a) : (b)) -#define max(a,b) ((a) < (b) ? (b) : (a)) - #define LOBYTE(w) ((BYTE)(w)) #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF)) #define LOWORD(l) ((WORD)((DWORD_PTR)(l))) Modified: trunk/reactos/tools/widl/widltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widltypes.h?rev…
============================================================================== --- trunk/reactos/tools/widl/widltypes.h (original) +++ trunk/reactos/tools/widl/widltypes.h Thu Nov 29 01:01:17 2007 @@ -26,6 +26,9 @@ #define S_FALSE ((HRESULT)0x00000001L) #define E_OUTOFMEMORY ((HRESULT)0x8007000EL) #define TYPE_E_IOERROR ((HRESULT)0x80028CA2L) + +#define min(a, b) ((a) < (b) ? (a) : (b)) +#define max(a,b) ((a) < (b) ? (b) : (a)) #include <stdarg.h> #include "guiddef.h"
17 years
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
89
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Results per page:
10
25
50
100
200