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
January 2009
----- 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
30 participants
755 discussions
Start a n
N
ew thread
[tkreuzer] 39203: formatting, no code change
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 29 15:33:38 2009 New Revision: 39203 URL:
http://svn.reactos.org/svn/reactos?rev=39203&view=rev
Log: formatting, no code change Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] Thu Jan 29 15:33:38 2009 @@ -37,30 +37,30 @@ void FASTCALL IntFixIsotropicMapping(PDC dc) { - ULONG xdim; - ULONG ydim; - PDC_ATTR Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - xdim = EngMulDiv(Dc_Attr->szlViewportExt.cx, - ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize, - ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes) / - Dc_Attr->szlWindowExt.cx; - ydim = EngMulDiv(Dc_Attr->szlViewportExt.cy, - ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize, - ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes) / - Dc_Attr->szlWindowExt.cy; - - if (xdim > ydim) - { - Dc_Attr->szlViewportExt.cx = Dc_Attr->szlViewportExt.cx * abs(ydim / xdim); - if (!Dc_Attr->szlViewportExt.cx) Dc_Attr->szlViewportExt.cx = 1; - } - else - { - Dc_Attr->szlViewportExt.cy = Dc_Attr->szlViewportExt.cy * abs(xdim / ydim); - if (!Dc_Attr->szlViewportExt.cy) Dc_Attr->szlViewportExt.cy = 1; - } + ULONG xdim; + ULONG ydim; + PDC_ATTR Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + xdim = EngMulDiv(Dc_Attr->szlViewportExt.cx, + ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize, + ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes) / + Dc_Attr->szlWindowExt.cx; + ydim = EngMulDiv(Dc_Attr->szlViewportExt.cy, + ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize, + ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes) / + Dc_Attr->szlWindowExt.cy; + + if (xdim > ydim) + { + Dc_Attr->szlViewportExt.cx = Dc_Attr->szlViewportExt.cx * abs(ydim / xdim); + if (!Dc_Attr->szlViewportExt.cx) Dc_Attr->szlViewportExt.cx = 1; + } + else + { + Dc_Attr->szlViewportExt.cy = Dc_Attr->szlViewportExt.cy * abs(xdim / ydim); + if (!Dc_Attr->szlViewportExt.cy) Dc_Attr->szlViewportExt.cy = 1; + } } BOOL FASTCALL @@ -68,64 +68,60 @@ LPXFORM xform1, LPXFORM xform2) { - XFORM xformTemp; - /* Check for illegal parameters */ - if (!XFormResult || !xform1 || !xform2) - { - return FALSE; - } - - /* Create the result in a temporary XFORM, since xformResult may be - * equal to xform1 or xform2 */ - xformTemp.eM11 = xform1->eM11 * xform2->eM11 + xform1->eM12 * xform2->eM21; - xformTemp.eM12 = xform1->eM11 * xform2->eM12 + xform1->eM12 * xform2->eM22; - xformTemp.eM21 = xform1->eM21 * xform2->eM11 + xform1->eM22 * xform2->eM21; - xformTemp.eM22 = xform1->eM21 * xform2->eM12 + xform1->eM22 * xform2->eM22; - xformTemp.eDx = xform1->eDx * xform2->eM11 + xform1->eDy * xform2->eM21 + xform2->eDx; - xformTemp.eDy = xform1->eDx * xform2->eM12 + xform1->eDy * xform2->eM22 + xform2->eDy; - *XFormResult = xformTemp; - - return TRUE; + XFORM xformTemp; + /* Check for illegal parameters */ + if (!XFormResult || !xform1 || !xform2) + { + return FALSE; + } + + /* Create the result in a temporary XFORM, since xformResult may be + * equal to xform1 or xform2 */ + xformTemp.eM11 = xform1->eM11 * xform2->eM11 + xform1->eM12 * xform2->eM21; + xformTemp.eM12 = xform1->eM11 * xform2->eM12 + xform1->eM12 * xform2->eM22; + xformTemp.eM21 = xform1->eM21 * xform2->eM11 + xform1->eM22 * xform2->eM21; + xformTemp.eM22 = xform1->eM21 * xform2->eM12 + xform1->eM22 * xform2->eM22; + xformTemp.eDx = xform1->eDx * xform2->eM11 + xform1->eDy * xform2->eM21 + xform2->eDx; + xformTemp.eDy = xform1->eDx * xform2->eM12 + xform1->eDy * xform2->eM22 + xform2->eDy; + *XFormResult = xformTemp; + + return TRUE; } BOOL APIENTRY NtGdiCombineTransform(LPXFORM UnsafeXFormResult, - LPXFORM Unsafexform1, - LPXFORM Unsafexform2) -{ - BOOL Ret; - - _SEH2_TRY - { - ProbeForWrite(UnsafeXFormResult, - sizeof(XFORM), - 1); - ProbeForRead(Unsafexform1, - sizeof(XFORM), - 1); - ProbeForRead(Unsafexform2, - sizeof(XFORM), - 1); - Ret = IntGdiCombineTransform(UnsafeXFormResult, Unsafexform1, Unsafexform2); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Ret = FALSE; - } - _SEH2_END; - - return Ret; + LPXFORM Unsafexform1, + LPXFORM Unsafexform2) +{ + BOOL Ret; + + _SEH2_TRY + { + ProbeForWrite(UnsafeXFormResult, sizeof(XFORM), 1); + ProbeForRead(Unsafexform1, sizeof(XFORM), 1); + ProbeForRead(Unsafexform2, sizeof(XFORM), 1); + Ret = IntGdiCombineTransform(UnsafeXFormResult, + Unsafexform1, + Unsafexform2); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Ret = FALSE; + } + _SEH2_END; + + return Ret; } int FASTCALL -IntGetGraphicsMode ( PDC dc ) -{ - PDC_ATTR Dc_Attr; - ASSERT ( dc ); - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - return Dc_Attr->iGraphicsMode; +IntGetGraphicsMode(PDC dc) +{ + PDC_ATTR Dc_Attr; + ASSERT(dc); + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + return Dc_Attr->iGraphicsMode; } BOOL @@ -134,88 +130,86 @@ CONST LPXFORM lpXForm, DWORD Mode) { - ASSERT(pDc); - XFORM xformWorld2Wnd; - - switch(Mode) - { - case MWT_IDENTITY: - xformWorld2Wnd.eM11 = 1.0f; - xformWorld2Wnd.eM12 = 0.0f; - xformWorld2Wnd.eM21 = 0.0f; - xformWorld2Wnd.eM22 = 1.0f; - xformWorld2Wnd.eDx = 0.0f; - xformWorld2Wnd.eDy = 0.0f; - XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, &xformWorld2Wnd); - break; - - case MWT_LEFTMULTIPLY: - MatrixS2XForm(&xformWorld2Wnd, &pDc->DcLevel.mxWorldToPage); - IntGdiCombineTransform(&xformWorld2Wnd, lpXForm, &xformWorld2Wnd); - XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, &xformWorld2Wnd); - break; - - case MWT_RIGHTMULTIPLY: - MatrixS2XForm(&xformWorld2Wnd, &pDc->DcLevel.mxWorldToPage); - IntGdiCombineTransform(&xformWorld2Wnd, &xformWorld2Wnd, lpXForm); - XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, &xformWorld2Wnd); - break; - - case MWT_MAX+1: // Must be MWT_SET???? - XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, lpXForm); // Do it like Wine. - break; - - default: - return FALSE; - } - DC_UpdateXforms(pDc); - return TRUE; + ASSERT(pDc); + XFORM xformWorld2Wnd; + + switch (Mode) + { + case MWT_IDENTITY: + xformWorld2Wnd.eM11 = 1.0f; + xformWorld2Wnd.eM12 = 0.0f; + xformWorld2Wnd.eM21 = 0.0f; + xformWorld2Wnd.eM22 = 1.0f; + xformWorld2Wnd.eDx = 0.0f; + xformWorld2Wnd.eDy = 0.0f; + XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, &xformWorld2Wnd); + break; + + case MWT_LEFTMULTIPLY: + MatrixS2XForm(&xformWorld2Wnd, &pDc->DcLevel.mxWorldToPage); + IntGdiCombineTransform(&xformWorld2Wnd, lpXForm, &xformWorld2Wnd); + XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, &xformWorld2Wnd); + break; + + case MWT_RIGHTMULTIPLY: + MatrixS2XForm(&xformWorld2Wnd, &pDc->DcLevel.mxWorldToPage); + IntGdiCombineTransform(&xformWorld2Wnd, &xformWorld2Wnd, lpXForm); + XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, &xformWorld2Wnd); + break; + + case MWT_MAX+1: // Must be MWT_SET???? + XForm2MatrixS(&pDc->DcLevel.mxWorldToPage, lpXForm); // Do it like Wine. + break; + + default: + return FALSE; + } + DC_UpdateXforms(pDc); + return TRUE; } BOOL APIENTRY NtGdiGetTransform(HDC hDC, - DWORD iXform, - LPXFORM XForm) -{ - PDC dc; - NTSTATUS Status = STATUS_SUCCESS; - - dc = DC_LockDc ( hDC ); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - if (!XForm) - { - DC_UnlockDc(dc); - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - - _SEH2_TRY - { - ProbeForWrite(XForm, - sizeof(XFORM), - 1); - switch(iXform) - { - case GdiWorldSpaceToPageSpace: - MatrixS2XForm(XForm, &dc->DcLevel.mxWorldToPage); - break; - default: - break; - } - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - DC_UnlockDc(dc); - return NT_SUCCESS(Status); + DWORD iXform, + LPXFORM XForm) +{ + PDC dc; + NTSTATUS Status = STATUS_SUCCESS; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + if (!XForm) + { + DC_UnlockDc(dc); + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + + _SEH2_TRY + { + ProbeForWrite(XForm, sizeof(XFORM), 1); + switch (iXform) + { + case GdiWorldSpaceToPageSpace: + MatrixS2XForm(XForm, &dc->DcLevel.mxWorldToPage); + break; + default: + break; + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + DC_UnlockDc(dc); + return NT_SUCCESS(Status); } @@ -229,111 +223,103 @@ */ BOOL APIENTRY -NtGdiTransformPoints( HDC hDC, - PPOINT UnsafePtsIn, - PPOINT UnsafePtOut, - INT Count, - INT iMode ) -{ - PDC dc; - NTSTATUS Status = STATUS_SUCCESS; - LPPOINT Points; - ULONG Size; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - - if (!UnsafePtsIn || !UnsafePtOut || Count <= 0) - { - DC_UnlockDc(dc); - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - - Size = Count * sizeof(POINT); - - Points = (LPPOINT)ExAllocatePoolWithTag(PagedPool, Size, TAG_COORD); - if(!Points) - { - DC_UnlockDc(dc); - SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - _SEH2_TRY - { - ProbeForWrite(UnsafePtOut, - Size, - 1); - ProbeForRead(UnsafePtsIn, - Size, - 1); - RtlCopyMemory(Points, - UnsafePtsIn, - Size); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - DC_UnlockDc(dc); - ExFreePoolWithTag(Points, TAG_COORD); - SetLastNtError(Status); - return FALSE; - } - - switch (iMode) - { - case GdiDpToLp: - IntDPtoLP(dc, Points, Count); - break; - case GdiLpToDp: - IntLPtoDP(dc, Points, Count); - break; - case 2: // Not supported yet. Need testing. - default: - { +NtGdiTransformPoints(HDC hDC, + PPOINT UnsafePtsIn, + PPOINT UnsafePtOut, + INT Count, + INT iMode) +{ + PDC dc; + NTSTATUS Status = STATUS_SUCCESS; + LPPOINT Points; + ULONG Size; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + + if (!UnsafePtsIn || !UnsafePtOut || Count <= 0) + { + DC_UnlockDc(dc); + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + + Size = Count * sizeof(POINT); + + Points = (LPPOINT)ExAllocatePoolWithTag(PagedPool, Size, TAG_COORD); + if (!Points) + { + DC_UnlockDc(dc); + SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + _SEH2_TRY + { + ProbeForWrite(UnsafePtOut, Size, 1); + ProbeForRead(UnsafePtsIn, Size, 1); + RtlCopyMemory(Points, UnsafePtsIn, Size); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { DC_UnlockDc(dc); ExFreePoolWithTag(Points, TAG_COORD); - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - } - - _SEH2_TRY - { - /* pointer was already probed! */ - RtlCopyMemory(UnsafePtOut, - Points, - Size); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - DC_UnlockDc(dc); - ExFreePoolWithTag(Points, TAG_COORD); - SetLastNtError(Status); - return FALSE; - } + SetLastNtError(Status); + return FALSE; + } + + switch (iMode) + { + case GdiDpToLp: + IntDPtoLP(dc, Points, Count); + break; + case GdiLpToDp: + IntLPtoDP(dc, Points, Count); + break; + case 2: // Not supported yet. Need testing. + default: + { + DC_UnlockDc(dc); + ExFreePoolWithTag(Points, TAG_COORD); + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + } + + _SEH2_TRY + { + /* pointer was already probed! */ + RtlCopyMemory(UnsafePtOut, Points, Size); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + DC_UnlockDc(dc); + ExFreePoolWithTag(Points, TAG_COORD); + SetLastNtError(Status); + return FALSE; + } // // If we are getting called that means User XForms is a mess! // - DC_UnlockDc(dc); - ExFreePoolWithTag(Points, TAG_COORD); - return TRUE; + DC_UnlockDc(dc); + ExFreePoolWithTag(Points, TAG_COORD); + return TRUE; } BOOL @@ -342,69 +328,70 @@ LPXFORM UnsafeXForm, DWORD Mode) { - PDC dc; - XFORM SafeXForm; - BOOL Ret = TRUE; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - - // The xform is permitted to be NULL for MWT_IDENTITY. - // However, if it is not NULL, then it must be valid even though it is not used. - if (UnsafeXForm != NULL || Mode != MWT_IDENTITY) - { - _SEH2_TRY - { - ProbeForRead(UnsafeXForm, sizeof(XFORM), 1); - RtlCopyMemory(&SafeXForm, UnsafeXForm, sizeof(XFORM)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Ret = FALSE; - } - _SEH2_END; - } - - // Safe to handle kernel mode data. - if (Ret) Ret = IntGdiModifyWorldTransform(dc, &SafeXForm, Mode); - DC_UnlockDc(dc); - return Ret; + PDC dc; + XFORM SafeXForm; + BOOL Ret = TRUE; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + + // The xform is permitted to be NULL for MWT_IDENTITY. + // However, if it is not NULL, then it must be valid even though it is not used. + if (UnsafeXForm != NULL || Mode != MWT_IDENTITY) + { + _SEH2_TRY + { + ProbeForRead(UnsafeXForm, sizeof(XFORM), 1); + RtlCopyMemory(&SafeXForm, UnsafeXForm, sizeof(XFORM)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Ret = FALSE; + } + _SEH2_END; + } + + // Safe to handle kernel mode data. + if (Ret) Ret = IntGdiModifyWorldTransform(dc, &SafeXForm, Mode); + DC_UnlockDc(dc); + return Ret; } BOOL APIENTRY NtGdiOffsetViewportOrgEx(HDC hDC, - int XOffset, - int YOffset, - LPPOINT UnsafePoint) -{ - PDC dc; - PDC_ATTR Dc_Attr; - NTSTATUS Status = STATUS_SUCCESS; - - dc = DC_LockDc ( hDC ); - if(!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - if (UnsafePoint) + int XOffset, + int YOffset, + LPPOINT UnsafePoint) +{ + PDC dc; + PDC_ATTR Dc_Attr; + NTSTATUS Status = STATUS_SUCCESS; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + if (UnsafePoint) { _SEH2_TRY { - ProbeForWrite(UnsafePoint, - sizeof(POINT), - 1); + ProbeForWrite(UnsafePoint, sizeof(POINT), 1); UnsafePoint->x = Dc_Attr->ptlViewportOrg.x; UnsafePoint->y = Dc_Attr->ptlViewportOrg.y; - if ( Dc_Attr->dwLayout & LAYOUT_RTL ) UnsafePoint->x = -UnsafePoint->x; + if (Dc_Attr->dwLayout & LAYOUT_RTL) + { + UnsafePoint->x = -UnsafePoint->x; + } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -412,318 +399,321 @@ } _SEH2_END; - if ( !NT_SUCCESS(Status) ) - { - SetLastNtError(Status); - DC_UnlockDc(dc); - return FALSE; - } - } - - if ( Dc_Attr->dwLayout & LAYOUT_RTL ) XOffset = -XOffset; - Dc_Attr->ptlViewportOrg.x += XOffset; - Dc_Attr->ptlViewportOrg.y += YOffset; - DC_UpdateXforms(dc); - DC_UnlockDc(dc); - return TRUE; + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(dc); + return FALSE; + } + } + + if (Dc_Attr->dwLayout & LAYOUT_RTL) + { + XOffset = -XOffset; + } + Dc_Attr->ptlViewportOrg.x += XOffset; + Dc_Attr->ptlViewportOrg.y += YOffset; + DC_UpdateXforms(dc); + DC_UnlockDc(dc); + + return TRUE; } BOOL APIENTRY NtGdiOffsetWindowOrgEx(HDC hDC, - int XOffset, - int YOffset, - LPPOINT Point) -{ - PDC dc; - PDC_ATTR Dc_Attr; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - if (Point) - { - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForWrite(Point, - sizeof(POINT), - 1); - Point->x = Dc_Attr->ptlWindowOrg.x; - Point->y = Dc_Attr->ptlWindowOrg.y; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - DC_UnlockDc(dc); - return FALSE; - } - } - - Dc_Attr->ptlWindowOrg.x += XOffset; - Dc_Attr->ptlWindowOrg.y += YOffset; - - DC_UpdateXforms(dc); - DC_UnlockDc(dc); - - return TRUE; + int XOffset, + int YOffset, + LPPOINT Point) +{ + PDC dc; + PDC_ATTR Dc_Attr; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + if (Point) + { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(Point, sizeof(POINT), 1); + Point->x = Dc_Attr->ptlWindowOrg.x; + Point->y = Dc_Attr->ptlWindowOrg.y; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(dc); + return FALSE; + } + } + + Dc_Attr->ptlWindowOrg.x += XOffset; + Dc_Attr->ptlWindowOrg.y += YOffset; + + DC_UpdateXforms(dc); + DC_UnlockDc(dc); + + return TRUE; } BOOL APIENTRY NtGdiScaleViewportExtEx(HDC hDC, - int Xnum, - int Xdenom, - int Ynum, - int Ydenom, - LPSIZE pSize) -{ - PDC pDC; - PDC_ATTR pDc_Attr; - BOOL Ret = FALSE; - LONG X, Y; - - pDC = DC_LockDc(hDC); - if (!pDC) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - pDc_Attr = pDC->pDc_Attr; - if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr; - - if ( pSize ) - { - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForWrite(pSize, - sizeof(LPSIZE), - 1); - - pSize->cx = pDc_Attr->szlViewportExt.cx; - pSize->cy = pDc_Attr->szlViewportExt.cy; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - DC_UnlockDc(pDC); - return FALSE; - } - } - - if (pDc_Attr->iMapMode > MM_TWIPS) - { - if ( ( Xdenom ) && ( Ydenom ) ) - { - X = Xnum * pDc_Attr->szlViewportExt.cx / Xdenom; - if ( X ) - { - Y = Ynum * pDc_Attr->szlViewportExt.cy / Ydenom; - if ( Y ) - { - pDc_Attr->szlViewportExt.cx = X; - pDc_Attr->szlViewportExt.cy = Y; - - IntMirrorWindowOrg(pDC); - - pDc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); - - if (pDc_Attr->iMapMode == MM_ISOTROPIC) IntFixIsotropicMapping(pDC); - DC_UpdateXforms(pDC); - - Ret = TRUE; - } - } - } - } - else - Ret = TRUE; - - DC_UnlockDc(pDC); - return Ret; + int Xnum, + int Xdenom, + int Ynum, + int Ydenom, + LPSIZE pSize) +{ + PDC pDC; + PDC_ATTR pDc_Attr; + BOOL Ret = FALSE; + LONG X, Y; + + pDC = DC_LockDc(hDC); + if (!pDC) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + pDc_Attr = pDC->pDc_Attr; + if (!pDc_Attr) pDc_Attr = &pDC->Dc_Attr; + + if (pSize) + { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(pSize, sizeof(LPSIZE), 1); + + pSize->cx = pDc_Attr->szlViewportExt.cx; + pSize->cy = pDc_Attr->szlViewportExt.cy; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(pDC); + return FALSE; + } + } + + if (pDc_Attr->iMapMode > MM_TWIPS) + { + if (Xdenom && Ydenom) + { + X = Xnum * pDc_Attr->szlViewportExt.cx / Xdenom; + if (X) + { + Y = Ynum * pDc_Attr->szlViewportExt.cy / Ydenom; + if (Y) + { + pDc_Attr->szlViewportExt.cx = X; + pDc_Attr->szlViewportExt.cy = Y; + + IntMirrorWindowOrg(pDC); + + pDc_Attr->flXform |= (PAGE_EXTENTS_CHANGED | + INVALIDATE_ATTRIBUTES | + DEVICE_TO_WORLD_INVALID); + + if (pDc_Attr->iMapMode == MM_ISOTROPIC) + { + IntFixIsotropicMapping(pDC); + } + DC_UpdateXforms(pDC); + + Ret = TRUE; + } + } + } + } + else + Ret = TRUE; + + DC_UnlockDc(pDC); + return Ret; } BOOL APIENTRY NtGdiScaleWindowExtEx(HDC hDC, - int Xnum, - int Xdenom, - int Ynum, - int Ydenom, - LPSIZE pSize) -{ - PDC pDC; - PDC_ATTR pDc_Attr; - BOOL Ret = FALSE; - LONG X, Y; - - pDC = DC_LockDc(hDC); - if (!pDC) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - pDc_Attr = pDC->pDc_Attr; - if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr; - - if ( pSize ) - { - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForWrite(pSize, - sizeof(LPSIZE), - 1); - - X = pDc_Attr->szlWindowExt.cx; - if (pDc_Attr->dwLayout & LAYOUT_RTL) X = -X; - pSize->cx = X; - pSize->cy = pDc_Attr->szlWindowExt.cy; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - DC_UnlockDc(pDC); - return FALSE; - } - } - - if (pDc_Attr->iMapMode > MM_TWIPS) - { - if (( Xdenom ) && ( Ydenom )) - { - X = Xnum * pDc_Attr->szlWindowExt.cx / Xdenom; - if ( X ) - { - Y = Ynum * pDc_Attr->szlWindowExt.cy / Ydenom; - if ( Y ) - { - pDc_Attr->szlWindowExt.cx = X; - pDc_Attr->szlWindowExt.cy = Y; - - IntMirrorWindowOrg(pDC); - - pDc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); - - if (pDc_Attr->iMapMode == MM_ISOTROPIC) IntFixIsotropicMapping(pDC); - DC_UpdateXforms(pDC); - - Ret = TRUE; - } - } - } - } - else - Ret = TRUE; - - DC_UnlockDc(pDC); - return Ret; + int Xnum, + int Xdenom, + int Ynum, + int Ydenom, + LPSIZE pSize) +{ + PDC pDC; + PDC_ATTR pDc_Attr; + BOOL Ret = FALSE; + LONG X, Y; + + pDC = DC_LockDc(hDC); + if (!pDC) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + pDc_Attr = pDC->pDc_Attr; + if (!pDc_Attr) pDc_Attr = &pDC->Dc_Attr; + + if (pSize) + { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(pSize, sizeof(LPSIZE), 1); + + X = pDc_Attr->szlWindowExt.cx; + if (pDc_Attr->dwLayout & LAYOUT_RTL) X = -X; + pSize->cx = X; + pSize->cy = pDc_Attr->szlWindowExt.cy; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(pDC); + return FALSE; + } + } + + if (pDc_Attr->iMapMode > MM_TWIPS) + { + if (Xdenom && Ydenom) + { + X = Xnum * pDc_Attr->szlWindowExt.cx / Xdenom; + if (X) + { + Y = Ynum * pDc_Attr->szlWindowExt.cy / Ydenom; + if (Y) + { + pDc_Attr->szlWindowExt.cx = X; + pDc_Attr->szlWindowExt.cy = Y; + + IntMirrorWindowOrg(pDC); + + pDc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); + + if (pDc_Attr->iMapMode == MM_ISOTROPIC) IntFixIsotropicMapping(pDC); + DC_UpdateXforms(pDC); + + Ret = TRUE; + } + } + } + } + else + Ret = TRUE; + + DC_UnlockDc(pDC); + return Ret; } int APIENTRY IntGdiSetMapMode(PDC dc, - int MapMode) -{ - int PrevMapMode; - PDC_ATTR Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - PrevMapMode = Dc_Attr->iMapMode; - - Dc_Attr->iMapMode = MapMode; - - switch (MapMode) - { - case MM_TEXT: - Dc_Attr->szlWindowExt.cx = 1; - Dc_Attr->szlWindowExt.cy = 1; - Dc_Attr->szlViewportExt.cx = 1; - Dc_Attr->szlViewportExt.cy = 1; - Dc_Attr->flXform &= ~(ISO_OR_ANISO_MAP_MODE|PTOD_EFM22_NEGATIVE| - PTOD_EFM11_NEGATIVE|POSITIVE_Y_IS_UP); - Dc_Attr->flXform |= (PAGE_XLATE_CHANGED|PAGE_TO_DEVICE_SCALE_IDENTITY| - INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); - break; - - case MM_ISOTROPIC: - Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE; - /* Fall through */ - - case MM_LOMETRIC: - Dc_Attr->szlWindowExt.cx = 3600; - Dc_Attr->szlWindowExt.cy = 2700; - Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; - Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; - break; - - case MM_HIMETRIC: - Dc_Attr->szlWindowExt.cx = 36000; - Dc_Attr->szlWindowExt.cy = 27000; - Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; - Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; - break; - - case MM_LOENGLISH: - Dc_Attr->szlWindowExt.cx = 1417; - Dc_Attr->szlWindowExt.cy = 1063; - Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; - Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; - break; - - case MM_HIENGLISH: - Dc_Attr->szlWindowExt.cx = 14173; - Dc_Attr->szlWindowExt.cy = 10630; - Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; - Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; - break; - - case MM_TWIPS: - Dc_Attr->szlWindowExt.cx = 20409; - Dc_Attr->szlWindowExt.cy = 15307; - Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; - Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; - break; - - case MM_ANISOTROPIC: - Dc_Attr->flXform &= ~(PAGE_TO_DEVICE_IDENTITY|POSITIVE_Y_IS_UP); - Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE; - break; - default: - Dc_Attr->iMapMode = PrevMapMode; - PrevMapMode = 0; - } + int MapMode) +{ + int PrevMapMode; + PDC_ATTR Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + PrevMapMode = Dc_Attr->iMapMode; + + Dc_Attr->iMapMode = MapMode; + + switch (MapMode) + { + case MM_TEXT: + Dc_Attr->szlWindowExt.cx = 1; + Dc_Attr->szlWindowExt.cy = 1; + Dc_Attr->szlViewportExt.cx = 1; + Dc_Attr->szlViewportExt.cy = 1; + Dc_Attr->flXform &= ~(ISO_OR_ANISO_MAP_MODE|PTOD_EFM22_NEGATIVE| + PTOD_EFM11_NEGATIVE|POSITIVE_Y_IS_UP); + Dc_Attr->flXform |= (PAGE_XLATE_CHANGED|PAGE_TO_DEVICE_SCALE_IDENTITY| + INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); + break; + + case MM_ISOTROPIC: + Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE; + /* Fall through */ + + case MM_LOMETRIC: + Dc_Attr->szlWindowExt.cx = 3600; + Dc_Attr->szlWindowExt.cy = 2700; + Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; + Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; + break; + + case MM_HIMETRIC: + Dc_Attr->szlWindowExt.cx = 36000; + Dc_Attr->szlWindowExt.cy = 27000; + Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; + Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; + break; + + case MM_LOENGLISH: + Dc_Attr->szlWindowExt.cx = 1417; + Dc_Attr->szlWindowExt.cy = 1063; + Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; + Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; + break; + + case MM_HIENGLISH: + Dc_Attr->szlWindowExt.cx = 14173; + Dc_Attr->szlWindowExt.cy = 10630; + Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; + Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; + break; + + case MM_TWIPS: + Dc_Attr->szlWindowExt.cx = 20409; + Dc_Attr->szlWindowExt.cy = 15307; + Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; + Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; + break; + + case MM_ANISOTROPIC: + Dc_Attr->flXform &= ~(PAGE_TO_DEVICE_IDENTITY|POSITIVE_Y_IS_UP); + Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE; + break; + default: + Dc_Attr->iMapMode = PrevMapMode; + PrevMapMode = 0; + } DC_UpdateXforms(dc); - return PrevMapMode; + return PrevMapMode; } BOOL @@ -733,246 +723,238 @@ int YExtent, LPSIZE Size) { - PDC dc; - PDC_ATTR Dc_Attr; - - dc = DC_LockDc(hDC); - if ( !dc ) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - switch (Dc_Attr->iMapMode) - { - case MM_HIENGLISH: - case MM_HIMETRIC: - case MM_LOENGLISH: - case MM_LOMETRIC: - case MM_TEXT: - case MM_TWIPS: - DC_UnlockDc(dc); - return FALSE; - - case MM_ISOTROPIC: - // Here we should (probably) check that SetWindowExtEx *really* has - // been called - break; - } - - if (Size) - { - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForWrite(Size, - sizeof(SIZE), - 1); - Size->cx = Dc_Attr->szlViewportExt.cx; - Size->cy = Dc_Attr->szlViewportExt.cy; - - Dc_Attr->szlViewportExt.cx = XExtent; - Dc_Attr->szlViewportExt.cy = YExtent; - - if (Dc_Attr->iMapMode == MM_ISOTROPIC) - IntFixIsotropicMapping(dc); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - DC_UnlockDc(dc); - return FALSE; - } - } - - - DC_UpdateXforms(dc); - DC_UnlockDc(dc); - - return TRUE; + PDC dc; + PDC_ATTR Dc_Attr; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + switch (Dc_Attr->iMapMode) + { + case MM_HIENGLISH: + case MM_HIMETRIC: + case MM_LOENGLISH: + case MM_LOMETRIC: + case MM_TEXT: + case MM_TWIPS: + DC_UnlockDc(dc); + return FALSE; + + case MM_ISOTROPIC: + // Here we should (probably) check that SetWindowExtEx *really* has + // been called + break; + } + + if (Size) + { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(Size, sizeof(SIZE), 1); + Size->cx = Dc_Attr->szlViewportExt.cx; + Size->cy = Dc_Attr->szlViewportExt.cy; + + Dc_Attr->szlViewportExt.cx = XExtent; + Dc_Attr->szlViewportExt.cy = YExtent; + + if (Dc_Attr->iMapMode == MM_ISOTROPIC) + IntFixIsotropicMapping(dc); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(dc); + return FALSE; + } + } + + + DC_UpdateXforms(dc); + DC_UnlockDc(dc); + + return TRUE; } BOOL APIENTRY NtGdiSetViewportOrgEx(HDC hDC, - int X, - int Y, - LPPOINT Point) -{ - PDC dc; - PDC_ATTR Dc_Attr; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - if (Point) - { - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForWrite(Point, - sizeof(POINT), - 1); - Point->x = Dc_Attr->ptlViewportOrg.x; - Point->y = Dc_Attr->ptlViewportOrg.y; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - DC_UnlockDc(dc); - return FALSE; - } - } - - Dc_Attr->ptlViewportOrg.x = X; - Dc_Attr->ptlViewportOrg.y = Y; - - DC_UpdateXforms(dc); - DC_UnlockDc(dc); - - return TRUE; + int X, + int Y, + LPPOINT Point) +{ + PDC dc; + PDC_ATTR Dc_Attr; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + if (Point) + { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(Point, sizeof(POINT), 1); + Point->x = Dc_Attr->ptlViewportOrg.x; + Point->y = Dc_Attr->ptlViewportOrg.y; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(dc); + return FALSE; + } + } + + Dc_Attr->ptlViewportOrg.x = X; + Dc_Attr->ptlViewportOrg.y = Y; + + DC_UpdateXforms(dc); + DC_UnlockDc(dc); + + return TRUE; } BOOL APIENTRY NtGdiSetWindowExtEx(HDC hDC, - int XExtent, - int YExtent, - LPSIZE Size) -{ - PDC dc; - PDC_ATTR Dc_Attr; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - switch (Dc_Attr->iMapMode) - { - case MM_HIENGLISH: - case MM_HIMETRIC: - case MM_LOENGLISH: - case MM_LOMETRIC: - case MM_TEXT: - case MM_TWIPS: - DC_UnlockDc(dc); - return FALSE; - } - - if (Size) - { - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForWrite(Size, - sizeof(SIZE), - 1); - Size->cx = Dc_Attr->szlWindowExt.cx; - Size->cy = Dc_Attr->szlWindowExt.cy; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - DC_UnlockDc(dc); - return FALSE; - } - } - - Dc_Attr->szlWindowExt.cx = XExtent; - Dc_Attr->szlWindowExt.cy = YExtent; - - DC_UpdateXforms(dc); - DC_UnlockDc(dc); - - return TRUE; + int XExtent, + int YExtent, + LPSIZE Size) +{ + PDC dc; + PDC_ATTR Dc_Attr; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + switch (Dc_Attr->iMapMode) + { + case MM_HIENGLISH: + case MM_HIMETRIC: + case MM_LOENGLISH: + case MM_LOMETRIC: + case MM_TEXT: + case MM_TWIPS: + DC_UnlockDc(dc); + return FALSE; + } + + if (Size) + { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(Size, sizeof(SIZE), 1); + Size->cx = Dc_Attr->szlWindowExt.cx; + Size->cy = Dc_Attr->szlWindowExt.cy; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(dc); + return FALSE; + } + } + + Dc_Attr->szlWindowExt.cx = XExtent; + Dc_Attr->szlWindowExt.cy = YExtent; + + DC_UpdateXforms(dc); + DC_UnlockDc(dc); + + return TRUE; } BOOL APIENTRY NtGdiSetWindowOrgEx(HDC hDC, - int X, - int Y, - LPPOINT Point) -{ - PDC dc; - PDC_ATTR Dc_Attr; - - dc = DC_LockDc(hDC); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - if (Point) - { - NTSTATUS Status = STATUS_SUCCESS; - - _SEH2_TRY - { - ProbeForWrite(Point, - sizeof(POINT), - 1); - Point->x = Dc_Attr->ptlWindowOrg.x; - Point->y = Dc_Attr->ptlWindowOrg.y; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - DC_UnlockDc(dc); - return FALSE; - } - } - - Dc_Attr->ptlWindowOrg.x = X; - Dc_Attr->ptlWindowOrg.y = Y; - - DC_UpdateXforms(dc); - DC_UnlockDc(dc); - - return TRUE; + int X, + int Y, + LPPOINT Point) +{ + PDC dc; + PDC_ATTR Dc_Attr; + + dc = DC_LockDc(hDC); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + if (Point) + { + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(Point, sizeof(POINT), 1); + Point->x = Dc_Attr->ptlWindowOrg.x; + Point->y = Dc_Attr->ptlWindowOrg.y; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + DC_UnlockDc(dc); + return FALSE; + } + } + + Dc_Attr->ptlWindowOrg.x = X; + Dc_Attr->ptlWindowOrg.y = Y; + + DC_UpdateXforms(dc); + DC_UnlockDc(dc); + + return TRUE; } // @@ -982,32 +964,32 @@ FASTCALL IntMirrorWindowOrg(PDC dc) { - PDC_ATTR Dc_Attr; - LONG X; - - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - if (!(Dc_Attr->dwLayout & LAYOUT_RTL)) - { - Dc_Attr->ptlWindowOrg.x = Dc_Attr->lWindowOrgx; // Flip it back. - return; - } - if (!Dc_Attr->szlViewportExt.cx) return; - // - // WOrgx = wox - (Width - 1) * WExtx / VExtx - // - X = (dc->erclWindow.right - dc->erclWindow.left) - 1; // Get device width - 1 - - X = ( X * Dc_Attr->szlWindowExt.cx) / Dc_Attr->szlViewportExt.cx; - - Dc_Attr->ptlWindowOrg.x = Dc_Attr->lWindowOrgx - X; // Now set the inverted win origion. - - return; + PDC_ATTR Dc_Attr; + LONG X; + + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + if (!(Dc_Attr->dwLayout & LAYOUT_RTL)) + { + Dc_Attr->ptlWindowOrg.x = Dc_Attr->lWindowOrgx; // Flip it back. + return; + } + if (!Dc_Attr->szlViewportExt.cx) return; + // + // WOrgx = wox - (Width - 1) * WExtx / VExtx + // + X = (dc->erclWindow.right - dc->erclWindow.left) - 1; // Get device width - 1 + + X = (X * Dc_Attr->szlWindowExt.cx) / Dc_Attr->szlViewportExt.cx; + + Dc_Attr->ptlWindowOrg.x = Dc_Attr->lWindowOrgx - X; // Now set the inverted win origion. + + return; } // NtGdiSetLayout -// +// // The default is left to right. This function changes it to right to left, which // is the standard in Arabic and Hebrew cultures. // @@ -1021,50 +1003,55 @@ IN LONG wox, IN DWORD dwLayout) { - PDC dc; - PDC_ATTR Dc_Attr; - DWORD oLayout; - - dc = DC_LockDc(hdc); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return GDI_ERROR; - } - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - Dc_Attr->dwLayout = dwLayout; - oLayout = Dc_Attr->dwLayout; - - if (!(dwLayout & LAYOUT_ORIENTATIONMASK)) - { - DC_UnlockDc(dc); - return oLayout; - } - - if (dwLayout & LAYOUT_RTL) Dc_Attr->iMapMode = MM_ANISOTROPIC; - - Dc_Attr->szlWindowExt.cy = -Dc_Attr->szlWindowExt.cy; - Dc_Attr->ptlWindowOrg.x = -Dc_Attr->ptlWindowOrg.x; - - if (wox == -1) - IntMirrorWindowOrg(dc); - else - Dc_Attr->ptlWindowOrg.x = wox - Dc_Attr->ptlWindowOrg.x; - - if (!(Dc_Attr->flTextAlign & TA_CENTER)) Dc_Attr->flTextAlign |= TA_RIGHT; - - if (dc->DcLevel.flPath & DCPATH_CLOCKWISE) - dc->DcLevel.flPath &= ~DCPATH_CLOCKWISE; - else - dc->DcLevel.flPath |= DCPATH_CLOCKWISE; - - Dc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); + PDC dc; + PDC_ATTR Dc_Attr; + DWORD oLayout; + + dc = DC_LockDc(hdc); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return GDI_ERROR; + } + Dc_Attr = dc->pDc_Attr; + if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + Dc_Attr->dwLayout = dwLayout; + oLayout = Dc_Attr->dwLayout; + + if (!(dwLayout & LAYOUT_ORIENTATIONMASK)) + { + DC_UnlockDc(dc); + return oLayout; + } + + if (dwLayout & LAYOUT_RTL) + { + Dc_Attr->iMapMode = MM_ANISOTROPIC; + } + + Dc_Attr->szlWindowExt.cy = -Dc_Attr->szlWindowExt.cy; + Dc_Attr->ptlWindowOrg.x = -Dc_Attr->ptlWindowOrg.x; + + if (wox == -1) + IntMirrorWindowOrg(dc); + else + Dc_Attr->ptlWindowOrg.x = wox - Dc_Attr->ptlWindowOrg.x; + + if (!(Dc_Attr->flTextAlign & TA_CENTER)) Dc_Attr->flTextAlign |= TA_RIGHT; + + if (dc->DcLevel.flPath & DCPATH_CLOCKWISE) + dc->DcLevel.flPath &= ~DCPATH_CLOCKWISE; + else + dc->DcLevel.flPath |= DCPATH_CLOCKWISE; + + Dc_Attr->flXform |= (PAGE_EXTENTS_CHANGED | + INVALIDATE_ATTRIBUTES | + DEVICE_TO_WORLD_INVALID); // DC_UpdateXforms(dc); - DC_UnlockDc(dc); - return oLayout; + DC_UnlockDc(dc); + return oLayout; } /* @@ -1075,17 +1062,17 @@ NtGdiGetDeviceWidth( IN HDC hdc) { - PDC dc; - LONG Ret; - dc = DC_LockDc(hdc); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return 0; - } - Ret = dc->erclWindow.right - dc->erclWindow.left; - DC_UnlockDc(dc); - return Ret; + PDC dc; + LONG Ret; + dc = DC_LockDc(hdc); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return 0; + } + Ret = dc->erclWindow.right - dc->erclWindow.left; + DC_UnlockDc(dc); + return Ret; } /* @@ -1096,16 +1083,16 @@ NtGdiMirrorWindowOrg( IN HDC hdc) { - PDC dc; - dc = DC_LockDc(hdc); - if (!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - IntMirrorWindowOrg(dc); - DC_UnlockDc(dc); - return TRUE; + PDC dc; + dc = DC_LockDc(hdc); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + IntMirrorWindowOrg(dc); + DC_UnlockDc(dc); + return TRUE; } /* @@ -1121,19 +1108,21 @@ PDC dc; PDC_ATTR pDc_Attr; - if (!cxVirtualDevice || - !cyVirtualDevice ) return FALSE; + if (!cxVirtualDevice || !cyVirtualDevice) + { + return FALSE; + } dc = DC_LockDc(hdc); if (!dc) return FALSE; - + pDc_Attr = dc->pDc_Attr; - if(!pDc_Attr) pDc_Attr = &dc->Dc_Attr; + if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr; pDc_Attr->szlVirtualDeviceSize.cx = cxVirtualDevice; pDc_Attr->szlVirtualDeviceSize.cy = cyVirtualDevice; -// DC_UpdateXforms(dc); +// DC_UpdateXforms(dc); DC_UnlockDc(dc); return TRUE; @@ -1158,16 +1147,16 @@ dc = DC_LockDc(hdc); if (!dc) return FALSE; - + pDc_Attr = dc->pDc_Attr; - if(!pDc_Attr) pDc_Attr = &dc->Dc_Attr; + if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr; pDc_Attr->szlVirtualDevicePixel.cx = cxVirtualDevicePixel; pDc_Attr->szlVirtualDevicePixel.cy = cyVirtualDevicePixel; pDc_Attr->szlVirtualDeviceMm.cx = cxVirtualDeviceMm; pDc_Attr->szlVirtualDeviceMm.cy = cyVirtualDeviceMm; -// DC_UpdateXforms(dc); +// DC_UpdateXforms(dc); DC_UnlockDc(dc); return TRUE; }
15 years, 10 months
1
0
0
0
[tkreuzer] 39202: Fix IntGdiSetMapMode
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 29 13:17:53 2009 New Revision: 39202 URL:
http://svn.reactos.org/svn/reactos?rev=39202&view=rev
Log: Fix IntGdiSetMapMode Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/coord.c [iso-8859-1] Thu Jan 29 13:17:53 2009 @@ -675,43 +675,40 @@ break; case MM_ISOTROPIC: + Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE; + /* Fall through */ + + case MM_LOMETRIC: Dc_Attr->szlWindowExt.cx = 3600; Dc_Attr->szlWindowExt.cy = 2700; Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; break; - case MM_LOMETRIC: - Dc_Attr->szlWindowExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize * 10; - Dc_Attr->szlWindowExt.cy = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize * 10; + case MM_HIMETRIC: + Dc_Attr->szlWindowExt.cx = 36000; + Dc_Attr->szlWindowExt.cy = 27000; Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; break; - case MM_HIMETRIC: - Dc_Attr->szlWindowExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize * 100; - Dc_Attr->szlWindowExt.cy = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize * 100; + case MM_LOENGLISH: + Dc_Attr->szlWindowExt.cx = 1417; + Dc_Attr->szlWindowExt.cy = 1063; Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; break; - case MM_LOENGLISH: - Dc_Attr->szlWindowExt.cx = EngMulDiv(1000, ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize, 254); - Dc_Attr->szlWindowExt.cy = EngMulDiv(1000, ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize, 254); + case MM_HIENGLISH: + Dc_Attr->szlWindowExt.cx = 14173; + Dc_Attr->szlWindowExt.cy = 10630; Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; break; - case MM_HIENGLISH: - Dc_Attr->szlWindowExt.cx = EngMulDiv(10000, ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize, 254); - Dc_Attr->szlWindowExt.cy = EngMulDiv(10000, ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize, 254); - Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; - Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; - break; - case MM_TWIPS: - Dc_Attr->szlWindowExt.cx = EngMulDiv(14400, ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzSize, 254); - Dc_Attr->szlWindowExt.cy = EngMulDiv(14400, ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertSize, 254); + Dc_Attr->szlWindowExt.cx = 20409; + Dc_Attr->szlWindowExt.cy = 15307; Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->pPDev)->GDIInfo.ulHorzRes; Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->pPDev)->GDIInfo.ulVertRes; break;
15 years, 10 months
1
0
0
0
[tkreuzer] 39201: Add more tests for SetMapMode
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 29 13:16:45 2009 New Revision: 39201 URL:
http://svn.reactos.org/svn/reactos?rev=39201&view=rev
Log: Add more tests for SetMapMode Modified: trunk/rostests/apitests/gdi32api/tests/SetMapMode.c Modified: trunk/rostests/apitests/gdi32api/tests/SetMapMode.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/S…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/SetMapMode.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/SetMapMode.c [iso-8859-1] Thu Jan 29 13:16:45 2009 @@ -6,6 +6,7 @@ { HDC hDC; SIZE WindowExt, ViewportExt; + ULONG ulMapMode; hDC = CreateCompatibleDC(NULL); ASSERT(hDC); @@ -13,21 +14,167 @@ GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); - ASSERT(WindowExt.cx == 1); - ASSERT(WindowExt.cy == 1); - ASSERT(ViewportExt.cx == 1); - ASSERT(ViewportExt.cy == 1); + ulMapMode = SetMapMode(hDC, MM_ISOTROPIC); + TEST(ulMapMode == MM_TEXT); + TEST(WindowExt.cx == 1); + TEST(WindowExt.cy == 1); + TEST(ViewportExt.cx == 1); + TEST(ViewportExt.cy == 1); - SetMapMode(hDC, MM_ISOTROPIC); + SetLastError(0); + ulMapMode = SetMapMode(hDC, 0); + TEST(GetLastError() == 0); + TEST(ulMapMode == 0); + /* Go through all valid values */ + ulMapMode = SetMapMode(hDC, 1); + TEST(ulMapMode == MM_ISOTROPIC); + ulMapMode = SetMapMode(hDC, 2); + TEST(ulMapMode == 1); + ulMapMode = SetMapMode(hDC, 3); + TEST(ulMapMode == 2); + ulMapMode = SetMapMode(hDC, 4); + TEST(ulMapMode == 3); + ulMapMode = SetMapMode(hDC, 5); + TEST(ulMapMode == 4); + ulMapMode = SetMapMode(hDC, 6); + TEST(ulMapMode == 5); + ulMapMode = SetMapMode(hDC, 7); + TEST(ulMapMode == 6); + ulMapMode = SetMapMode(hDC, 8); + TEST(ulMapMode == 7); + + /* Test invalid value */ + ulMapMode = SetMapMode(hDC, 9); + TEST(ulMapMode == 0); + ulMapMode = SetMapMode(hDC, 10); + TEST(ulMapMode == 0); + + TEST(GetLastError() == 0); + + /* Test NULL DC */ + ulMapMode = SetMapMode((HDC)0, 2); + TEST(ulMapMode == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); + + /* Test NULL DC and invalid mode */ + ulMapMode = SetMapMode((HDC)0, 10); + TEST(ulMapMode == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); + + /* Test invalid DC */ + ulMapMode = SetMapMode((HDC)0x12345, 2); + TEST(ulMapMode == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); + + /* Test invalid DC and invalid mode */ + ulMapMode = SetMapMode((HDC)0x12345, 10); + TEST(ulMapMode == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); + + DeleteDC(hDC); + + /* Test a deleted DC */ + ulMapMode = SetMapMode(hDC, 2); + TEST(ulMapMode == 0); + TEST(GetLastError() == ERROR_INVALID_PARAMETER); + + /* Test MM_TEXT */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_TEXT); GetWindowExtEx(hDC, &WindowExt); GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 1); + TEST(WindowExt.cy == 1); + TEST(ViewportExt.cx == 1); + TEST(ViewportExt.cy == 1); + DeleteDC(hDC); + /* Test MM_ISOTROPIC */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_ISOTROPIC); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); TEST(WindowExt.cx == 3600); TEST(WindowExt.cy == 2700); TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + DeleteDC(hDC); + /* Test MM_ANISOTROPIC */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_ANISOTROPIC); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 1); + TEST(WindowExt.cy == 1); + TEST(ViewportExt.cx == 1); + TEST(ViewportExt.cy == 1); + + /* set MM_ISOTROPIC first, the values will be kept */ + SetMapMode(hDC, MM_ISOTROPIC); + SetMapMode(hDC, MM_ANISOTROPIC); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 3600); + TEST(WindowExt.cy == 2700); + TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); + TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + DeleteDC(hDC); + + /* Test MM_LOMETRIC */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_LOMETRIC); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 3600); + TEST(WindowExt.cy == 2700); + TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); + TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + DeleteDC(hDC); + + /* Test MM_HIMETRIC */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_HIMETRIC); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 36000); + TEST(WindowExt.cy == 27000); + TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); + TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + DeleteDC(hDC); + + /* Test MM_LOENGLISH */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_LOENGLISH); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 1417); + TEST(WindowExt.cy == 1063); + TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); + TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + DeleteDC(hDC); + + /* Test MM_HIENGLISH */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_HIENGLISH); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 14173); + TEST(WindowExt.cy == 10630); + TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); + TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + DeleteDC(hDC); + + /* Test MM_TWIPS */ + hDC = CreateCompatibleDC(NULL); + SetMapMode(hDC, MM_TWIPS); + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + TEST(WindowExt.cx == 20409); + TEST(WindowExt.cy == 15307); + TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); + TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); DeleteDC(hDC); return APISTATUS_NORMAL;
15 years, 10 months
1
0
0
0
[dreimer] 39200: Set the Default Settings of options.exe to the proper values.
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Jan 29 12:12:18 2009 New Revision: 39200 URL:
http://svn.reactos.org/svn/reactos?rev=39200&view=rev
Log: Set the Default Settings of options.exe to the proper values. Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 trunk/tools/RosBE/RosBE-Windows/Root/options.cmd trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c trunk/tools/RosBE/RosBE-Windows/Tools/config/options.h Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] Thu Jan 29 12:12:18 2009 @@ -13,7 +13,9 @@ # Run options.exe # if (Test-Path "$_ROSBE_BASEDIR\Tools\options.exe") { + Push-Location "$_ROSBE_BASEDIR" & "$_ROSBE_BASEDIR\Tools\options.exe" | out-null + Pop-Location if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options.cmd") { & "$ENV:APPDATA\RosBE\rosbe-options.cmd" } Modified: trunk/tools/RosBE/RosBE-Windows/Root/options.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/opt…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/options.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/options.cmd [iso-8859-1] Thu Jan 29 12:12:18 2009 @@ -18,7 +18,9 @@ :: Run options.exe :: if exist "%_ROSBE_BASEDIR%\Tools\options.exe" ( + pushd "%_ROSBE_BASEDIR%" call "%_ROSBE_BASEDIR%\Tools\options.exe" + popd if exist "%APPDATA%\RosBE\rosbe-options.cmd" ( call "%APPDATA%\RosBE\rosbe-options.cmd" ) Modified: trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c [iso-8859-1] Thu Jan 29 12:12:18 2009 @@ -242,6 +242,8 @@ { LoadedSettings->foreground = 0xa; LoadedSettings->background = 0; + LoadedSettings->showtime = 1; + LoadedSettings->writelog = 1; GetCurrentDirectory(MAX_PATH, LoadedSettings->mingwpath); if ((wcslen(LoadedSettings->mingwpath) + wcslen(MINGWVERSION)) < MAX_PATH) wcscat(LoadedSettings->mingwpath, MINGWVERSION); Modified: trunk/tools/RosBE/RosBE-Windows/Tools/config/options.h URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Tools/config/options.h [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Tools/config/options.h [iso-8859-1] Thu Jan 29 12:12:18 2009 @@ -14,7 +14,7 @@ #include <wchar.h> #include "resources.h" -#define MINGWVERSION L"\\4.1.3" +#define MINGWVERSION L"\\i386" typedef struct _SETTINGS {
15 years, 10 months
1
0
0
0
[tkreuzer] 39199: Add a comment, remove a comment
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 29 10:00:22 2009 New Revision: 39199 URL:
http://svn.reactos.org/svn/reactos?rev=39199&view=rev
Log: Add a comment, remove a comment Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c [iso-8859-1] Thu Jan 29 10:00:22 2009 @@ -17,6 +17,7 @@ KIDT_INIT KiInterruptInitTable[] = { + /* Id, Dpl, IST, ServiceRoutine */ {0x00, 0x00, 0x00, KiDivideErrorFault}, {0x01, 0x00, 0x00, KiDebugTrapOrFault}, {0x02, 0x00, 0x03, KiNmiInterrupt}, @@ -119,7 +120,6 @@ case STATUS_BREAKPOINT: /* Decrement RIP by one */ - // FIXME: that doesn't work, why? Context.Rip--; break;
15 years, 10 months
1
0
0
0
[tkreuzer] 39198: fix Ki386InitializeTss
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 29 09:56:54 2009 New Revision: 39198 URL:
http://svn.reactos.org/svn/reactos?rev=39198&view=rev
Log: fix Ki386InitializeTss Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] Thu Jan 29 09:56:54 2009 @@ -384,6 +384,7 @@ TssEntry->Bits.LongMode = 0; TssEntry->Bits.DefaultBig = 0; TssEntry->Bits.Granularity = 0; + TssEntry->MustBeZero = 0; /* Descriptor base is the TSS address */ TssEntry->BaseLow = (ULONG64)Tss & 0xffff; @@ -395,8 +396,11 @@ TssEntry->LimitLow = sizeof(KTSS64) -1; TssEntry->Bits.LimitHigh = 0; + /* Zero out the TSS */ + RtlZeroMemory(Tss, sizeof(KTSS)); + /* FIXME: I/O Map? */ - Tss->IoMapBase = 0; + Tss->IoMapBase = 0x68; /* Setup ring 0 stack pointer */ Tss->Rsp0 = Stack;
15 years, 10 months
1
0
0
0
[dchapyshev] 39197: - Merge with r39196. Fix the handle leak in taskmgr
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Thu Jan 29 09:34:11 2009 New Revision: 39197 URL:
http://svn.reactos.org/svn/reactos?rev=39197&view=rev
Log: - Merge with r39196. Fix the handle leak in taskmgr Modified: branches/ros-branch-0_3_8/reactos/dll/win32/lsasrv/lsarpc.c Modified: branches/ros-branch-0_3_8/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_8/reactos/dll/wi…
============================================================================== --- branches/ros-branch-0_3_8/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_8/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Thu Jan 29 09:34:11 2009 @@ -189,7 +189,10 @@ /* This is our fake handle, don't go too much long way */ if (*ObjectHandle == (LSA_HANDLE)0xcafe) + { + *ObjectHandle = NULL; Status = STATUS_SUCCESS; + } TRACE("LsarClose done (Status: 0x%08lx)!\n", Status);
15 years, 10 months
1
0
0
0
[cwittich] 39196: fix lsa handle leak See issue #3999 for more details.
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Jan 29 08:42:13 2009 New Revision: 39196 URL:
http://svn.reactos.org/svn/reactos?rev=39196&view=rev
Log: fix lsa handle leak See issue #3999 for more details. Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Thu Jan 29 08:42:13 2009 @@ -189,7 +189,10 @@ /* This is our fake handle, don't go too much long way */ if (*ObjectHandle == (LSA_HANDLE)0xcafe) + { + *ObjectHandle = NULL; Status = STATUS_SUCCESS; + } TRACE("LsarClose done (Status: 0x%08lx)!\n", Status);
15 years, 10 months
1
0
0
0
[mkupfer] 39195: remove outdated unimplemented MessageBox
by mkupfer@svn.reactos.org
Author: mkupfer Date: Thu Jan 29 07:53:13 2009 New Revision: 39195 URL:
http://svn.reactos.org/svn/reactos?rev=39195&view=rev
Log: remove outdated unimplemented MessageBox Modified: trunk/reactos/dll/cpl/sysdm/hardprof.c trunk/reactos/dll/cpl/sysdm/userprofile.c Modified: trunk/reactos/dll/cpl/sysdm/hardprof.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/hardprof.c?r…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/hardprof.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/hardprof.c [iso-8859-1] Thu Jan 29 07:53:13 2009 @@ -22,10 +22,6 @@ switch (uMsg) { - case WM_INITDIALOG: - MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0); - break; - case WM_COMMAND: if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) { @@ -60,7 +56,6 @@ SendMessage(GetDlgItem(hwndDlg, IDC_HRDPROFDWN), BM_SETIMAGE,(WPARAM)IMAGE_ICON, (LPARAM)(HANDLE)LoadIcon(hApplet, MAKEINTRESOURCE(IDI_DOWN))); - MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0); } break; Modified: trunk/reactos/dll/cpl/sysdm/userprofile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/userprofile.…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/userprofile.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/userprofile.c [iso-8859-1] Thu Jan 29 07:53:13 2009 @@ -139,7 +139,6 @@ switch (uMsg) { case WM_INITDIALOG: - MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0); OnInitDialog(hwndDlg); break;
15 years, 10 months
1
0
0
0
[cwittich] 39194: define NDEBUG
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Jan 29 06:30:02 2009 New Revision: 39194 URL:
http://svn.reactos.org/svn/reactos?rev=39194&view=rev
Log: define NDEBUG Modified: trunk/reactos/dll/win32/shimgvw/shimgvw.c Modified: trunk/reactos/dll/win32/shimgvw/shimgvw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.c [iso-8859-1] Thu Jan 29 06:30:02 2009 @@ -17,6 +17,8 @@ #include <commctrl.h> #include <gdiplus.h> #include <tchar.h> + +#define NDEBUG #include <debug.h> #include "shimgvw.h"
15 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
76
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
Results per page:
10
25
50
100
200