ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2010
----- 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
26 participants
522 discussions
Start a n
N
ew thread
[gedmurphy] 44976: Fix pause / resume code. The buttons need fixing yet so it still won't work, although the menu items probably will.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed Jan 6 14:10:09 2010 New Revision: 44976 URL:
http://svn.reactos.org/svn/reactos?rev=44976&view=rev
Log: Fix pause / resume code. The buttons need fixing yet so it still won't work, although the menu items probably will. Modified: trunk/reactos/base/applications/mscutils/servman/control.c Modified: trunk/reactos/base/applications/mscutils/servman/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/control.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/control.c [iso-8859-1] Wed Jan 6 14:10:09 2010 @@ -23,7 +23,22 @@ DWORD dwOldCheckPoint; DWORD dwWaitTime; DWORD dwMaxWait; + DWORD dwReqState; BOOL bRet = FALSE; + + /* Set the state we're interested in */ + switch (Control) + { + case SERVICE_CONTROL_PAUSE: + dwReqState = SERVICE_PAUSED; + break; + case SERVICE_CONTROL_CONTINUE: + dwReqState = SERVICE_RUNNING; + break; + default: + /* Unhandled control code */ + return FALSE; + } hSCManager = OpenSCManager(NULL, NULL, @@ -32,7 +47,7 @@ { hService = OpenService(hSCManager, Info->pCurrentService->lpServiceName, - SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_QUERY_CONFIG); + SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_QUERY_STATUS); if (hService) { if (hProgress) @@ -58,7 +73,7 @@ dwStartTickCount = GetTickCount(); /* Loop until it's at the correct state */ - while (ServiceStatus.dwCurrentState != Control) + while (ServiceStatus.dwCurrentState != dwReqState) { dwOldCheckPoint = ServiceStatus.dwCheckPoint; dwWaitTime = ServiceStatus.dwWaitHint / 10; @@ -103,7 +118,7 @@ } } - if (ServiceStatus.dwCurrentState == Control) + if (ServiceStatus.dwCurrentState == dwReqState) { bRet = TRUE; }
14 years, 11 months
1
0
0
0
[gadamopoulos] 44975: [win32k] - Rewrite SetCursorPos and ShowCursror - Store coursor show count in SYSTEM_CURSORINFO and not in GDIPOINTER - Fix broken behaviour in ClipCursor
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Wed Jan 6 13:44:31 2010 New Revision: 44975 URL:
http://svn.reactos.org/svn/reactos?rev=44975&view=rev
Log: [win32k] - Rewrite SetCursorPos and ShowCursror - Store coursor show count in SYSTEM_CURSORINFO and not in GDIPOINTER - Fix broken behaviour in ClipCursor Modified: trunk/reactos/dll/win32/user32/include/user32p.h trunk/reactos/dll/win32/user32/windows/cursor.c trunk/reactos/subsystems/win32/win32k/eng/mouse.c trunk/reactos/subsystems/win32/win32k/include/cursoricon.h trunk/reactos/subsystems/win32/win32k/include/pdevobj.h trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/input.c trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c Modified: trunk/reactos/dll/win32/user32/include/user32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
============================================================================== --- trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -99,6 +99,9 @@ #define NtUserGetDesktopMapping(Ptr) \ (PVOID)NtUserCallOneParam((DWORD)Ptr, ONEPARAM_ROUTINE_GETDESKTOPMAPPING) +#define NtUserSetCursorPos(x, y) \ + (BOOL)NtUserCallTwoParam((DWORD)x, (DWORD)y, TWOPARAM_ROUTINE_SETCURSORPOS) + #define ShowCaret(hwnd) \ NtUserShowCaret(hwnd) Modified: trunk/reactos/dll/win32/user32/windows/cursor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/c…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/cursor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/cursor.c [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -280,18 +280,7 @@ SetCursorPos(int X, int Y) { - INPUT Input; - - Input.type = INPUT_MOUSE; - Input.mi.dx = (LONG)X; - Input.mi.dy = (LONG)Y; - Input.mi.mouseData = 0; - Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; - Input.mi.time = 0; - Input.mi.dwExtraInfo = 0; - - NtUserSendInput(1, &Input, sizeof(INPUT)); - return TRUE; + return NtUserSetCursorPos(X,Y); } Modified: trunk/reactos/subsystems/win32/win32k/eng/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/mouse.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/mouse.c [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -157,12 +157,6 @@ pgp->Enabled = FALSE; - /* The mouse is hide from ShowCours and it is frist ?? */ - if (pgp->ShowPointer < 0) - { - return; - } - if (!pgp->psurfSave) { DPRINT1("No SaveSurface!\n"); @@ -214,12 +208,6 @@ } pgp->Enabled = TRUE; - - /* Do not blt the pointer, if it is hidden */ - if (pgp->ShowPointer < 0) - { - return ; - } /* Calculate pointer coordinates */ pt.x = ppdev->ptlPointer.x - pgp->HotSpot.x; @@ -538,8 +526,11 @@ prcl->right = prcl->left + pgp->Size.cx; prcl->bottom = prcl->top + pgp->Size.cy; } - } else if (prcl != NULL) + } + else if (prcl != NULL) + { prcl->left = prcl->top = prcl->right = prcl->bottom = -1; + } } VOID APIENTRY Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -47,7 +47,7 @@ UINT ButtonsDown; CURSORCLIP_INFO CursorClipInfo; PCURICON_OBJECT CurrentCursorObject; - BYTE ShowingCursor; + INT ShowingCursor; /* UINT WheelScroLines; UINT WheelScroChars; @@ -77,9 +77,9 @@ INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags); PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon); -BOOL FASTCALL UserSetCursorPos( INT x, INT y); +BOOL UserSetCursorPos( INT x, INT y); -int APIENTRY UserShowCursor(BOOL bShow); +int UserShowCursor(BOOL bShow); PSYSTEM_CURSORINFO FASTCALL IntGetSysCursorInfo(); Modified: trunk/reactos/subsystems/win32/win32k/include/pdevobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/pdevobj.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/pdevobj.h [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -33,7 +33,6 @@ SURFACE *psurfColor; SURFACE *psurfMask; SURFACE *psurfSave; - int ShowPointer; /* counter negtive do not show the mouse postive show the mouse */ /* public pointer information */ RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -137,7 +137,7 @@ { UserReferenceObject(NewCursor); - CurInfo->ShowingCursor = CURSOR_SHOWING; + CurInfo->ShowingCursor = 1; CurInfo->CurrentCursorObject = NewCursor; /* Call GDI to set the new screen cursor */ @@ -173,6 +173,101 @@ /* Return handle of the old cursor */ return hOldCursor; +} + +BOOL UserSetCursorPos( INT x, INT y) +{ + PWINDOW_OBJECT DesktopWindow; + PSYSTEM_CURSORINFO CurInfo; + HDC hDC; + MSG Msg; + + if(!(hDC = IntGetScreenDC())) + { + return FALSE; + } + + CurInfo = IntGetSysCursorInfo(); + + DesktopWindow = UserGetDesktopWindow(); + + if (DesktopWindow) + { + if(x >= DesktopWindow->Wnd->rcClient.right) + x = DesktopWindow->Wnd->rcClient.right - 1; + if(y >= DesktopWindow->Wnd->rcClient.bottom) + y = DesktopWindow->Wnd->rcClient.bottom - 1; + } + + if(x < 0) + x = 0; + if(y < 0) + y = 0; + + //Clip cursor position + if(CurInfo->CursorClipInfo.IsClipped) + { + if(x >= (LONG)CurInfo->CursorClipInfo.Right) + x = (LONG)CurInfo->CursorClipInfo.Right - 1; + if(x < (LONG)CurInfo->CursorClipInfo.Left) + x = (LONG)CurInfo->CursorClipInfo.Left; + if(y >= (LONG)CurInfo->CursorClipInfo.Bottom) + y = (LONG)CurInfo->CursorClipInfo.Bottom - 1; + if(y < (LONG)CurInfo->CursorClipInfo.Top) + y = (LONG)CurInfo->CursorClipInfo.Top; + } + + //Store the new cursor position + gpsi->ptCursor.x = x; + gpsi->ptCursor.y = y; + + //Move the mouse pointer + GreMovePointer(hDC, x, y); + + //Generate a mouse move message + Msg.message = WM_MOUSEMOVE; + Msg.wParam = CurInfo->ButtonsDown; + Msg.lParam = MAKELPARAM(x, y); + Msg.pt = gpsi->ptCursor; + MsqInsertSystemMessage(&Msg); + + return TRUE; +} + +/* Called from NtUserCallOneParam with Routine ONEPARAM_ROUTINE_SHOWCURSOR + * User32 macro NtUserShowCursor */ +int UserShowCursor(BOOL bShow) +{ + PSYSTEM_CURSORINFO CurInfo = IntGetSysCursorInfo();; + HDC hdcScreen; + + if (!(hdcScreen = IntGetScreenDC())) + { + return 0; /* No mouse */ + } + + if (bShow == FALSE) + { + /* Check if were diplaying a cursor */ + if (CurInfo->ShowingCursor == 1) + { + /* Remove the pointer */ + GreMovePointer(hdcScreen, -1, -1); + DPRINT("Removing pointer!\n"); + } + CurInfo->ShowingCursor--; + } + else + { + if (CurInfo->ShowingCursor == 0) + { + /*Show the pointer*/ + GreMovePointer(hdcScreen, gpsi->ptCursor.x, gpsi->ptCursor.y); + } + CurInfo->ShowingCursor++; + } + + return CurInfo->ShowingCursor; } /* @@ -712,21 +807,14 @@ if ((Rect.right > Rect.left) && (Rect.bottom > Rect.top) && DesktopWindow && UnsafeRect != NULL) { - MOUSEINPUT mi; CurInfo->CursorClipInfo.IsClipped = TRUE; CurInfo->CursorClipInfo.Left = max(Rect.left, DesktopWindow->Wnd->rcWindow.left); CurInfo->CursorClipInfo.Top = max(Rect.top, DesktopWindow->Wnd->rcWindow.top); - CurInfo->CursorClipInfo.Right = min(Rect.right - 1, DesktopWindow->Wnd->rcWindow.right - 1); - CurInfo->CursorClipInfo.Bottom = min(Rect.bottom - 1, DesktopWindow->Wnd->rcWindow.bottom - 1); - - mi.dx = gpsi->ptCursor.x; - mi.dy = gpsi->ptCursor.y; - mi.mouseData = 0; - mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; - mi.time = 0; - mi.dwExtraInfo = 0; - IntMouseInput(&mi); + CurInfo->CursorClipInfo.Right = min(Rect.right, DesktopWindow->Wnd->rcWindow.right); + CurInfo->CursorClipInfo.Bottom = min(Rect.bottom, DesktopWindow->Wnd->rcWindow.bottom); + + UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y); RETURN(TRUE); } @@ -1507,89 +1595,3 @@ return Ret; } -/* Called from NtUserCallOneParam with Routine ONEPARAM_ROUTINE_SHOWCURSOR - * User32 macro NtUserShowCursor */ -int -APIENTRY -UserShowCursor(BOOL bShow) -{ - PSYSTEM_CURSORINFO CurInfo; - HDC Screen; - PDC dc; - SURFOBJ *SurfObj; - SURFACE *psurfDc; - PDEVOBJ *ppdev; - GDIPOINTER *pgp; - int showpointer=0; - - CurInfo = IntGetSysCursorInfo(); - - if (!(Screen = IntGetScreenDC())) - { - return showpointer; /* No mouse */ - } - - dc = DC_LockDc(Screen); - - if (!dc) - { - return showpointer; /* No mouse */ - } - - psurfDc = dc->dclevel.pSurface; - - if (!psurfDc) - { - DC_UnlockDc(dc); - return showpointer; /* No Mouse */ - } - - SurfObj = &psurfDc->SurfObj; - if (SurfObj == NULL) - { - DC_UnlockDc(dc); - return showpointer; /* No mouse */ - } - - ppdev = GDIDEV(SurfObj); - - if (ppdev == NULL) - { - DC_UnlockDc(dc); - return showpointer; /* No mouse */ - } - - pgp = &ppdev->Pointer; - - if (bShow == FALSE) - { - pgp->ShowPointer--; - showpointer = pgp->ShowPointer; - - if (showpointer >= 0) - { - //ppdev->SafetyRemoveCount = 1; - //ppdev->SafetyRemoveLevel = 1; - IntEngMovePointer(SurfObj,-1,-1,NULL); - CurInfo->ShowingCursor = 0; - } - - } - else - { - pgp->ShowPointer++; - showpointer = pgp->ShowPointer; - - /* Show Cursor */ - if (showpointer < 0) - { - //ppdev->SafetyRemoveCount = 0; - //ppdev->SafetyRemoveLevel = 0; - IntEngMovePointer(SurfObj,-1,-1,NULL); - CurInfo->ShowingCursor = CURSOR_SHOWING; - } - } - - DC_UnlockDc(dc); - return showpointer; -} Modified: trunk/reactos/subsystems/win32/win32k/ntuser/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -120,10 +120,8 @@ /* Check if the mouse move is absolute */ if (mid->Flags == MOUSE_MOVE_ABSOLUTE) { - /* Set flag and convert to screen location */ + /* Set flag to convert to screen location */ mi.dwFlags |= MOUSEEVENTF_ABSOLUTE; - mi.dx = mi.dx / (65535 / (UserGetSystemMetrics(SM_CXVIRTUALSCREEN) - 1)); - mi.dy = mi.dy / (65535 / (UserGetSystemMetrics(SM_CYVIRTUALSCREEN) - 1)); } if(mid->ButtonFlags) @@ -1052,48 +1050,19 @@ { const UINT SwapBtnMsg[2][2] = { - { - WM_LBUTTONDOWN, WM_RBUTTONDOWN - }, + {WM_LBUTTONDOWN, WM_RBUTTONDOWN}, {WM_LBUTTONUP, WM_RBUTTONUP} }; const WPARAM SwapBtn[2] = { MK_LBUTTON, MK_RBUTTON }; - POINT MousePos = {0}, OrgPos; + POINT MousePos; PSYSTEM_CURSORINFO CurInfo; - PWINSTATION_OBJECT WinSta; - BOOL DoMove, SwapButtons; + BOOL SwapButtons; MSG Msg; - SURFACE *psurf; - SURFOBJ *pso; - PDC dc; - PWINDOW_OBJECT DesktopWindow; - -#if 1 - - HDC hDC; - - /* FIXME - get the screen dc from the window station or desktop */ - if(!(hDC = IntGetScreenDC())) - { - return FALSE; - } -#endif ASSERT(mi); -#if 0 - - WinSta = PsGetCurrentProcessWin32Process()->WindowStation; -#else - /* FIXME - ugly hack but as long as we're using this dumb callback from the - mouse class driver, we can't access the window station from the calling - process */ - WinSta = InputWindowStation; -#endif - - ASSERT(WinSta); CurInfo = IntGetSysCursorInfo(); @@ -1105,84 +1074,26 @@ } SwapButtons = gspv.bMouseBtnSwap; - DoMove = FALSE; - - OrgPos = MousePos = gpsi->ptCursor; + + MousePos = gpsi->ptCursor; if(mi->dwFlags & MOUSEEVENTF_MOVE) { if(mi->dwFlags & MOUSEEVENTF_ABSOLUTE) { - MousePos.x = mi->dx; - MousePos.y = mi->dy; + MousePos.x = mi->dx * UserGetSystemMetrics(SM_CXVIRTUALSCREEN) >> 16; + MousePos.y = mi->dy * UserGetSystemMetrics(SM_CYVIRTUALSCREEN) >> 16; } else { MousePos.x += mi->dx; MousePos.y += mi->dy; - } - - DesktopWindow = IntGetWindowObject(WinSta->ActiveDesktop->DesktopWindow); - - if (DesktopWindow) - { - if(MousePos.x >= DesktopWindow->Wnd->rcClient.right) - MousePos.x = DesktopWindow->Wnd->rcClient.right - 1; - if(MousePos.y >= DesktopWindow->Wnd->rcClient.bottom) - MousePos.y = DesktopWindow->Wnd->rcClient.bottom - 1; - UserDereferenceObject(DesktopWindow); - } - - if(MousePos.x < 0) - MousePos.x = 0; - if(MousePos.y < 0) - MousePos.y = 0; - - if(CurInfo->CursorClipInfo.IsClipped) - { - /* The mouse cursor needs to be clipped */ - - if(MousePos.x >= (LONG)CurInfo->CursorClipInfo.Right) - MousePos.x = (LONG)CurInfo->CursorClipInfo.Right; - if(MousePos.x < (LONG)CurInfo->CursorClipInfo.Left) - MousePos.x = (LONG)CurInfo->CursorClipInfo.Left; - if(MousePos.y >= (LONG)CurInfo->CursorClipInfo.Bottom) - MousePos.y = (LONG)CurInfo->CursorClipInfo.Bottom; - if(MousePos.y < (LONG)CurInfo->CursorClipInfo.Top) - MousePos.y = (LONG)CurInfo->CursorClipInfo.Top; - } - - DoMove = (MousePos.x != OrgPos.x || MousePos.y != OrgPos.y); - } - - if (DoMove) - { - dc = DC_LockDc(hDC); - if (dc) - { - psurf = dc->dclevel.pSurface; - if (psurf) - { - pso = &psurf->SurfObj; - - if (CurInfo->ShowingCursor) - { - IntEngMovePointer(pso, MousePos.x, MousePos.y, &(GDIDEV(pso)->Pointer.Exclude)); - } - /* Only now, update the info in the PDEVOBJ, so EngMovePointer can - * use the old values to move the pointer image */ - gpsi->ptCursor.x = MousePos.x; - gpsi->ptCursor.y = MousePos.y; - } - - DC_UnlockDc(dc); } } /* * Insert the messages into the system queue */ - Msg.wParam = CurInfo->ButtonsDown; Msg.lParam = MAKELPARAM(MousePos.x, MousePos.y); Msg.pt = MousePos; @@ -1197,13 +1108,10 @@ Msg.wParam |= MK_CONTROL; } - if(DoMove) - { - Msg.message = WM_MOUSEMOVE; - MsqInsertSystemMessage(&Msg); - } - - Msg.message = 0; + if(mi->dwFlags & MOUSEEVENTF_MOVE) + { + UserSetCursorPos(MousePos.x, MousePos.y); + } if(mi->dwFlags & MOUSEEVENTF_LEFTDOWN) { gQueueKeyStateTable[VK_LBUTTON] |= 0xc0; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Wed Jan 6 13:44:31 2010 @@ -438,6 +438,10 @@ case TWOPARAM_ROUTINE_REGISTERLOGONPROC: RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2)); + + case TWOPARAM_ROUTINE_SETCURSORPOS: + RETURN( (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2)); + } DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n", Routine, Param1, Param2);
14 years, 11 months
1
0
0
0
[dgorbachev] 44974: [freeldr] - Do not use GetSystemMemorySize(), which truncates size to 32 bit. - Other minor changes.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Wed Jan 6 12:44:54 2010 New Revision: 44974 URL:
http://svn.reactos.org/svn/reactos?rev=44974&view=rev
Log: [freeldr] - Do not use GetSystemMemorySize(), which truncates size to 32 bit. - Other minor changes. Removed: trunk/reactos/boot/freeldr/freeldr/.cvsignore Modified: trunk/reactos/boot/freeldr/freeldr/cache/cache.c trunk/reactos/boot/freeldr/freeldr/include/mm.h trunk/reactos/boot/freeldr/freeldr/mm/mm.c trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c Removed: trunk/reactos/boot/freeldr/freeldr/.cvsignore URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/.cvsi…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/.cvsignore [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/.cvsignore (removed) @@ -1,1 +1,0 @@ -obj Modified: trunk/reactos/boot/freeldr/freeldr/cache/cache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cache…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/cache/cache.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/cache/cache.c [iso-8859-1] Wed Jan 6 12:44:54 2010 @@ -89,7 +89,7 @@ CacheManagerDrive.BlockSize = MachDiskGetCacheableBlockCount(DriveNumber); CacheBlockCount = 0; - CacheSizeLimit = GetSystemMemorySize() / 8; + CacheSizeLimit = TotalPagesInLookupTable / 8 * MM_PAGE_SIZE; CacheSizeCurrent = 0; if (CacheSizeLimit < (64 * 1024)) { Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] Wed Jan 6 12:44:54 2010 @@ -104,7 +104,6 @@ BOOLEAN MmAreMemoryPagesAvailable(PVOID PageLookupTable, ULONG TotalPageCount, PVOID PageAddress, ULONG PageCount); // Returns TRUE if the specified pages of memory are available, otherwise FALSE VOID MmSetMemoryType(PVOID MemoryAddress, ULONG MemorySize, TYPE_OF_MEMORY NewType); // Use with EXTREME caution! -ULONG GetSystemMemorySize(VOID); // Returns the amount of total memory in the system PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries); // Returns a pointer to the memory mapping table and a number of entries in it Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Wed Jan 6 12:44:54 2010 @@ -337,11 +337,6 @@ } #endif // DBG -ULONG GetSystemMemorySize(VOID) -{ - return (TotalPagesInLookupTable * MM_PAGE_SIZE); -} - PPAGE_LOOKUP_TABLE_ITEM MmGetMemoryMap(ULONG *NoEntries) { PPAGE_LOOKUP_TABLE_ITEM RealPageLookupTable = (PPAGE_LOOKUP_TABLE_ITEM)PageLookupTableAddress; Modified: trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c [iso-8859-1] Wed Jan 6 12:44:54 2010 @@ -53,13 +53,13 @@ // Max number of entries = MaxPageNum >> 10 // FIXME: This is a number to describe ALL physical memory // and windows doesn't expect ALL memory mapped... - NumPageTables = (GetSystemMemorySize() >> MM_PAGE_SHIFT) >> 10; + NumPageTables = TotalPagesInLookupTable >> 10; DPRINTM(DPRINT_WINDOWS, "NumPageTables = %d\n", NumPageTables); // Allocate memory block for all these things: // PDE, HAL mapping page table, physical mapping, kernel mapping - TotalSize = (1+1+NumPageTables*2)*MM_PAGE_SIZE; + TotalSize = (1 + 1 + NumPageTables * 2) * MM_PAGE_SIZE; // PDE+HAL+KernelPTEs == MemoryData Buffer = MmAllocateMemoryWithType(TotalSize, LoaderMemoryData); @@ -141,7 +141,7 @@ BOOLEAN MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages) + IN ULONG NumberOfPages) { PHARDWARE_PTE PhysicalPT; PHARDWARE_PTE KernelPT; @@ -163,7 +163,7 @@ // // Now actually set up the page tables for identity mapping // - for (Page=StartPage; Page < StartPage+NumberOfPages; Page++) + for (Page = StartPage; Page < StartPage + NumberOfPages; Page++) { Entry = Page >> 10; @@ -177,26 +177,13 @@ KernelPT = (PHARDWARE_PTE)(PDE[Entry+(KSEG0_BASE >> 22)].PageFrameNumber << MM_PAGE_SHIFT); } - if (Page == 0) - { - PhysicalPT[Page & 0x3ff].PageFrameNumber = Page; - PhysicalPT[Page & 0x3ff].Valid = 0; - PhysicalPT[Page & 0x3ff].Write = 0; - - KernelPT[Page & 0x3ff].PageFrameNumber = Page; - KernelPT[Page & 0x3ff].Valid = 0; - KernelPT[Page & 0x3ff].Write = 0; - } - else - { - PhysicalPT[Page & 0x3ff].PageFrameNumber = Page; - PhysicalPT[Page & 0x3ff].Valid = 1; - PhysicalPT[Page & 0x3ff].Write = 1; - - KernelPT[Page & 0x3ff].PageFrameNumber = Page; - KernelPT[Page & 0x3ff].Valid = 1; - KernelPT[Page & 0x3ff].Write = 1; - } + PhysicalPT[Page & 0x3ff].PageFrameNumber = Page; + PhysicalPT[Page & 0x3ff].Valid = (Page != 0); + PhysicalPT[Page & 0x3ff].Write = (Page != 0); + + KernelPT[Page & 0x3ff].PageFrameNumber = Page; + KernelPT[Page & 0x3ff].Valid = (Page != 0); + KernelPT[Page & 0x3ff].Write = (Page != 0); } return TRUE; Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] Wed Jan 6 12:44:54 2010 @@ -184,7 +184,7 @@ MadCount++; // - // Map it (don't map low 1Mb because it was already contigiously + // Map it (don't map low 1Mb because it was already contiguously // mapped in WinLdrTurnOnPaging) // if (BasePage >= 0x100) @@ -255,7 +255,7 @@ DPRINTM(DPRINT_WINDOWS, "Got memory map with %d entries\n", NoEntries); - // Always contigiously map low 1Mb of memory + // Always contiguously map low 1Mb of memory Status = MempSetupPaging(0, 0x100); if (!Status) { @@ -270,7 +270,7 @@ PagesCount = 1; LastPageIndex = 0; LastPageType = MemoryMap[0].PageAllocated; - for(i=1;i<NoEntries;i++) + for (i = 1; i < NoEntries; i++) { // Check if its memory map itself if (i >= MemoryMapStartPage &&
14 years, 11 months
1
0
0
0
[arty] 44973: Fix some wrong unlocking. Remove erroneous clean when recalling a page.
by arty@svn.reactos.org
Author: arty Date: Wed Jan 6 09:48:56 2010 New Revision: 44973 URL:
http://svn.reactos.org/svn/reactos?rev=44973&view=rev
Log: Fix some wrong unlocking. Remove erroneous clean when recalling a page. Modified: branches/arty-newcc/ntoskrnl/mm/section/fault.c Modified: branches/arty-newcc/ntoskrnl/mm/section/fault.c URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/section/…
============================================================================== --- branches/arty-newcc/ntoskrnl/mm/section/fault.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/mm/section/fault.c [iso-8859-1] Wed Jan 6 09:48:56 2010 @@ -46,7 +46,7 @@ /* INCLUDES *****************************************************************/ #include <ntoskrnl.h> -#define NDEBUG +//#define NDEBUG #include <debug.h> extern KEVENT MmWaitPageEvent; @@ -97,17 +97,8 @@ &MemoryArea->Data.SectionData.RegionListHead, Address, NULL); - if (Segment->Flags & MM_IMAGE_SEGMENT) - { - FileOffset.QuadPart = TotalOffset.QuadPart + Segment->Image.FileOffset; - DPRINT("SEG Flags %x File Offset %x\n", - Segment->Image.Characteristics, FileOffset.LowPart); - } - else - { - TotalOffset.QuadPart += MemoryArea->Data.SectionData.ViewOffset.QuadPart; - FileOffset = TotalOffset; - } + TotalOffset.QuadPart += MemoryArea->Data.SectionData.ViewOffset.QuadPart; + FileOffset = TotalOffset; Consumer = (Segment->Flags & MM_DATAFILE_SEGMENT) ? MC_CACHE : MC_USER; @@ -183,6 +174,7 @@ if (SwapEntry == MM_WAIT_ENTRY) { DPRINT1("Wait for page entry in section\n"); + MmUnlockSectionSegment(Segment); return STATUS_SUCCESS + 1; } else @@ -203,6 +195,7 @@ if (SwapEntry == MM_WAIT_ENTRY) { DPRINT1("Wait for page entry in section\n"); + MmUnlockSectionSegment(Segment); return STATUS_SUCCESS + 1; } else @@ -353,7 +346,6 @@ DPRINT("Set in section @ %x\n", Offset.LowPart); Status = MiSetPageEntrySectionSegment (Segment, &Offset, MAKE_PFN_SSE(Page)); - KeSetEvent(&MmWaitPageEvent, IO_NO_INCREMENT, FALSE); } if (Required->State & 2) @@ -366,8 +358,6 @@ MmInsertRmap(Page, Process, Address); if (Locked) MmLockPage(Page); } - DPRINT("Set clean %x\n", Page); - MmSetCleanAllRmaps(Page); } if (Required->State & 4) @@ -378,6 +368,8 @@ } MmUnlockSectionSegment(Segment); + DPRINT("XXX Set Event %x\n", Status); + KeSetEvent(&MmWaitPageEvent, IO_NO_INCREMENT, FALSE); DPRINT("Done: %x\n", Status); return Status; }
14 years, 11 months
1
0
0
0
[dgorbachev] 44972: Check if MmHeapAlloc() failed.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Wed Jan 6 02:28:23 2010 New Revision: 44972 URL:
http://svn.reactos.org/svn/reactos?rev=44972&view=rev
Log: Check if MmHeapAlloc() failed. Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] Wed Jan 6 02:28:23 2010 @@ -68,7 +68,7 @@ LoaderBlock.Flags |= MB_FLAGS_ACPI_TABLE; /* Get BIOS memory map */ - RtlZeroMemory(BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32); + RtlZeroMemory(BiosMemoryMap, sizeof(BiosMemoryMap)); BiosMemoryMapEntryCount = PcMemGetMemoryMap(BiosMemoryMap, sizeof(BiosMemoryMap) / sizeof(BIOS_MEMORY_MAP)); @@ -79,6 +79,14 @@ /* Set 'Configuration Data' value */ PartialResourceList = MmHeapAlloc(sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize); + + if (PartialResourceList == NULL) + { + DPRINTM(DPRINT_HWDETECT, + "Failed to allocate resource descriptor\n"); + return; + } + memset(PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST) + TableSize); PartialResourceList->Version = 0; PartialResourceList->Revision = 0;
14 years, 11 months
1
0
0
0
[ros-arm-bringup] 44971: - Implement NMI handler in C instead of ASM. - Tested with the "nmi 0" command in QEMU and NmiDbg.sys.
by ros-arm-bringup@svn.reactos.org
Author: ros-arm-bringup Date: Wed Jan 6 01:40:07 2010 New Revision: 44971 URL:
http://svn.reactos.org/svn/reactos?rev=44971&view=rev
Log: - Implement NMI handler in C instead of ASM. - Tested with the "nmi 0" command in QEMU and NmiDbg.sys. Modified: trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/i386/trap.s Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Wed Jan 6 01:40:07 2010 @@ -863,6 +863,10 @@ PKTRAP_FRAME Tf ); +BOOLEAN +NTAPI +KiHandleNmi(VOID); + VOID NTAPI KeFlushCurrentTb(VOID); Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Wed Jan 6 01:40:07 2010 @@ -944,6 +944,154 @@ KiSaveProcessorControlState(&Prcb->ProcessorState); } +/* C TRAP HANDLERS ************************************************************/ + +BOOLEAN +NTAPI +KiNmiFault(IN PVOID InterruptStack) +{ + PKTSS Tss, NmiTss; + PKTHREAD Thread; + PKPROCESS Process; + PKGDTENTRY TssGdt; + KTRAP_FRAME TrapFrame; + KIRQL OldIrql; + + // + // In some sort of strange recursion case, we might end up here with the IF + // flag incorrectly on the interrupt frame -- during a normal NMI this would + // normally already be set. + // + // For sanity's sake, make sure interrupts are disabled for sure. + // NMIs will already be since the CPU does it for us. + // + _disable(); + + // + // Get the current TSS, thread, and process + // + Tss = PCR->TSS; + Thread = ((PKIPCR)PCR)->PrcbData.CurrentThread; + Process = Thread->ApcState.Process; + + // + // Save data usually not in the TSS + // + Tss->CR3 = Process->DirectoryTableBase[0]; + Tss->IoMapBase = Process->IopmOffset; + Tss->LDT = Process->LdtDescriptor.LimitLow ? KGDT_LDT : 0; + + // + // Now get the base address of the NMI TSS + // + TssGdt = &((PKIPCR)KeGetPcr())->GDT[KGDT_NMI_TSS / sizeof(KGDTENTRY)]; + NmiTss = (PKTSS)(ULONG_PTR)(TssGdt->BaseLow | + TssGdt->HighWord.Bytes.BaseMid << 16 | + TssGdt->HighWord.Bytes.BaseHi << 24); + + // + // Switch to it and activate it, masking off the nested flag + // + // Note that in reality, we are already on the NMI tss -- we just need to + // update the PCR to reflect this + // + PCR->TSS = NmiTss; + __writeeflags(__readeflags() &~ EFLAGS_NESTED_TASK); + TssGdt->HighWord.Bits.Dpl = 0; + TssGdt->HighWord.Bits.Pres = 1; + TssGdt->HighWord.Bits.Type = I386_TSS; + + // + // Now build the trap frame based on the original TSS + // + // The CPU does a hardware "Context switch" / task switch of sorts and so it + // takes care of saving our context in the normal TSS. + // + // We just have to go get the values... + // + RtlZeroMemory(&TrapFrame, sizeof(KTRAP_FRAME)); + TrapFrame.HardwareSegSs = Tss->Ss0; + TrapFrame.HardwareEsp = Tss->Esp0; + TrapFrame.EFlags = Tss->EFlags; + TrapFrame.SegCs = Tss->Cs; + TrapFrame.Eip = Tss->Eip; + TrapFrame.Ebp = Tss->Ebp; + TrapFrame.Ebx = Tss->Ebx; + TrapFrame.Esi = Tss->Esi; + TrapFrame.Edi = Tss->Edi; + TrapFrame.SegFs = Tss->Fs; + TrapFrame.ExceptionList = PCR->Tib.ExceptionList; + TrapFrame.PreviousPreviousMode = -1; + TrapFrame.Eax = Tss->Eax; + TrapFrame.Ecx = Tss->Ecx; + TrapFrame.Edx = Tss->Edx; + TrapFrame.SegDs = Tss->Ds; + TrapFrame.SegEs = Tss->Es; + TrapFrame.SegGs = Tss->Gs; + TrapFrame.DbgEip = Tss->Eip; + TrapFrame.DbgEbp = Tss->Ebp; + + // + // Store the trap frame in the KPRCB + // + KiSaveProcessorState(&TrapFrame, NULL); + + // + // Call any registered NMI handlers and see if they handled it or not + // + if (!KiHandleNmi()) + { + // + // They did not, so call the platform HAL routine to bugcheck the system + // + // Make sure the HAL believes it's running at HIGH IRQL... we can't use + // the normal APIs here as playing with the IRQL could change the system + // state + // + OldIrql = PCR->Irql; + PCR->Irql = HIGH_LEVEL; + HalHandleNMI(NULL); + PCR->Irql = OldIrql; + } + + // + // Although the CPU disabled NMIs, we just did a BIOS Call, which could've + // totally changed things. + // + // We have to make sure we're still in our original NMI -- a nested NMI + // will point back to the NMI TSS, and in that case we're hosed. + // + if (PCR->TSS->Backlink != KGDT_NMI_TSS) + { + // + // Restore original TSS + // + PCR->TSS = Tss; + + // + // Set it back to busy + // + TssGdt->HighWord.Bits.Dpl = 0; + TssGdt->HighWord.Bits.Pres = 1; + TssGdt->HighWord.Bits.Type = I386_ACTIVE_TSS; + + // + // Restore nested flag + // + __writeeflags(__readeflags() | EFLAGS_NESTED_TASK); + + // + // Handled, return from interrupt + // + return TRUE; + } + + // + // Unhandled: crash the system + // + return FALSE; +} + /* PUBLIC FUNCTIONS **********************************************************/ /* Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Wed Jan 6 01:40:07 2010 @@ -791,143 +791,24 @@ .globl _KiTrap2 .func KiTrap2 _KiTrap2: - // - // Don't allow any other NMIs to come in for now - // - cli // Disable interrupts - - // - // Save current state data in registers - // - mov eax, PCR[KPCR_TSS] // Save KTSS - mov ecx, PCR[KPCR_CURRENT_THREAD] // Save ETHREAD - mov edi, [ecx+KTHREAD_APCSTATE_PROCESS] // Save EPROCESS - - // - // Migrate state data to TSS - // - mov ecx, [edi+KPROCESS_DIRECTORY_TABLE_BASE] // Page Directory Table - mov [eax+KTSS_CR3], ecx // Saved in CR3 - mov cx, [edi+KPROCESS_IOPM_OFFSET] // IOPM Offset - mov [eax+KTSS_IOMAPBASE], cx // Saved in IOPM Base - mov ecx, [edi+KPROCESS_LDT_DESCRIPTOR0] // Get LDT descriptor - test ecx, ecx // Check if ne - jz 1f // Doesn't exist - mov cx, KGDT_LDT // Load LDT descriptor + // + // Call the C handler + // + stdCall _KiNmiFault, esp // Handle it in C + or al, al // Check if it got handled + jne 1f // Resume from NMI + + // + // Return from NMI + // + iretd // Interrupt return + jmp _KiTrap2 // Handle recursion 1: - mov [eax+KTSS_LDT], cx // Saved in LDT - - // - // Migrate to NMI TSS - // - push PCR[KPCR_TSS] // Save current TSS - mov eax, PCR[KPCR_GDT] // Get GDT - mov ch, [eax+KGDT_NMI_TSS+KGDT_BASE_HI] // Get High KTSS Base - mov cl, [eax+KGDT_NMI_TSS+KGDT_BASE_MID] // Get Mid KTSS Base - shl ecx, 16 // Build Top KTSS Base - mov cx, [eax+KGDT_NMI_TSS+KGDT_BASE_LOW] // Add Low KTSS Base - mov PCR[KPCR_TSS], ecx - - // - // Clear nested flag and activate the NMI TSS - // - pushf // Get EFLAGS - and dword ptr [esp], ~EFLAGS_NESTED_TASK // Clear nested task - popf // Set EFLAGS - mov ecx, PCR[KPCR_GDT] // Get GDT - lea eax, [ecx+KGDT_NMI_TSS] // Get NMI TSS - mov byte ptr [eax+5], 0x89 // DPL 0, Present, NonBusy - - // - // Build the trap frame and save it into the KPRCB - // - mov eax, [esp] // KGDT_TSS from earlier - push 0 // V86 segments - push 0 // V86 segments - push 0 // V86 segments - push 0 // V86 segments - push [eax+KTSS_SS] // TSS fields -> Trap Frame - push [eax+KTSS_ESP] // TSS fields -> Trap Frame - push [eax+KTSS_EFLAGS] // TSS fields -> Trap Frame - push [eax+KTSS_CS] // TSS fields -> Trap Frame - push [eax+KTSS_EIP] // TSS fields -> Trap Frame - push 0 // Error Code - push [eax+KTSS_EBP] // TSS fields -> Trap Frame - push [eax+KTSS_EBX] // TSS fields -> Trap Frame - push [eax+KTSS_ESI] // TSS fields -> Trap Frame - push [eax+KTSS_EDI] // TSS fields -> Trap Frame - push [eax+KTSS_FS] // TSS fields -> Trap Frame - push PCR[KPCR_EXCEPTION_LIST] // SEH Handler from KPCR - push -1 // Bogus previous mode - push [eax+KTSS_EAX] // TSS fields -> Trap Frame - push [eax+KTSS_ECX] // TSS fields -> Trap Frame - push [eax+KTSS_EDX] // TSS fields -> Trap Frame - push [eax+KTSS_DS] // TSS fields -> Trap Frame - push [eax+KTSS_ES] // TSS fields -> Trap Frame - push [eax+KTSS_GS] // TSS fields -> Trap Frame - push 0 // Debug registers - push 0 // Debug registers - push 0 // Debug registers - push 0 // Debug registers - push 0 // Debug registers - push 0 // Debug registers - push 0 // Temp - push 0 // Temp - push 0 // Debug Pointer - push 0 // Debug Marker - push [eax+KTSS_EIP] // Debug EIP - push [eax+KTSS_EBP] // Debug EBP - mov ebp, esp // Set trap frame address - stdCall _KiSaveProcessorState, ebp, 0 // Save to KPRCB CONTEXT - - // - // Call Registered NMI handlers - // - stdCall _KiHandleNmi // Call NMI handlers - or al, al // Check if any handled it - jne 1f // Resume from NMI - - // - // Call the platform driver for NMI handling (panic, etc) - // Do this with IRQL at HIGH - // - push PCR[KPCR_IRQL] // Save real IRQL - mov dword ptr PCR[KPCR_IRQL], HIGH_LEVEL // Force HIGH - stdCall _HalHandleNMI, 0 // Call the HAL - pop PCR[KPCR_IRQL] // Restore real IRQL - - // - // In certain situations, nested NMIs can corrupt the TSS, making us lose - // the original context. If this happens, we have no choice but to panic. - // -1: - mov eax, PCR[KPCR_TSS] // Get current TSS - cmp word ptr [eax], KGDT_NMI_TSS // Check who its points to - je 2f // Back to the NMI TSS crash - - // - // Otherwise, recover the original state - // - add esp, KTRAP_FRAME_LENGTH // Clear the trap frame - pop PCR[KPCR_TSS] // Restore original TSS - mov ecx, PCR[KPCR_GDT] // Get GDT - lea eax, [ecx+KGDT_TSS] // Get KTSS - mov byte ptr [eax+5], 0x8B // DPL 0, Present, Busy - pushf // Get EFLAGS - or dword ptr [esp], EFLAGS_NESTED_TASK // Set nested flags - popf // Set EFLAGS - - // - // Return from NMI - // - iretd // Interrupt return - jmp _KiTrap2 // Handle recursion -2: - // - // Crash the system - // - mov eax, EXCEPTION_NMI - jmp _KiSystemFatalException + // + // Crash the system + // + mov eax, EXCEPTION_NMI // STOP fault code + jmp _KiSystemFatalException // Bugcheck helper .endfunc .func KiTrap3
14 years, 11 months
1
0
0
0
[tkreuzer] 44970: [RTL] Merge from amd64 branch 35738, 37004, 37308, 37324, 37330, 37331, 37332, 37370, 37419, 37424, 37425, 37428, 37473, 37492, 37844, 37911, 37987, 40604, 41006, 43686, 43951, 43953, 43980, 43993, 44001, 44289, 44295, 44296, 44428, 44966, 44967, 44968 - Implement amd64 specific RTL functions: RtlLookupFunctionTable, RtlLookupFunctionEntry, RtlCaptureContext, RtlVirtualUnwind, RtlWalkFrameChain, RtlGetCallersAddress, RtlRaiseException (Timo Kreuzer) - Implement amd64 asm functi
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 6 01:39:07 2010 New Revision: 44970 URL:
http://svn.reactos.org/svn/reactos?rev=44970&view=rev
Log: [RTL] Merge from amd64 branch 35738,37004,37308,37324,37330,37331,37332,37370,37419,37424,37425,37428,37473,37492,37844,37911,37987,40604,41006,43686,43951,43953,43980,43993,44001,44289,44295,44296,44428,44966,44967,44968 - Implement amd64 specific RTL functions: RtlLookupFunctionTable, RtlLookupFunctionEntry, RtlCaptureContext, RtlVirtualUnwind, RtlWalkFrameChain, RtlGetCallersAddress, RtlRaiseException (Timo Kreuzer) - Implement amd64 asm functions: RtlCompareMemory, DebugService, RtlInterlockedPopEntrySList, RtlInterlockedPushEntrySList and RtlInterlockedFlushSList (Timo Kreuzer) - Don't use double in rtl's sprintf / swprintf, use double_t union instead. (Stefan Ginsberg) Added: trunk/reactos/lib/rtl/amd64/ (with props) trunk/reactos/lib/rtl/amd64/debug_asm.S (with props) trunk/reactos/lib/rtl/amd64/except_asm.S (with props) trunk/reactos/lib/rtl/amd64/rtlmem.S (with props) trunk/reactos/lib/rtl/amd64/slist.S (with props) trunk/reactos/lib/rtl/amd64/stubs.c (with props) trunk/reactos/lib/rtl/amd64/unwind.c (with props) Modified: trunk/reactos/lib/rtl/exception.c trunk/reactos/lib/rtl/rtl.rbuild trunk/reactos/lib/rtl/rtlp.h trunk/reactos/lib/rtl/slist.c trunk/reactos/lib/rtl/sprintf.c trunk/reactos/lib/rtl/swprintf.c Propchange: trunk/reactos/lib/rtl/amd64/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Jan 6 01:39:07 2010 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/lib/rtl/amd64/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/lib/rtl/amd64/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/lib/rtl/amd64/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/lib/rtl/amd64/debug_asm.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/debug_asm.S?…
============================================================================== --- trunk/reactos/lib/rtl/amd64/debug_asm.S (added) +++ trunk/reactos/lib/rtl/amd64/debug_asm.S [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -1,0 +1,79 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Run-Time Library + * PURPOSE: Debug Routines + * FILE: lib/rtl/i386/debug.S + * PROGRAMER: Alex Ionescu (alex(a)relsoft.net) + */ + +.intel_syntax noprefix + +/* GLOBALS ****************************************************************/ + +.globl _DbgBreakPoint +.globl _DbgBreakPointWithStatus +.globl _DbgUserBreakPoint +.globl _DebugService +.globl _DebugService2 +.globl _DbgBreakPointNoBugCheck +.globl _RtlpBreakWithStatusInstruction + +/* FUNCTIONS ***************************************************************/ + +.func DbgBreakPointNoBugCheck +_DbgBreakPointNoBugCheck: + int 3 + ret +.endfunc + +.func DbgBreakPoint +_DbgBreakPoint: +_DbgUserBreakPoint: + int 3 + ret +.endfunc + +.func DbgBreakPointWithStatus +_DbgBreakPointWithStatus: + mov eax, ecx + +_RtlpBreakWithStatusInstruction: + int 3 + ret +.endfunc + +.func DebugService2 +_DebugService2: + ret + /* Call the interrupt */ +// mov eax, [rbp+8] +// int 0x2D +// int 3 + +.endfunc + +/****************************************************************************** + * NTSTATUS NTAPI DebugService( + * IN ULONG Service, // <rcx> = [rsp + 8] + * IN PVOID Buffer, // <rdx> = [rsp + 16] + * IN ULONG Length, // <r8> = [rsp + 24] + * IN PVOID Argument1, // <r9> = [rsp + 32] + * IN PVOID Argument2); // [rsp + 40] + */ +.func DebugService +_DebugService: + + /* Prepare registers for interrupt */ + mov eax, ecx // Service + mov rcx, rdx // Buffer + mov edx, r8d // Length + mov r8, r9 // Argument1 + mov r9, [rsp + 40] // Argument2 + + /* Call the Interrupt */ + int 0x2D + int 3 + + /* Return */ + ret +.endfunc Propchange: trunk/reactos/lib/rtl/amd64/debug_asm.S ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/rtl/amd64/except_asm.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/except_asm.S…
============================================================================== --- trunk/reactos/lib/rtl/amd64/except_asm.S (added) +++ trunk/reactos/lib/rtl/amd64/except_asm.S [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -1,0 +1,100 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Runtime Library (RTL) + * FILE: lib/rtl/amd64/except_asm.S + * PURPOSE: Exception support for AMD64 + * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <ndk/asm.h> +.intel_syntax noprefix + +/* FUNCTIONS *****************************************************************/ + +/* + * VOID NTAPI + * RtlCaptureContext( + * PCONTEXT ContextRecord); <rcx> + */ +.func RtlCaptureContext +.global _RtlCaptureContext +_RtlCaptureContext: + .cfi_startproc + + /* Push rflags */ + pushfq + .cfi_adjust_cfa_offset 8 + + /* Save the basic register context */ + mov [rcx + CONTEXT_Rax], rax + mov [rcx + CONTEXT_Rcx], rcx + mov [rcx + CONTEXT_Rdx], rdx + + /* Load rflags into rax */ + mov rax, [rsp] + + mov [rcx + CONTEXT_Rbx], rbx + mov [rcx + CONTEXT_Rsi], rsi + mov [rcx + CONTEXT_Rdi], rdi + + /* Store rflags */ + mov [rcx + CONTEXT_EFlags], rax + + mov [rcx + CONTEXT_Rbp], rbp + mov [rcx + CONTEXT_R8], r8 + mov [rcx + CONTEXT_R9], r9 + + /* Load former stack pointer in rax */ + lea rax, [rsp + 0x10] + + mov [rcx + CONTEXT_R10], r10 + mov [rcx + CONTEXT_R11], r11 + mov [rcx + CONTEXT_R12], r12 + + /* Store stack pointer */ + mov [rcx + CONTEXT_Rsp], rax + + mov [rcx + CONTEXT_R13], r13 + mov [rcx + CONTEXT_R14], r14 + mov [rcx + CONTEXT_R15], r15 + + /* Load return address in rax */ + mov rax, [rsp + 8] + + /* Safe segment selectors */ + mov [rcx + CONTEXT_SegCs], cs + mov [rcx + CONTEXT_SegDs], ds + mov [rcx + CONTEXT_SegEs], es + mov [rcx + CONTEXT_SegFs], fs + mov [rcx + CONTEXT_SegGs], gs + mov [rcx + CONTEXT_SegSs], ss + + /* Store return address */ + mov [rcx + CONTEXT_Rip], rax + + /* Safe xmm registers */ + movdqa [rcx + CONTEXT_Xmm0], xmm0 + movdqa [rcx + CONTEXT_Xmm1], xmm1 + movdqa [rcx + CONTEXT_Xmm2], xmm2 + movdqa [rcx + CONTEXT_Xmm3], xmm3 + movdqa [rcx + CONTEXT_Xmm4], xmm4 + movdqa [rcx + CONTEXT_Xmm5], xmm5 + movdqa [rcx + CONTEXT_Xmm6], xmm6 + movdqa [rcx + CONTEXT_Xmm7], xmm7 + movdqa [rcx + CONTEXT_Xmm8], xmm8 + movdqa [rcx + CONTEXT_Xmm9], xmm9 + movdqa [rcx + CONTEXT_Xmm10], xmm10 + movdqa [rcx + CONTEXT_Xmm11], xmm11 + movdqa [rcx + CONTEXT_Xmm12], xmm12 + movdqa [rcx + CONTEXT_Xmm13], xmm13 + movdqa [rcx + CONTEXT_Xmm14], xmm14 + movdqa [rcx + CONTEXT_Xmm15], xmm15 + + /* Cleanup stack and return */ + add rsp, 8 + ret + .cfi_endproc +.endfunc + Propchange: trunk/reactos/lib/rtl/amd64/except_asm.S ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/rtl/amd64/rtlmem.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/rtlmem.S?rev…
============================================================================== --- trunk/reactos/lib/rtl/amd64/rtlmem.S (added) +++ trunk/reactos/lib/rtl/amd64/rtlmem.S [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -1,0 +1,78 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Run-Time Library + * PURPOSE: Memory functions for amd64 + * FILE: lib/rtl/i386/rtlswap.S + * PROGRAMER: Timo Kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include <ndk/amd64/asmmacro.S> + +/* FUNCTIONS *****************************************************************/ +.intel_syntax noprefix + +/* SIZE_T + * RtlCompareMemory( + * IN CONST VOID *Source1, <rcx> + * IN CONST VOID *Source2, <rdx> + * IN SIZE_T Length <r8> + * ); + */ +.proc RtlCompareMemory + + /* Save registers */ + push rsi + .pushreg rsi + push rdi + .pushreg rdi + + /* Setup registers for compare */ + mov rsi, rcx + mov rdi, rdx + + /* Clear direction flag */ + cli + + /* Get number of qwords */ + mov rcx, r8 + shr rcx, 3 + jz 2f + + /* Compare qwords */ + repe cmpsq + jnz 4f + +2: /* Compare rest */ + mov rcx, r8 + and rcx, 7 + jz 3f + + repe cmpsb + jnz 5f + +3: /* All equal */ + /* Return the full count */ + mov rax, rcx + jmp 6f + +4: /* Not equal after comparing qwords */ + /* Compare the last qword */ + sub rsi, 8 + sub rdi, 8 + mov rcx, 8 + repe cmpsb + +5: /* Not equal after comparing bytes */ + /* Return difference */ + sub rdi, rdx + dec rdi + mov rax, rdi + +6: /* Cleanup and return */ + pop rdi + pop rsi + ret +.endproc + Propchange: trunk/reactos/lib/rtl/amd64/rtlmem.S ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/rtl/amd64/slist.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/slist.S?rev=…
============================================================================== --- trunk/reactos/lib/rtl/amd64/slist.S (added) +++ trunk/reactos/lib/rtl/amd64/slist.S [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -1,0 +1,343 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/amd64/interlck.S + * PURPOSE: Rtl Interlocked Functions for amd64 + * PROGRAMMERS: Timo Kreuzer + */ + +#include <ndk/asm.h> +#include <ndk/amd64/asmmacro.S> +.intel_syntax noprefix + +#define SLIST8A_DEPTH_MASK 0x000000000000FFFF +#define SLIST8A_DEPTH_INC 0x0000000000000001 +#define SLIST8A_SEQUENCE_MASK 0x0000000001FF0000 +#define SLIST8A_SEQUENCE_INC 0x0000000000010000 +#define SLIST8A_NEXTENTRY_MASK 0xFFFFFFFFFE000000 +#define SLIST8A_NEXTENTRY_SHIFT 21 +#define SLIST8B_HEADERTYPE_MASK 0x0000000000000001 +#define SLIST8B_INIT_MASK 0x0000000000000002 +#define SLIST8B_REGION_MASK 0xE000000000000000 +#define SLIST8_POINTER_MASK 0x000007FFFFFFFFF0 + +#define SLIST16A_DEPTH_MASK 0x000000000000FFFF +#define SLIST16A_DEPTH_INC 0x0000000000000001 +#define SLIST16A_SEQUENCE_MASK 0xFFFFFFFFFFFF0000 +#define SLIST16A_SEQUENCE_INC 0x0000000000010000 +#define SLIST16B_HEADERTYPE_MASK 0x0000000000000001 +#define SLIST16B_INIT_MASK 0x0000000000000002 +#define SLIST16B_NEXTENTY_MASK 0xFFFFFFFFFFFFFFF0 + + +/* FUNCTIONS ****************************************************************/ + +.global _ExpInterlockedPopEntrySList +.global _ExpInterlockedPopEntrySListResume +.global _ExpInterlockedPopEntrySListFault +.global _ExpInterlockedPopEntrySListEnd +.global _ExpInterlockedPopEntrySListResume16 +.global _ExpInterlockedPopEntrySListFault16 +.global _ExpInterlockedPopEntrySListEnd16 +.global _ExpInterlockedPushEntrySList +.global _ExpInterlockedFlushSList + +/* PSLIST_ENTRY + * NTAPI + * RtlInterlockedPopEntrySList( + * IN PSLIST_HEADER ListHead); + */ +.proc RtlInterlockedPopEntrySList +_ExpInterlockedPopEntrySList: + + /* Load ListHead->Region into rdx */ + mov rdx, [rcx + 8] + + /* Load ListHead->Alignment into rax */ + mov rax, [rcx] + + /* Check what kind of header this is */ + test rdx, SLIST8B_HEADERTYPE_MASK + jnz _RtlInterlockedPopEntrySList16 + + /* We have an 8 byte header */ + +_ExpInterlockedPopEntrySListResume: + + /* Check if ListHead->NextEntry is NULL */ + mov r9, rax + and r9, SLIST8A_NEXTENTRY_MASK + jz _RtlInterlockedPopEntrySListEmpty + + /* Copy Depth and Sequence number and adjust Depth */ + lea r8, [rax - SLIST8A_DEPTH_INC] + and r8, SLIST8A_SEQUENCE_MASK | SLIST8A_DEPTH_MASK + + /* Create a pointer template from rcx in rdx */ + mov rdx, ~SLIST8_POINTER_MASK + and rdx, rcx + + /* Shift the NextEntry pointer */ + shr r9, SLIST8A_NEXTENTRY_SHIFT + + /* Combine to new pointer in rdx */ + or rdx, r9 + +_ExpInterlockedPopEntrySListFault: + + /* Load the next NextEntry pointer to r9 */ + mov r9, [rdx] + + /* Shift bits in place */ + shl r9, SLIST8A_NEXTENTRY_SHIFT + + /* Combine into r8 */ + or r8, r9 + +_ExpInterlockedPopEntrySListEnd: + + /* If [rcx] equals rax, exchange it with r8 */ + lock cmpxchg [rcx], r8 + + /* If not equal, retry with rax, being the content of [rcx] now */ + jnz _ExpInterlockedPopEntrySListResume + + /* Shift the pointer bits in place */ + and rax, SLIST8A_NEXTENTRY_MASK + shr rax, SLIST8A_NEXTENTRY_SHIFT + + /* Use rcx as pointer template */ + mov rdx, ~SLIST8_POINTER_MASK + and rdx, rcx + + /* Combine result and return */ + or rax, rdx + ret + +_RtlInterlockedPopEntrySListEmpty: + xor rax, rax + ret + +_RtlInterlockedPopEntrySList16: + /* This is a 16 byte header */ + + /* Save rbx */ + push rbx + + /* Copy rcx to r8, as we need rcx for the exchange */ + mov r8, rcx + +_ExpInterlockedPopEntrySListResume16: + + /* Check if ListHead->NextEntry is NULL */ + mov r9, rdx + and r9, SLIST16B_NEXTENTY_MASK + jz _RtlInterlockedPopEntrySListEmpty16 + +_ExpInterlockedPopEntrySListFault16: + + /* Get next pointer */ + mov rcx, [r9] + + /* Set ListHead->HeaderType = 1 and ListHead->Init = 1 */ + or rcx, 0x3 + + /* Copy Depth and Sequence number and adjust Depth */ + lea rbx, [rax - SLIST16A_DEPTH_INC] + +_ExpInterlockedPopEntrySListEnd16: + + /* If [r8] equals rdx:rax, exchange it with rcx:rbx */ + lock cmpxchg16b [r8] + + /* If not equal, retry with rdx:rax, being the content of [r8] now */ + jnz _ExpInterlockedPopEntrySListResume16 + + /* Copy the old NextEntry pointer to rax */ + mov rax, rdx + and rax, SLIST16B_NEXTENTY_MASK + + /* Return */ + pop rbx + ret + +_RtlInterlockedPopEntrySListEmpty16: + xor rax, rax + pop rbx + ret + +.endproc + + +/* PSLIST_ENTRY + * NTAPI + * RtlInterlockedPushEntrySList( + * IN PSLIST_HEADER ListHead, + * IN PSLIST_ENTRY ListEntry); + */ +.proc RtlInterlockedPushEntrySList +_ExpInterlockedPushEntrySList: + + /* Load ListHead->Alignment into rax */ + mov rax, [rcx] + + /* Load ListHead->Region into rdx */ + mov r9, [rcx + 8] + + /* Check what kind of header this is */ + test r9, SLIST8B_HEADERTYPE_MASK + jnz _RtlInterlockedPushEntrySList16 + + /* We have an 8 byte header */ + +_RtlInterlockedPushEntrySListLoop: + + /* Get ListHead->NextEntry */ + mov r8, rax + and r8, SLIST8A_NEXTENTRY_MASK + jz _RtlInterlockedPushEntrySListEmpty + + /* Shift the NextEntry pointer */ + shr r8, SLIST8A_NEXTENTRY_SHIFT + + /* Create a pointer template from rcx in rdx */ + mov r9, ~SLIST8_POINTER_MASK + and r9, rcx + + /* Combine to new pointer and save as ListEntry->NextEntry */ + or r8, r9 + +_RtlInterlockedPushEntrySListEmpty: + /* Store the NextEntry pointer in the new ListEntry */ + mov [rdx], r8 + + /* Shift and mask the new ListEntry pointer */ + mov r8, rdx + shl r8, SLIST8A_NEXTENTRY_SHIFT + and r8, SLIST8A_NEXTENTRY_MASK + + /* Copy and adjust depth and sequence number */ + lea r9, [rax + SLIST8A_DEPTH_INC + SLIST8A_SEQUENCE_INC] + and r9, SLIST8A_SEQUENCE_MASK | SLIST8A_DEPTH_MASK + + /* Combine to exchange value in r8 */ + or r8, r9 + + /* Save the NextEntry in r9 */ + mov r9, [rdx] + + /* If [rcx] equals rax, exchange it with r8 */ + lock cmpxchg [rcx], r8 + + /* If not equal, retry with rax, being the content of [rcx] now */ + jnz _RtlInterlockedPushEntrySListLoop + + /* Return the old NextEntry pointer */ + mov rax, r9 + ret + +_RtlInterlockedPushEntrySList16: + /* This is a 16 byte header */ + + /* Save rbx */ + push rbx + + /* Copy rcx/rdx to r8/r9, as we need rcx/rdx for the exchange */ + mov r8, rcx + mov r9, rdx + + /* Set ListHead->HeaderType = 1 and ListHead->Init = 1 */ + mov rcx, rdx + or rcx, 0x3 + + mov rdx, [r8 + 8] + +_RtlInterlockedPushEntrySListLoop16: + + /* Move ListHead->NextEntry to rbx */ + mov rbx, rdx + and rbx, SLIST16B_NEXTENTY_MASK + + /* Store next pointer in ListEntry->NextEntry */ + mov [r9], rbx + + /* Copy Depth and Sequence number and adjust Depth */ + lea rbx, [rax + SLIST16A_DEPTH_INC + SLIST16A_SEQUENCE_INC] + + /* If [r8] equals rdx:rax, exchange it with rcx:rbx */ + lock cmpxchg16b [r8] + + /* If not equal, retry with rdx:rax, being the content of [r8] now */ + jnz _RtlInterlockedPushEntrySListLoop16 + + /* Copy the old NextEntry pointer to rax */ + mov rax, rdx + and rax, SLIST16B_NEXTENTY_MASK + + /* Return */ + pop rbx + ret + +.endproc + +/* PSLIST_ENTRY + * NTAPI + * RtlInterlockedFlushSList( + * IN PSINGLE_LIST_ENTRY ListHead); + */ +.proc RtlInterlockedFlushSList +_ExpInterlockedFlushSList: + + /* Load ListHead->Region into rdx */ + mov rax, [rcx + 8] + + /* Check what kind of header this is */ + test rax, SLIST8B_HEADERTYPE_MASK + jnz _RtlInterlockedFlushSList16 + + /* We have an 8 byte header */ + +_RtlInterlockedFlushSListLoop: + + /* Zero ListHead->Alignment */ + xor r8, r8 + + /* If [rcx] equals rax, exchange it with r8 */ + lock cmpxchg [rcx], r8 + + /* If not equal, retry with rax, being the content of [rcx] now */ + jnz _RtlInterlockedFlushSListLoop + + /* Use rcx as pointer template */ + mov rdx, ~SLIST8_POINTER_MASK + or rdx, rcx + + /* Combine result and return */ + or rax, rdx + ret + +_RtlInterlockedFlushSList16: + /* We have a 16 byte header */ + push rbx + + mov rdx, [rcx + 8] + xor rbx, rbx + mov rcx, 0x3 + +_RtlInterlockedFlushSListLoop16: + + /* If [r8] equals rdx:rax, exchange it with rcx:rbx */ + lock cmpxchg16b [r8] + + /* If not equal, retry with rdx:rax, being the content of [r8] now */ + jnz _RtlInterlockedFlushSListLoop16 + + /* Copy the old NextEntry pointer to rax */ + mov rax, rdx + and rax, SLIST16B_NEXTENTY_MASK + + /* Return */ + pop rbx + ret + +.endproc Propchange: trunk/reactos/lib/rtl/amd64/slist.S ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/rtl/amd64/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/stubs.c?rev=…
============================================================================== --- trunk/reactos/lib/rtl/amd64/stubs.c (added) +++ trunk/reactos/lib/rtl/amd64/stubs.c [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -1,0 +1,53 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Run-Time Library + * PURPOSE: AMD64 stubs + * FILE: lib/rtl/amd64/stubs.c + * PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg(a)reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include <rtl.h> +#define NDEBUG +#include <debug.h> + +/* PUBLIC FUNCTIONS **********************************************************/ + +/* + * @unimplemented + */ +VOID +NTAPI +RtlInitializeContext(IN HANDLE ProcessHandle, + OUT PCONTEXT ThreadContext, + IN PVOID ThreadStartParam OPTIONAL, + IN PTHREAD_START_ROUTINE ThreadStartAddress, + IN PINITIAL_TEB InitialTeb) +{ + UNIMPLEMENTED; + return; +} + +/* + * @unimplemented + */ +PVOID +NTAPI +RtlpGetExceptionAddress(VOID) +{ + UNIMPLEMENTED; + return NULL; +} + +/* + * @unimplemented + */ +BOOLEAN +NTAPI +RtlDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, + IN PCONTEXT Context) +{ + UNIMPLEMENTED; + return FALSE; +} Propchange: trunk/reactos/lib/rtl/amd64/stubs.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/rtl/amd64/unwind.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/amd64/unwind.c?rev…
============================================================================== --- trunk/reactos/lib/rtl/amd64/unwind.c (added) +++ trunk/reactos/lib/rtl/amd64/unwind.c [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -1,0 +1,684 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Unwinding related functions + * PROGRAMMER: Timo Kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include <rtl.h> + +#define NDEBUG +#include <debug.h> + +#define UNWIND_HISTORY_TABLE_NONE 0 +#define UNWIND_HISTORY_TABLE_GLOBAL 1 +#define UNWIND_HISTORY_TABLE_LOCAL 2 + +#define UWOP_PUSH_NONVOL 0 +#define UWOP_ALLOC_LARGE 1 +#define UWOP_ALLOC_SMALL 2 +#define UWOP_SET_FPREG 3 +#define UWOP_SAVE_NONVOL 4 +#define UWOP_SAVE_NONVOL_FAR 5 +#define UWOP_SAVE_XMM 6 +#define UWOP_SAVE_XMM_FAR 7 +#define UWOP_SAVE_XMM128 8 +#define UWOP_SAVE_XMM128_FAR 9 +#define UWOP_PUSH_MACHFRAME 10 + +#define UNW_FLAG_NHANDLER 0 +#define UNW_FLAG_EHANDLER 1 +#define UNW_FLAG_UHANDLER 2 +#define UNW_FLAG_CHAININFO 4 + +typedef unsigned char UBYTE; + +typedef union _UNWIND_CODE +{ + struct + { + UBYTE CodeOffset; + UBYTE UnwindOp:4; + UBYTE OpInfo:4; + }; + USHORT FrameOffset; +} UNWIND_CODE, *PUNWIND_CODE; + +typedef struct _UNWIND_INFO +{ + UBYTE Version:3; + UBYTE Flags:5; + UBYTE SizeOfProlog; + UBYTE CountOfCodes; + UBYTE FrameRegister:4; + UBYTE FrameOffset:4; + UNWIND_CODE UnwindCode[1]; +/* union { + OPTIONAL ULONG ExceptionHandler; + OPTIONAL ULONG FunctionEntry; + }; + OPTIONAL ULONG ExceptionData[]; +*/ +} UNWIND_INFO, *PUNWIND_INFO; + +/* FUNCTIONS *****************************************************************/ + +/*! RtlLookupFunctionTable + * \brief Locates the table of RUNTIME_FUNCTION entries for a code address. + * \param ControlPc + * Address of the code, for which the table should be searched. + * \param ImageBase + * Pointer to a DWORD64 that receives the base address of the + * corresponding executable image. + * \param Length + * Pointer to an ULONG that receives the number of table entries + * present in the table. + */ +PRUNTIME_FUNCTION +NTAPI +RtlLookupFunctionTable( + IN DWORD64 ControlPc, + OUT PDWORD64 ImageBase, + OUT PULONG Length) +{ + PVOID Table; + ULONG Size; + + /* Find corresponding file header from code address */ + if (!RtlPcToFileHeader((PVOID)ControlPc, (PVOID*)ImageBase)) + { + /* Nothing found */ + return NULL; + } + + /* Locate the exception directory */ + Table = RtlImageDirectoryEntryToData((PVOID)*ImageBase, + TRUE, + IMAGE_DIRECTORY_ENTRY_EXCEPTION, + &Size); + + /* Return the number of entries */ + *Length = Size / sizeof(RUNTIME_FUNCTION); + + /* Return the address of the table */ + return Table; +} + +/*! RtlLookupFunctionEntry + * \brief Locates the RUNTIME_FUNCTION entry corresponding to a code address. + * \ref
http://msdn.microsoft.com/en-us/library/ms680597(VS.85).aspx
+ * \todo Implement HistoryTable + */ +PRUNTIME_FUNCTION +NTAPI +RtlLookupFunctionEntry( + IN DWORD64 ControlPc, + OUT PDWORD64 ImageBase, + OUT PUNWIND_HISTORY_TABLE HistoryTable) +{ + PRUNTIME_FUNCTION FunctionTable, FunctionEntry; + ULONG TableLength; + ULONG IndexLo, IndexHi, IndexMid; + + /* Find the corresponding table */ + FunctionTable = RtlLookupFunctionTable(ControlPc, ImageBase, &TableLength); + + /* Fail, if no table is found */ + if (!FunctionTable) + { + return NULL; + } + + /* Use relative virtual address */ + ControlPc -= *ImageBase; + + /* Do a binary search */ + IndexLo = 0; + IndexHi = TableLength; + while (IndexHi > IndexLo) + { + IndexMid = (IndexLo + IndexHi) / 2; + FunctionEntry = &FunctionTable[IndexMid]; + + if (ControlPc < FunctionEntry->BeginAddress) + { + /* Continue search in lower half */ + IndexHi = IndexMid; + } + else if (ControlPc >= FunctionEntry->EndAddress) + { + /* Continue search in upper half */ + IndexLo = IndexMid + 1; + } + else + { + /* ControlPc is within limits, return entry */ + return FunctionEntry; + } + } + + /* Nothing found, return NULL */ + return NULL; +} + +BOOLEAN +NTAPI +RtlAddFunctionTable( + IN PRUNTIME_FUNCTION FunctionTable, + IN DWORD EntryCount, + IN DWORD64 BaseAddress) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOLEAN +NTAPI +RtlDeleteFunctionTable( + IN PRUNTIME_FUNCTION FunctionTable) +{ + UNIMPLEMENTED; + return FALSE; +} + +BOOLEAN +NTAPI +RtlInstallFunctionTableCallback( + IN DWORD64 TableIdentifier, + IN DWORD64 BaseAddress, + IN DWORD Length, + IN PGET_RUNTIME_FUNCTION_CALLBACK Callback, + IN PVOID Context, + IN PCWSTR OutOfProcessCallbackDll) +{ + UNIMPLEMENTED; + return FALSE; +} + +void +FORCEINLINE +SetReg(PCONTEXT Context, BYTE Reg, DWORD64 Value) +{ + ((DWORD64*)(&Context->Rax))[Reg] = Value; +} + +DWORD64 +FORCEINLINE +GetReg(PCONTEXT Context, BYTE Reg) +{ + return ((DWORD64*)(&Context->Rax))[Reg]; +} + +void +FORCEINLINE +PopReg(PCONTEXT Context, BYTE Reg) +{ + DWORD64 Value = *(DWORD64*)Context->Rsp; + Context->Rsp += 8; + SetReg(Context, Reg, Value); +} + +/*! RtlpTryToUnwindEpilog + * \brief Helper function that tries to unwind epilog instructions. + * \return TRUE if we have been in an epilog and it could be unwound. + * FALSE if the instructions were not allowed for an epilog. + * \ref + *
http://msdn.microsoft.com/en-us/library/8ydc79k6(VS.80).aspx
+ *
http://msdn.microsoft.com/en-us/library/tawsa7cb.aspx
+ * \todo + * - Test and compare with Windows behaviour + */ +BOOLEAN +static +inline +RtlpTryToUnwindEpilog( + PCONTEXT Context, + ULONG64 ImageBase, + PRUNTIME_FUNCTION FunctionEntry) +{ + CONTEXT LocalContext; + BYTE *InstrPtr; + DWORD Instr; + BYTE Reg, Mod; + ULONG64 EndAddress; + + /* Make a local copy of the context */ + LocalContext = *Context; + + InstrPtr = (BYTE*)LocalContext.Rip; + + /* Check if first instruction of epilog is "add rsp, x" */ + Instr = *(DWORD*)InstrPtr; + if ( (Instr & 0x00fffdff) == 0x00c48148 ) + { + if ( (Instr & 0x0000ff00) == 0x8300 ) + { + /* This is "add rsp, 0x??" */ + LocalContext.Rsp += Instr >> 24; + InstrPtr += 4; + } + else + { + /* This is "add rsp, 0x???????? */ + LocalContext.Rsp += *(DWORD*)(InstrPtr + 3); + InstrPtr += 7; + } + } + /* Check if first instruction of epilog is "lea rsp, ..." */ + else if ( (Instr & 0x38fffe) == 0x208d48 ) + { + /* Get the register */ + Reg = ((Instr << 8) | (Instr >> 16)) & 0x7; + + LocalContext.Rsp = GetReg(&LocalContext, Reg); + + /* Get adressing mode */ + Mod = (Instr >> 22) & 0x3; + if (Mod == 0) + { + /* No displacement */ + InstrPtr += 3; + } + else if (Mod == 1) + { + /* 1 byte displacement */ + LocalContext.Rsp += Instr >> 24; + InstrPtr += 4; + } + else if (Mod == 2) + { + /* 4 bytes displacement */ + LocalContext.Rsp += *(DWORD*)(InstrPtr + 3); + InstrPtr += 7; + } + } + + /* Loop the following instructions */ + EndAddress = FunctionEntry->EndAddress + ImageBase; + while((DWORD64)InstrPtr < EndAddress) + { + Instr = *(DWORD*)InstrPtr; + + /* Check for a simple pop */ + if ( (Instr & 0xf8) == 0x58 ) + { + /* Opcode pops a basic register from stack */ + Reg = Instr & 0x7; + PopReg(&LocalContext, Reg); + InstrPtr++; + continue; + } + + /* Check for REX + pop */ + if ( (Instr & 0xf8fb) == 0x5841 ) + { + /* Opcode is pop r8 .. r15 */ + Reg = (Instr & 0x7) + 8; + PopReg(&LocalContext, Reg); + InstrPtr += 2; + continue; + } + + /* Check for retn / retf */ + if ( (Instr & 0xf7) == 0xc3 ) + { + /* We are finished */ + break; + } + + /* Opcode not allowed for Epilog */ + return FALSE; + } + + /* Unwind is finished, pop new Rip from Stack */ + LocalContext.Rip = *(DWORD64*)LocalContext.Rsp; + LocalContext.Rsp += sizeof(DWORD64); + + *Context = LocalContext; + return TRUE; +} + + +PEXCEPTION_ROUTINE +NTAPI +RtlVirtualUnwind( + IN ULONG HandlerType, + IN ULONG64 ImageBase, + IN ULONG64 ControlPc, + IN PRUNTIME_FUNCTION FunctionEntry, + IN OUT PCONTEXT Context, + OUT PVOID *HandlerData, + OUT PULONG64 EstablisherFrame, + IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers) +{ + PUNWIND_INFO UnwindInfo; + ULONG CodeOffset; + ULONG i; + UNWIND_CODE UnwindCode; + BYTE Reg; + + /* Use relative virtual address */ + ControlPc -= ImageBase; + + /* Sanity checks */ + if ( (ControlPc < FunctionEntry->BeginAddress) || + (ControlPc >= FunctionEntry->EndAddress) ) + { + return NULL; + } + + /* Get a pointer to the unwind info */ + UnwindInfo = RVA(ImageBase, FunctionEntry->UnwindData); + + /* Calculate relative offset to function start */ + CodeOffset = ControlPc - FunctionEntry->BeginAddress; + + /* Check if we are in the function epilog and try to finish it */ + if (CodeOffset > UnwindInfo->SizeOfProlog) + { + if (RtlpTryToUnwindEpilog(Context, ImageBase, FunctionEntry)) + { + /* There's no exception routine */ + return NULL; + } + } + + /* Skip all Ops with an offset greater than the current Offset */ + i = 0; + while (i < UnwindInfo->CountOfCodes && + CodeOffset < UnwindInfo->UnwindCode[i].CodeOffset) + { + UnwindCode = UnwindInfo->UnwindCode[i]; + switch (UnwindCode.UnwindOp) + { + case UWOP_SAVE_NONVOL: + case UWOP_SAVE_XMM: + case UWOP_SAVE_XMM128: + i += 2; + break; + + case UWOP_SAVE_NONVOL_FAR: + case UWOP_SAVE_XMM_FAR: + case UWOP_SAVE_XMM128_FAR: + i += 3; + break; + + case UWOP_ALLOC_LARGE: + i += UnwindCode.OpInfo ? 3 : 2; + break; + + default: + i++; + } + } + + /* Process the left Ops */ + while (i < UnwindInfo->CountOfCodes) + { + UnwindCode = UnwindInfo->UnwindCode[i]; + switch (UnwindCode.UnwindOp) + { + case UWOP_PUSH_NONVOL: + Reg = UnwindCode.OpInfo; + SetReg(Context, Reg, *(DWORD64*)Context->Rsp); + Context->Rsp += sizeof(DWORD64); + i++; + break; + + case UWOP_ALLOC_LARGE: + if (UnwindCode.OpInfo) + { + ULONG Offset = *(ULONG*)(&UnwindInfo->UnwindCode[i+1]); + Context->Rsp += Offset; + i += 3; + } + else + { + USHORT Offset = UnwindInfo->UnwindCode[i+1].FrameOffset; + Context->Rsp += Offset * 8; + i += 2; + } + break; + + case UWOP_ALLOC_SMALL: + Context->Rsp += (UnwindCode.OpInfo + 1) * 8; + i++; + break; + + case UWOP_SET_FPREG: + i++; + break; + + case UWOP_SAVE_NONVOL: + i += 2; + break; + + case UWOP_SAVE_NONVOL_FAR: + i += 3; + break; + + case UWOP_SAVE_XMM: + i += 2; + break; + + case UWOP_SAVE_XMM_FAR: + i += 3; + break; + + case UWOP_SAVE_XMM128: + i += 2; + break; + + case UWOP_SAVE_XMM128_FAR: + i += 3; + break; + + case UWOP_PUSH_MACHFRAME: + i += 1; + break; + } + } + + /* Unwind is finished, pop new Rip from Stack */ + Context->Rip = *(DWORD64*)Context->Rsp; + Context->Rsp += sizeof(DWORD64); + + return 0; +} + +VOID +NTAPI +RtlUnwindEx( + IN ULONG64 TargetFrame, + IN ULONG64 TargetIp, + IN PEXCEPTION_RECORD ExceptionRecord, + IN PVOID ReturnValue, + OUT PCONTEXT OriginalContext, + IN PUNWIND_HISTORY_TABLE HistoryTable) +{ + UNIMPLEMENTED; + return; +} + +VOID +NTAPI +RtlUnwind( + IN PVOID TargetFrame, + IN PVOID TargetIp, + IN PEXCEPTION_RECORD ExceptionRecord, + IN PVOID ReturnValue) +{ + UNIMPLEMENTED; + return; +} + +ULONG +NTAPI +RtlWalkFrameChain(OUT PVOID *Callers, + IN ULONG Count, + IN ULONG Flags) +{ + CONTEXT Context; + ULONG64 ControlPc, ImageBase, EstablisherFrame; + ULONG64 StackLow, StackHigh; + PVOID HandlerData; + INT i; + PRUNTIME_FUNCTION FunctionEntry; + + DPRINT("Enter RtlWalkFrameChain\n"); + + /* Capture the current Context */ + RtlCaptureContext(&Context); + ControlPc = Context.Rip; + + /* Get the stack limits */ + RtlpGetStackLimits(&StackLow, &StackHigh); + + /* Check if we want the user-mode stack frame */ + if (Flags == 1) + { + } + + /* Loop the frames */ + for (i = 0; i < Count; i++) + { + /* Lookup the FunctionEntry for the current ControlPc */ + FunctionEntry = RtlLookupFunctionEntry(ControlPc, &ImageBase, NULL); + + /* Is this a leaf function? */ + if (!FunctionEntry) + { + Context.Rip = *(DWORD64*)Context.Rsp; + Context.Rsp += sizeof(DWORD64); + DPRINT("leaf funtion, new Rip = %p, new Rsp = %p\n", (PVOID)Context.Rip, (PVOID)Context.Rsp); + } + else + { + RtlVirtualUnwind(0, + ImageBase, + ControlPc, + FunctionEntry, + &Context, + &HandlerData, + &EstablisherFrame, + NULL); + DPRINT("normal funtion, new Rip = %p, new Rsp = %p\n", (PVOID)Context.Rip, (PVOID)Context.Rsp); + } + + /* Check if new Rip is valid */ + if (!Context.Rip) + { + break; + } + + /* Check, if we have left our stack */ + if ((Context.Rsp < StackLow) || (Context.Rsp > StackHigh)) + { + break; + } + + /* Save this frame and continue with new Rip */ + ControlPc = Context.Rip; + Callers[i] = (PVOID)ControlPc; + } + + DPRINT("RtlWalkFrameChain returns %ld\n", i); + return i; +} + +/*! RtlGetCallersAddress + * \ref
http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Debug…
+ */ +#undef RtlGetCallersAddress +VOID +NTAPI +RtlGetCallersAddress( + OUT PVOID *CallersAddress, + OUT PVOID *CallersCaller ) +{ + PVOID Callers[4]; + ULONG Number; + + /* Get callers: + * RtlWalkFrameChain -> RtlGetCallersAddress -> x -> y */ + Number = RtlWalkFrameChain(Callers, 4, 0); + + if (CallersAddress) + { + *CallersAddress = (Number >= 3) ? Callers[2] : NULL; + } + if (CallersCaller) + { + *CallersCaller = (Number == 4) ? Callers[3] : NULL; + } + + return; +} + +// FIXME: move to different file +VOID +NTAPI +RtlRaiseException(IN PEXCEPTION_RECORD ExceptionRecord) +{ + CONTEXT Context; + NTSTATUS Status = STATUS_INVALID_DISPOSITION; + ULONG64 ImageBase; + PRUNTIME_FUNCTION FunctionEntry; + PVOID HandlerData; + ULONG64 EstablisherFrame; + + /* Capture the context */ + RtlCaptureContext(&Context); + + /* Get the function entry for this function */ + FunctionEntry = RtlLookupFunctionEntry(Context.Rip, + &ImageBase, + NULL); + + /* Check if we found it */ + if (FunctionEntry) + { + /* Unwind to the caller of this function */ + RtlVirtualUnwind(UNW_FLAG_NHANDLER, + ImageBase, + Context.Rip, + FunctionEntry, + &Context, + &HandlerData, + &EstablisherFrame, + NULL); + + /* Save the exception address */ + ExceptionRecord->ExceptionAddress = (PVOID)Context.Rip; + + /* Write the context flag */ + Context.ContextFlags = CONTEXT_FULL; + + /* Check if user mode debugger is active */ + if (RtlpCheckForActiveDebugger()) + { + /* Raise an exception immediately */ + Status = ZwRaiseException(ExceptionRecord, &Context, TRUE); + } + else + { + /* Dispatch the exception and check if we should continue */ + if (!RtlDispatchException(ExceptionRecord, &Context)) + { + /* Raise the exception */ + Status = ZwRaiseException(ExceptionRecord, &Context, FALSE); + } + else + { + /* Continue, go back to previous context */ + Status = ZwContinue(&Context, FALSE); + } + } + } + + /* If we returned, raise a status */ + RtlRaiseStatus(Status); +} + Propchange: trunk/reactos/lib/rtl/amd64/unwind.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/lib/rtl/exception.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/exception.c?rev=44…
============================================================================== --- trunk/reactos/lib/rtl/exception.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/exception.c [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -17,7 +17,7 @@ /* FUNCTIONS ***************************************************************/ -#if !defined(_M_IX86) +#if !defined(_M_IX86) && !defined(_M_AMD64) /* * @implemented @@ -62,6 +62,10 @@ /* If we returned, raise a status */ RtlRaiseStatus(Status); } + +#endif + +#if !defined(_M_IX86) #ifdef _MSC_VER #pragma warning(push) Modified: trunk/reactos/lib/rtl/rtl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=449…
============================================================================== --- trunk/reactos/lib/rtl/rtl.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/rtl.rbuild [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -31,6 +31,17 @@ <if property="ARCH" value="arm"> <directory name="arm"> <file>debug_asm.S</file> + </directory> + <file>mem.c</file> + <file>memgen.c</file> + </if> + <if property="ARCH" value="amd64"> + <directory name="amd64"> + <file>debug_asm.S</file> + <file>except_asm.S</file> + <file>slist.S</file> + <file>unwind.c</file> + <file>stubs.c</file> </directory> <file>mem.c</file> <file>memgen.c</file> Modified: trunk/reactos/lib/rtl/rtlp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtlp.h?rev=44970&r…
============================================================================== --- trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -32,10 +32,12 @@ #define ROUND_UP(n, align) \ ROUND_DOWN(((ULONG)n) + (align) - 1, (align)) +#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m))) + VOID NTAPI -RtlpGetStackLimits(PULONG_PTR StackBase, - PULONG_PTR StackLimit); +RtlpGetStackLimits(PULONG_PTR LowLimit, + PULONG_PTR HighLimit); PEXCEPTION_REGISTRATION_RECORD NTAPI Modified: trunk/reactos/lib/rtl/slist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/slist.c?rev=44970&…
============================================================================== --- trunk/reactos/lib/rtl/slist.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/slist.c [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -20,7 +20,10 @@ RtlInitializeSListHead(IN PSLIST_HEADER ListHead) { #ifdef _WIN64 - UNIMPLEMENTED; + ListHead->Alignment = 0; + ListHead->Region = 0; + ListHead->Header8.Init = 1; + // ListHead->Header8.HeaderType = 1; // FIXME: depending on cmpxchg16b support? #else ListHead->Alignment = 0; #endif @@ -31,8 +34,25 @@ RtlFirstEntrySList(IN const SLIST_HEADER *ListHead) { #ifdef _WIN64 - UNIMPLEMENTED; - return NULL; + if (ListHead->Header8.HeaderType) + { + return (PVOID)(ListHead->Region & ~0xF); + } + else + { + union { + PVOID P; + struct { + ULONG64 Reserved:4; + ULONG64 NextEntry:39; + ULONG64 Reserved2:21; + } Bits; + } Pointer; + + Pointer.P = (PVOID)ListHead; + Pointer.Bits.NextEntry = ListHead->Header8.NextEntry; + return Pointer.P; + } #else return ListHead->Next.Next; #endif @@ -43,8 +63,8 @@ RtlQueryDepthSList(IN PSLIST_HEADER ListHead) { #ifdef _WIN64 - UNIMPLEMENTED; - return 0; + return ListHead->Header8.HeaderType ? + ListHead->Header16.Sequence : ListHead->Header8.Sequence; #else return ListHead->Depth; #endif Modified: trunk/reactos/lib/rtl/sprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/sprintf.c?rev=4497…
============================================================================== --- trunk/reactos/lib/rtl/sprintf.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/sprintf.c [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -27,40 +27,33 @@ #define SPECIAL 32 /* 0x */ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ #define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */ -typedef struct { - unsigned int mantissal:32; - unsigned int mantissah:20; - unsigned int exponent:11; - unsigned int sign:1; +typedef union { + struct { + unsigned int mantissal:32; + unsigned int mantissah:20; + unsigned int exponent:11; + unsigned int sign:1; + }; + long long AsLongLong; } double_t; + +/* We depend on this being true */ +C_ASSERT(sizeof(double_t) == sizeof(double)); static __inline int -_isinf(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); +_isinf(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah == 0 && x.mantissal == 0 )); } static __inline int -_isnan(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 )); +_isnan(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah != 0 || x.mantissal != 0 )); } @@ -180,14 +173,13 @@ } static char * -numberf(char * buf, char * end, double num, int base, int size, int precision, int type) +numberf(char * buf, char * end, double_t num, int base, int size, int precision, int type) { char c,sign,tmp[66]; const char *digits; const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i; - long long x; /* FIXME the float version of number is direcly copy of number @@ -201,9 +193,9 @@ c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) { - if (num < 0) { + if (num.sign) { sign = '-'; - num = -num; + num.sign = 0; size--; } else if (type & PLUS) { sign = '+'; @@ -220,15 +212,11 @@ size--; } i = 0; - if (num == 0) + if (num.AsLongLong == 0) tmp[i++] = '0'; - else while (num != 0) + else while (num.AsLongLong != 0) { - x = num; - tmp[i++] = digits[do_div(&x,base)]; -#ifndef _M_ARM // Missing __floatdidf in CeGCC 0.55 -- GCC 4.4 - num=x; -#endif + tmp[i++] = digits[do_div(&num.AsLongLong,base)]; } if (i > precision) precision = i; @@ -389,7 +377,7 @@ { int len; unsigned long long num; - double _double; + double_t _double; int base; char *str, *end; @@ -600,7 +588,7 @@ case 'f': case 'g': case 'G': - _double = (double)va_arg(args, double); + _double = va_arg(args, double_t); if ( _isnan(_double) ) { s = "Nan"; len = 3; @@ -631,7 +619,7 @@ } else { if ( precision == -1 ) precision = 6; - str = numberf(str, end, (int)_double, base, field_width, precision, flags); + str = numberf(str, end, _double, base, field_width, precision, flags); } continue; Modified: trunk/reactos/lib/rtl/swprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/swprintf.c?rev=449…
============================================================================== --- trunk/reactos/lib/rtl/swprintf.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/swprintf.c [iso-8859-1] Wed Jan 6 01:39:07 2010 @@ -27,40 +27,33 @@ #define SPECIAL 32 /* 0x */ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ #define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */ -typedef struct { - unsigned int mantissal:32; - unsigned int mantissah:20; - unsigned int exponent:11; - unsigned int sign:1; +typedef union { + struct { + unsigned int mantissal:32; + unsigned int mantissah:20; + unsigned int exponent:11; + unsigned int sign:1; + }; + long long AsLongLong; } double_t; + +/* We depend on this being true */ +C_ASSERT(sizeof(double_t) == sizeof(double)); static __inline int -_isinf(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); +_isinf(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah == 0 && x.mantissal == 0 )); } static __inline int -_isnan(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 )); +_isnan(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah != 0 || x.mantissal != 0 )); } @@ -179,14 +172,13 @@ } static wchar_t * -numberf(wchar_t * buf, wchar_t * end, double num, int base, int size, int precision, int type) +numberf(wchar_t * buf, wchar_t * end, double_t num, int base, int size, int precision, int type) { wchar_t c, sign, tmp[66]; const wchar_t *digits; const wchar_t *small_digits = L"0123456789abcdefghijklmnopqrstuvwxyz"; const wchar_t *large_digits = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i; - long long x; /* FIXME the float version of number is direcly copy of number @@ -201,9 +193,9 @@ c = (type & ZEROPAD) ? L'0' : L' '; sign = 0; if (type & SIGN) { - if (num < 0) { + if (num.sign) { sign = L'-'; - num = -num; + num.sign = 0; size--; } else if (type & PLUS) { sign = L'+'; @@ -220,15 +212,11 @@ size--; } i = 0; - if (num == 0) + if (num.AsLongLong == 0) tmp[i++] = L'0'; - else while (num != 0) - { - x = num; - tmp[i++] = digits[do_div(&x,base)]; -#ifndef _M_ARM // Missing __floatdidf in CeGCC 0.55 -- GCC 4.4 - num = x; -#endif + else while (num.AsLongLong != 0) + { + tmp[i++] = digits[do_div(&num.AsLongLong,base)]; } if (i > precision) precision = i; @@ -394,7 +382,7 @@ const char *s; const wchar_t *sw; const wchar_t *ss; - double _double; + double_t _double; int flags; /* flags to number() */ @@ -597,7 +585,7 @@ case 'f': case 'g': case 'G': - _double = (double)va_arg(args, double); + _double = va_arg(args, double_t); if ( _isnan(_double) ) { ss = L"Nan";
14 years, 11 months
1
0
0
0
[dgorbachev] 44969: Fix memory leak in CreateToolhelp32Snapshot(). Bug #5096.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Wed Jan 6 00:28:16 2010 New Revision: 44969 URL:
http://svn.reactos.org/svn/reactos?rev=44969&view=rev
Log: Fix memory leak in CreateToolhelp32Snapshot(). Bug #5096. Modified: trunk/reactos/dll/win32/kernel32/misc/toolhelp.c Modified: trunk/reactos/dll/win32/kernel32/misc/toolhelp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/to…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/toolhelp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/toolhelp.c [iso-8859-1] Wed Jan 6 00:28:16 2010 @@ -98,7 +98,7 @@ if(ProcThrdInfo != NULL) { NtFreeVirtualMemory(NtCurrentProcess(), - ProcThrdInfo, + &ProcThrdInfo, &ProcThrdInfoSize, MEM_RELEASE); }
14 years, 11 months
1
0
0
0
[tkreuzer] 44968: [RTL] Patch by Stefan Ginsberg: Don't use double in rtl's sprintf / swprintf, use double_t union instead. Minor modifications by me.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 6 00:02:08 2010 New Revision: 44968 URL:
http://svn.reactos.org/svn/reactos?rev=44968&view=rev
Log: [RTL] Patch by Stefan Ginsberg: Don't use double in rtl's sprintf / swprintf, use double_t union instead. Minor modifications by me. Modified: branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c Modified: branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/r…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/rtl/sprintf.c [iso-8859-1] Wed Jan 6 00:02:08 2010 @@ -27,43 +27,35 @@ #define SPECIAL 32 /* 0x */ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ #define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */ -typedef struct { - unsigned int mantissal:32; - unsigned int mantissah:20; - unsigned int exponent:11; - unsigned int sign:1; +typedef union { + struct { + unsigned int mantissal:32; + unsigned int mantissah:20; + unsigned int exponent:11; + unsigned int sign:1; + }; + long long AsLongLong; } double_t; -#if 0 +/* We depend on this being true */ +C_ASSERT(sizeof(double_t) == sizeof(double)); + static __inline int -_isinf(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); +_isinf(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah == 0 && x.mantissal == 0 )); } static __inline int -_isnan(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 )); -} -#endif +_isnan(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah != 0 || x.mantissal != 0 )); +} + static __inline @@ -180,16 +172,14 @@ return buf; } -#if 0 static char * -numberf(char * buf, char * end, double num, int base, int size, int precision, int type) +numberf(char * buf, char * end, double_t num, int base, int size, int precision, int type) { char c,sign,tmp[66]; const char *digits; const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i; - long long x; /* FIXME the float version of number is direcly copy of number @@ -203,9 +193,9 @@ c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) { - if (num < 0) { + if (num.sign) { sign = '-'; - num = -num; + num.sign = 0; size--; } else if (type & PLUS) { sign = '+'; @@ -222,15 +212,11 @@ size--; } i = 0; - if (num == 0) + if (num.AsLongLong == 0) tmp[i++] = '0'; - else while (num != 0) + else while (num.AsLongLong != 0) { - x = num; - tmp[i++] = digits[do_div(&x,base)]; -#ifndef _M_ARM // Missing __floatdidf in CeGCC 0.55 -- GCC 4.4 - num=x; -#endif + tmp[i++] = digits[do_div(&num.AsLongLong,base)]; } if (i > precision) precision = i; @@ -285,7 +271,6 @@ } return buf; } -#endif static char* string(char* buf, char* end, const char* s, int len, int field_width, int precision, int flags) @@ -392,7 +377,7 @@ { int len; unsigned long long num; -// double _double; + double_t _double; int base; char *str, *end; @@ -597,14 +582,13 @@ } continue; -#if 0 /* float number formats - set up the flags and "break" */ case 'e': case 'E': case 'f': case 'g': case 'G': - _double = (double)va_arg(args, double); + _double = va_arg(args, double_t); if ( _isnan(_double) ) { s = "Nan"; len = 3; @@ -635,11 +619,11 @@ } else { if ( precision == -1 ) precision = 6; - str = numberf(str, end, (int)_double, base, field_width, precision, flags); + str = numberf(str, end, _double, base, field_width, precision, flags); } continue; -#endif + /* integer number formats - set up the flags and "break" */ case 'o': Modified: branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/r…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/rtl/swprintf.c [iso-8859-1] Wed Jan 6 00:02:08 2010 @@ -27,42 +27,35 @@ #define SPECIAL 32 /* 0x */ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ #define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */ -typedef struct { - unsigned int mantissal:32; - unsigned int mantissah:20; - unsigned int exponent:11; - unsigned int sign:1; +typedef union { + struct { + unsigned int mantissal:32; + unsigned int mantissah:20; + unsigned int exponent:11; + unsigned int sign:1; + }; + long long AsLongLong; } double_t; -#if 0 + +/* We depend on this being true */ +C_ASSERT(sizeof(double_t) == sizeof(double)); + static __inline int -_isinf(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); +_isinf(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah == 0 && x.mantissal == 0 )); } static __inline int -_isnan(double __x) -{ - union - { - double* __x; - double_t* x; - } x; - x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 )); -} -#endif +_isnan(double_t x) +{ + return ( x.exponent == 0x7ff && ( x.mantissah != 0 || x.mantissal != 0 )); +} + static __inline @@ -178,16 +171,14 @@ return buf; } -#if 0 static wchar_t * -numberf(wchar_t * buf, wchar_t * end, double num, int base, int size, int precision, int type) +numberf(wchar_t * buf, wchar_t * end, double_t num, int base, int size, int precision, int type) { wchar_t c, sign, tmp[66]; const wchar_t *digits; const wchar_t *small_digits = L"0123456789abcdefghijklmnopqrstuvwxyz"; const wchar_t *large_digits = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i; - long long x; /* FIXME the float version of number is direcly copy of number @@ -202,9 +193,9 @@ c = (type & ZEROPAD) ? L'0' : L' '; sign = 0; if (type & SIGN) { - if (num < 0) { + if (num.sign) { sign = L'-'; - num = -num; + num.sign = 0; size--; } else if (type & PLUS) { sign = L'+'; @@ -221,15 +212,11 @@ size--; } i = 0; - if (num == 0) + if (num.AsLongLong == 0) tmp[i++] = L'0'; - else while (num != 0) - { - x = num; - tmp[i++] = digits[do_div(&x,base)]; -#ifndef _M_ARM // Missing __floatdidf in CeGCC 0.55 -- GCC 4.4 - num = x; -#endif + else while (num.AsLongLong != 0) + { + tmp[i++] = digits[do_div(&num.AsLongLong,base)]; } if (i > precision) precision = i; @@ -284,7 +271,6 @@ } return buf; } -#endif static wchar_t* string(wchar_t* buf, wchar_t* end, const char* s, int len, int field_width, int precision, int flags) @@ -395,10 +381,8 @@ wchar_t * str, * end; const char *s; const wchar_t *sw; -#if 0 const wchar_t *ss; - double _double; -#endif + double_t _double; int flags; /* flags to number() */ @@ -595,14 +579,13 @@ *ip = (str - buf); } continue; -#if 0 /* float number formats - set up the flags and "break" */ case 'e': case 'E': case 'f': case 'g': case 'G': - _double = (double)va_arg(args, double); + _double = va_arg(args, double_t); if ( _isnan(_double) ) { ss = L"Nan"; @@ -638,7 +621,7 @@ } continue; -#endif + /* integer number formats - set up the flags and "break" */
14 years, 11 months
1
0
0
0
[tkreuzer] 44967: revert changes to exception.x from 44966
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 5 23:58:45 2010 New Revision: 44967 URL:
http://svn.reactos.org/svn/reactos?rev=44967&view=rev
Log: revert changes to exception.x from 44966 Modified: branches/ros-amd64-bringup/reactos/lib/rtl/exception.c Modified: branches/ros-amd64-bringup/reactos/lib/rtl/exception.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/r…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/rtl/exception.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/rtl/exception.c [iso-8859-1] Tue Jan 5 23:58:45 2010 @@ -17,7 +17,7 @@ /* FUNCTIONS ***************************************************************/ -#if !defined(_M_IX86) +#if !defined(_M_IX86) && !defined(_M_AMD64) /* * @implemented @@ -62,6 +62,10 @@ /* If we returned, raise a status */ RtlRaiseStatus(Status); } + +#endif + +#if !defined(_M_IX86) #ifdef _MSC_VER #pragma warning(push)
14 years, 11 months
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
53
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200