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
December 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
22 participants
501 discussions
Start a n
N
ew thread
[jimtabor] 44752: [gdi32] - Enable and fix more region user code.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Dec 24 08:42:38 2009 New Revision: 44752 URL:
http://svn.reactos.org/svn/reactos?rev=44752&view=rev
Log: [gdi32] - Enable and fix more region user code. Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h trunk/reactos/dll/win32/gdi32/misc/misc.c trunk/reactos/dll/win32/gdi32/objects/region.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 [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Thu Dec 24 08:42:38 2009 @@ -290,6 +290,7 @@ GdiGetBitmapBitsSize(BITMAPINFO *lpbmi); VOID GdiSAPCallback(PLDC pldc); +HGDIOBJ FASTCALL hGetPEBHandle(HANDLECACHETYPE,COLORREF); int FASTCALL DocumentEventEx(PVOID,HANDLE,HDC,int,ULONG,PVOID,ULONG,PVOID); BOOL FASTCALL EndPagePrinterEx(PVOID,HANDLE); 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 [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c [iso-8859-1] Thu Dec 24 08:42:38 2009 @@ -284,3 +284,10 @@ return NtGdiSetBoundsRect(hdc, prc, 0x8000 | DCB_ACCUMULATE ) ? TRUE : FALSE; } +HGDIOBJ +FASTCALL +hGetPEBHandle(HANDLECACHETYPE Type, COLORREF cr) +{ + return NULL; +} + Modified: trunk/reactos/dll/win32/gdi32/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/re…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] Thu Dec 24 08:42:38 2009 @@ -1,4 +1,50 @@ #include "precomp.h" + +#define INRECT(r, x, y) \ + ( ( ((r).right > x)) && \ + ( ((r).left <= x)) && \ + ( ((r).bottom > y)) && \ + ( ((r).top <= y)) ) + +static +INT +FASTCALL +ComplexityFromRects( PRECT prc1, PRECT prc2) +{ + if ( prc2->left >= prc1->left ) + { + if ( ( prc1->right >= prc2->right) && + ( prc1->top <= prc2->top ) && + ( prc1->bottom <= prc2->bottom ) ) + return SIMPLEREGION; + + if ( prc2->left > prc1->left ) + { + if ( ( prc1->left >= prc2->right ) || + ( prc1->right <= prc2->left ) || + ( prc1->top >= prc2->bottom ) || + ( prc1->bottom <= prc2->top ) ) + return COMPLEXREGION; + } + } + + if ( ( prc2->right < prc1->right ) || + ( prc2->top > prc1->top ) || + ( prc2->bottom < prc1->bottom ) ) + { + if ( ( prc1->left >= prc2->right ) || + ( prc1->right <= prc2->left ) || + ( prc1->top >= prc2->bottom ) || + ( prc1->bottom <= prc2->top ) ) + return COMPLEXREGION; + } + else + { + return NULLREGION; + } + + return ERROR; +} static VOID @@ -192,8 +238,68 @@ WINAPI CreateRectRgn(int x1, int y1, int x2, int y2) { - /* FIXME Some part need be done in user mode */ - return NtGdiCreateRectRgn(x1,y1,x2,y2); + PRGN_ATTR pRgn_Attr; + HRGN hrgn; + int x, y; + + /* Normalize points */ + x = x1; + if ( x1 > x2 ) + { + x1 = x2; + x2 = x; + } + + y = y1; + if ( y1 > y2 ) + { + y1 = y2; + y2 = y; + } + + if ( (UINT)x1 < 0x80000000 || + (UINT)y1 < 0x80000000 || + (UINT)x2 > 0x7FFFFFFF || + (UINT)y2 > 0x7FFFFFFF ) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } +//// Remove when Bush/Pen/Rgn Attr is ready! + return NtGdiCreateRectRgn(x1,y1,x2,y2); +//// + hrgn = hGetPEBHandle(hctRegionHandle, 0); + + if (!hrgn) + hrgn = NtGdiCreateRectRgn(0, 0, 1, 1); + + if (!hrgn) + return hrgn; + + if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) + { + DeleteRegion(hrgn); + return NULL; + } + + if (( x1 == x2) || (y1 == y2)) + { + pRgn_Attr->Flags = NULLREGION; + pRgn_Attr->Rect.left = pRgn_Attr->Rect.top = + pRgn_Attr->Rect.right = pRgn_Attr->Rect.bottom = 0; + } + else + { + pRgn_Attr->Flags = SIMPLEREGION; + pRgn_Attr->Rect.left = x1; + pRgn_Attr->Rect.top = y1; + pRgn_Attr->Rect.right = x2; + pRgn_Attr->Rect.bottom = y2; + } + + pRgn_Attr->AttrFlags = (ATTR_RGN_DIRTY|ATTR_RGN_VALID); + + return hrgn; } /* @@ -217,7 +323,26 @@ WINAPI ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom) { - /* FIXME some part need be done on user mode size */ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_ExcludeClipRect( hdc, xLeft, yTop, xRight, yBottom); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( pLDC ) + { + if (pLDC->iType != LDC_EMFLDC || EMFDRV_ExcludeClipRect( hdc, xLeft, yTop, xRight, yBottom)) + return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom); + } + else + SetLastError(ERROR_INVALID_HANDLE); + return ERROR; + } + } +#endif return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom); } @@ -361,7 +486,7 @@ } else SetLastError(ERROR_INVALID_HANDLE); - return 0; + return ERROR; } } #endif @@ -401,10 +526,10 @@ if ( !pLDC ) { SetLastError(ERROR_INVALID_HANDLE); - return 0; + return ERROR; } if (pLDC->iType == LDC_EMFLDC && !EMFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset )) - return 0; + return ERROR; return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); } } @@ -422,12 +547,59 @@ int nXOffset, int nYOffset) { - /* FIXME some part are done in user mode */ - return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); -} - -/* - * @unimplemented + PRGN_ATTR pRgn_Attr; + int nLeftRect, nTopRect, nRightRect, nBottomRect; + + if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) + return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); + + if ( pRgn_Attr->Flags == NULLREGION) + return pRgn_Attr->Flags; + + if ( pRgn_Attr->Flags != SIMPLEREGION) + return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); + + nLeftRect = pRgn_Attr->Rect.left; + nTopRect = pRgn_Attr->Rect.top; + nRightRect = pRgn_Attr->Rect.right; + nBottomRect = pRgn_Attr->Rect.bottom; + + if (nLeftRect < nRightRect) + { + if (nTopRect < nBottomRect) + { + nLeftRect = nXOffset + nLeftRect; + nTopRect = nYOffset + nTopRect; + nRightRect = nXOffset + nRightRect; + nBottomRect = nYOffset + nBottomRect; + + /* Mask and bit test. */ + if ( ( nLeftRect & 0xF8000000 && + (nLeftRect & 0xF8000000) != 0x80000000 ) || + ( nTopRect & 0xF8000000 && + (nTopRect & 0xF8000000) != 0x80000000 ) || + ( nRightRect & 0xF8000000 && + (nRightRect & 0xF8000000) != 0x80000000 ) || + ( nBottomRect & 0xF8000000 && + (nBottomRect & 0xF8000000) != 0x80000000 ) ) + { + return ERROR; + } + else + { + pRgn_Attr->Rect.top = nTopRect; + pRgn_Attr->Rect.left = nLeftRect; + pRgn_Attr->Rect.right = nRightRect; + pRgn_Attr->Rect.bottom = nBottomRect; + pRgn_Attr->AttrFlags |= ATTR_RGN_DIRTY; + } + } + } + return pRgn_Attr->Flags; +} + +/* + * @implemented */ BOOL WINAPI @@ -435,20 +607,67 @@ int x, int y) { - /* FIXME some stuff at user mode need be fixed */ - return NtGdiPtInRegion(hrgn,x,y); -} - -/* - * @unimplemented + PRGN_ATTR pRgn_Attr; + + if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) + return NtGdiPtInRegion(hrgn,x,y); + + if ( pRgn_Attr->Flags == NULLREGION) + return FALSE; + + if ( pRgn_Attr->Flags != SIMPLEREGION) + return NtGdiPtInRegion(hrgn,x,y); + + return INRECT( pRgn_Attr->Rect, x, y); +} + +/* + * @implemented */ BOOL WINAPI RectInRegion(HRGN hrgn, LPCRECT prcl) { - /* FIXME some stuff at user mode need be fixed */ - return NtGdiRectInRegion(hrgn, (LPRECT) prcl); + PRGN_ATTR pRgn_Attr; + RECT rc; + + if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) + return NtGdiRectInRegion(hrgn, (LPRECT) prcl); + + if ( pRgn_Attr->Flags == NULLREGION) + return FALSE; + + if ( pRgn_Attr->Flags != SIMPLEREGION) + return NtGdiRectInRegion(hrgn, (LPRECT) prcl); + + /* swap the coordinates to make right >= left and bottom >= top */ + /* (region building rectangles are normalized the same way) */ + if ( prcl->top > prcl->bottom) + { + rc.top = prcl->bottom; + rc.bottom = prcl->top; + } + else + { + rc.top = prcl->top; + rc.bottom = prcl->bottom; + } + if ( prcl->right < prcl->left) + { + rc.right = prcl->left; + rc.left = prcl->right; + } + else + { + rc.right = prcl->right; + rc.left = prcl->left; + } + + if ( ComplexityFromRects( (PRECT)&pRgn_Attr->Rect, &rc) != COMPLEXREGION ) + return TRUE; + + return FALSE; } /* @@ -476,7 +695,7 @@ { PRGN_ATTR Rgn_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) + if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect); if ((nLeftRect == nRightRect) || (nTopRect == nBottomRect)) @@ -530,7 +749,7 @@ SetLastError(ERROR_INVALID_HANDLE); } #endif - return 0; -} - - + return ERROR; +} + +
15 years
1
0
0
0
[jimtabor] 44751: [gdi32] - Set the last arg to 1 for GetTextExtentPoint support mode.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Dec 24 08:03:46 2009 New Revision: 44751 URL:
http://svn.reactos.org/svn/reactos?rev=44751&view=rev
Log: [gdi32] - Set the last arg to 1 for GetTextExtentPoint support mode. Modified: trunk/reactos/dll/win32/gdi32/objects/text.c 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 [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] Thu Dec 24 08:03:46 2009 @@ -173,7 +173,7 @@ LPSIZE lpSize ) { - return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0); + return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 1); }
15 years
1
0
0
0
[jimtabor] 44750: [gdi32] - Move OpenPrinterW out from static.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Dec 24 07:57:48 2009 New Revision: 44750 URL:
http://svn.reactos.org/svn/reactos?rev=44750&view=rev
Log: [gdi32] - Move OpenPrinterW out from static. Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h trunk/reactos/dll/win32/gdi32/objects/printdrv.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 [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Thu Dec 24 07:57:48 2009 @@ -157,6 +157,7 @@ typedef DWORD (WINAPI *QUERYREMOTEFONTS) (DWORD,DWORD,DWORD); extern CLOSEPRINTER fpClosePrinter; +extern OPENPRINTERW fpOpenPrinterW; /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/dll/win32/gdi32/objects/printdrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/pr…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/printdrv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/printdrv.c [iso-8859-1] Thu Dec 24 07:57:48 2009 @@ -52,7 +52,7 @@ static GETPRINTERW fpGetPrinterW; static GETPRINTERDRIVERW fpGetPrinterDriverW; static ISVALIDDEVMODEW fpIsValidDevmodeW; -static OPENPRINTERW fpOpenPrinterW; +OPENPRINTERW fpOpenPrinterW; static QUERYSPOOLMODE fpQuerySpoolMode; static QUERYREMOTEFONTS fpQueryRemoteFonts; static QUERYCOLORPROFILE fpQueryColorProfile;
15 years
1
0
0
0
[sserapion] 44749: [ntoskrnl] - enable KdpEnableSafeMem for amd64 - unhack ExInitPoolLookasidePointers - hackplement KiInitializeContextThread - Remove extended eflag code from kdb, its useless. - Rewrite KdbpCmdGdtLdtIdt - Enable KdbpCmdTss - misc kdb fixes.
by sserapion@svn.reactos.org
Author: sserapion Date: Thu Dec 24 05:12:02 2009 New Revision: 44749 URL:
http://svn.reactos.org/svn/reactos?rev=44749&view=rev
Log: [ntoskrnl] - enable KdpEnableSafeMem for amd64 - unhack ExInitPoolLookasidePointers - hackplement KiInitializeContextThread - Remove extended eflag code from kdb, its useless. - Rewrite KdbpCmdGdtLdtIdt - Enable KdbpCmdTss - misc kdb fixes. Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c branches/ros-amd64-bringup/reactos/ntoskrnl/kd/kdinit.c branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb_cli.c branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/thrdini.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/lookas.c [iso-8859-1] Thu Dec 24 05:12:02 2009 @@ -72,24 +72,16 @@ InitializeSListHead(&Entry->ListHead); /* Bind to PRCB */ -#ifdef _M_AMD64 - DPRINT1("Something is missing here, Prcb = %p\n", Prcb); - // FIXME -#else Prcb->PPNPagedLookasideList[i].P = Entry; Prcb->PPNPagedLookasideList[i].L = Entry; -#endif + /* Initialize the paged list */ Entry = &ExpSmallPagedPoolLookasideLists[i]; InitializeSListHead(&Entry->ListHead); /* Bind to PRCB */ -#ifdef _M_AMD64 - // FIXME -#else Prcb->PPPagedLookasideList[i].P = Entry; Prcb->PPPagedLookasideList[i].L = Entry; -#endif } } Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/kd/kdinit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/kd/kdinit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/kd/kdinit.c [iso-8859-1] Thu Dec 24 05:12:02 2009 @@ -249,7 +249,7 @@ } else /* BootPhase > 0 */ { -#ifdef _M_IX86 +#if defined(_M_IX86) || defined(_M_AMD64) KdpEnableSafeMem(); #endif } Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb_cli.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] Thu Dec 24 05:12:02 2009 @@ -602,21 +602,13 @@ { PKTRAP_FRAME Tf = &KdbCurrentTrapFrame->Tf; INT i; - const PCHAR EflagsBits[64] = { " CF", NULL, " PF", " BIT3", " AF", " BIT5", + const PCHAR EflagsBits[32] = { " CF", NULL, " PF", " BIT3", " AF", " BIT5", " ZF", " SF", " TF", " IF", " DF", " OF", NULL, NULL, " NT", " BIT15", " RF", " VF", " AC", " VIF", " VIP", " ID", " BIT22", " BIT23", " BIT24", " BIT25", " BIT26", - " BIT27", " BIT28", " BIT29", " BIT30", - " BIT31", " BIT32", " BIT33", " BIT34", - " BIT35", " BIT36", " BIT37", " BIT38", - " BIT39", " BIT40", " BIT41", " BIT42", - " BIT43", " BIT44", " BIT45", " BIT46", - " BIT47", " BIT48", " BIT49", " BIT50", - " BIT51", " BIT52", " BIT53", " BIT54", - " BIT55", " BIT56", " BIT57", " BIT58", - " BIT59", " BIT60", " BIT61", " BIT62", - " BIT63", + " BIT27", " BIT28", " BIT29", " BIT30" + }; if (Argv[0][0] == 'r') /* regs */ @@ -654,11 +646,7 @@ #endif KdbpPrint("EFLAGS 0x%08x ", Tf->EFlags); -#ifdef _M_IX86 for (i = 0; i < 32; i++) -#elif defined(_M_AMD64) - for (i = 0; i < 64; i++) -#endif { if (i == 1) { @@ -1591,19 +1579,21 @@ /*!\brief Displays GDT, LDT or IDTd. */ +#ifdef _M_AMD64 static BOOLEAN KdbpCmdGdtLdtIdt( ULONG Argc, PCHAR Argv[]) { KDESCRIPTOR Reg; - ULONG SegDesc[2]; - ULONG SegBase; + KIDTENTRY IdtEntry; + KGDTENTRY GdtEntry; + ULONG_PTR SegBase; ULONG SegLimit; PCHAR SegType; USHORT SegSel; UCHAR Type, Dpl; - INT i; + INT i = 0; ULONG ul; if (Argv[0][0] == 'i') @@ -1617,49 +1607,53 @@ return TRUE; } - KdbpPrint("IDT Base: 0x%08x Limit: 0x%04x\n", Reg.Base, Reg.Limit); + KdbpPrint("IDT Base: 0x%p Limit: 0x%04x\n", Reg.Base, Reg.Limit); KdbpPrint(" Idx Type Seg. Sel. Offset DPL\n"); - for (i = 0; (i + sizeof(SegDesc) - 1) <= Reg.Limit; i += 8) - { - if (!NT_SUCCESS(KdbpSafeReadMemory(SegDesc, (PVOID)((ULONG_PTR)Reg.Base + i), sizeof(SegDesc)))) - { - KdbpPrint("Couldn't access memory at 0x%08x!\n", (ULONG_PTR)Reg.Base + i); + while (i < (Reg.Limit)/sizeof(IdtEntry)) + { + if (!NT_SUCCESS(KdbpSafeReadMemory(&IdtEntry, (PVOID)((ULONG_PTR)Reg.Base +(i *sizeof(IdtEntry))), sizeof(IdtEntry)))) + { + KdbpPrint("Couldn't access memory at 0x%x!\n", (ULONG_PTR)Reg.Base + sizeof(IdtEntry)); return TRUE; } - Dpl = ((SegDesc[1] >> 13) & 3); - if ((SegDesc[1] & 0x1f00) == 0x0500) /* Task gate */ + Dpl = IdtEntry.Dpl; + if (IdtEntry.Type == 0x5) /* Task gate */ SegType = "TASKGATE"; - else if ((SegDesc[1] & 0x1fe0) == 0x0e00) /* 32 bit Interrupt gate */ + else if (IdtEntry.Type == 0xE) /* 32 bit Interrupt gate */ SegType = "INTGATE32"; - else if ((SegDesc[1] & 0x1fe0) == 0x0600) /* 16 bit Interrupt gate */ + else if (IdtEntry.Type == 0x6) /* 16 bit Interrupt gate */ SegType = "INTGATE16"; - else if ((SegDesc[1] & 0x1fe0) == 0x0f00) /* 32 bit Trap gate */ + else if (IdtEntry.Type == 0xF) /* 32 bit Trap gate */ SegType = "TRAPGATE32"; - else if ((SegDesc[1] & 0x1fe0) == 0x0700) /* 16 bit Trap gate */ + else if (IdtEntry.Type == 0x7) /* 16 bit Trap gate */ SegType = "TRAPGATE16"; else SegType = "UNKNOWN"; - if ((SegDesc[1] & (1 << 15)) == 0) /* not present */ + if (IdtEntry.Present == 0) /* not present */ { KdbpPrint(" %03d %-10s [NP] [NP] %02d\n", - i / 8, SegType, Dpl); - } - else if ((SegDesc[1] & 0x1f00) == 0x0500) /* Task gate */ - { - SegSel = SegDesc[0] >> 16; + i, SegType, Dpl); + } + else if (IdtEntry.Type == 0x5) /* Task gate */ + { + SegSel = IdtEntry.Selector; KdbpPrint(" %03d %-10s 0x%04x %02d\n", - i / 8, SegType, SegSel, Dpl); + i, SegType, SegSel, Dpl); } else { - SegSel = SegDesc[0] >> 16; - SegBase = (SegDesc[1] & 0xffff0000) | (SegDesc[0] & 0x0000ffff); - KdbpPrint(" %03d %-10s 0x%04x 0x%08x %02d\n", - i / 8, SegType, SegSel, SegBase, Dpl); - } + SegSel = IdtEntry.Selector; + SegBase = (ULONG64)IdtEntry.OffsetLow | + (ULONG64)IdtEntry.OffsetMiddle << 16 | + (ULONG64)IdtEntry.OffsetHigh << 32; + + KdbpPrint(" %03d %-10s 0x%04x 0x%p %02d\n", + i , SegType, SegSel, SegBase, Dpl); + } + i++; } } else @@ -1669,25 +1663,17 @@ if (Argv[0][0] == 'g') { /* Read GDTR */ -#ifdef _M_IX86 - Ke386GetGlobalDescriptorTable(&Reg.Limit); -#elif defined(_M_AMD64) __sgdt(&Reg.Limit); -#endif - i = 8; + } else { ASSERT(Argv[0][0] == 'l'); /* Read LDTR */ -#ifdef _M_IX86 - Reg.Limit = Ke386GetLocalDescriptorTable(); -#elif defined(_M_AMD64) - __sldt(&Reg.Limit); -#endif + __sldt(&Reg.Limit); + Reg.Base = 0; - i = 0; ul = 1 << 2; } @@ -1698,28 +1684,27 @@ return TRUE; } - KdbpPrint("%cDT Base: 0x%08x Limit: 0x%04x\n", + KdbpPrint("%cDT Base: 0x%p Limit: 0x%04x\n", Argv[0][0] == 'g' ? 'G' : 'L', Reg.Base, Reg.Limit); KdbpPrint(" Idx Sel. Type Base Limit DPL Attribs\n"); - for (; (i + sizeof(SegDesc) - 1) <= Reg.Limit; i += 8) - { - if (!NT_SUCCESS(KdbpSafeReadMemory(SegDesc, (PVOID)((ULONG_PTR)Reg.Base + i), sizeof(SegDesc)))) - { - KdbpPrint("Couldn't access memory at 0x%08x!\n", (ULONG_PTR)Reg.Base + i); + while (i < (Reg.Limit)/sizeof(GdtEntry)) + { + if (!NT_SUCCESS(KdbpSafeReadMemory(&GdtEntry, (PVOID)((ULONG_PTR)Reg.Base +(i * 8)), sizeof(GdtEntry)))) + { + KdbpPrint("Couldn't access memory at 0x%p!\n", (ULONG_PTR)Reg.Base + i); return TRUE; } - Dpl = ((SegDesc[1] >> 13) & 3); - Type = ((SegDesc[1] >> 8) & 0xf); - - SegBase = SegDesc[0] >> 16; - SegBase |= (SegDesc[1] & 0xff) << 16; - SegBase |= SegDesc[1] & 0xff000000; - SegLimit = SegDesc[0] & 0x0000ffff; - SegLimit |= (SegDesc[1] >> 16) & 0xf; - - if ((SegDesc[1] & (1 << 23)) != 0) + Dpl = GdtEntry.Bits.Dpl; + Type = GdtEntry.Bits.Type; + + SegBase = (ULONG_PTR)KiGetGdtDescriptorBase(&GdtEntry); + + SegLimit = GdtEntry.LimitLow; + SegLimit |= (ULONG64)GdtEntry.Bits.LimitHigh << 32; + + if (GdtEntry.Bits.DefaultBig != 0) { SegLimit *= 4096; SegLimit += 4095; @@ -1729,7 +1714,7 @@ SegLimit++; } - if ((SegDesc[1] & (1 << 12)) == 0) /* System segment */ + if (GdtEntry.Bits.System == 1) /* System segment */ { switch (Type) { @@ -1755,6 +1740,230 @@ SegLimit = 0; } } + else if ((Type & (1 << 3)) == 0) /* Data segment */ + { + if (GdtEntry.Bits.LongMode != 0) + SegType = "DATA32"; + else + SegType = "DATA16"; + } + else /* Code segment */ + { + if (GdtEntry.Bits.LongMode != 0) + SegType = "CODE32"; + else + SegType = "CODE16"; + } + + if (GdtEntry.Bits.Present == 0) /* not present */ + { + KdbpPrint(" %03d 0x%04x %-11s [NP] [NP] %02d NP\n", + i, i | Dpl | ul, SegType, Dpl); + } + else + { + KdbpPrint(" %03d 0x%04x %-11s 0x%p 0x%08x %02d ", + i, i | Dpl | ul, SegType, SegBase, SegLimit, Dpl); + + if (GdtEntry.Bits.System == 1) /* System segment */ + { + /* FIXME: Display system segment */ + /* they are twice as big as regular segments */ + i++; + } + else if ((Type & (1 << 3)) == 0) /* Data segment */ + { + if ((Type & (1 << 2)) != 0) /* Expand-down */ + KdbpPrint(" E"); + + KdbpPrint((Type & (1 << 1)) ? " R/W" : " R"); + + if ((Type & (1 >> 1)) != 0) + KdbpPrint(" A"); + } + else /* Code segment */ + { + if ((Type & (1 << 2)) != 0) /* Conforming */ + KdbpPrint(" C"); + + KdbpPrint((Type & (1 << 1)) ? " R/X" : " X"); + + if ((Type & (1 << 1)) != 0) + KdbpPrint(" A"); + } + + if ((GdtEntry.Bits.LimitHigh & (1 << 3)) != 0) + KdbpPrint(" AVL"); + + KdbpPrint("\n"); + } + i++; + } + } + + return TRUE; +} +#endif + +/*!\brief Displays GDT, LDT or IDTd. + */ +#ifdef _M_IX86 +static BOOLEAN +KdbpCmdGdtLdtIdt( + ULONG Argc, + PCHAR Argv[]) +{ + KDESCRIPTOR Reg; + ULONG SegDesc[2]; + ULONG SegBase; + ULONG SegLimit; + PCHAR SegType; + USHORT SegSel; + UCHAR Type, Dpl; + INT i; + ULONG ul; + + if (Argv[0][0] == 'i') + { + /* Read IDTR */ + __sidt(&Reg.Limit); + + if (Reg.Limit < 7) + { + KdbpPrint("Interrupt descriptor table is empty.\n"); + return TRUE; + } + + KdbpPrint("IDT Base: 0x%08x Limit: 0x%04x\n", Reg.Base, Reg.Limit); + KdbpPrint(" Idx Type Seg. Sel. Offset DPL\n"); + + for (i = 0; (i + sizeof(SegDesc) - 1) <= Reg.Limit; i += 8) + { + if (!NT_SUCCESS(KdbpSafeReadMemory(SegDesc, (PVOID)((ULONG_PTR)Reg.Base + i), sizeof(SegDesc)))) + { + KdbpPrint("Couldn't access memory at 0x%08x!\n", (ULONG_PTR)Reg.Base + i); + return TRUE; + } + + Dpl = ((SegDesc[1] >> 13) & 3); + if ((SegDesc[1] & 0x1f00) == 0x0500) /* Task gate */ + SegType = "TASKGATE"; + else if ((SegDesc[1] & 0x1fe0) == 0x0e00) /* 32 bit Interrupt gate */ + SegType = "INTGATE32"; + else if ((SegDesc[1] & 0x1fe0) == 0x0600) /* 16 bit Interrupt gate */ + SegType = "INTGATE16"; + else if ((SegDesc[1] & 0x1fe0) == 0x0f00) /* 32 bit Trap gate */ + SegType = "TRAPGATE32"; + else if ((SegDesc[1] & 0x1fe0) == 0x0700) /* 16 bit Trap gate */ + SegType = "TRAPGATE16"; + else + SegType = "UNKNOWN"; + + if ((SegDesc[1] & (1 << 15)) == 0) /* not present */ + { + KdbpPrint(" %03d %-10s [NP] [NP] %02d\n", + i / 8, SegType, Dpl); + } + else if ((SegDesc[1] & 0x1f00) == 0x0500) /* Task gate */ + { + SegSel = SegDesc[0] >> 16; + KdbpPrint(" %03d %-10s 0x%04x %02d\n", + i / 8, SegType, SegSel, Dpl); + } + else + { + SegSel = SegDesc[0] >> 16; + SegBase = (SegDesc[1] & 0xffff0000) | (SegDesc[0] & 0x0000ffff); + KdbpPrint(" %03d %-10s 0x%04x 0x%08x %02d\n", + i / 8, SegType, SegSel, SegBase, Dpl); + } + } + } + else + { + ul = 0; + + if (Argv[0][0] == 'g') + { + /* Read GDTR */ + Ke386GetGlobalDescriptorTable(&Reg.Limit); + i = 8; + } + else + { + ASSERT(Argv[0][0] == 'l'); + + /* Read LDTR */ + Reg.Limit = Ke386GetLocalDescriptorTable(); + Reg.Base = 0; + i = 0; + ul = 1 << 2; + } + + if (Reg.Limit < 7) + { + KdbpPrint("%s descriptor table is empty.\n", + Argv[0][0] == 'g' ? "Global" : "Local"); + return TRUE; + } + + KdbpPrint("%cDT Base: 0x%08x Limit: 0x%04x\n", + Argv[0][0] == 'g' ? 'G' : 'L', Reg.Base, Reg.Limit); + KdbpPrint(" Idx Sel. Type Base Limit DPL Attribs\n"); + + for (; (i + sizeof(SegDesc) - 1) <= Reg.Limit; i += 8) + { + if (!NT_SUCCESS(KdbpSafeReadMemory(SegDesc, (PVOID)((ULONG_PTR)Reg.Base + i), sizeof(SegDesc)))) + { + KdbpPrint("Couldn't access memory at 0x%08x!\n", (ULONG_PTR)Reg.Base + i); + return TRUE; + } + + Dpl = ((SegDesc[1] >> 13) & 3); + Type = ((SegDesc[1] >> 8) & 0xf); + + SegBase = SegDesc[0] >> 16; + SegBase |= (SegDesc[1] & 0xff) << 16; + SegBase |= SegDesc[1] & 0xff000000; + SegLimit = SegDesc[0] & 0x0000ffff; + SegLimit |= (SegDesc[1] >> 16) & 0xf; + + if ((SegDesc[1] & (1 << 23)) != 0) + { + SegLimit *= 4096; + SegLimit += 4095; + } + else + { + SegLimit++; + } + + if ((SegDesc[1] & (1 << 12)) == 0) /* System segment */ + { + switch (Type) + { + case 1: SegType = "TSS16(Avl)"; break; + case 2: SegType = "LDT"; break; + case 3: SegType = "TSS16(Busy)"; break; + case 4: SegType = "CALLGATE16"; break; + case 5: SegType = "TASKGATE"; break; + case 6: SegType = "INTGATE16"; break; + case 7: SegType = "TRAPGATE16"; break; + case 9: SegType = "TSS32(Avl)"; break; + case 11: SegType = "TSS32(Busy)"; break; + case 12: SegType = "CALLGATE32"; break; + case 14: SegType = "INTGATE32"; break; + case 15: SegType = "INTGATE32"; break; + default: SegType = "UNKNOWN"; break; + } + + if (!(Type >= 1 && Type <= 3) && + Type != 9 && Type != 11) + { + SegBase = 0; + SegLimit = 0; + } + } else if ((SegDesc[1] & (1 << 11)) == 0) /* Data segment */ { if ((SegDesc[1] & (1 << 22)) != 0) @@ -1815,6 +2024,7 @@ return TRUE; } +#endif /*!\brief Displays the KPCR */ @@ -1862,21 +2072,21 @@ Pcr->VdmAlert, Pcr->SecondLevelCacheSize, Pcr->InterruptMode); #elif defined(_M_AMD64) KdbpPrint("Current PCR is at 0x%x.\n", (INT_PTR)Pcr); - KdbpPrint(" Tib.ExceptionList: 0x%x\n" - " Tib.StackBase: 0x%x\n" + KdbpPrint(" Tib.ExceptionList: 0x%p\n" + " Tib.StackBase: 0x%p\n" " Tib.StackLimit: 0x%x\n" - " Tib.SubSystemTib: 0x%x\n" + " Tib.SubSystemTib: 0x%p\n" " Tib.FiberData/Version: 0x%x\n" - " Tib.ArbitraryUserPointer: 0x%x\n" - " Tib.Self: 0x%x\n" - " Self: 0x%x\n" - " PCRCB: 0x%x\n" + " Tib.ArbitraryUserPointer: 0x%p\n" + " Tib.Self: 0x%p\n" + " Self: 0x%p\n" + " PCRCB: 0x%p\n" " Irql: 0x%x\n" " KdVersionBlock: 0x%08x\n" - " IDT: 0x%08x\n" - " GDT: 0x%08x\n" - " TSS: 0x%08x\n" - " UserRsp: 0x%08x\n" + " IDT: 0x%p\n" + " GDT: 0x%p\n" + " TSS: 0x%p\n" + " UserRsp: 0x%p\n" " MajorVersion: 0x%04x\n" " MinorVersion: 0x%04x\n" " StallScaleFactor: 0x%08x\n" @@ -1902,8 +2112,8 @@ #ifdef _M_IX86 KTSS *Tss = KeGetPcr()->TSS; - KdbpPrint("Current TSS is at 0x%08x.\n", (INT)Tss); - KdbpPrint(" Eip: 0x%08x\n" + KdbpPrint("Current TSS is at 0x%p.\n", (INT_PTR)Tss); + KdbpPrint(" Eip: 0x%p\n" " Es: 0x%04x\n" " Cs: 0x%04x\n" " Ss: 0x%04x\n" @@ -1912,10 +2122,18 @@ " Gs: 0x%04x\n" " IoMapBase: 0x%04x\n", Tss->Eip, Tss->Es, Tss->Cs, Tss->Ds, Tss->Fs, Tss->Gs, Tss->IoMapBase); - +#elif defined(_M_AMD64) + KTSS *Tss = KeGetPcr()->TssBase; + + KdbpPrint("Current TSS is at 0x%p.\n", (INT_PTR)Tss); + KdbpPrint(" Rsp0: 0x%p\n" + " Rsp1: 0x%p\n" + " Rsp2: 0x%p\n" + " Ist: 0x%p\n" + " IoMapBase: 0x%04x\n", + Tss->Rsp0, Tss->Rsp1, Tss->Rsp2, Tss->Ist, Tss->IoMapBase); +#endif return TRUE; -#endif - return FALSE; } /*!\brief Bugchecks the system. Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] Thu Dec 24 05:12:02 2009 @@ -714,7 +714,10 @@ if (KdPollBreakIn()) DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); /* Hack! Wait for the debugger! */ - //while (!KdPollBreakIn()); +#ifdef _WINKD_ + while (!KdPollBreakIn()); + DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); +#endif } Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/thrdini.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/thrdini.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/thrdini.c [iso-8859-1] Thu Dec 24 05:12:02 2009 @@ -11,7 +11,7 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> -#if 0 + typedef struct _KSWITCHFRAME { PVOID ExceptionList; @@ -32,16 +32,16 @@ KSWITCHFRAME CtxSwitchFrame; KSTART_FRAME StartFrame; KTRAP_FRAME TrapFrame; - FX_SAVE_AREA FxSaveArea; + //FX_SAVE_AREA FxSaveArea; } KUINIT_FRAME, *PKUINIT_FRAME; typedef struct _KKINIT_FRAME { KSWITCHFRAME CtxSwitchFrame; KSTART_FRAME StartFrame; - FX_SAVE_AREA FxSaveArea; + //FX_SAVE_AREA FxSaveArea; } KKINIT_FRAME, *PKKINIT_FRAME; -#endif + /* FUNCTIONS *****************************************************************/ VOID @@ -52,10 +52,8 @@ IN PVOID StartContext, IN PCONTEXT ContextPointer) { - FrLdrDbgPrint("KiInitializeContextThread stub\n"); -#if 0 - PFX_SAVE_AREA FxSaveArea; - PFXSAVE_FORMAT FxSaveFormat; + //PFX_SAVE_AREA FxSaveArea; + //PFXSAVE_FORMAT FxSaveFormat; PKSTART_FRAME StartFrame; PKSWITCHFRAME CtxSwitchFrame; PKTRAP_FRAME TrapFrame; @@ -78,60 +76,60 @@ /* Zero out the trap frame and save area */ RtlZeroMemory(&InitFrame->TrapFrame, - KTRAP_FRAME_LENGTH + sizeof(FX_SAVE_AREA)); + KTRAP_FRAME_LENGTH); /* Setup the Fx Area */ - FxSaveArea = &InitFrame->FxSaveArea; + //FxSaveArea = &InitFrame->FxSaveArea; /* Check if we support FXsr */ - if (KeI386FxsrPresent) - { - /* Get the FX Save Format Area */ - FxSaveFormat = (PFXSAVE_FORMAT)Context->ExtendedRegisters; - - /* Set an initial state */ - FxSaveFormat->ControlWord = 0x27F; - FxSaveFormat->StatusWord = 0; - FxSaveFormat->TagWord = 0; - FxSaveFormat->ErrorOffset = 0; - FxSaveFormat->ErrorSelector = 0; - FxSaveFormat->DataOffset = 0; - FxSaveFormat->DataSelector = 0; - FxSaveFormat->MXCsr = 0x1F80; - } - else - { - /* Setup the regular save area */ - Context->FloatSave.ControlWord = 0x27F; - Context->FloatSave.StatusWord = 0; - Context->FloatSave.TagWord = -1; - Context->FloatSave.ErrorOffset = 0; - Context->FloatSave.ErrorSelector = 0; - Context->FloatSave.DataOffset =0; - Context->FloatSave.DataSelector = 0; - } +// if (KeI386FxsrPresent) +// { +// /* Get the FX Save Format Area */ +// FxSaveFormat = (PFXSAVE_FORMAT)Context->ExtendedRegisters; +// +// /* Set an initial state */ +// FxSaveFormat->ControlWord = 0x27F; +// FxSaveFormat->StatusWord = 0; +// FxSaveFormat->TagWord = 0; +// FxSaveFormat->ErrorOffset = 0; +// FxSaveFormat->ErrorSelector = 0; +// FxSaveFormat->DataOffset = 0; +// FxSaveFormat->DataSelector = 0; +// FxSaveFormat->MXCsr = 0x1F80; +// } +// else +// { +// /* Setup the regular save area */ +// Context->FloatSave.ControlWord = 0x27F; +// Context->FloatSave.StatusWord = 0; +// Context->FloatSave.TagWord = -1; +// Context->FloatSave.ErrorOffset = 0; +// Context->FloatSave.ErrorSelector = 0; +// Context->FloatSave.DataOffset =0; +// Context->FloatSave.DataSelector = 0; +// } /* Check if the CPU has NPX */ if (KeI386NpxPresent) { /* Set an intial NPX State */ - Context->FloatSave.Cr0NpxState = 0; - FxSaveArea->Cr0NpxState = 0; - FxSaveArea->NpxSavedCpu = 0; + //Context->FloatSave.Cr0NpxState = 0; + //FxSaveArea->Cr0NpxState = 0; + //FxSaveArea->NpxSavedCpu = 0; /* Now set the context flags depending on XMM support */ - ContextFlags |= (KeI386FxsrPresent) ? CONTEXT_EXTENDED_REGISTERS : - CONTEXT_FLOATING_POINT; + //ContextFlags |= (KeI386FxsrPresent) ? CONTEXT_EXTENDED_REGISTERS : + // CONTEXT_FLOATING_POINT; /* Set the Thread's NPX State */ - Thread->NpxState = NPX_STATE_NOT_LOADED; + Thread->NpxState = 0xA; Thread->DispatcherHeader.NpxIrql = PASSIVE_LEVEL; } else { /* We'll use emulation */ - FxSaveArea->Cr0NpxState = CR0_EM; - Thread->NpxState = NPX_STATE_NOT_LOADED &~ CR0_MP; + //FxSaveArea->Cr0NpxState = CR0_EM; + Thread->NpxState = 0xA &~ CR0_MP; } /* Disable any debug regiseters */ @@ -148,19 +146,16 @@ UserMode); /* Set SS, DS, ES's RPL Mask properly */ - TrapFrame->HardwareSegSs |= RPL_MASK; + TrapFrame->SegSs |= RPL_MASK; TrapFrame->SegDs |= RPL_MASK; TrapFrame->SegEs |= RPL_MASK; TrapFrame->Dr7 = 0; - /* Set the debug mark */ - TrapFrame->DbgArgMark = 0xBADB0D00; - /* Set the previous mode as user */ - TrapFrame->PreviousPreviousMode = UserMode; + TrapFrame->PreviousMode = UserMode; /* Terminate the Exception Handler List */ - TrapFrame->ExceptionList = EXCEPTION_CHAIN_END; + TrapFrame->ExceptionFrame = 0; /* Setup the Stack for KiThreadStartup and Context Switching */ StartFrame = &InitFrame->StartFrame; @@ -180,25 +175,26 @@ sizeof(KKINIT_FRAME)); /* Setup the Fx Area */ - FxSaveArea = &InitFrame->FxSaveArea; - RtlZeroMemory(FxSaveArea, sizeof(FX_SAVE_AREA)); + //FxSaveArea = &InitFrame->FxSaveArea; + //RtlZeroMemory(FxSaveArea, sizeof(FX_SAVE_AREA)); /* Check if we have Fxsr support */ if (KeI386FxsrPresent) { - /* Set the stub FX area */ - FxSaveArea->U.FxArea.ControlWord = 0x27F; - FxSaveArea->U.FxArea.MXCsr = 0x1F80; + DPRINT1("FxsrPresent but did nothing\n"); +// /* Set the stub FX area */ +// FxSaveArea->U.FxArea.ControlWord = 0x27F; +// FxSaveArea->U.FxArea.MXCsr = 0x1F80; +// } +// else +// { +// /* Set the stub FN area */ +// FxSaveArea->U.FnArea.ControlWord = 0x27F; +// FxSaveArea->U.FnArea.TagWord = -1; } - else - { - /* Set the stub FN area */ - FxSaveArea->U.FnArea.ControlWord = 0x27F; - FxSaveArea->U.FnArea.TagWord = -1; - } /* No NPX State */ - Thread->NpxState = NPX_STATE_NOT_LOADED; + Thread->NpxState = 0xA; /* Setup the Stack for KiThreadStartup and Context Switching */ StartFrame = &InitFrame->StartFrame; @@ -223,7 +219,7 @@ /* Save back the new value of the kernel stack. */ Thread->KernelStack = (PVOID)CtxSwitchFrame; -#endif + } /* EOF */
15 years
1
0
0
0
[tkreuzer] 44748: [GENINC] This is going to be a host tool that autogenerates assembly definitions from the target headers. This is done in two steps: 1) a raw data file is compiled with the target compiler using the target headers 2) The host tool parses this data file and creates an appropriate .h or .inc file. So far there's only the source for the data file, which is halfway complete and currently compiled as bootloader type, as we don't seem to have raw binary target. WIP
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Dec 24 04:45:21 2009 New Revision: 44748 URL:
http://svn.reactos.org/svn/reactos?rev=44748&view=rev
Log: [GENINC] This is going to be a host tool that autogenerates assembly definitions from the target headers. This is done in two steps: 1) a raw data file is compiled with the target compiler using the target headers 2) The host tool parses this data file and creates an appropriate .h or .inc file. So far there's only the source for the data file, which is halfway complete and currently compiled as bootloader type, as we don't seem to have raw binary target. WIP Added: trunk/reactos/tools/geninc/ (with props) trunk/reactos/tools/geninc/data.c (with props) trunk/reactos/tools/geninc/geninc.c (with props) trunk/reactos/tools/geninc/geninc.rbuild (with props) Propchange: trunk/reactos/tools/geninc/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Thu Dec 24 04:45:21 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/geninc/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/geninc/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/geninc/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/tools/geninc/data.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/geninc/data.c?rev=44…
============================================================================== --- trunk/reactos/tools/geninc/data.c (added) +++ trunk/reactos/tools/geninc/data.c [iso-8859-1] Thu Dec 24 04:45:21 2009 @@ -1,0 +1,1329 @@ +#undef __MSVCRT__ +#include <psdk/ntverp.h> + +/* DDK/IFS/NDK Headers */ +#include <excpt.h> +#include <ntdef.h> +#include <ntifs.h> +#include <arc/arc.h> +#include <ntndk.h> +#include <bugcodes.h> + +/* KD Support */ +#define NOEXTAPI +#include <windbgkd.h> +#include <wdbgexts.h> +#include <kddll.h> + +typedef struct +{ + UCHAR Type; + CHAR Name[60]; + ULONGLONG Value; +} ASMGENDATA; + +#define RAW(x) {0, #x, 0} +#define CONSTANT(name) {1, #name, name} +#define OFFSET(name, struct, member) {1, #name, FIELD_OFFSET(struct, member)} +#define RELOFFSET(name, struct, member, to) {1, #name, FIELD_OFFSET(struct, member) - FIELD_OFFSET(struct, to)} +#define SIZE(name, struct) {1, #name, sizeof(struct)} +#define HEADER(x) {2, "/* " x " */", 0} + +ASMGENDATA Table[] = +{ + +/* PORTABLE CONSTANTS ********************************************************/ + + HEADER("Pointer size"), + SIZE(SizeofPointer, PVOID), + + HEADER("Breakpoints"), + CONSTANT(BREAKPOINT_BREAK), + CONSTANT(BREAKPOINT_PRINT), + CONSTANT(BREAKPOINT_PROMPT), + CONSTANT(BREAKPOINT_LOAD_SYMBOLS), + CONSTANT(BREAKPOINT_UNLOAD_SYMBOLS), + CONSTANT(BREAKPOINT_COMMAND_STRING), + + HEADER("Context Frame Flags"), + CONSTANT(CONTEXT_FULL), + CONSTANT(CONTEXT_CONTROL), + CONSTANT(CONTEXT_INTEGER), + CONSTANT(CONTEXT_SEGMENTS), + CONSTANT(CONTEXT_FLOATING_POINT), + CONSTANT(CONTEXT_DEBUG_REGISTERS), + + HEADER("Exception flags"), + CONSTANT(EXCEPTION_NONCONTINUABLE), + CONSTANT(EXCEPTION_UNWINDING), + CONSTANT(EXCEPTION_EXIT_UNWIND), + CONSTANT(EXCEPTION_STACK_INVALID), + CONSTANT(EXCEPTION_NESTED_CALL), + CONSTANT(EXCEPTION_TARGET_UNWIND), + CONSTANT(EXCEPTION_COLLIDED_UNWIND), + CONSTANT(EXCEPTION_UNWIND), + CONSTANT(EXCEPTION_EXECUTE_HANDLER), + CONSTANT(EXCEPTION_CONTINUE_SEARCH), + CONSTANT(EXCEPTION_CONTINUE_EXECUTION), +#ifdef _X86_ + //CONSTANT(EXCEPTION_CHAIN_END), + //CONSTANT(FIXED_NTVDMSTATE_LINEAR), +#endif + + HEADER("Exception types"), + CONSTANT(ExceptionContinueExecution), + CONSTANT(ExceptionContinueSearch), + CONSTANT(ExceptionNestedException), + CONSTANT(ExceptionCollidedUnwind), + + HEADER("Lock Queue"), + CONSTANT(LOCK_QUEUE_WAIT), + CONSTANT(LOCK_QUEUE_OWNER), + CONSTANT(LockQueueDispatcherLock), + + HEADER("Performance Definitions"), +// CONSTANT(PERF_CONTEXTSWAP_OFFSET), +// CONSTANT(PERF_CONTEXTSWAP_FLAG), +// CONSTANT(PERF_INTERRUPT_OFFSET), +// CONSTANT(PERF_INTERRUPT_FLAG), +// CONSTANT(PERF_PROFILE_OFFSET), +// CONSTANT(PERF_PROFILE_FLAG), +// CONSTANT(PERF_SYSCALL_OFFSET), +// CONSTANT(PERF_SYSCALL_FLAG), +// CONSTANT(NTOS_YIELD_MACRO), + + HEADER("Process states"), + CONSTANT(ProcessInMemory), + CONSTANT(ProcessOutOfMemory), + CONSTANT(ProcessInTransition), + + HEADER("Processor mode"), + CONSTANT(KernelMode), + CONSTANT(UserMode), + + HEADER("Status codes"), + CONSTANT(STATUS_ACCESS_VIOLATION), + CONSTANT(STATUS_ASSERTION_FAILURE), + CONSTANT(STATUS_ARRAY_BOUNDS_EXCEEDED), + CONSTANT(STATUS_BAD_COMPRESSION_BUFFER), + CONSTANT(STATUS_BREAKPOINT), + CONSTANT(STATUS_CALLBACK_POP_STACK), + CONSTANT(STATUS_DATATYPE_MISALIGNMENT), + CONSTANT(STATUS_FLOAT_DENORMAL_OPERAND), + CONSTANT(STATUS_FLOAT_DIVIDE_BY_ZERO), + CONSTANT(STATUS_FLOAT_INEXACT_RESULT), + CONSTANT(STATUS_FLOAT_INVALID_OPERATION), + CONSTANT(STATUS_FLOAT_OVERFLOW), + CONSTANT(STATUS_FLOAT_STACK_CHECK), + CONSTANT(STATUS_FLOAT_UNDERFLOW), + CONSTANT(STATUS_FLOAT_MULTIPLE_FAULTS), + CONSTANT(STATUS_FLOAT_MULTIPLE_TRAPS), + CONSTANT(STATUS_GUARD_PAGE_VIOLATION), + CONSTANT(STATUS_ILLEGAL_FLOAT_CONTEXT), + CONSTANT(STATUS_ILLEGAL_INSTRUCTION), + CONSTANT(STATUS_INSTRUCTION_MISALIGNMENT), + CONSTANT(STATUS_INVALID_HANDLE), + CONSTANT(STATUS_INVALID_LOCK_SEQUENCE), + CONSTANT(STATUS_INVALID_OWNER), + CONSTANT(STATUS_INVALID_PARAMETER), + CONSTANT(STATUS_INVALID_PARAMETER_1), + CONSTANT(STATUS_INVALID_SYSTEM_SERVICE), + CONSTANT(STATUS_INTEGER_DIVIDE_BY_ZERO), + CONSTANT(STATUS_INTEGER_OVERFLOW), + CONSTANT(STATUS_IN_PAGE_ERROR), + CONSTANT(STATUS_KERNEL_APC), + CONSTANT(STATUS_LONGJUMP), + CONSTANT(STATUS_NO_CALLBACK_ACTIVE), + CONSTANT(STATUS_NO_EVENT_PAIR), + CONSTANT(STATUS_PRIVILEGED_INSTRUCTION), + CONSTANT(STATUS_SINGLE_STEP), + CONSTANT(STATUS_STACK_BUFFER_OVERRUN), + CONSTANT(STATUS_STACK_OVERFLOW), + CONSTANT(STATUS_SUCCESS), + CONSTANT(STATUS_THREAD_IS_TERMINATING), + CONSTANT(STATUS_TIMEOUT), + CONSTANT(STATUS_UNWIND), + CONSTANT(STATUS_UNWIND_CONSOLIDATE), + CONSTANT(STATUS_USER_APC), + CONSTANT(STATUS_WAKE_SYSTEM_DEBUGGER), + + HEADER("TLS defines"), + CONSTANT(TLS_MINIMUM_AVAILABLE), + CONSTANT(TLS_EXPANSION_SLOTS), + + HEADER("Thread states"), + CONSTANT(Initialized), + CONSTANT(Ready), + CONSTANT(Running), + CONSTANT(Standby), + CONSTANT(Terminated), + CONSTANT(Waiting), + + HEADER("Wait type / reason"), + CONSTANT(WrExecutive), + CONSTANT(WrMutex), + CONSTANT(WrDispatchInt), + CONSTANT(WrQuantumEnd), + CONSTANT(WrEventPair), + CONSTANT(WaitAny), + CONSTANT(WaitAll), + + HEADER("Interrupt object types"), +// CONSTANT(InLevelSensitive), +// CONSTANT(InLatched), + + HEADER("Bug Check Codes"), + CONSTANT(APC_INDEX_MISMATCH), + CONSTANT(INVALID_AFFINITY_SET), + CONSTANT(INVALID_DATA_ACCESS_TRAP), + CONSTANT(IRQL_NOT_GREATER_OR_EQUAL), + CONSTANT(IRQL_NOT_LESS_OR_EQUAL), + CONSTANT(NO_USER_MODE_CONTEXT), + CONSTANT(SPIN_LOCK_ALREADY_OWNED), + CONSTANT(SPIN_LOCK_NOT_OWNED), + CONSTANT(THREAD_NOT_MUTEX_OWNER), + CONSTANT(TRAP_CAUSE_UNKNOWN), + CONSTANT(KMODE_EXCEPTION_NOT_HANDLED), + CONSTANT(KERNEL_APC_PENDING_DURING_EXIT), + CONSTANT(PANIC_STACK_SWITCH), + CONSTANT(DATA_BUS_ERROR), + CONSTANT(INSTRUCTION_BUS_ERROR), + CONSTANT(SYSTEM_EXIT_OWNED_MUTEX), +// CONSTANT(SYSTEM_UNWIND_PREVIOUS_USER), +// CONSTANT(SYSTEM_SERVICE_EXCEPTION), +// CONSTANT(INTERRUPT_UNWIND_ATTEMPTED), +// CONSTANT(INTERRUPT_EXCEPTION_NOT_HANDLED), + CONSTANT(PAGE_FAULT_WITH_INTERRUPTS_OFF), + CONSTANT(IRQL_GT_ZERO_AT_SYSTEM_SERVICE), + CONSTANT(DATA_COHERENCY_EXCEPTION), + CONSTANT(INSTRUCTION_COHERENCY_EXCEPTION), + CONSTANT(HAL1_INITIALIZATION_FAILED), + CONSTANT(UNEXPECTED_KERNEL_MODE_TRAP), + CONSTANT(NMI_HARDWARE_FAILURE), + CONSTANT(SPIN_LOCK_INIT_FAILURE), + CONSTANT(ATTEMPTED_SWITCH_FROM_DPC), +// CONSTANT(MUTEX_ALREADY_OWNED), +// CONSTANT(HARDWARE_INTERRUPT_STORM), +// CONSTANT(RECURSIVE_MACHINE_CHECK), +// CONSTANT(RECURSIVE_NMI), + + HEADER("IRQL"), + CONSTANT(PASSIVE_LEVEL), + CONSTANT(APC_LEVEL), + CONSTANT(DISPATCH_LEVEL), +#ifdef _M_AMD64 + CONSTANT(CLOCK_LEVEL), +#else + CONSTANT(CLOCK1_LEVEL), + CONSTANT(CLOCK2_LEVEL), +#endif + CONSTANT(IPI_LEVEL), + CONSTANT(POWER_LEVEL), + CONSTANT(PROFILE_LEVEL), + CONSTANT(HIGH_LEVEL), + RAW("#ifdef NT_UP"), + {1, "SYNCH_LEVEL", DISPATCH_LEVEL}, + RAW("#else"), + {1, "SYNCH_LEVEL", (IPI_LEVEL - 2)}, + RAW("#endif"), + + HEADER("Miscellaneous Definitions"), +// CONSTANT(BASE_PRIORITY_THRESHOLD), +// CONSTANT(EVENT_PAIR_INCREMENT), + CONSTANT(LOW_REALTIME_PRIORITY), + CONSTANT(CLOCK_QUANTUM_DECREMENT), +// CONSTANT(READY_SKIP_QUANTUM), +// CONSTANT(THREAD_QUANTUM), + CONSTANT(WAIT_QUANTUM_DECREMENT), +// CONSTANT(ROUND_TRIP_DECREMENT_COUNT), + CONSTANT(MAXIMUM_PROCESSORS), + CONSTANT(INITIAL_STALL_COUNT), + CONSTANT(EXCEPTION_EXECUTE_FAULT), +// CONSTANT(KCACHE_ERRATA_MONITOR_FLAGS), +// CONSTANT(KI_EXCEPTION_GP_FAULT), +// CONSTANT(KI_EXCEPTION_INVALID_OP), +// CONSTANT(KI_EXCEPTION_INTEGER_DIVIDE_BY_ZERO), + CONSTANT(KI_EXCEPTION_ACCESS_VIOLATION), +// CONSTANT(TARGET_FREEZE), +// CONSTANT(BlackHole), + CONSTANT(Executive), + CONSTANT(FALSE), + CONSTANT(TRUE), + CONSTANT(DBG_STATUS_CONTROL_C), + CONSTANT(USER_SHARED_DATA), +// CONSTANT(MM_SHARED_USER_DATA_VA), + CONSTANT(PAGE_SIZE), +// CONSTANT(KERNEL_STACK_CONTROL_LARGE_STACK), + +/* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/ + +#if defined(_M_AMD64) || defined(_M_IX86) + + HEADER("CR0 flags"), + CONSTANT(CR0_PE), + CONSTANT(CR0_MP), + CONSTANT(CR0_EM), + CONSTANT(CR0_TS), + CONSTANT(CR0_ET), + CONSTANT(CR0_NE), + CONSTANT(CR0_WP), + CONSTANT(CR0_AM), + CONSTANT(CR0_NW), + CONSTANT(CR0_CD), + CONSTANT(CR0_PG), + + HEADER("CR4 flags"), + CONSTANT(CR4_VME), + CONSTANT(CR4_PVI), + CONSTANT(CR4_TSD), + CONSTANT(CR4_DE), + CONSTANT(CR4_PSE), + CONSTANT(CR4_PAE), + CONSTANT(CR4_MCE), + CONSTANT(CR4_PGE), + CONSTANT(CR4_FXSR), + CONSTANT(CR4_XMMEXCPT), +#ifdef _M_AMD64 + CONSTANT(CR4_CHANNELS), +#endif + + HEADER("KeFeatureBits flags"), + CONSTANT(KF_RDTSC), + CONSTANT(KF_CR4), + CONSTANT(KF_GLOBAL_PAGE), + CONSTANT(KF_LARGE_PAGE), + CONSTANT(KF_CMPXCHG8B), + CONSTANT(KF_FAST_SYSCALL), + + HEADER("Machine type definitions"), + CONSTANT(MACHINE_TYPE_ISA), + CONSTANT(MACHINE_TYPE_EISA), + CONSTANT(MACHINE_TYPE_MCA), + +#endif + +#ifdef _M_IX86 + + HEADER("KDGT selectors"), + CONSTANT(KGDT_R3_DATA), + CONSTANT(KGDT_R3_CODE), + CONSTANT(KGDT_R0_CODE), + CONSTANT(KGDT_R0_DATA), + CONSTANT(KGDT_R0_PCR), +// CONSTANT(KGDT_STACK16), +// CONSTANT(KGDT_CODE16), + CONSTANT(KGDT_TSS), + CONSTANT(KGDT_R3_TEB), + CONSTANT(KGDT_DF_TSS), + CONSTANT(KGDT_NMI_TSS), + CONSTANT(KGDT_LDT), + +#elif defined(_M_AMD64) + + HEADER("Hypervisor Enlightenment Definitions"), + CONSTANT(HV_MMU_USE_HYPERCALL_FOR_ADDRESS_SWITCH), + CONSTANT(HV_MMU_USE_HYPERCALL_FOR_LOCAL_FLUSH), + CONSTANT(HV_MMU_USE_HYPERCALL_FOR_REMOTE_FLUSH), + CONSTANT(HV_X64_MSR_APIC_EOI), + CONSTANT(HV_APIC_ENLIGHTENED), + CONSTANT(HV_KE_USE_HYPERCALL_FOR_LONG_SPIN_WAIT), + CONSTANT(HV_VIRTUAL_APIC_NO_EOI_REQUIRED_V), + CONSTANT(HvApicFlags), + + HEADER("KDGT selectors"), + CONSTANT(KGDT64_NULL), + CONSTANT(KGDT64_R0_CODE), + CONSTANT(KGDT64_R0_DATA), + CONSTANT(KGDT64_R3_CMCODE), + CONSTANT(KGDT64_R3_DATA), + CONSTANT(KGDT64_R3_CODE), + CONSTANT(KGDT64_SYS_TSS), + CONSTANT(KGDT64_R3_CMTEB), + + HEADER("Machine Specific Register Numbers"), + CONSTANT(MSR_EFER), + CONSTANT(MSR_STAR), + CONSTANT(MSR_LSTAR), + CONSTANT(MSR_CSTAR), + CONSTANT(MSR_SYSCALL_MASK), + CONSTANT(MSR_FS_BASE), + CONSTANT(MSR_GS_BASE), + CONSTANT(MSR_GS_SWAP), + CONSTANT(MSR_MCG_STATUS), + CONSTANT(MSR_AMD_ACCESS), + + HEADER("Flags for MSR_EFER"), + CONSTANT(MSR_LMA), + CONSTANT(MSR_LME), + CONSTANT(MSR_SCE), + CONSTANT(MSR_NXE), + CONSTANT(MSR_PAT), + CONSTANT(MSR_DEGUG_CTL), + CONSTANT(MSR_LAST_BRANCH_FROM), + CONSTANT(MSR_LAST_BRANCH_TO), + CONSTANT(MSR_LAST_EXCEPTION_FROM), + CONSTANT(MSR_LAST_EXCEPTION_TO), + + HEADER("Flags for MSR_DEGUG_CTL"), + CONSTANT(MSR_DEBUG_CTL_LBR), + CONSTANT(MSR_DEBUG_CRL_BTF), + + HEADER("Stack sizes"), + CONSTANT(KERNEL_STACK_SIZE), + CONSTANT(KERNEL_LARGE_STACK_SIZE), + CONSTANT(KERNEL_LARGE_STACK_COMMIT), + CONSTANT(DOUBLE_FAULT_STACK_SIZE), +#ifdef _M_AMD64 + CONSTANT(KERNEL_MCA_EXCEPTION_STACK_SIZE), + CONSTANT(NMI_STACK_SIZE), +#endif + +#endif + +#if 0 + HEADER("Fatal exception codes"), + CONSTANT(EXCEPTION_DIVIDED_BY_ZERO), + CONSTANT(EXCEPTION_DEBUG), + CONSTANT(EXCEPTION_NMI), + CONSTANT(EXCEPTION_INT3), + CONSTANT(EXCEPTION_BOUND_CHECK), + CONSTANT(EXCEPTION_INVALID_OPCODE), + CONSTANT(EXCEPTION_NPX_NOT_AVAILABLE), + CONSTANT(EXCEPTION_DOUBLE_FAULT), + CONSTANT(EXCEPTION_NPX_OVERRUN), + CONSTANT(EXCEPTION_INVALID_TSS), + CONSTANT(EXCEPTION_SEGMENT_NOT_PRESENT), + CONSTANT(EXCEPTION_STACK_FAULT), + CONSTANT(EXCEPTION_GP_FAULT), + CONSTANT(EXCEPTION_RESERVED_TRAP), + CONSTANT(EXCEPTION_NPX_ERROR), + CONSTANT(EXCEPTION_ALIGNMENT_CHECK), +#endif + + +/* STRUCTURE OFFSETS *********************************************************/ + + HEADER("CLIENT_ID"), + OFFSET(CidUniqueProcess, CLIENT_ID, UniqueProcess), + OFFSET(CidUniqueThread, CLIENT_ID, UniqueThread), + + HEADER("KAPC"), + OFFSET(ApType, KAPC, Type), + OFFSET(ApSize, KAPC, Size), + OFFSET(ApThread, KAPC, Thread), + OFFSET(ApApcListEntry, KAPC, ApcListEntry), + OFFSET(ApKernelRoutine, KAPC, KernelRoutine), + OFFSET(ApRundownRoutine, KAPC, RundownRoutine), + OFFSET(ApNormalRoutine, KAPC, NormalRoutine), + OFFSET(ApNormalContext, KAPC, NormalContext), + OFFSET(ApSystemArgument1, KAPC, SystemArgument1), + OFFSET(ApSystemArgument2, KAPC, SystemArgument2), + OFFSET(ApApcStateIndex, KAPC, ApcStateIndex), + OFFSET(ApApcMode, KAPC, ApcMode), + OFFSET(ApInserted, KAPC, Inserted), + SIZE(ApcObjectLength, KAPC), + + HEADER("KAPC_STATE"), + OFFSET(AsApcListHead, KAPC_STATE, ApcListHead), + OFFSET(AsProcess, KAPC_STATE, Process), + OFFSET(AsKernelApcInProgress, KAPC_STATE, KernelApcInProgress), + OFFSET(AsKernelApcPending, KAPC_STATE, KernelApcPending), + OFFSET(AsUserApcPending, KAPC_STATE, UserApcPending), + + HEADER("RTL_CRITICAL_SECTION"), + OFFSET(CsDebugInfo, RTL_CRITICAL_SECTION, DebugInfo), + OFFSET(CsLockCount, RTL_CRITICAL_SECTION, LockCount), + OFFSET(CsRecursionCount, RTL_CRITICAL_SECTION, RecursionCount), + OFFSET(CsOwningThread, RTL_CRITICAL_SECTION, OwningThread), + OFFSET(CsLockSemaphore, RTL_CRITICAL_SECTION, LockSemaphore), + OFFSET(CsSpinCount, RTL_CRITICAL_SECTION, SpinCount), + + HEADER("RTL_CRITICAL_SECTION_DEBUG"), + OFFSET(CsType, RTL_CRITICAL_SECTION_DEBUG, Type), + OFFSET(CsCreatorBackTraceIndex, RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex), + OFFSET(CsCriticalSection, RTL_CRITICAL_SECTION_DEBUG, CriticalSection), + OFFSET(CsProcessLocksList, RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList), + OFFSET(CsEntryCount, RTL_CRITICAL_SECTION_DEBUG, EntryCount), + OFFSET(CsContentionCount, RTL_CRITICAL_SECTION_DEBUG, ContentionCount), + + HEADER("KDEVICE_QUEUE_ENTRY"), + OFFSET(DeDeviceListEntry, KDEVICE_QUEUE_ENTRY, DeviceListEntry), + OFFSET(DeSortKey, KDEVICE_QUEUE_ENTRY, SortKey), + OFFSET(DeInserted, KDEVICE_QUEUE_ENTRY, Inserted), + SIZE(DeviceQueueEntryLength, KDEVICE_QUEUE_ENTRY), + + HEADER("KDPC"), + OFFSET(DpType, KDPC, Type), + OFFSET(DpImportance, KDPC, Importance), + OFFSET(DpNumber, KDPC, Number), + OFFSET(DpDpcListEntry, KDPC, DpcListEntry), + OFFSET(DpDeferredRoutine, KDPC, DeferredRoutine), + OFFSET(DpDeferredContext, KDPC, DeferredContext), + OFFSET(DpSystemArgument1, KDPC, SystemArgument1), + OFFSET(DpSystemArgument2, KDPC, SystemArgument2), + OFFSET(DpDpcData, KDPC, DpcData), + SIZE(DpcObjectLength, KDPC), + + HEADER("KDEVICE_QUEUE"), + OFFSET(DvType, KDEVICE_QUEUE, Type), + OFFSET(DvSize, KDEVICE_QUEUE, Size), + OFFSET(DvDeviceListHead, KDEVICE_QUEUE, DeviceListHead), + OFFSET(DvSpinLock, KDEVICE_QUEUE, Lock), + OFFSET(DvBusy, KDEVICE_QUEUE, Busy), + SIZE(DeviceQueueObjectLength, KDEVICE_QUEUE), + + HEADER("EXCEPTION_RECORD"), + OFFSET(ErExceptionCode, EXCEPTION_RECORD, ExceptionCode), + OFFSET(ErExceptionFlags, EXCEPTION_RECORD, ExceptionFlags), + OFFSET(ErExceptionRecord, EXCEPTION_RECORD, ExceptionRecord), + OFFSET(ErExceptionAddress, EXCEPTION_RECORD, ExceptionAddress), + OFFSET(ErNumberParameters, EXCEPTION_RECORD, NumberParameters), + OFFSET(ErExceptionInformation, EXCEPTION_RECORD, ExceptionInformation), + SIZE(ExceptionRecordLength, EXCEPTION_RECORD), + SIZE(EXCEPTION_RECORD_LENGTH, EXCEPTION_RECORD), + + HEADER("EPROCESS"), + OFFSET(EpDebugPort, EPROCESS, DebugPort), + OFFSET(EpVdmObjects, EPROCESS, VdmObjects), + SIZE(ExecutiveProcessObjectLength, EPROCESS), + + HEADER("KEVENT"), + OFFSET(EvType, KEVENT, Header.Type), + OFFSET(EvSize, KEVENT, Header.Size), + OFFSET(EvSignalState, KEVENT, Header.SignalState), + OFFSET(EvWaitListHead, KEVENT, Header.WaitListHead), + SIZE(EventObjectLength, KEVENT), + + HEADER("FAST_MUTEX"), + OFFSET(FmCount, FAST_MUTEX, Count), + OFFSET(FmOwner, FAST_MUTEX, Owner), + OFFSET(FmContention, FAST_MUTEX, Contention), + OFFSET(FmGate, FAST_MUTEX, Gate), + OFFSET(FmOldIrql, FAST_MUTEX, OldIrql), + + HEADER("KINTERRUPT"), + OFFSET(InType, KINTERRUPT, Type), + OFFSET(InSize, KINTERRUPT, Size), + OFFSET(InInterruptListEntry, KINTERRUPT, InterruptListEntry), + OFFSET(InServiceRoutine, KINTERRUPT, ServiceRoutine), + OFFSET(InServiceContext, KINTERRUPT, ServiceContext), + OFFSET(InSpinLock, KINTERRUPT, SpinLock), + OFFSET(InTickCount, KINTERRUPT, TickCount), + OFFSET(InActualLock, KINTERRUPT, ActualLock), + OFFSET(InDispatchAddress, KINTERRUPT, DispatchAddress), + OFFSET(InVector, KINTERRUPT, Vector), + OFFSET(InIrql, KINTERRUPT, Irql), + OFFSET(InSynchronizeIrql, KINTERRUPT, SynchronizeIrql), + OFFSET(InFloatingSave, KINTERRUPT, FloatingSave), + OFFSET(InConnected, KINTERRUPT, Connected), + OFFSET(InNumber, KINTERRUPT, Number), + OFFSET(InShareVector, KINTERRUPT, ShareVector), + OFFSET(InMode, KINTERRUPT, Mode), + OFFSET(InServiceCount, KINTERRUPT, ServiceCount), + OFFSET(InDispatchCount, KINTERRUPT, DispatchCount), +// OFFSET(InTrapFrame, KINTERRUPT, TrapFrame), + OFFSET(InDispatchCode, KINTERRUPT, DispatchCode), + SIZE(InterruptObjectLength, KINTERRUPT), + + HEADER("IO_STATUS_BLOCK"), + OFFSET(IoStatus, IO_STATUS_BLOCK, Status), + OFFSET(IoPointer, IO_STATUS_BLOCK, Pointer), + OFFSET(IoInformation, IO_STATUS_BLOCK, Information), + + HEADER("KERNEL_STACK_CONTROL"), +// OFFSET(KcPreviousBase, KERNEL_STACK_CONTROL, PreviousBase), +// OFFSET(KcPreviousLimit, KERNEL_STACK_CONTROL, PreviousLimit), +// OFFSET(KcPreviousKernel, KERNEL_STACK_CONTROL, PreviousKernel), +// OFFSET(KcPreviousInitial, KERNEL_STACK_CONTROL, PreviousInitial), +// SIZE(KERNEL_STACK_CONTROL_LENGTH, KERNEL_STACK_CONTROL), + + HEADER("KNODE"), +// OFFSET(KnRight, KNODE, Right), +// OFFSET(KnLeft, KNODE, Left), + OFFSET(KnPfnDereferenceSListHead, KNODE, PfnDereferenceSListHead), + OFFSET(KnProcessorMask, KNODE, ProcessorMask), + OFFSET(KnColor, KNODE, Color), + OFFSET(KnSeed, KNODE, Seed), + OFFSET(KnNodeNumber, KNODE, NodeNumber), + OFFSET(KnFlags, KNODE, Flags), + OFFSET(knMmShiftedColor, KNODE, MmShiftedColor), + OFFSET(KnFreeCount, KNODE, FreeCount), + OFFSET(KnPfnDeferredList, KNODE, PfnDeferredList), + SIZE(KNODE_SIZE, KNODE), + + HEADER("KSPIN_LOCK_QUEUE"), + OFFSET(LqNext, KSPIN_LOCK_QUEUE, Next), + OFFSET(LqLock, KSPIN_LOCK_QUEUE, Lock), + + HEADER("KLOCK_QUEUE_HANDLE"), + OFFSET(LqhNext, KLOCK_QUEUE_HANDLE, LockQueue.Next), + OFFSET(LqhLock, KLOCK_QUEUE_HANDLE, LockQueue.Lock), + OFFSET(LqhOldIrql, KLOCK_QUEUE_HANDLE, OldIrql), + SIZE(LOCK_QUEUE_HEADER_SIZE, KLOCK_QUEUE_HANDLE), + + HEADER("LARGE_INTEGER"), + OFFSET(LiLowPart, LARGE_INTEGER, LowPart), + OFFSET(LiHighPart, LARGE_INTEGER, HighPart), + + HEADER("LOADER_PARAMETER_BLOCK (rel. to LoadOrderListHead)"), + RELOFFSET(LpbLoadOrderListHead, LOADER_PARAMETER_BLOCK, LoadOrderListHead, LoadOrderListHead), + RELOFFSET(LpbMemoryDescriptorListHead, LOADER_PARAMETER_BLOCK, MemoryDescriptorListHead, LoadOrderListHead), + RELOFFSET(LpbKernelStack, LOADER_PARAMETER_BLOCK, KernelStack, LoadOrderListHead), + RELOFFSET(LpbPrcb, LOADER_PARAMETER_BLOCK, Prcb, LoadOrderListHead), + RELOFFSET(LpbProcess, LOADER_PARAMETER_BLOCK, Process, LoadOrderListHead), + RELOFFSET(LpbThread, LOADER_PARAMETER_BLOCK, Thread, LoadOrderListHead), + RELOFFSET(LpbI386, LOADER_PARAMETER_BLOCK, u.I386, LoadOrderListHead), + RELOFFSET(LpbRegistryLength, LOADER_PARAMETER_BLOCK, RegistryLength, LoadOrderListHead), + RELOFFSET(LpbRegistryBase, LOADER_PARAMETER_BLOCK, RegistryBase, LoadOrderListHead), + RELOFFSET(LpbConfigurationRoot, LOADER_PARAMETER_BLOCK, ConfigurationRoot, LoadOrderListHead), + RELOFFSET(LpbArcBootDeviceName, LOADER_PARAMETER_BLOCK, ArcBootDeviceName, LoadOrderListHead), + RELOFFSET(LpbArcHalDeviceName, LOADER_PARAMETER_BLOCK, ArcHalDeviceName, LoadOrderListHead), + RELOFFSET(LpbLoadOptions, LOADER_PARAMETER_BLOCK, LoadOptions, LoadOrderListHead), + + HEADER("LIST_ENTRY"), + OFFSET(LsFlink, LIST_ENTRY, Flink), + OFFSET(LsBlink, LIST_ENTRY, Blink), + + HEADER("PEB"), + OFFSET(PeKernelCallbackTable, PEB, KernelCallbackTable), + SIZE(ProcessEnvironmentBlockLength, PEB), + + HEADER("KPROFILE"), + OFFSET(PfType, KPROFILE, Type), + OFFSET(PfSize, KPROFILE, Size), + OFFSET(PfProfileListEntry, KPROFILE, ProfileListEntry), + OFFSET(PfProcess, KPROFILE, Process), + OFFSET(PfRangeBase, KPROFILE, RangeBase), + OFFSET(PfRangeLimit, KPROFILE, RangeLimit), + OFFSET(PfBucketShift, KPROFILE, BucketShift), + OFFSET(PfBuffer, KPROFILE, Buffer), + OFFSET(PfSegment, KPROFILE, Segment), + OFFSET(PfAffinity, KPROFILE, Affinity), + OFFSET(PfSource, KPROFILE, Source), + OFFSET(PfStarted, KPROFILE, Started), + SIZE(ProfileObjectLength, KPROFILE), + + HEADER("PORT_MESSAGE"), + OFFSET(PmLength, PORT_MESSAGE, u1.Length), + OFFSET(PmZeroInit, PORT_MESSAGE, u2.ZeroInit), + OFFSET(PmClientId, PORT_MESSAGE, ClientId), + OFFSET(PmProcess, PORT_MESSAGE, ClientId.UniqueProcess), + OFFSET(PmThread, PORT_MESSAGE, ClientId.UniqueThread), + OFFSET(PmMessageId, PORT_MESSAGE, MessageId), + OFFSET(PmClientViewSize, PORT_MESSAGE, ClientViewSize), + SIZE(PortMessageLength, PORT_MESSAGE), + + HEADER("KPROCESS"), + OFFSET(PrType, KPROCESS, Header.Type), + OFFSET(PrSize, KPROCESS, Header.Size), + OFFSET(PrSignalState, KPROCESS, Header.SignalState), + OFFSET(PrProfileListHead, KPROCESS, ProfileListHead), + OFFSET(PrDirectoryTableBase, KPROCESS, DirectoryTableBase), + OFFSET(PrIopmOffset, KPROCESS, IopmOffset), +// OFFSET(PrInstrumentationCallback, KPROCESS, InstrumentationCallback), + OFFSET(PrActiveProcessors, KPROCESS, ActiveProcessors), + OFFSET(PrKernelTime, KPROCESS, KernelTime), + OFFSET(PrUserTime, KPROCESS, UserTime), + OFFSET(PrReadyListHead, KPROCESS, ReadyListHead), + OFFSET(PrSwapListEntry, KPROCESS, SwapListEntry), + OFFSET(PrThreadListHead, KPROCESS, ThreadListHead), + OFFSET(PrProcessLock, KPROCESS, ProcessLock), + OFFSET(PrAffinity, KPROCESS, Affinity), + OFFSET(PrProcessFlags, KPROCESS, ProcessFlags), + OFFSET(PrBasePriority, KPROCESS, BasePriority), + OFFSET(PrQuantumReset, KPROCESS, QuantumReset), + OFFSET(PrState, KPROCESS, State), + OFFSET(PrStackCount, KPROCESS, StackCount), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(PrCycleTime, KPROCESS, CycleTime), +#endif + SIZE(KernelProcessObjectLength, KPROCESS), + + HEADER("KQUEUE"), + OFFSET(QuType, KQUEUE, Header.Type), + OFFSET(QuSize, KQUEUE, Header.Size), + OFFSET(QuSignalState, KQUEUE, Header.SignalState), + OFFSET(QuEntryListHead, KQUEUE, EntryListHead), + OFFSET(QuCurrentCount, KQUEUE, CurrentCount), + OFFSET(QuMaximumCount, KQUEUE, MaximumCount), + OFFSET(QuThreadListHead, KQUEUE, ThreadListHead), + SIZE(QueueObjectLength, KQUEUE), + + HEADER("STRING"), + OFFSET(StrLength, STRING, Length), + OFFSET(StrMaximumLength, STRING, MaximumLength), + OFFSET(StrBuffer, STRING, Buffer), + + HEADER("TEB"), + OFFSET(TeCmTeb, TEB, Tib), +#ifdef _M_IX86 + OFFSET(TeExceptionList, TEB, Tib.ExceptionList), +#endif + OFFSET(TeStackBase, TEB, Tib.StackBase), + OFFSET(TeStackLimit, TEB, Tib.StackLimit), + OFFSET(TeFiberData, TEB, Tib.FiberData), + OFFSET(TeSelf, TEB, Tib.Self), + OFFSET(TeEnvironmentPointer, TEB, EnvironmentPointer), + OFFSET(TeClientId, TEB, ClientId), + OFFSET(TeActiveRpcHandle, TEB, ActiveRpcHandle), + OFFSET(TeThreadLocalStoragePointer, TEB, ThreadLocalStoragePointer), + OFFSET(TeCountOfOwnedCriticalSections, TEB, CountOfOwnedCriticalSections), + OFFSET(TePeb, TEB, ProcessEnvironmentBlock), + OFFSET(TeCsrClientThread, TEB, CsrClientThread), + OFFSET(TeWOW32Reserved, TEB, WOW32Reserved), +// OFFSET(TeSoftFpcr, TEB, SoftFpcr), + OFFSET(TeExceptionCode, TEB, ExceptionCode), + OFFSET(TeActivationContextStackPointer, TEB, ActivationContextStackPointer), + OFFSET(TeGdiClientPID, TEB, GdiClientPID), + OFFSET(TeGdiClientTID, TEB, GdiClientTID), + OFFSET(TeGdiThreadLocalInfo, TEB, GdiThreadLocalInfo), + OFFSET(TeglDispatchTable, TEB, glDispatchTable), + OFFSET(TeglReserved1, TEB, glReserved1), + OFFSET(TeglReserved2, TEB, glReserved2), + OFFSET(TeglSectionInfo, TEB, glSectionInfo), + OFFSET(TeglSection, TEB, glSection), + OFFSET(TeglTable, TEB, glTable), + OFFSET(TeglCurrentRC, TEB, glCurrentRC), + OFFSET(TeglContext, TEB, glContext), + OFFSET(TeDeallocationStack, TEB, DeallocationStack), + OFFSET(TeTlsSlots, TEB, TlsSlots), + OFFSET(TeTlsExpansionSlots, TEB, TlsExpansionSlots), + OFFSET(TeLastErrorValue, TEB, LastErrorValue), + OFFSET(TeVdm, TEB, Vdm), + OFFSET(TeInstrumentation, TEB, Instrumentation), + OFFSET(TeGdiBatchCount, TEB, GdiBatchCount), + OFFSET(TeGuaranteedStackBytes, TEB, GuaranteedStackBytes), + OFFSET(TeFlsData, TEB, FlsData), +// OFFSET(TeProcessRundown, TEB, ProcessRundown), + SIZE(ThreadEnvironmentBlockLength, TEB), + + HEADER("TIME_FIELDS"), + OFFSET(TfSecond, TIME_FIELDS, Second), + OFFSET(TfMinute, TIME_FIELDS, Minute), + OFFSET(TfHour, TIME_FIELDS, Hour), + OFFSET(TfWeekday, TIME_FIELDS, Weekday), + OFFSET(TfDay, TIME_FIELDS, Day), + OFFSET(TfMonth, TIME_FIELDS, Month), + OFFSET(TfYear, TIME_FIELDS, Year), + OFFSET(TfMilliseconds, TIME_FIELDS, Milliseconds), + + HEADER("KTHREAD"), + OFFSET(ThType, KTHREAD, DispatcherHeader.Type), +// OFFSET(ThNpxIrql, KTHREAD, NpxIrql), + OFFSET(ThSize, KTHREAD, DispatcherHeader.Size), + OFFSET(ThDebugActive, KTHREAD, DispatcherHeader.DebugActive), + OFFSET(ThSignalState, KTHREAD, DispatcherHeader.SignalState), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(ThCycleTime, KTHREAD, CycleTime), +#endif + OFFSET(ThInitialStack, KTHREAD, InitialStack), + OFFSET(ThStackLimit, KTHREAD, StackLimit), + OFFSET(ThKernelStack, KTHREAD, KernelStack), + OFFSET(ThThreadLock, KTHREAD, ThreadLock), + OFFSET(ThApcState, KTHREAD, ApcState), + OFFSET(ThNextProcessor, KTHREAD, NextProcessor), + OFFSET(ThDeferredProcessor, KTHREAD, DeferredProcessor), + OFFSET(ThAdjustReason, KTHREAD, AdjustReason), + OFFSET(ThAdjustIncrement, KTHREAD, AdjustIncrement), + OFFSET(ThApcQueueLock, KTHREAD, ApcQueueLock), + OFFSET(ThWaitStatus, KTHREAD, WaitStatus), + OFFSET(ThWaitBlockList, KTHREAD, WaitBlockList), + OFFSET(ThGateObject, KTHREAD, GateObject), + OFFSET(ThWaitReason, KTHREAD, WaitReason), + OFFSET(ThPriority, KTHREAD, Priority), + OFFSET(ThSwapBusy, KTHREAD, SwapBusy), + OFFSET(ThAlerted, KTHREAD, Alerted), + OFFSET(ThWaitListEntry, KTHREAD, WaitListEntry), + OFFSET(ThSwapListEntry, KTHREAD, SwapListEntry), + OFFSET(ThQueue, KTHREAD, Queue), + OFFSET(ThTeb, KTHREAD, Teb), + OFFSET(ThTimer, KTHREAD, Timer), + OFFSET(ThThreadFlags, KTHREAD, ThreadFlags), + OFFSET(ThWaitBlock, KTHREAD, WaitBlock), + OFFSET(ThPreviousMode, KTHREAD, PreviousMode), + OFFSET(ThResourceIndex, KTHREAD, ResourceIndex), + OFFSET(ThLargeStack, KTHREAD, LargeStack), + OFFSET(ThContextSwitches, KTHREAD, ContextSwitches), + OFFSET(ThState, KTHREAD, State), + OFFSET(ThNpxState, KTHREAD, NpxState), + OFFSET(ThWaitIrql, KTHREAD, WaitIrql), + OFFSET(ThWaitMode, KTHREAD, WaitMode), + OFFSET(ThWaitTime, KTHREAD, WaitTime), + OFFSET(ThCombinedApcDisable, KTHREAD, CombinedApcDisable), + OFFSET(ThKernelApcDisable, KTHREAD, KernelApcDisable), + OFFSET(ThSpecialApcDisable, KTHREAD, SpecialApcDisable), + OFFSET(ThQueueListEntry, KTHREAD, QueueListEntry), + OFFSET(ThTrapFrame, KTHREAD, TrapFrame), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(ThFirstArgument, KTHREAD, FirstArgument), +#endif + OFFSET(ThCallbackStack, KTHREAD, CallbackStack), +// OFFSET(ThCallbackDepth, KTHREAD, CallbackDepth), + OFFSET(ThApcStateIndex, KTHREAD, ApcStateIndex), + OFFSET(ThIdealProcessor, KTHREAD, IdealProcessor), + OFFSET(ThBasePriority, KTHREAD, BasePriority), + OFFSET(ThPriorityDecrement, KTHREAD, PriorityDecrement), + OFFSET(ThSaturation, KTHREAD, Saturation), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(ThSystemCallNumber, KTHREAD, SystemCallNumber), +#endif + OFFSET(ThUserAffinity, KTHREAD, UserAffinity), + OFFSET(ThProcess, KTHREAD, Process), + OFFSET(ThAffinity, KTHREAD, Affinity), + OFFSET(ThApcStatePointer, KTHREAD, ApcStatePointer), + OFFSET(ThSavedApcState, KTHREAD, SavedApcState), + OFFSET(ThFreezeCount, KTHREAD, FreezeCount), + OFFSET(ThSuspendCount, KTHREAD, SuspendCount), + OFFSET(ThUserIdealProcessor, KTHREAD, UserIdealProcessor), +// OFFSET(ThCodePatchInProgress, KTHREAD, CodePatchInProgress), + OFFSET(ThWin32Thread, KTHREAD, Win32Thread), + OFFSET(ThStackBase, KTHREAD, StackBase), + OFFSET(ThSuspendApc, KTHREAD, SuspendApc), + OFFSET(ThKernelTime, KTHREAD, KernelTime), + OFFSET(ThLegoData, KTHREAD, LegoData), + OFFSET(ThPowerState, KTHREAD, PowerState), + OFFSET(ThUserTime, KTHREAD, UserTime), + OFFSET(ThSuspendSemaphore, KTHREAD, SuspendSemaphore), + OFFSET(ThSListFaultCount, KTHREAD, SListFaultCount), + OFFSET(ThMutantListHead, KTHREAD, MutantListHead), + OFFSET(ThThreadListEntry, KTHREAD, ThreadListEntry), + OFFSET(ThSListFaultAddress, KTHREAD, SListFaultAddress), + SIZE(KernelThreadObjectLength, KTHREAD), + SIZE(ExecutiveThreadObjectLength, ETHREAD), + + HEADER("KTIMER"), + OFFSET(TiType, KTIMER, Header.Type), + OFFSET(TiSize, KTIMER, Header.Size), + OFFSET(TiInserted, KTIMER, Header.Inserted), + OFFSET(TiSignalState, KTIMER, Header.SignalState), + OFFSET(TiDueTime, KTIMER, DueTime), + OFFSET(TiTimerListEntry, KTIMER, TimerListEntry), + OFFSET(TiDpc, KTIMER, Dpc), + OFFSET(TiPeriod, KTIMER, Period), + SIZE(TimerObjectLength, KTIMER), + + HEADER("TIME"), +// OFFSET(TmLowTime, TIME, LowTime), +// OFFSET(TmHighTime, TIME, HighTime), + +#if 0 + HEADER("SYSTEM_CONTEXT_SWITCH_INFORMATION (relative to FindAny)"), + RELOFFSET(TwFindAny, SYSTEM_CONTEXT_SWITCH_INFORMATION, FindAny, FindAny), + RELOFFSET(TwFindIdeal, SYSTEM_CONTEXT_SWITCH_INFORMATION, FindIdeal, FindAny), + RELOFFSET(TwFindLast, SYSTEM_CONTEXT_SWITCH_INFORMATION, FindLast, FindAny), + RELOFFSET(TwIdleAny, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleAny, FindAny), + RELOFFSET(TwIdleCurrent, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleCurrent, FindAny), + RELOFFSET(TwIdleIdeal, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleIdeal, FindAny), + RELOFFSET(TwIdleLast, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleLast, FindAny), + RELOFFSET(TwPreemptAny, SYSTEM_CONTEXT_SWITCH_INFORMATION, PreemptAny, FindAny), + RELOFFSET(TwPreemptCurrent, SYSTEM_CONTEXT_SWITCH_INFORMATION, PreemptCurrent, FindAny), + RELOFFSET(TwPreemptLast, SYSTEM_CONTEXT_SWITCH_INFORMATION, PreemptLast, FindAny), + RELOFFSET(TwSwitchToIdle, SYSTEM_CONTEXT_SWITCH_INFORMATION, SwitchToIdle, FindAny), +#endif + + HEADER("KUSER_SHARED_DATA"), + OFFSET(UsTickCountMultiplier, KUSER_SHARED_DATA, TickCountMultiplier), + OFFSET(UsInterruptTime, KUSER_SHARED_DATA, InterruptTime), + OFFSET(UsSystemTime, KUSER_SHARED_DATA, SystemTime), + OFFSET(UsTimeZoneBias, KUSER_SHARED_DATA, TimeZoneBias), + OFFSET(UsImageNumberLow, KUSER_SHARED_DATA, ImageNumberLow), + OFFSET(UsImageNumberHigh, KUSER_SHARED_DATA, ImageNumberHigh), + OFFSET(UsNtSystemRoot, KUSER_SHARED_DATA, NtSystemRoot), + OFFSET(UsMaxStackTraceDepth, KUSER_SHARED_DATA, MaxStackTraceDepth), + OFFSET(UsCryptoExponent, KUSER_SHARED_DATA, CryptoExponent), + OFFSET(UsTimeZoneId, KUSER_SHARED_DATA, TimeZoneId), + OFFSET(UsLargePageMinimum, KUSER_SHARED_DATA, LargePageMinimum), + OFFSET(UsReserved2, KUSER_SHARED_DATA, Reserved2), + OFFSET(UsNtProductType, KUSER_SHARED_DATA, NtProductType), + OFFSET(UsProductTypeIsValid, KUSER_SHARED_DATA, ProductTypeIsValid), + OFFSET(UsNtMajorVersion, KUSER_SHARED_DATA, NtMajorVersion), + OFFSET(UsNtMinorVersion, KUSER_SHARED_DATA, NtMinorVersion), + OFFSET(UsProcessorFeatures, KUSER_SHARED_DATA, ProcessorFeatures), + OFFSET(UsReserved1, KUSER_SHARED_DATA, Reserved1), + OFFSET(UsReserved3, KUSER_SHARED_DATA, Reserved3), + OFFSET(UsTimeSlip, KUSER_SHARED_DATA, TimeSlip), + OFFSET(UsAlternativeArchitecture, KUSER_SHARED_DATA, AlternativeArchitecture), + OFFSET(UsSystemExpirationDate, KUSER_SHARED_DATA, SystemExpirationDate), + OFFSET(UsSuiteMask, KUSER_SHARED_DATA, SuiteMask), + OFFSET(UsKdDebuggerEnabled, KUSER_SHARED_DATA, KdDebuggerEnabled), + OFFSET(UsActiveConsoleId, KUSER_SHARED_DATA, ActiveConsoleId), + OFFSET(UsDismountCount, KUSER_SHARED_DATA, DismountCount), + OFFSET(UsComPlusPackage, KUSER_SHARED_DATA, ComPlusPackage), + OFFSET(UsLastSystemRITEventTickCount, KUSER_SHARED_DATA, LastSystemRITEventTickCount), + OFFSET(UsNumberOfPhysicalPages, KUSER_SHARED_DATA, NumberOfPhysicalPages), + OFFSET(UsSafeBootMode, KUSER_SHARED_DATA, SafeBootMode), + OFFSET(UsTestRetInstruction, KUSER_SHARED_DATA, TestRetInstruction), + OFFSET(UsSystemCall, KUSER_SHARED_DATA, SystemCall), + OFFSET(UsSystemCallReturn, KUSER_SHARED_DATA, SystemCallReturn), + OFFSET(UsSystemCallPad, KUSER_SHARED_DATA, SystemCallPad), + OFFSET(UsTickCount, KUSER_SHARED_DATA, TickCount), + OFFSET(UsTickCountQuad, KUSER_SHARED_DATA, TickCountQuad), + OFFSET(UsWow64SharedInformation, KUSER_SHARED_DATA, Wow64SharedInformation), + + HEADER("KWAIT_BLOCK"), + OFFSET(WbWaitListEntry, KWAIT_BLOCK, WaitListEntry), + OFFSET(WbThread, KWAIT_BLOCK, Thread), + OFFSET(WbObject, KWAIT_BLOCK, Object), + OFFSET(WbNextWaitBlock, KWAIT_BLOCK, NextWaitBlock), + OFFSET(WbWaitKey, KWAIT_BLOCK, WaitKey), + OFFSET(WbWaitType, KWAIT_BLOCK, WaitType), + +#if defined(_M_IX86) + + +#elif defined(_M_AMD64) + + HEADER("Argument Home Address"), + OFFSET(P1Home, CONTEXT, Member), + OFFSET(P2Home, CONTEXT, Member), + OFFSET(P3Home, CONTEXT, Member), + OFFSET(P4Home, CONTEXT, Member), + + HEADER("CONTEXT"), + OFFSET(CxP1Home, CONTEXT, P1Home), + OFFSET(CxP2Home, CONTEXT, P2Home), + OFFSET(CxP3Home, CONTEXT, P3Home), + OFFSET(CxP4Home, CONTEXT, P4Home), + OFFSET(CxP5Home, CONTEXT, P5Home), + OFFSET(CxP6Home, CONTEXT, P6Home), + OFFSET(CxContextFlags, CONTEXT, ContextFlags), + OFFSET(CxMxCsr, CONTEXT, MxCsr), + OFFSET(CxSegCs, CONTEXT, SegCs), + OFFSET(CxSegDs, CONTEXT, SegDs), + OFFSET(CxSegEs, CONTEXT, SegEs), + OFFSET(CxSegFs, CONTEXT, SegFs), + OFFSET(CxSegGs, CONTEXT, SegGs), + OFFSET(CxSegSs, CONTEXT, SegSs), + OFFSET(CxEFlags, CONTEXT, EFlags), + OFFSET(CxDr0, CONTEXT, Dr0), + OFFSET(CxDr1, CONTEXT, Dr1), + OFFSET(CxDr2, CONTEXT, Dr2), + OFFSET(CxDr3, CONTEXT, Dr3), + OFFSET(CxDr6, CONTEXT, Dr6), + OFFSET(CxDr7, CONTEXT, Dr7), + OFFSET(CxRax, CONTEXT, Rax), + OFFSET(CxRcx, CONTEXT, Rcx), + OFFSET(CxRdx, CONTEXT, Rdx), + OFFSET(CxRbx, CONTEXT, Rbx), + OFFSET(CxRsp, CONTEXT, Rsp), + OFFSET(CxRbp, CONTEXT, Rbp), + OFFSET(CxRsi, CONTEXT, Rsi), + OFFSET(CxRdi, CONTEXT, Rdi), + OFFSET(CxR8, CONTEXT, R8), + OFFSET(CxR9, CONTEXT, R9), + OFFSET(CxR10, CONTEXT, R10), + OFFSET(CxR11, CONTEXT, R11), + OFFSET(CxR12, CONTEXT, R12), + OFFSET(CxR13, CONTEXT, R13), + OFFSET(CxR14, CONTEXT, R14), + OFFSET(CxR15, CONTEXT, R15), + OFFSET(CxRip, CONTEXT, Rip), + OFFSET(CxFltSave, CONTEXT, FltSave), + OFFSET(CxXmm0, CONTEXT, Xmm0), + OFFSET(CxXmm1, CONTEXT, Xmm1), + OFFSET(CxXmm2, CONTEXT, Xmm2), + OFFSET(CxXmm3, CONTEXT, Xmm3), + OFFSET(CxXmm4, CONTEXT, Xmm4), + OFFSET(CxXmm5, CONTEXT, Xmm5), + OFFSET(CxXmm6, CONTEXT, Xmm6), + OFFSET(CxXmm7, CONTEXT, Xmm7), + OFFSET(CxXmm8, CONTEXT, Xmm8), + OFFSET(CxXmm9, CONTEXT, Xmm9), + OFFSET(CxXmm10, CONTEXT, Xmm10), + OFFSET(CxXmm11, CONTEXT, Xmm11), + OFFSET(CxXmm12, CONTEXT, Xmm12), + OFFSET(CxXmm13, CONTEXT, Xmm13), + OFFSET(CxXmm14, CONTEXT, Xmm14), + OFFSET(CxXmm15, CONTEXT, Xmm15), + OFFSET(CxDebugControl, CONTEXT, DebugControl), + OFFSET(CxLastBranchToRip, CONTEXT, LastBranchToRip), + OFFSET(CxLastBranchFromRip, CONTEXT, LastBranchFromRip), + OFFSET(CxLastExceptionToRip, CONTEXT, LastExceptionToRip), + OFFSET(CxLastExceptionFromRip, CONTEXT, LastExceptionFromRip), + OFFSET(CxVectorControl, CONTEXT, VectorControl), + OFFSET(CxVectorRegister, CONTEXT, VectorRegister), + SIZE(CONTEXT_FRAME_LENGTH, CONTEXT), + + HEADER("DISPATCHER_CONTEXT"), + OFFSET(DcControlPc, TYPE, ControlPc), + OFFSET(DcImageBase, TYPE, ImageBase), + OFFSET(DcFunctionEntry, TYPE, FunctionEntry), + OFFSET(DcEstablisherFrame, TYPE, EstablisherFrame), + OFFSET(DcTargetIp, TYPE, TargetIp), + OFFSET(DcContextRecord, TYPE, ContextRecord), + OFFSET(DcLanguageHandler, TYPE, LanguageHandler), + OFFSET(DcHandlerData, TYPE, HandlerData), + OFFSET(DcHistoryTable, TYPE, HistoryTable), + OFFSET(DcScopeIndex, TYPE, ScopeIndex), + + HEADER("KEXCEPTION_FRAME"), + OFFSET(ExP1Home, KEXCEPTION_FRAME, P1Home), + OFFSET(ExP2Home, KEXCEPTION_FRAME, P2Home), + OFFSET(ExP3Home, KEXCEPTION_FRAME, P3Home), + OFFSET(ExP4Home, KEXCEPTION_FRAME, P4Home), + OFFSET(ExP5, KEXCEPTION_FRAME, P5), + OFFSET(ExXmm6, KEXCEPTION_FRAME, Xmm6), + OFFSET(ExXmm7, KEXCEPTION_FRAME, Xmm7), + OFFSET(ExXmm8, KEXCEPTION_FRAME, Xmm8), + OFFSET(ExXmm9, KEXCEPTION_FRAME, Xmm9), + OFFSET(ExXmm10, KEXCEPTION_FRAME, Xmm10), + OFFSET(ExXmm11, KEXCEPTION_FRAME, Xmm11), + OFFSET(ExXmm12, KEXCEPTION_FRAME, Xmm12), + OFFSET(ExXmm13, KEXCEPTION_FRAME, Xmm13), + OFFSET(ExXmm14, KEXCEPTION_FRAME, Xmm14), + OFFSET(ExXmm15, KEXCEPTION_FRAME, Xmm15), + OFFSET(ExMxCsr, KEXCEPTION_FRAME, MxCsr), + OFFSET(ExRbp, KEXCEPTION_FRAME, Rbp), + OFFSET(ExRbx, KEXCEPTION_FRAME, Rbx), + OFFSET(ExRdi, KEXCEPTION_FRAME, Rdi), + OFFSET(ExRsi, KEXCEPTION_FRAME, Rsi), + OFFSET(ExR12, KEXCEPTION_FRAME, R12), + OFFSET(ExR13, KEXCEPTION_FRAME, R13), + OFFSET(ExR14, KEXCEPTION_FRAME, R14), + OFFSET(ExR15, KEXCEPTION_FRAME, R15), + OFFSET(ExReturn, KEXCEPTION_FRAME, Return), + OFFSET(CuInitialStack, KEXCEPTION_FRAME, InitialStack), + OFFSET(CuTrapFrame, KEXCEPTION_FRAME, TrapFrame), + OFFSET(CuCallbackStack, KEXCEPTION_FRAME, CallbackStack), + OFFSET(CuOutputBuffer, KEXCEPTION_FRAME, OutputBuffer), + OFFSET(CuOutputLength, KEXCEPTION_FRAME, OutputLength), + SIZE(KEXCEPTION_FRAME_LENGTH, KEXCEPTION_FRAME), + + HEADER("JUMP_BUFFER"), + OFFSET(JbFrame, JUMP_BUFFER, Frame), + OFFSET(JbRbx, JUMP_BUFFER, Rbx), + OFFSET(JbRsp, JUMP_BUFFER, Rsp), + OFFSET(JbRbp, JUMP_BUFFER, Rbp), + OFFSET(JbRsi, JUMP_BUFFER, Rsi), + OFFSET(JbRdi, JUMP_BUFFER, Rdi), + OFFSET(JbR12, JUMP_BUFFER, R12), + OFFSET(JbR13, JUMP_BUFFER, R13), + OFFSET(JbR14, JUMP_BUFFER, R14), + OFFSET(JbR15, JUMP_BUFFER, R15), + OFFSET(JbRip, JUMP_BUFFER, Rip), + OFFSET(JbMxCsr, JUMP_BUFFER, MxCsr), + OFFSET(JbFpCsr, JUMP_BUFFER, FpCsr), + OFFSET(JbXmm6, JUMP_BUFFER, Xmm6), + OFFSET(JbXmm7, JUMP_BUFFER, Xmm7), + OFFSET(JbXmm8, JUMP_BUFFER, Xmm8), + OFFSET(JbXmm9, JUMP_BUFFER, Xmm9), + OFFSET(JbXmm10, JUMP_BUFFER, Xmm10), + OFFSET(JbXmm11, JUMP_BUFFER, Xmm11), + OFFSET(JbXmm12, JUMP_BUFFER, Xmm12), + OFFSET(JbXmm13, JUMP_BUFFER, Xmm13), + OFFSET(JbXmm14, JUMP_BUFFER, Xmm14), + OFFSET(JbXmm15, JUMP_BUFFER, Xmm15), + + HEADER("KGDT64"), + OFFSET(KgdtBaseLow, KGDT64, BaseLow), + OFFSET(KgdtBaseMiddle, KGDT64, BaseMiddle), + OFFSET(KgdtBaseHigh, KGDT64, BaseHigh), + OFFSET(KgdtBaseUpper, KGDT64, BaseUpper), + OFFSET(KgdtLimitHigh, KGDT64, LimitHigh), + OFFSET(KgdtLimitLow, KGDT64, LimitLow), + CONSTANT(KGDT_LIMIT_ENCODE_MASK), + + HEADER("KPRCB"), + OFFSET(PbMxCsr, KPRCB, MxCsr), + OFFSET(PbNumber, KPRCB, Number), + OFFSET(PbInterruptRequest, KPRCB, InterruptRequest), + OFFSET(PbIdleHalt, KPRCB, IdleHalt), + OFFSET(PbCurrentThread, KPRCB, CurrentThread), + OFFSET(PbNextThread, KPRCB, NextThread), + OFFSET(PbIdleThread, KPRCB, IdleThread), + OFFSET(PbNestingLevel, KPRCB, NestingLevel), + OFFSET(PbRspBase, KPRCB, RspBase), + OFFSET(PbPrcbLock, KPRCB, PrcbLock), + OFFSET(PbSetMember, KPRCB, SetMember), + OFFSET(PbProcessorState, KPRCB, ProcessorState), + OFFSET(PbCpuType, KPRCB, CpuType), + OFFSET(PbCpuID, KPRCB, CpuID), + OFFSET(PbCpuStep, KPRCB, CpuStep), + OFFSET(PbHalReserved, KPRCB, HalReserved), + OFFSET(PbMinorVersion, KPRCB, MinorVersion), + OFFSET(PbMajorVersion, KPRCB, MajorVersion), + OFFSET(PbBuildType, KPRCB, Member), + OFFSET(PbCpuVendor, KPRCB, Member), + OFFSET(PbCoresPerPhysicalProcessor, KPRCB, Member), + OFFSET(PbLogicalProcessorsPerCore, KPRCB, Member), + OFFSET(PbApicMask, KPRCB, Member), + OFFSET(PbCFlushSize, KPRCB, Member), + OFFSET(PbAcpiReserved, KPRCB, Member), + OFFSET(PbInitialApicId, KPRCB, Member), + OFFSET(PbStride, KPRCB, Member), + OFFSET(PbLockQueue, KPRCB, Member), + OFFSET(PbPPLookasideList, KPRCB, Member), + OFFSET(PbPPNPagedLookasideList, KPRCB, Member), + OFFSET(PbPPPagedLookasideList, KPRCB, Member), + OFFSET(PbPacketBarrier, KPRCB, Member), + OFFSET(PbDeferredReadyListHead, KPRCB, Member), + OFFSET(PbLookasideIrpFloat, KPRCB, Member), + OFFSET(PbSystemCalls, KPRCB, Member), + OFFSET(PbReadOperationCount, KPRCB, Member), + OFFSET(PbWriteOperationCount, KPRCB, Member), + OFFSET(PbOtherOperationCount, KPRCB, Member), + OFFSET(PbReadTransferCount, KPRCB, Member), + OFFSET(PbWriteTransferCount, KPRCB, Member), + OFFSET(PbOtherTransferCount, KPRCB, Member), + OFFSET(PbContextSwitches, KPRCB, Member), + OFFSET(PbTargetSet, KPRCB, Member), + OFFSET(PbIpiFrozen, KPRCB, Member), + OFFSET(PbRequestMailbox, KPRCB, Member), + OFFSET(PbSenderSummary, KPRCB, Member), + OFFSET(PbDpcListHead, KPRCB, Member), + OFFSET(PbDpcLock, KPRCB, Member), + OFFSET(PbDpcQueueDepth, KPRCB, Member), + OFFSET(PbDpcCount, KPRCB, Member), + OFFSET(PbDpcStack, KPRCB, Member), + OFFSET(PbMaximumDpcQueueDepth, KPRCB, Member), + OFFSET(PbDpcRequestRate, KPRCB, Member), + OFFSET(PbMinimumDpcRate, KPRCB, Member), + OFFSET(PbDpcInterruptRequested, KPRCB, Member), + OFFSET(PbDpcThreadRequested, KPRCB, Member), + OFFSET(PbDpcRoutineActive, KPRCB, Member), + OFFSET(PbDpcThreadActive, KPRCB, Member), + OFFSET(PbTimerHand, KPRCB, Member), + OFFSET(PbTimerRequest, KPRCB, Member), + OFFSET(PbTickOffset, KPRCB, Member), + OFFSET(PbMasterOffset, KPRCB, Member), + OFFSET(PbDpcLastCount, KPRCB, Member), + OFFSET(PbQuantumEnd, KPRCB, Member), + OFFSET(PbDpcSetEventRequest, KPRCB, Member), + OFFSET(PbIdleSchedule, KPRCB, Member), + OFFSET(PbReadySummary, KPRCB, Member), + OFFSET(PbDispatcherReadyListHead, KPRCB, Member), + OFFSET(PbInterruptCount, KPRCB, Member), + OFFSET(PbKernelTime, KPRCB, Member), + OFFSET(PbUserTime, KPRCB, Member), + OFFSET(PbDpcTime, KPRCB, Member), + OFFSET(PbInterruptTime, KPRCB, Member), + OFFSET(PbAdjustDpcThreshold, KPRCB, Member), + OFFSET(PbSkipTick, KPRCB, Member), + OFFSET(PbPollSlot, KPRCB, Member), + OFFSET(PbParentNode, KPRCB, Member), + OFFSET(PbMultiThreadProcessorSet, KPRCB, Member), + OFFSET(PbMultiThreadSetMaster, KPRCB, Member), + OFFSET(PbStartCycles, KPRCB, Member), + OFFSET(PbPageColor, KPRCB, Member), + OFFSET(PbNodeColor, KPRCB, Member), + OFFSET(PbNodeShiftedColor, KPRCB, Member), + OFFSET(PbSecondaryColorMask, KPRCB, Member), + OFFSET(PbSleeping, KPRCB, Member), + OFFSET(PbCycleTime, KPRCB, Member), + OFFSET(PbFastReadNoWait, KPRCB, Member), + OFFSET(PbFastReadWait, KPRCB, Member), + OFFSET(PbFastReadNotPossible, KPRCB, Member), + OFFSET(PbCopyReadNoWait, KPRCB, Member), + OFFSET(PbCopyReadWait, KPRCB, Member), + OFFSET(PbCopyReadNoWaitMiss, KPRCB, Member), + OFFSET(PbAlignmentFixupCount, KPRCB, Member), + OFFSET(PbExceptionDispatchCount, KPRCB, Member), + OFFSET(PbVendorString, KPRCB, Member), + OFFSET(PbPowerState, KPRCB, Member), + OFFSET(ProcessorBlockLength, KPRCB, Member), + + HEADER("KPCR"), + OFFSET(PcGdt, KPCR, Gdt), + OFFSET(PcTss, KPCR, Tss), + OFFSET(PcUserRsp, KPCR, UserRsp), + OFFSET(PcSelf, KPCR, Self), + OFFSET(PcCurrentPrcb, KPCR, CurrentPrcb), + OFFSET(PcLockArray, KPCR, LockArray), + OFFSET(PcTeb, KPCR, Teb), + OFFSET(PcIdt, KPCR, Idt), + OFFSET(PcIrql, KPCR, Irql), + OFFSET(PcStallScaleFactor, KPCR, StallScaleFactor), + OFFSET(PcHalReserved, KPCR, HalReserved), + OFFSET(PcPrcb, KPCR, Prcb), + OFFSET(PcMxCsr, KPCR, MxCsr), + OFFSET(PcNumber, KPCR, Number), + OFFSET(PcInterruptRequest, KPCR, InterruptRequest), + OFFSET(PcIdleHalt, KPCR, IdleHalt), + OFFSET(PcCurrentThread, KPCR, CurrentThread), + OFFSET(PcNextThread, KPCR, NextThread), + OFFSET(PcIdleThread, KPCR, IdleThread), + OFFSET(PcIpiFrozen, KPCR, IpiFrozen), + OFFSET(PcNestingLevel, KPCR, NestingLevel), + OFFSET(PcRspBase, KPCR, RspBase), + OFFSET(PcPrcbLock, KPCR, PrcbLock), + OFFSET(PcSetMember, KPCR, SetMember), + OFFSET(PcCr0, KPCR, Cr0), + OFFSET(PcCr2, KPCR, Cr2), + OFFSET(PcCr3, KPCR, Cr3), + OFFSET(PcCr4, KPCR, Cr4), + OFFSET(PcKernelDr0, KPCR, KernelDr0), + OFFSET(PcKernelDr1, KPCR, KernelDr1), + OFFSET(PcKernelDr2, KPCR, KernelDr2), + OFFSET(PcKernelDr3, KPCR, KernelDr3), + OFFSET(PcKernelDr7, KPCR, KernelDr7), + OFFSET(PcGdtrLimit, KPCR, GdtrLimit), + OFFSET(PcGdtrBase, KPCR, GdtrBase), + OFFSET(PcIdtrLimit, KPCR, IdtrLimit), + OFFSET(PcIdtrBase, KPCR, IdtrBase), + OFFSET(PcTr, KPCR, Tr), + OFFSET(PcLdtr, KPCR, Ldtr), + OFFSET(PcDebugControl, KPCR, DebugControl), + OFFSET(PcLastBranchToRip, KPCR, LastBranchToRip), + OFFSET(PcLastBranchFromRip, KPCR, LastBranchFromRip), + OFFSET(PcLastExceptionToRip, KPCR, LastExceptionToRip), + OFFSET(PcLastExceptionFromRip, KPCR, LastExceptionFromRip), + OFFSET(PcCr8, KPCR, Cr8), + OFFSET(PcCpuType, KPCR, CpuType), + OFFSET(PcCpuID, KPCR, CpuID), + OFFSET(PcCpuStep, KPCR, CpuStep), + OFFSET(PcCpuVendor, KPCR, CpuVendor), + OFFSET(PcVirtualApicAssist, KPCR, VirtualApicAssist), + OFFSET(PcCFlushSize, KPCR, CFlushSize), + OFFSET(PcDeferredReadyListHead, KPCR, DeferredReadyListHead), + OFFSET(PcSystemCalls, KPCR, SystemCalls), + OFFSET(PcDpcRoutineActive, KPCR, DpcRoutineActive), + OFFSET(PcInterruptCount, KPCR, InterruptCount), + OFFSET(PcDebuggerSavedIRQL, KPCR, DebuggerSavedIRQL), + OFFSET(PcTickOffset, KPCR, TickOffset), + OFFSET(PcMasterOffset, KPCR, MasterOffset), + OFFSET(PcSkipTick, KPCR, SkipTick), + OFFSET(PcStartCycles, KPCR, StartCycles), + SIZE(ProcessorControlRegisterLength, KPCR), + + HEADER("KPROCESSOR_STATE"), + OFFSET(PsSpecialRegisters, KPROCESSOR_STATE, SpecialRegisters), + OFFSET(PsCr0, KPROCESSOR_STATE, Cr0), + OFFSET(PsCr2, KPROCESSOR_STATE, Cr2), + OFFSET(PsCr3, KPROCESSOR_STATE, Cr3), + OFFSET(PsCr4, KPROCESSOR_STATE, Cr4), + OFFSET(PsKernelDr0, KPROCESSOR_STATE, KernelDr0), + OFFSET(PsKernelDr1, KPROCESSOR_STATE, KernelDr1), + OFFSET(PsKernelDr2, KPROCESSOR_STATE, KernelDr2), + OFFSET(PsKernelDr3, KPROCESSOR_STATE, KernelDr3), + OFFSET(PsKernelDr6, KPROCESSOR_STATE, KernelDr6), + OFFSET(PsKernelDr7, KPROCESSOR_STATE, KernelDr7), + OFFSET(PsGdtr, KPROCESSOR_STATE, Gdtr), + OFFSET(PsIdtr, KPROCESSOR_STATE, Idtr), + OFFSET(PsTr, KPROCESSOR_STATE, Tr), + OFFSET(PsLdtr, KPROCESSOR_STATE, Ldtr), + OFFSET(PsMxCsr, KPROCESSOR_STATE, MxCsr), + OFFSET(PsContextFrame, KPROCESSOR_STATE, ContextFrame), + OFFSET(PsDebugControl, KPROCESSOR_STATE, DebugControl), + OFFSET(PsLastBranchToRip, KPROCESSOR_STATE, LastBranchToRip), + OFFSET(PsLastBranchFromRip, KPROCESSOR_STATE, LastBranchFromRip), + OFFSET(PsLastExceptionToRip, KPROCESSOR_STATE, LastExceptionToRip), + OFFSET(PsLastExceptionFromRip, KPROCESSOR_STATE, LastExceptionFromRip), + OFFSET(PsCr8, KPROCESSOR_STATE, Cr8), + SIZE(ProcessorStateLength, KPROCESSOR_STATE), + + HEADER("KSTART_FRAME"), + OFFSET(SfP1Home, KSTART_FRAME, P1Home), + OFFSET(SfP2Home, KSTART_FRAME, P2Home), + OFFSET(SfP3Home, KSTART_FRAME, P3Home), + OFFSET(SfP4Home, KSTART_FRAME, P4Home), + OFFSET(SfReturn, KSTART_FRAME, Return), + SIZE(KSTART_FRAME_LENGTH, KSTART_FRAME), + + HEADER("KSPECIAL_REGISTERS"), + OFFSET(SrKernelDr0, KSPECIAL_REGISTERS, KernelDr0), + OFFSET(SrKernelDr1, KSPECIAL_REGISTERS, KernelDr1), + OFFSET(SrKernelDr2, KSPECIAL_REGISTERS, KernelDr2), + OFFSET(SrKernelDr3, KSPECIAL_REGISTERS, KernelDr3), + OFFSET(SrKernelDr6, KSPECIAL_REGISTERS, KernelDr6), + OFFSET(SrKernelDr7, KSPECIAL_REGISTERS, KernelDr7), + OFFSET(SrGdtr, KSPECIAL_REGISTERS, Gdtr), + OFFSET(SrIdtr, KSPECIAL_REGISTERS, Idtr), + OFFSET(SrTr, KSPECIAL_REGISTERS, Tr), + OFFSET(SrMxCsr, KSPECIAL_REGISTERS, MxCsr), + OFFSET(SrMsrGsBase, KSPECIAL_REGISTERS, MsrGsBase), + OFFSET(SrMsrGsSwap, KSPECIAL_REGISTERS, MsrGsSwap), + OFFSET(SrMsrStar, KSPECIAL_REGISTERS, MsrStar), + OFFSET(SrMsrLStar, KSPECIAL_REGISTERS, MsrLStar), + OFFSET(SrMsrCStar, KSPECIAL_REGISTERS, MsrCStar), + OFFSET(SrMsrSyscallMask, KSPECIAL_REGISTERS, MsrSyscallMask), + + HEADER("KSWITCH_FRAME"), + OFFSET(SwP5Home, KSWITCH_FRAME, P5Home), + OFFSET(SwApcBypass, KSWITCH_FRAME, ApcBypass), + OFFSET(SwRbp, KSWITCH_FRAME, Rbp), + OFFSET(SwReturn, KSWITCH_FRAME, Return), + SIZE(KSWITCH_FRAME_LENGTH, KSWITCH_FRAME), + + HEADER("KTRAP_FRAME"), + OFFSET(TrP1Home, KTRAP_FRAME, P1Home), + OFFSET(TrP2Home, KTRAP_FRAME, P2Home), + OFFSET(TrP3Home, KTRAP_FRAME, P3Home), + OFFSET(TrP4Home, KTRAP_FRAME, P4Home), + OFFSET(TrP5, KTRAP_FRAME, P5), + OFFSET(TrPreviousMode, KTRAP_FRAME, PreviousMode), + OFFSET(TrPreviousIrql, KTRAP_FRAME, PreviousIrql), + OFFSET(TrFaultIndicator, KTRAP_FRAME, FaultIndicator), + OFFSET(TrExceptionActive, KTRAP_FRAME, ExceptionActive), + OFFSET(TrMxCsr, KTRAP_FRAME, MxCsr), + OFFSET(TrRax, KTRAP_FRAME, Rax), + OFFSET(TrRcx, KTRAP_FRAME, Rcx), + OFFSET(TrRdx, KTRAP_FRAME, Rdx), + OFFSET(TrR8, KTRAP_FRAME, R8), + OFFSET(TrR9, KTRAP_FRAME, R9), + OFFSET(TrR10, KTRAP_FRAME, R10), + OFFSET(TrR11, KTRAP_FRAME, R11), + OFFSET(TrGsBase, KTRAP_FRAME, GsBase), + OFFSET(TrGsSwap, KTRAP_FRAME,GsSwap), + OFFSET(TrXmm0, KTRAP_FRAME, Xmm0), + OFFSET(TrXmm1, KTRAP_FRAME, Xmm1), + OFFSET(TrXmm2, KTRAP_FRAME, Xmm2), + OFFSET(TrXmm3, KTRAP_FRAME, Xmm3), + OFFSET(TrXmm4, KTRAP_FRAME, Xmm4), + OFFSET(TrXmm5, KTRAP_FRAME, Xmm5), + OFFSET(TrFaultAddress, KTRAP_FRAME, FaultAddress), + OFFSET(TrTimeStampCKCL, KTRAP_FRAME, TimeStampCKCL), + OFFSET(TrDr0, KTRAP_FRAME, Dr0), + OFFSET(TrDr1, KTRAP_FRAME, Dr1), + OFFSET(TrDr2, KTRAP_FRAME, Dr2), + OFFSET(TrDr3, KTRAP_FRAME, Dr3), + OFFSET(TrDr6, KTRAP_FRAME, Dr6), + OFFSET(TrDr7, KTRAP_FRAME, Dr7), + OFFSET(TrDebugControl, KTRAP_FRAME, DebugControl), + OFFSET(TrLastBranchToRip, KTRAP_FRAME, LastBranchToRip), + OFFSET(TrLastBranchFromRip, KTRAP_FRAME, LastBranchFromRip), + OFFSET(TrLastExceptionToRip, KTRAP_FRAME, LastExceptionToRip), + OFFSET(TrLastExceptionFromRip, KTRAP_FRAME, LastExceptionFromRip), + OFFSET(TrLastBranchControl, KTRAP_FRAME, LastBranchControl), + OFFSET(TrLastBranchMSR, KTRAP_FRAME, LastBranchMSR), + OFFSET(TrSegDs, KTRAP_FRAME, SegDs), + OFFSET(TrSegEs, KTRAP_FRAME, SegEs), + OFFSET(TrSegFs, KTRAP_FRAME, SegFs), + OFFSET(TrSegGs, KTRAP_FRAME, SegGs), + OFFSET(TrTrapFrame, KTRAP_FRAME, TrapFrame), + OFFSET(TrRbx, KTRAP_FRAME, Rbx), + OFFSET(TrRdi, KTRAP_FRAME, Rdi), + OFFSET(TrRsi, KTRAP_FRAME, Rsi), + OFFSET(TrRbp, KTRAP_FRAME, Rbp), + OFFSET(TrErrorCode, KTRAP_FRAME, ErrorCode), + OFFSET(TrTimeStampKlog, KTRAP_FRAME, TimeStampKlog), + OFFSET(TrRip, KTRAP_FRAME, Rip), + OFFSET(TrSegCs, KTRAP_FRAME, SegCs), + OFFSET(TrLogging, KTRAP_FRAME, Logging), + OFFSET(TrEFlags, KTRAP_FRAME, EFlags), + OFFSET(TrRsp, KTRAP_FRAME, Rsp), + OFFSET(TrSegSs, KTRAP_FRAME, SegSs), + OFFSET(TrCodePatchCycle, KTRAP_FRAME, CodePatchCycle), + SIZE(KTRAP_FRAME_LENGTH, KTRAP_FRAME), + + HEADER("KTIMER_TABLE"), + OFFSET(TtEntry, KTIMER_TABLE, TimerEntries), + OFFSET(TtTime, KTIMER_TABLE, Time), + SIZE(TIMER_ENTRY_SIZE, KTIMER_ENTRY), + SIZE(TIMER_TABLE_SIZE, KTIMER_TABLE), + + HEADER("KTSS"), + OFFSET(TssRsp0, TYPE, Rsp0), + OFFSET(TssRsp1, TYPE, Rsp1), + OFFSET(TssRsp2, TYPE, Rsp2), + OFFSET(TssPanicStack, TYPE, PanicStack), + OFFSET(TssMcaStack, TYPE, McaStack), + OFFSET(TssNmiStack, TYPE, NmiStack), + OFFSET(TssIoMapBase, TYPE, IoMapBase), + SIZE(TssLength, TYPE), + +#endif + + /* End of list */ + {-1, "", 0} +}; + Propchange: trunk/reactos/tools/geninc/data.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/geninc/geninc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/geninc/geninc.c?rev=…
============================================================================== --- trunk/reactos/tools/geninc/geninc.c (added) +++ trunk/reactos/tools/geninc/geninc.c [iso-8859-1] Thu Dec 24 04:45:21 2009 @@ -1,0 +1,11 @@ + + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + + +int main(int argc, char* argv[]) +{ +} Propchange: trunk/reactos/tools/geninc/geninc.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/geninc/geninc.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/geninc/geninc.rbuild…
============================================================================== --- trunk/reactos/tools/geninc/geninc.rbuild (added) +++ trunk/reactos/tools/geninc/geninc.rbuild [iso-8859-1] Thu Dec 24 04:45:21 2009 @@ -1,0 +1,8 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd"> +<module name="geninc" type="buildtool"> + <file>geninc.c</file> +</module> +<module name="geninc_data" type="bootloader" installname="geninc_data.bin"> + <file>data.c</file> +</module> Propchange: trunk/reactos/tools/geninc/geninc.rbuild ------------------------------------------------------------------------------ svn:eol-style = native
15 years
1
0
0
0
[jimtabor] 44747: [gdi32] - Move more region code from stubs into the appropriate file. - Enable and fix more user code.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Dec 24 00:30:26 2009 New Revision: 44747 URL:
http://svn.reactos.org/svn/reactos?rev=44747&view=rev
Log: [gdi32] - Move more region code from stubs into the appropriate file. - Enable and fix more user code. Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/objects/region.c Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Thu Dec 24 00:30:26 2009 @@ -1704,25 +1704,6 @@ return NtGdiGetFontData(hdc, dwTable, dwOffset, lpvBuffer, cbData); } - -/* - * @implemented - * - */ -DWORD -WINAPI -GetRegionData(HRGN hrgn, - DWORD nCount, - LPRGNDATA lpRgnData) -{ - if (!lpRgnData) - { - nCount = 0; - } - - return NtGdiGetRegionData(hrgn,nCount,lpRgnData); -} - INT WINAPI NamedEscape(HDC hdc, Modified: trunk/reactos/dll/win32/gdi32/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/re…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] Thu Dec 24 00:30:26 2009 @@ -190,7 +190,7 @@ */ HRGN WINAPI -CreateRectRgn(int x1, int y1, int x2,int y2) +CreateRectRgn(int x1, int y1, int x2, int y2) { /* FIXME Some part need be done in user mode */ return NtGdiCreateRectRgn(x1,y1,x2,y2); @@ -289,15 +289,34 @@ * @implemented * */ +DWORD +WINAPI +GetRegionData(HRGN hrgn, + DWORD nCount, + LPRGNDATA lpRgnData) +{ + if (!lpRgnData) + { + nCount = 0; + } + + return NtGdiGetRegionData(hrgn,nCount,lpRgnData); +} + +/* + * @implemented + * + */ INT WINAPI GetRgnBox(HRGN hrgn, LPRECT prcOut) { -#if 0 PRGN_ATTR Rgn_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) + + if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) return NtGdiGetRgnBox(hrgn, prcOut); + if (Rgn_Attr->Flags == NULLREGION) { prcOut->left = 0; @@ -307,12 +326,12 @@ } else { - if (Rgn_Attr->Flags != SIMPLEREGION) return NtGdiGetRgnBox(hrgn, prcOut); - *prcOut = Rgn_Attr->Rect; + if (Rgn_Attr->Flags != SIMPLEREGION) + return NtGdiGetRgnBox(hrgn, prcOut); + /* WARNING! prcOut is never checked newbies! */ + RtlCopyMemory( prcOut, &Rgn_Attr->Rect, sizeof(RECT)); } return Rgn_Attr->Flags; -#endif - return NtGdiGetRgnBox(hrgn, prcOut); } /*
15 years
1
0
0
0
[jimtabor] 44746: [gdi32] - Move region code from stubs into the appropriate file. - Enable and fix SetRectRgn user code.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Dec 24 00:10:32 2009 New Revision: 44746 URL:
http://svn.reactos.org/svn/reactos?rev=44746&view=rev
Log: [gdi32] - Move region code from stubs into the appropriate file. - Enable and fix SetRectRgn user code. Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/objects/region.c Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Thu Dec 24 00:10:32 2009 @@ -18,32 +18,6 @@ #define SIZEOF_DEVMODEW_400 212 #define SIZEOF_DEVMODEW_500 220 - -/* - * @unimplemented - */ -BOOL -WINAPI -PtInRegion(IN HRGN hrgn, - int x, - int y) -{ - /* FIXME some stuff at user mode need be fixed */ - return NtGdiPtInRegion(hrgn,x,y); -} - -/* - * @unimplemented - */ -BOOL -WINAPI -RectInRegion(HRGN hrgn, - LPCRECT prcl) -{ - /* FIXME some stuff at user mode need be fixed */ - return NtGdiRectInRegion(hrgn, (LPRECT) prcl); -} - /* * @unimplemented */ @@ -66,8 +40,6 @@ /* FIXME Sharememory */ return NtGdiSaveDC(hdc); } - - /* * @implemented @@ -194,8 +166,6 @@ return Result; } - - /* * @implemented */ @@ -209,7 +179,6 @@ { return NtGdiGetBoundsRect(hdc,lprcBounds,flags & DCB_RESET); } - /* * @unimplemented @@ -1559,21 +1528,6 @@ return 0; } - -/* - * @unimplemented - */ -INT -WINAPI -CombineRgn(HRGN hDest, - HRGN hSrc1, - HRGN hSrc2, - INT CombineMode) -{ - /* FIXME some part should be done in user mode */ - return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); -} - /* * @unimplemented */ @@ -1636,29 +1590,6 @@ { UNIMPLEMENTED; SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -} - - -/* - * @implemented - */ -INT -WINAPI -ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom) -{ - /* FIXME some part need be done on user mode size */ - return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom); -} - -/* - * @implemented - */ -INT -WINAPI -ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode) -{ - /* FIXME some part need be done on user mode size */ - return NtGdiExtSelectClipRgn(hdc,hrgn, iMode); } /* @@ -1792,119 +1723,6 @@ return NtGdiGetRegionData(hrgn,nCount,lpRgnData); } - -/* - * @implemented - * - */ -INT -WINAPI -GetRgnBox(HRGN hrgn, - LPRECT prcOut) -{ -#if 0 - PRGN_ATTR Rgn_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) - return NtGdiGetRgnBox(hrgn, prcOut); - if (Rgn_Attr->Flags == NULLREGION) - { - prcOut->left = 0; - prcOut->top = 0; - prcOut->right = 0; - prcOut->bottom = 0; - } - else - { - if (Rgn_Attr->Flags != SIMPLEREGION) return NtGdiGetRgnBox(hrgn, prcOut); - *prcOut = Rgn_Attr->Rect; - } - return Rgn_Attr->Flags; -#endif - return NtGdiGetRgnBox(hrgn, prcOut); -} - - -/* - * @implemented - * - */ -INT -WINAPI -OffsetRgn( HRGN hrgn, - int nXOffset, - int nYOffset) -{ - /* FIXME some part are done in user mode */ - return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); -} - -/* - * @implemented - */ -INT -WINAPI -IntersectClipRect(HDC hdc, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); - else - { - PLDC pLDC = GdiGetLDC(hdc); - if ( pLDC ) - { - if (pLDC->iType != LDC_EMFLDC || EMFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect)) - return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); - } - else - SetLastError(ERROR_INVALID_HANDLE); - return 0; - } - } -#endif - return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); -} - -/* - * @implemented - */ -INT -WINAPI -OffsetClipRgn(HDC hdc, - int nXOffset, - int nYOffset) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset ); - else - { - PLDC pLDC = GdiGetLDC(hdc); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return 0; - } - if (pLDC->iType == LDC_EMFLDC && !EMFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset )) - return 0; - return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); - } - } -#endif - return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); -} - - INT WINAPI NamedEscape(HDC hdc, @@ -1922,8 +1740,6 @@ return NtGdiExtEscape(NULL,pDriver,wcslen(pDriver),iEsc,cjIn,pjIn,cjOut,pjOut); } - - /* * @unimplemented */ Modified: trunk/reactos/dll/win32/gdi32/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/re…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] Thu Dec 24 00:10:32 2009 @@ -1,5 +1,4 @@ #include "precomp.h" - static VOID @@ -136,6 +135,20 @@ /* FUNCTIONS *****************************************************************/ /* + * @unimplemented + */ +INT +WINAPI +CombineRgn(HRGN hDest, + HRGN hSrc1, + HRGN hSrc2, + INT CombineMode) +{ + /* FIXME some part should be done in user mode */ + return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); +} + +/* * @implemented */ HRGN @@ -144,7 +157,6 @@ { return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn); } - /* * @implemented @@ -159,7 +171,6 @@ return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) lpPolyCounts, (ULONG) nCount, GdiPolyPolyRgn ); } - /* * @implemented */ @@ -197,6 +208,17 @@ /* Notes if prc is NULL it will crash on All Windows NT I checked 2000/XP/VISTA */ return CreateRectRgn(prc->left, prc->top, prc->right, prc->bottom); +} + +/* + * @implemented + */ +INT +WINAPI +ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom) +{ + /* FIXME some part need be done on user mode size */ + return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom); } /* @@ -226,6 +248,17 @@ /* * @implemented */ +INT +WINAPI +ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode) +{ + /* FIXME some part need be done on user mode size */ + return NtGdiExtSelectClipRgn(hdc,hrgn, iMode); +} + +/* + * @implemented + */ int WINAPI GetClipRgn( @@ -254,6 +287,70 @@ /* * @implemented + * + */ +INT +WINAPI +GetRgnBox(HRGN hrgn, + LPRECT prcOut) +{ +#if 0 + PRGN_ATTR Rgn_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) + return NtGdiGetRgnBox(hrgn, prcOut); + if (Rgn_Attr->Flags == NULLREGION) + { + prcOut->left = 0; + prcOut->top = 0; + prcOut->right = 0; + prcOut->bottom = 0; + } + else + { + if (Rgn_Attr->Flags != SIMPLEREGION) return NtGdiGetRgnBox(hrgn, prcOut); + *prcOut = Rgn_Attr->Rect; + } + return Rgn_Attr->Flags; +#endif + return NtGdiGetRgnBox(hrgn, prcOut); +} + +/* + * @implemented + */ +INT +WINAPI +IntersectClipRect(HDC hdc, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( pLDC ) + { + if (pLDC->iType != LDC_EMFLDC || EMFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect)) + return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); + } + else + SetLastError(ERROR_INVALID_HANDLE); + return 0; + } + } +#endif + return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); +} + +/* + * @implemented */ BOOL WINAPI @@ -262,6 +359,77 @@ RECT Rect; GetWindowRect(hwnd, &Rect); return MirrorRgnByWidth(hrgn, Rect.right - Rect.left, NULL); +} + +/* + * @implemented + */ +INT +WINAPI +OffsetClipRgn(HDC hdc, + int nXOffset, + int nYOffset) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset ); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return 0; + } + if (pLDC->iType == LDC_EMFLDC && !EMFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset )) + return 0; + return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); + } + } +#endif + return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); +} + +/* + * @implemented + * + */ +INT +WINAPI +OffsetRgn( HRGN hrgn, + int nXOffset, + int nYOffset) +{ + /* FIXME some part are done in user mode */ + return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); +} + +/* + * @unimplemented + */ +BOOL +WINAPI +PtInRegion(IN HRGN hrgn, + int x, + int y) +{ + /* FIXME some stuff at user mode need be fixed */ + return NtGdiPtInRegion(hrgn,x,y); +} + +/* + * @unimplemented + */ +BOOL +WINAPI +RectInRegion(HRGN hrgn, + LPCRECT prcl) +{ + /* FIXME some stuff at user mode need be fixed */ + return NtGdiRectInRegion(hrgn, (LPRECT) prcl); } /* @@ -287,42 +455,39 @@ int nRightRect, int nBottomRect) { -#if 0 PRGN_ATTR Rgn_Attr; if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) -#endif return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect); -#if 0 + if ((nLeftRect == nRightRect) || (nTopRect == nBottomRect)) { - Rgn_Attr->flFlags |= DIRTY_RGNATTR; - Rgn_Attr->dwType = RGNATTR_INIT; - Rgn_Attr->rcBound.left = Rgn_Attr->rcBound.top = - Rgn_Attr->rcBound.right = Rgn_Attr->rcBound.bottom = 0; + Rgn_Attr->AttrFlags |= ATTR_RGN_DIRTY; + Rgn_Attr->Flags = NULLREGION; + Rgn_Attr->Rect.left = Rgn_Attr->Rect.top = + Rgn_Attr->Rect.right = Rgn_Attr->Rect.bottom = 0; return TRUE; } - Rgn_Attr->rcBound.left = nLeftRect; - Rgn_Attr->rcBound.top = nTopRect; - Rgn_Attr->rcBound.right = nRightRect; - Rgn_Attr->rcBound.bottom = nBottomRect; + Rgn_Attr->Rect.left = nLeftRect; + Rgn_Attr->Rect.top = nTopRect; + Rgn_Attr->Rect.right = nRightRect; + Rgn_Attr->Rect.bottom = nBottomRect; if(nLeftRect > nRightRect) { - Rgn_Attr->rcBound.left = nRightRect; - Rgn_Attr->rcBound.right = nLeftRect; + Rgn_Attr->Rect.left = nRightRect; + Rgn_Attr->Rect.right = nLeftRect; } if(nTopRect > nBottomRect) { - Rgn_Attr->rcBound.top = nBottomRect; - Rgn_Attr->rcBound.bottom = nTopRect; - } - - Rgn_Attr->flFlags |= DIRTY_RGNATTR; - Rgn_Attr->dwType = RGNATTR_SET; + Rgn_Attr->Rect.top = nBottomRect; + Rgn_Attr->Rect.bottom = nTopRect; + } + + Rgn_Attr->AttrFlags |= ATTR_RGN_DIRTY ; + Rgn_Attr->Flags = SIMPLEREGION; return TRUE; -#endif } /*
15 years
1
0
0
0
[jimtabor] 44745: [Win32k] - Set error if no handle is provided.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Dec 23 21:12:28 2009 New Revision: 44745 URL:
http://svn.reactos.org/svn/reactos?rev=44745&view=rev
Log: [Win32k] - Set error if no handle is provided. Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Wed Dec 23 21:12:28 2009 @@ -2186,6 +2186,7 @@ else if (src2Rgn == NULL) { DPRINT1("IntGdiCombineRgn requires hSrc2 != NULL for combine mode %d!\n", CombineMode); + SetLastWin32Error(ERROR_INVALID_HANDLE); } } } @@ -2193,6 +2194,7 @@ else { DPRINT("IntGdiCombineRgn: hDest unavailable\n"); + SetLastWin32Error(ERROR_INVALID_HANDLE); result = ERROR; } return result; @@ -2248,6 +2250,7 @@ else if (hSrc2 == NULL) { DPRINT1("NtGdiCombineRgn requires hSrc2 != NULL for combine mode %d!\n", CombineMode); + SetLastWin32Error(ERROR_INVALID_HANDLE); } } @@ -2259,6 +2262,7 @@ else { DPRINT("NtGdiCombineRgn: hDest unavailable\n"); + SetLastWin32Error(ERROR_INVALID_HANDLE); result = ERROR; }
15 years
1
0
0
0
[fireball] 44744: - Remove SetDCOrg driver API.
by fireball@svn.reactos.org
Author: fireball Date: Wed Dec 23 19:49:59 2009 New Revision: 44744 URL:
http://svn.reactos.org/svn/reactos?rev=44744&view=rev
Log: - Remove SetDCOrg driver API. Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c branches/arwinss/reactos/dll/win32/winent.drv/winent.drv.spec Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Wed Dec 23 19:49:59 2009 @@ -656,12 +656,6 @@ return 0; } -DWORD CDECL RosDrv_SetDCOrg( NTDRV_PDEVICE *physDev, INT x, INT y ) -{ - UNIMPLEMENTED; - return 0; -} - COLORREF CDECL RosDrv_SetDCPenColor( NTDRV_PDEVICE *physDev, COLORREF crColor ) { UNIMPLEMENTED; Modified: branches/arwinss/reactos/dll/win32/winent.drv/winent.drv.spec URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/winent.drv.spec [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/winent.drv.spec [iso-8859-1] Wed Dec 23 19:49:59 2009 @@ -48,7 +48,6 @@ @ cdecl SetBitmapBits(long ptr long) RosDrv_SetBitmapBits @ cdecl SetBkColor(ptr long) RosDrv_SetBkColor @ cdecl SetDCBrushColor(ptr long) RosDrv_SetDCBrushColor -@ cdecl SetDCOrg(ptr long long) RosDrv_SetDCOrg @ cdecl SetDCPenColor(ptr long) RosDrv_SetDCPenColor @ cdecl SetDIBColorTable(ptr long long ptr) RosDrv_SetDIBColorTable @ cdecl SetDIBits(ptr long long long ptr ptr long) RosDrv_SetDIBits @@ -136,6 +135,7 @@ # OpenGL #@ cdecl wglCopyContext(long long long) RosDrv_wglCopyContext #@ cdecl wglCreateContext(ptr) RosDrv_wglCreateContext +#@ cdecl wglCreateContextAttribsARB(ptr long ptr) RosDrv_wglCreateContextAttribsARB #@ cdecl wglDeleteContext(long) RosDrv_wglDeleteContext #@ cdecl wglGetProcAddress(str) RosDrv_wglGetProcAddress #@ cdecl wglGetPbufferDCARB(ptr ptr) RosDrv_wglGetPbufferDCARB
15 years
1
0
0
0
[tkreuzer] 44743: [i8042prt] - Fix Ctrl-Scroll key combination, by ignoring ACK codes and not relying on a 0xe0 sequence code, which is not being sent at least on VBox. - Fix Tab-K handling at high irql, by moving it out of the DPC routine into the ISR.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Dec 23 19:43:27 2009 New Revision: 44743 URL:
http://svn.reactos.org/svn/reactos?rev=44743&view=rev
Log: [i8042prt] - Fix Ctrl-Scroll key combination, by ignoring ACK codes and not relying on a 0xe0 sequence code, which is not being sent at least on VBox. - Fix Tab-K handling at high irql, by moving it out of the DPC routine into the ISR. Modified: trunk/reactos/drivers/input/i8042prt/keyboard.c Modified: trunk/reactos/drivers/input/i8042prt/keyboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/key…
============================================================================== --- trunk/reactos/drivers/input/i8042prt/keyboard.c [iso-8859-1] (original) +++ trunk/reactos/drivers/input/i8042prt/keyboard.c [iso-8859-1] Wed Dec 23 19:43:27 2009 @@ -15,7 +15,6 @@ /* GLOBALS *******************************************************************/ -static IO_WORKITEM_ROUTINE i8042DebugWorkItem; static IO_WORKITEM_ROUTINE i8042PowerWorkItem; /* This structure starts with the same layout as KEYBOARD_INDICATOR_TRANSLATION */ @@ -30,23 +29,6 @@ {0x46, KEYBOARD_SCROLL_LOCK_ON}}}; /* FUNCTIONS *****************************************************************/ - -static VOID NTAPI -i8042DebugWorkItem( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Key) -{ - UNREFERENCED_PARAMETER(DeviceObject); - INFO_(I8042PRT, "Debug key: p\n", Key); - - if (!Key) - return; - - /* We hope kernel would understand this. If - * that's not the case, nothing would happen. - */ - KdSystemDebugControl(' soR', Key, 0, NULL, 0, NULL, KernelMode); -} /* * These functions are callbacks for filter driver custom interrupt @@ -366,26 +348,6 @@ KeysInBufferCopy = DeviceExtension->KeysInBuffer; KeReleaseInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt, Irql); - - if (PortDeviceExtension->Settings.CrashOnCtrlScroll) - { - PKEYBOARD_INPUT_DATA InputData; - InputData = DeviceExtension->KeyboardBuffer + KeysInBufferCopy - 1; - - /* Test for TAB + key combination */ - if (InputData->MakeCode == 0x0F) - DeviceExtension->TabPressed = !(InputData->Flags & KEY_BREAK); - else if (DeviceExtension->TabPressed) - { - DeviceExtension->TabPressed = FALSE; - - IoQueueWorkItem( - DeviceExtension->DebugWorkItem, - &i8042DebugWorkItem, - DelayedWorkQueue, - (PVOID)(ULONG_PTR)InputData->MakeCode); - } - } TRACE_(I8042PRT, "Send a key\n"); @@ -827,18 +789,40 @@ if (PortDeviceExtension->Settings.CrashOnCtrlScroll) { /* Test for CTRL + SCROLL LOCK twice */ - static const UCHAR ScanCodes[] = { 0xe0, 0x1d, 0x46, 0xc6, 0x46, 0 }; + static const UCHAR ScanCodes[] = { 0x1d, 0x46, 0xc6, 0x46, 0 }; if (Output == ScanCodes[DeviceExtension->ComboPosition]) { DeviceExtension->ComboPosition++; if (ScanCodes[DeviceExtension->ComboPosition] == 0) KeBugCheck(MANUALLY_INITIATED_CRASH); + } + else if (Output == 0xfa) + { + /* Ignore ACK */ } else if (Output == ScanCodes[0]) DeviceExtension->ComboPosition = 1; else DeviceExtension->ComboPosition = 0; + + /* Test for TAB + key combination */ + if (InputData->MakeCode == 0x0F) + DeviceExtension->TabPressed = !(InputData->Flags & KEY_BREAK); + else if (DeviceExtension->TabPressed) + { + DeviceExtension->TabPressed = FALSE; + + /* Send request to the kernel debugger. + * Unknown requests will be ignored. */ + KdSystemDebugControl(' soR', + (PVOID)(ULONG_PTR)InputData->MakeCode, + 0, + NULL, + 0, + NULL, + KernelMode); + } } if (i8042KbdCallIsrHook(DeviceExtension, PortStatus, Output, &ToReturn))
15 years
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
51
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
Results per page:
10
25
50
100
200