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
July 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
27 participants
605 discussions
Start a n
N
ew thread
[fireball] 42270: Giannis Adamopoulos - Bring in mouse pointer functions to engpoint.c from trunk. - Implement kernelmode part of mouse cursor support.
by fireball@svn.reactos.org
Author: fireball Date: Tue Jul 28 16:12:29 2009 New Revision: 42270 URL:
http://svn.reactos.org/svn/reactos?rev=42270&view=rev
Log: Giannis Adamopoulos - Bring in mouse pointer functions to engpoint.c from trunk. - Implement kernelmode part of mouse cursor support. Added: branches/arwinss/reactos/subsystems/win32/win32k/gre/cursoricon.c (with props) branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h (with props) branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c (with props) Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -12,35 +12,399 @@ #define NDEBUG #include <debug.h> +#define TAG_MOUSE TAG('M', 'O', 'U', 'S') /* mouse */ +#define GDIDEV(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev)) + /* PUBLIC FUNCTIONS **********************************************************/ +GDIPOINTER Pointer; +POINTL ptlPointer; + VOID -APIENTRY +IntHideMousePointer( + PDEVOBJ *ppdev, + SURFOBJ *psoDest) +{ + GDIPOINTER *pgp; + POINTL pt; + RECTL rclDest; + POINTL ptlSave; + + ASSERT(ppdev); + ASSERT(psoDest); + + pgp = &Pointer; + + if (!pgp->Enabled) + { + return; + } + + pgp->Enabled = FALSE; + + if (!pgp->psurfSave) + { + return; + } + + /* Calculate cursor coordinates */ + pt.x = ptlPointer.x - pgp->HotSpot.x; + pt.y = ptlPointer.y - pgp->HotSpot.y; + + rclDest.left = max(pt.x, 0); + rclDest.top = max(pt.y, 0); + rclDest.right = min(pt.x + pgp->Size.cx, psoDest->sizlBitmap.cx); + rclDest.bottom = min(pt.y + pgp->Size.cy, psoDest->sizlBitmap.cy); + + ptlSave.x = rclDest.left - pt.x; + ptlSave.y = rclDest.top - pt.y; + + GrepBitBltEx(psoDest, + pgp->psurfSave, + NULL, + NULL, + NULL, + &rclDest, + &ptlSave, + &ptlSave, + NULL, + NULL, + ROP3_TO_ROP4(SRCCOPY), + FALSE); +} + +VOID +IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest) +{ + GDIPOINTER *pgp; + POINTL pt; + RECTL rclSurf, rclPointer; + + ASSERT(ppdev); + ASSERT(psoDest); + + + pgp = &Pointer; + + if (pgp->Enabled) + { + return; + } + + pgp->Enabled = TRUE; + + /* Calculate pointer coordinates */ + pt.x = ptlPointer.x - pgp->HotSpot.x; + pt.y = ptlPointer.y - pgp->HotSpot.y; + + /* Calculate the rect on the surface */ + rclSurf.left = max(pt.x, 0); + rclSurf.top = max(pt.y, 0); + rclSurf.right = min(pt.x + pgp->Size.cx, psoDest->sizlBitmap.cx); + rclSurf.bottom = min(pt.y + pgp->Size.cy, psoDest->sizlBitmap.cy); + + /* Calculate the rect in the pointer bitmap */ + rclPointer.left = rclSurf.left - pt.x; + rclPointer.top = rclSurf.top - pt.y; + rclPointer.right = min(pgp->Size.cx, psoDest->sizlBitmap.cx - pt.x); + rclPointer.bottom = min(pgp->Size.cy, psoDest->sizlBitmap.cy - pt.y); + + /* Copy the pixels under the cursor to temporary surface. */ + GrepBitBltEx(pgp->psurfSave, + psoDest, + NULL, + NULL, + NULL, + &rclPointer, + (POINTL*)&rclSurf, + NULL, + NULL, + NULL, + ROP3_TO_ROP4(SRCCOPY), + FALSE); + + /* Blt the pointer on the screen. */ + if (pgp->psurfColor) + { + GrepBitBltEx(psoDest, + pgp->psurfColor, + pgp->psurfMask, + NULL, + pgp->XlateObject, + &rclSurf, + (POINTL*)&rclPointer, + (POINTL*)&rclPointer, + NULL, + NULL, + R4_MASK, + FALSE); + } + else + { + GrepBitBltEx(psoDest, + pgp->psurfMask, + NULL, + NULL, + pgp->XlateObject, + &rclSurf, + (POINTL*)&rclPointer, + NULL, + NULL, + NULL, + ROP3_TO_ROP4(SRCAND), + FALSE); + + rclPointer.top += pgp->Size.cy; + + GrepBitBltEx(psoDest, + pgp->psurfMask, + NULL, + NULL, + pgp->XlateObject, + &rclSurf, + (POINTL*)&rclPointer, + NULL, + NULL, + NULL, + ROP3_TO_ROP4(SRCINVERT), + FALSE); + } +} + +/* + * @implemented + */ +ULONG APIENTRY +EngSetPointerShape( + IN SURFOBJ *pso, + IN SURFOBJ *psoMask, + IN SURFOBJ *psoColor, + IN XLATEOBJ *pxlo, + IN LONG xHot, + IN LONG yHot, + IN LONG x, + IN LONG y, + IN RECTL *prcl, + IN FLONG fl) +{ + PDEVOBJ *ppdev; + GDIPOINTER *pgp; + PBYTE Bits; + SIZEL Size; + LONG lDelta; + HBITMAP hbmp; + + ASSERT(pso); + + ppdev = GDIDEV(pso); + pgp = &Pointer; + + IntHideMousePointer(ppdev, pso); + + if (pgp->psurfColor) + { + /* FIXME: let GDI allocate/free memory */ + EngFreeMem(pgp->psurfColor->pvBits); + pgp->psurfColor->pvBits = 0; + + EngDeleteSurface(pgp->psurfColor->hsurf); + //SURFACE_ShareUnlockSurface(pgp->psurfColor); + pgp->psurfColor = NULL; + } + + if (pgp->psurfMask) + { + /* FIXME: let GDI allocate/free memory */ + EngFreeMem(pgp->psurfMask->pvBits); + pgp->psurfMask->pvBits = 0; + + EngDeleteSurface(pgp->psurfMask->hsurf); + //SURFACE_ShareUnlockSurface(pgp->psurfMask); + pgp->psurfMask = NULL; + } + + if (pgp->psurfSave != NULL) + { + EngDeleteSurface(pgp->psurfSave->hsurf); + //SURFACE_ShareUnlockSurface(pgp->psurfSave); + pgp->psurfSave = NULL; + } + + if (pgp->XlateObject != NULL) + { + EngDeleteXlate(pgp->XlateObject); + pgp->XlateObject = NULL; + } + + /* See if we are being asked to hide the pointer. */ + if (psoMask == NULL) + { + return SPS_ACCEPT_NOEXCLUDE; + } + + pgp->HotSpot.x = xHot; + pgp->HotSpot.y = yHot; + + if (x != -1) + { + ptlPointer.x = x; + ptlPointer.y = y; + } + + pgp->Size.cx = abs(psoMask->lDelta) << 3; + pgp->Size.cy = (psoMask->cjBits / abs(psoMask->lDelta)) >> 1; + + if (psoColor != NULL) + { + /* FIXME: let GDI allocate/free memory */ + Bits = EngAllocMem(0, psoColor->cjBits, TAG_MOUSE); + if (Bits == NULL) + { + return SPS_ERROR; + } + + memcpy(Bits, psoColor->pvBits, psoColor->cjBits); + + hbmp = EngCreateBitmap(pgp->Size, + psoColor->lDelta, + psoColor->iBitmapFormat, + psoColor->lDelta < 0 ? 0 : BMF_TOPDOWN, + Bits); + + pgp->psurfColor = EngLockSurface(hbmp); + } + else + { + pgp->psurfColor = NULL; + } + + Size.cx = pgp->Size.cx; + Size.cy = pgp->Size.cy << 1; + Bits = EngAllocMem(0, psoMask->cjBits, TAG_MOUSE); + if (Bits == NULL) + { + return SPS_ERROR; + } + + memcpy(Bits, psoMask->pvBits, psoMask->cjBits); + + hbmp = EngCreateBitmap(Size, + psoMask->lDelta, + psoMask->iBitmapFormat, + psoMask->lDelta < 0 ? 0 : BMF_TOPDOWN, + Bits); + + pgp->psurfMask = EngLockSurface(hbmp); + + /* Create an XLATEOBJ that will be used for drawing masks. + * FIXME: We should get this in pxlo parameter! */ + if (pxlo == NULL) + { + HPALETTE BWPalette, DestPalette; + ULONG BWColors[] = {0, 0xFFFFFF}; + + BWPalette = EngCreatePalette(PAL_INDEXED, sizeof(BWColors) / sizeof(ULONG), + BWColors, 0, 0, 0); + + DestPalette = ppdev->DevInfo.hpalDefault; + pgp->XlateObject = IntEngCreateXlate(0, 0, + DestPalette, BWPalette); + EngDeletePalette(BWPalette); + } + else + { + pgp->XlateObject = pxlo; + } + + /* Create surface for saving the pixels under the cursor. */ + switch (pso->iBitmapFormat) + { + case BMF_1BPP: + lDelta = pgp->Size.cx >> 3; + break; + case BMF_4BPP: + lDelta = pgp->Size.cx >> 1; + break; + case BMF_8BPP: + lDelta = pgp->Size.cx; + break; + case BMF_16BPP: + lDelta = pgp->Size.cx << 1; + break; + case BMF_24BPP: + lDelta = pgp->Size.cx * 3; + break; + case BMF_32BPP: + lDelta = pgp->Size.cx << 2; + break; + default: + lDelta = 0; + break; + } + + hbmp = EngCreateBitmap(pgp->Size, + lDelta, + pso->iBitmapFormat, + BMF_TOPDOWN | BMF_NOZEROINIT, + NULL); + + pgp->psurfSave = EngLockSurface(hbmp); + + if (x != -1) + { + IntShowMousePointer(ppdev, pso); + + if (prcl != NULL) + { + prcl->left = x - pgp->HotSpot.x; + prcl->top = y - pgp->HotSpot.x; + prcl->right = prcl->left + pgp->Size.cx; + prcl->bottom = prcl->top + pgp->Size.cy; + } + } else if (prcl != NULL) + prcl->left = prcl->top = prcl->right = prcl->bottom = -1; + + return SPS_ACCEPT_NOEXCLUDE; +} + +/* + * @implemented + */ + +VOID APIENTRY EngMovePointer( - IN SURFOBJ *pso, - IN LONG x, - IN LONG y, - IN RECTL *prcl) + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN RECTL *prcl) { - UNIMPLEMENTED; -} - -ULONG -APIENTRY -EngSetPointerShape( - IN SURFOBJ *pso, - IN SURFOBJ *psoMask, - IN SURFOBJ *psoColor, - IN XLATEOBJ *pxlo, - IN LONG xHot, - IN LONG yHot, - IN LONG x, - IN LONG y, - IN RECTL *prcl, - IN FLONG fl) -{ - UNIMPLEMENTED; - return 0; + PDEVOBJ *ppdev; + GDIPOINTER *pgp; + + ASSERT(pso); + + ppdev = GDIDEV(pso); + ASSERT(ppdev); + + pgp = &Pointer; + + IntHideMousePointer(ppdev, pso); + + ptlPointer.x = x; + ptlPointer.y = y; + + if (x != -1) + { + IntShowMousePointer(ppdev, pso); + if (prcl != NULL) + { + prcl->left = x - pgp->HotSpot.x; + prcl->top = y - pgp->HotSpot.x; + prcl->right = prcl->left + pgp->Size.cx; + prcl->bottom = prcl->top + pgp->Size.cy; + } + } else if (prcl != NULL) + prcl->left = prcl->top = prcl->right = prcl->bottom = -1; } BOOL Added: branches/arwinss/reactos/subsystems/win32/win32k/gre/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/cursoricon.c (added) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/cursoricon.c [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -1,0 +1,220 @@ +/* + * PROJECT: ReactOS Win32K + * LICENSE: LGPL - See COPYING in the top level directory + * FILE: subsystems/win32/win32k/gre/cursoricon.c + * PURPOSE: ReactOS cursor support routines + * PROGRAMMERS: Giannis Adamopoulos + */ + +#include <win32k.h> +#define NDEBUG +#include <debug.h> + +extern PDEVOBJ PrimarySurface; + +VOID NTAPI +GreMovePointer( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN RECTL *prcl) +{ + SURFACE_LockBitmapBits(pso); + GDIDEVFUNCS(pso).MovePointer(pso, x, y, prcl); + SURFACE_UnlockBitmapBits(pso); +} + + +ULONG NTAPI +GreSetPointerShape( + IN SURFOBJ *pso, + IN SURFOBJ *psoMask, + IN SURFOBJ *psoColor, + IN XLATEOBJ *pxlo, + IN LONG xHot, + IN LONG yHot, + IN LONG x, + IN LONG y, + IN RECTL *prcl, + IN FLONG fl) +{ + ULONG ulResult = SPS_DECLINE; + PFN_DrvSetPointerShape pfnSetPointerShape; + PPDEVOBJ ppdev = &PrimarySurface; + + pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape; + + SURFACE_LockBitmapBits(pso); + if (pfnSetPointerShape) + { + ulResult = pfnSetPointerShape(pso, + psoMask, + psoColor, + pxlo, + xHot, + yHot, + x, + y, + prcl, + fl); + } + + /* Check if the driver accepted it */ + if (ulResult == SPS_ACCEPT_NOEXCLUDE) + { + /* Set MovePointer to the driver function */ + ppdev->pfnMovePointer = GDIDEVFUNCS(pso).MovePointer; + } + else + { + /* Set software pointer */ + ulResult = EngSetPointerShape(pso, + psoMask, + psoColor, + pxlo, + xHot, + yHot, + x, + y, + prcl, + fl); + /* Set MovePointer to the eng function */ + ppdev->pfnMovePointer = EngMovePointer; + } + + SURFACE_UnlockBitmapBits(pso); + + return ulResult; +} + + + +BOOL +NTAPI +GreSetCursor(ICONINFO* NewCursor, PSYSTEM_CURSORINFO CursorInfo) +{ + SURFOBJ *pso; + SURFOBJ *MaskBmpObj = NULL; + HBITMAP hMask = 0; + SURFOBJ *soMask = NULL, *soColor = NULL; + XLATEOBJ *XlateObj = NULL; + ULONG Status; + + pso = EngLockSurface(PrimarySurface.pSurface); + + if (!NewCursor) + { + if (CursorInfo->ShowingCursor) + { + DPRINT("Removing pointer!\n"); + /* Remove the cursor if it was displayed */ + GreMovePointer(pso, -1, -1, NULL); + } + + CursorInfo->ShowingCursor = 0; + + EngUnlockSurface(pso); + + return TRUE; + } + + MaskBmpObj = EngLockSurface((HSURF)NewCursor->hbmMask); + if (MaskBmpObj) + { + const int maskBpp = BitsPerFormat(MaskBmpObj->iBitmapFormat); + EngUnlockSurface(MaskBmpObj); + if (maskBpp != 1) + { + DPRINT1("SetCursor: The Mask bitmap must have 1BPP!\n"); + EngUnlockSurface(pso); + return FALSE; + } + + if ((PrimarySurface.DevInfo.flGraphicsCaps2 & GCAPS2_ALPHACURSOR) && + pso->iBitmapFormat >= BMF_16BPP && + pso->iBitmapFormat <= BMF_32BPP) + { + /* FIXME - Create a color pointer, only 32bit bitmap, set alpha bits! + Do not pass a mask bitmap to DrvSetPointerShape()! + Create a XLATEOBJ that describes the colors of the bitmap. */ + DPRINT1("SetCursor: (Colored) alpha cursors are not supported!\n"); + } + else + { + if(NewCursor->hbmColor) + { + /* FIXME - Create a color pointer, create only one 32bit bitmap! + Do not pass a mask bitmap to DrvSetPointerShape()! + Create a XLATEOBJ that describes the colors of the bitmap. + (16bit bitmaps are propably allowed) */ + DPRINT1("SetCursor: Cursors with colors are not supported!\n"); + } + else + { + MaskBmpObj = EngLockSurface((HSURF)NewCursor->hbmMask); + if(MaskBmpObj) + { + RECTL DestRect = {0, 0, MaskBmpObj->sizlBitmap.cx, MaskBmpObj->sizlBitmap.cy}; + POINTL SourcePoint = {0, 0}; + + /* + * NOTE: For now we create the cursor in top-down bitmap, + * because VMware driver rejects it otherwise. This should + * be fixed later. + */ + hMask = EngCreateBitmap( + MaskBmpObj->sizlBitmap, abs(MaskBmpObj->lDelta), + MaskBmpObj->iBitmapFormat, BMF_TOPDOWN, + NULL); + if ( !hMask ) + { + EngUnlockSurface(MaskBmpObj); + EngUnlockSurface(pso); + return FALSE; + } + soMask = EngLockSurface((HSURF)hMask); + EngCopyBits(soMask, MaskBmpObj, NULL, NULL, + &DestRect, &SourcePoint); + EngUnlockSurface(MaskBmpObj); + } + } + } + CursorInfo->ShowingCursor = TRUE; + CursorInfo->CurrentCursorObject = *NewCursor; + } + else + { + CursorInfo->ShowingCursor = FALSE; + } + + Status = GreSetPointerShape(pso, + soMask, + soColor, + XlateObj, + NewCursor->xHotspot, + NewCursor->yHotspot, + CursorInfo->CursorPos.x, + CursorInfo->CursorPos.y, + NULL, + SPS_CHANGE); + + if (Status != SPS_ACCEPT_NOEXCLUDE) + { + DPRINT1("GreSetPointerShape returned %lx\n", Status); + } + + if(hMask) + { + EngUnlockSurface(soMask); + EngDeleteSurface((HSURF)hMask); + } + if(XlateObj) + { + EngDeleteXlate(XlateObj); + } + + EngUnlockSurface(pso); + + return TRUE; +} + Propchange: branches/arwinss/reactos/subsystems/win32/win32k/gre/cursoricon.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h (added) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -1,0 +1,22 @@ + +typedef struct _SYSTEM_CURSORINFO +{ + BOOL Enabled; + RECT ClipRect; + BOOL IsClipped; + ICONINFO CurrentCursorObject; + BOOL ShowingCursor; + POINT CursorPos; +} SYSTEM_CURSORINFO, *PSYSTEM_CURSORINFO; + +typedef struct _GDIPOINTER +{ + BOOL Enabled; + SIZEL Size; + POINTL HotSpot; + XLATEOBJ *XlateObject; + SURFOBJ *psurfColor; + SURFOBJ *psurfMask; + SURFOBJ *psurfSave; + RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */ +} GDIPOINTER, *PGDIPOINTER; Propchange: branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -212,5 +212,15 @@ BRUSHOBJ* pbo, LONG x, LONG y, LONG deltax, LONG deltay, POINTL* Translate); +BOOL NTAPI +GreSetCursor(ICONINFO* NewCursor, PSYSTEM_CURSORINFO CursorInfo); + +VOID NTAPI +GreMovePointer( + SURFOBJ *pso, + LONG x, + LONG y, + RECTL *prcl); + #endif Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -46,6 +46,7 @@ #include <floatobj.h> #include <xformobj.h> #include <xlateobj.h> +#include <cursor.h> #include <gre.h> #include "winesup.h" Added: branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c (added) +++ branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -1,0 +1,135 @@ +/* + * PROJECT: ReactOS Win32K + * LICENSE: LGPL - See COPYING in the top level directory + * FILE: subsystems/win32/win32k/main/cursor.c + * PURPOSE: ReactOS cursor support routines + * PROGRAMMERS: Giannis Adamopoulos + */ + +#include <win32k.h> +#define NDEBUG +#include <debug.h> + +static SYSTEM_CURSORINFO CursorInfo; + +extern PDEVOBJ PrimarySurface; + +BOOL +APIENTRY +RosUserGetCursorPos(LPPOINT pt) +{ + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForWrite(pt, sizeof(POINT), 1); + *pt = CursorInfo.CursorPos; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + return NT_SUCCESS(Status); +} + +static void NTAPI clip_point_to_rect(LPCRECT rect, LPPOINT pt) +{ + if (pt->x < rect->left) pt->x = rect->left; + else if (pt->x >= rect->right) pt->x = rect->right - 1; + if (pt->y < rect->top) pt->y = rect->top; + else if (pt->y >= rect->bottom) pt->y = rect->bottom - 1; +} + +BOOL +APIENTRY +RosUserSetCursorPos(INT x, INT y) +{ + POINT pos; + SURFOBJ *pso; + + pos.x = x; + pos.y = y; + + if(CursorInfo.IsClipped) + { + clip_point_to_rect(&CursorInfo.ClipRect, &pos); + } + + if (CursorInfo.ShowingCursor) + { + pso = EngLockSurface(PrimarySurface.pSurface); + GreMovePointer(pso, pos.x, pos.y, NULL); + EngUnlockSurface(pso); + } + + CursorInfo.CursorPos = pos; + + return TRUE; +} + +BOOL +APIENTRY +RosUserClipCursor( LPCRECT UnsafeRect ) +{ + NTSTATUS Status = STATUS_SUCCESS; + RECT Rect; + + if (!UnsafeRect) + { + CursorInfo.IsClipped = FALSE; + return TRUE; + } + + _SEH2_TRY + { + ProbeForRead(UnsafeRect, sizeof(RECT), 1); + RtlCopyMemory(&Rect, UnsafeRect , sizeof(RECT)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + + CursorInfo.IsClipped = TRUE; + CursorInfo.ClipRect = Rect; + + RosUserSetCursorPos(CursorInfo.CursorPos.x, CursorInfo.CursorPos.y); + + return TRUE; +} + +VOID +APIENTRY +RosUserSetCursor( ICONINFO* IconInfoUnsafe ) +{ + ICONINFO IconInfo; + NTSTATUS Status = STATUS_SUCCESS; + + _SEH2_TRY + { + ProbeForRead(IconInfoUnsafe, sizeof(ICONINFO), 1); + RtlCopyMemory(&IconInfo, IconInfoUnsafe , sizeof(ICONINFO)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (NT_SUCCESS(Status)) + { + IconInfo.hbmMask = GDI_MapUserHandle(IconInfo.hbmMask); + IconInfo.hbmColor = GDI_MapUserHandle(IconInfo.hbmColor); + GreSetCursor(&IconInfo, &CursorInfo); + } +} + Propchange: branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -61,4 +61,8 @@ RosGdiRoundRect 7 RosGdiSwapBuffers 1 RosGdiUnrealizePalette 1 -RosUserConnectCsrss 0 +RosUserConnectCsrss 0 +RosUserGetCursorPos 1 +RosUserSetCursorPos 2 +RosUserClipCursor 1 +RosUserSetCursor 1 Modified: branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Tue Jul 28 16:12:29 2009 @@ -106,12 +106,14 @@ <file>surfobj.c</file> <file>xformobj.c</file> <file>xlateobj.c</file> + <file>cursoricon.c</file> </directory> <directory name="main"> <file>csr.c</file> <file>err.c</file> <file>init.c</file> <file>usrheap.c</file> + <file>cursor.c</file> </directory> <directory name="wine"> <file>atom.c</file>
15 years, 4 months
1
0
0
0
[fireball] 42269: - Add declarations of cursor related RosUser APIs.
by fireball@svn.reactos.org
Author: fireball Date: Tue Jul 28 16:10:13 2009 New Revision: 42269 URL:
http://svn.reactos.org/svn/reactos?rev=42269&view=rev
Log: - Add declarations of cursor related RosUser APIs. Modified: branches/arwinss/reactos/include/reactos/win32k/rosuser.h Modified: branches/arwinss/reactos/include/reactos/win32k/rosuser.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/reactos…
============================================================================== --- branches/arwinss/reactos/include/reactos/win32k/rosuser.h [iso-8859-1] (original) +++ branches/arwinss/reactos/include/reactos/win32k/rosuser.h [iso-8859-1] Tue Jul 28 16:10:13 2009 @@ -37,6 +37,18 @@ ); #endif +BOOL NTAPI +RosUserGetCursorPos( LPPOINT pt ); + +BOOL NTAPI +RosUserSetCursorPos( INT x, INT y ); + +BOOL NTAPI +RosUserClipCursor( LPCRECT clip ); + +void NTAPI +RosUserSetCursor( ICONINFO* IconInfo ); + VOID NTAPI RosUserConnectCsrss();
15 years, 4 months
1
0
0
0
[janderwald] 42268: - Implement KsGetObjectFromFileObject, KsGetObjectFromFileObject, KsGetObjectTypeFromIrp, KsGetParent
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jul 28 15:52:57 2009 New Revision: 42268 URL:
http://svn.reactos.org/svn/reactos?rev=42268&view=rev
Log: - Implement KsGetObjectFromFileObject, KsGetObjectFromFileObject, KsGetObjectTypeFromIrp, KsGetParent Modified: trunk/reactos/drivers/ksfilter/ks/api.c trunk/reactos/drivers/ksfilter/ks/device.c trunk/reactos/drivers/ksfilter/ks/filter.c trunk/reactos/drivers/ksfilter/ks/filterfactory.c trunk/reactos/drivers/ksfilter/ks/kstypes.h trunk/reactos/drivers/ksfilter/ks/misc.c Modified: trunk/reactos/drivers/ksfilter/ks/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/api.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] Tue Jul 28 15:52:57 2009 @@ -512,6 +512,11 @@ /* initialize create item list */ InitializeListHead(&Header->ItemList); + + /* initialize basic header */ + Header->BasicHeader.Type = KsObjectTypeDevice; + Header->BasicHeader.KsDevice = &Header->KsDevice; + Header->BasicHeader.Parent.KsDevice = &Header->KsDevice; /* are there any create items provided */ if (ItemsCount && ItemsList) Modified: trunk/reactos/drivers/ksfilter/ks/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] Tue Jul 28 15:52:57 2009 @@ -653,7 +653,6 @@ KsSetDevicePnpAndBaseObject(Header, PhysicalDeviceObject, NextDeviceObject); /* initialize IKsDevice interface */ Header->lpVtblIKsDevice = &vt_IKsDevice; - Header->Type = KsObjectTypeDevice; Header->ref = 1; /* FIXME Power state */ Modified: trunk/reactos/drivers/ksfilter/ks/filter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] Tue Jul 28 15:52:57 2009 @@ -865,6 +865,7 @@ This->FilterFactory = iface; This->FileObject = IoStack->FileObject; This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice; + This->Header.Parent.KsFilterFactory = iface->lpVtbl->GetStruct(iface); This->Header.Type = KsObjectTypeFilter; /* allocate the stream descriptors */ @@ -919,6 +920,7 @@ This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice; This->ObjectHeader->Type = KsObjectTypeFilter; This->ObjectHeader->Unknown = (PUNKNOWN)&This->lpVtbl; + This->ObjectHeader->ObjectType = (PVOID)&This->Filter; /* completed initialization */ Modified: trunk/reactos/drivers/ksfilter/ks/filterfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] Tue Jul 28 15:52:57 2009 @@ -185,6 +185,7 @@ This->FilterFactory.FilterDescriptor = Descriptor; This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice; This->Header.Type = KsObjectTypeFilterFactory; + This->Header.Parent.KsDevice = &DeviceExtension->DeviceHeader->KsDevice; This->DeviceHeader = DeviceExtension->DeviceHeader; InitializeListHead(&This->SymbolicLinkList); Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Tue Jul 28 15:52:57 2009 @@ -28,6 +28,7 @@ UNICODE_STRING ObjectClass; PUNKNOWN Unknown; + PVOID ObjectType; PDEVICE_OBJECT TargetDevice; LIST_ENTRY TargetDeviceListEntry; @@ -55,11 +56,17 @@ { KSOBJECTTYPE Type; PKSDEVICE KsDevice; + union + { + PKSDEVICE KsDevice; + PKSFILTERFACTORY KsFilterFactory; + PKSFILTER KsFilter; + }Parent; }KSBASIC_HEADER, *PKSBASIC_HEADER; typedef struct { - KSOBJECTTYPE Type; + KSBASIC_HEADER BasicHeader; KSDEVICE KsDevice; IKsDeviceVtbl *lpVtblIKsDevice; Modified: trunk/reactos/drivers/ksfilter/ks/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/misc.c…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] Tue Jul 28 15:52:57 2009 @@ -140,7 +140,7 @@ } /* - @unimplemented + @implemented */ KSDDKAPI PVOID @@ -148,50 +148,66 @@ KsGetObjectFromFileObject( IN PFILE_OBJECT FileObject) { + PKSIOBJECT_HEADER ObjectHeader; + + /* get object header */ + ObjectHeader = (PKSIOBJECT_HEADER)FileObject->FsContext; + + /* return associated object */ + return ObjectHeader->ObjectType; +} + +/* + @implemented +*/ +KSDDKAPI +KSOBJECTTYPE +NTAPI +KsGetObjectTypeFromFileObject( + IN PFILE_OBJECT FileObject) +{ + PKSIOBJECT_HEADER ObjectHeader; + + /* get object header */ + ObjectHeader = (PKSIOBJECT_HEADER)FileObject->FsContext; + /* return type */ + return ObjectHeader->Type; +} + +/* + @implemented +*/ +KSOBJECTTYPE +NTAPI +KsGetObjectTypeFromIrp( + IN PIRP Irp) +{ + PKSIOBJECT_HEADER ObjectHeader; + PIO_STACK_LOCATION IoStack; + + /* get current irp stack */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + /* get object header */ + ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext; + /* return type */ + return ObjectHeader->Type; +} + +/* + @unimplemented +*/ +PUNKNOWN +NTAPI +KsGetOuterUnknown( + IN PVOID Object) +{ UNIMPLEMENTED return NULL; -} - -/* - @unimplemented -*/ -KSDDKAPI -KSOBJECTTYPE -NTAPI -KsGetObjectTypeFromFileObject( - IN PFILE_OBJECT FileObject) -{ - UNIMPLEMENTED - return (KSOBJECTTYPE)-1; -} - -/* - @unimplemented -*/ -KSOBJECTTYPE -NTAPI -KsGetObjectTypeFromIrp( - IN PIRP Irp) -{ - UNIMPLEMENTED - return (KSOBJECTTYPE)-1; -} - -/* - @unimplemented -*/ -PUNKNOWN -NTAPI -KsGetOuterUnknown( - IN PVOID Object) -{ - UNIMPLEMENTED - return NULL; - -} - -/* - @unimplemented + +} + +/* + @implemented */ KSDDKAPI PVOID @@ -199,8 +215,11 @@ KsGetParent( IN PVOID Object) { - UNIMPLEMENTED - return NULL; -} - - + PKSBASIC_HEADER BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)Object - sizeof(KSBASIC_HEADER)); + /* sanity check */ + ASSERT(BasicHeader->Parent.KsDevice != NULL); + /* return object type */ + return (PVOID)BasicHeader->Parent.KsDevice; +} + +
15 years, 4 months
1
0
0
0
[fireball] 42267: Giannis Adamopoulos - Implement table growing in add_atom_entry, grow_handle_table and add_handle_to_array. - Uncomment all_windows_from_point and get_window_children_from_point.
by fireball@svn.reactos.org
Author: fireball Date: Tue Jul 28 15:50:45 2009 New Revision: 42267 URL:
http://svn.reactos.org/svn/reactos?rev=42267&view=rev
Log: Giannis Adamopoulos - Implement table growing in add_atom_entry, grow_handle_table and add_handle_to_array. - Uncomment all_windows_from_point and get_window_children_from_point. Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/atom.c [iso-8859-1] Tue Jul 28 15:50:45 2009 @@ -138,10 +138,11 @@ if (new_size > MAX_ATOMS) new_size = MAX_ATOMS; if (new_size > table->count) { - //new_table = ExAllocatePool(PagedPool, sizeof(*table->handles) * new_size); - //RtlCopyMemory(new_table, table, sizeof(*table->handles)); - //new_table = realloc( table->handles, sizeof(*table->handles) * new_size ); - UNIMPLEMENTED; + new_table = ExAllocatePool(PagedPool, sizeof(*table->handles) * new_size); + RtlCopyMemory(new_table, table, sizeof(*table->handles)); + new_table = ExReallocPool(table->handles , + sizeof(*table->handles) * new_size, + sizeof(*table->handles) * table->count); } if (!new_table) { Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/handle.c [iso-8859-1] Tue Jul 28 15:50:45 2009 @@ -184,12 +184,13 @@ /* grow a handle table */ static int grow_handle_table( struct handle_table *table ) { -#if 0 struct handle_entry *new_entries; int count = min( table->count * 2, MAX_HANDLE_ENTRIES ); if (count == table->count || - !(new_entries = realloc( table->entries, count * sizeof(struct handle_entry) ))) + !(new_entries = ExReallocPool( table->entries, + count * sizeof(struct handle_entry) , + table->count * sizeof(struct handle_entry)))) { set_error( STATUS_INSUFFICIENT_RESOURCES ); return 0; @@ -197,10 +198,6 @@ table->entries = new_entries; table->count = count; return 1; -#else - UNIMPLEMENTED; - return 0; -#endif } /* allocate the first free entry in the handle table */ Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/wine/window.c [iso-8859-1] Tue Jul 28 15:50:45 2009 @@ -240,7 +240,9 @@ if (array->count >= array->total) { int new_total = max( array->total * 2, 32 ); - user_handle_t *new_array = realloc( array->handles, new_total * sizeof(*new_array) ); + user_handle_t *new_array = ExReallocPool(array->handles, + new_total * sizeof(user_handle_t), + array->total * sizeof(user_handle_t)); if (!new_array) { ExFreePool( array->handles ); @@ -688,7 +690,6 @@ } /* return list of all windows containing point (in absolute coords) */ -#if 0 static int all_windows_from_point( struct window *top, int x, int y, struct user_handle_array *array ) { struct window *ptr; @@ -718,7 +719,6 @@ if (!add_handle_to_array( array, top->handle )) return 0; return 1; } -#endif /* return the thread owning a window */ PTHREADINFO get_window_thread( user_handle_t handle ) @@ -1981,7 +1981,6 @@ /* get a list of the window children that contain a given point */ DECL_HANDLER(get_window_children_from_point) { -#if 0 struct user_handle_array array; struct window *parent = get_window( req->parent ); data_size_t len; @@ -1997,9 +1996,6 @@ len = min( get_reply_max_size((void*)req), array.count * sizeof(user_handle_t) ); if (len) set_reply_data_ptr( (void*)req, array.handles, len ); else ExFreePool( array.handles ); -#else - UNIMPLEMENTED; -#endif }
15 years, 4 months
1
0
0
0
[fireball] 42266: - Make desktop window occupy whole primary surface (as usual, dimensions are hacked to 800x600 with a corresponding // FIXME:) if it's size is set to 0x0 at creation time. This fixes a number of window drawing problems, particularly arwinss issue nr. 5.
by fireball@svn.reactos.org
Author: fireball Date: Tue Jul 28 15:11:22 2009 New Revision: 42266 URL:
http://svn.reactos.org/svn/reactos?rev=42266&view=rev
Log: - Make desktop window occupy whole primary surface (as usual, dimensions are hacked to 800x600 with a corresponding // FIXME:) if it's size is set to 0x0 at creation time. This fixes a number of window drawing problems, particularly arwinss issue nr. 5. Modified: branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c Modified: branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/userdrv.c [iso-8859-1] Tue Jul 28 15:11:22 2009 @@ -20,6 +20,7 @@ #include <ndk/ntndk.h> #include "ntrosgdi.h" #include "winent.h" +#include "wine/server.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(rosuserdrv); @@ -281,7 +282,37 @@ BOOL CDECL RosDrv_CreateDesktopWindow( HWND hwnd ) { - WARN("RosDrv_CreateDesktopWindow(%x)\n", hwnd); + unsigned int width, height; + + /* retrieve the real size of the desktop */ + SERVER_START_REQ( get_window_rectangles ) + { + req->handle = wine_server_user_handle( hwnd ); + wine_server_call( req ); + width = reply->window.right - reply->window.left; + height = reply->window.bottom - reply->window.top; + } + SERVER_END_REQ; + + TRACE("RosDrv_CreateDesktopWindow(%x), w %d h %d\n", hwnd, width, height); + + if (!width && !height) /* not initialized yet */ + { + SERVER_START_REQ( set_window_pos ) + { + req->handle = wine_server_user_handle( hwnd ); + req->previous = 0; + req->flags = SWP_NOZORDER; + req->window.left = 0; + req->window.top = 0; + req->window.right = 800; // FIXME: Use primary surface's dimensions! + req->window.bottom = 600; + req->client = req->window; + wine_server_call( req ); + } + SERVER_END_REQ; + } + return TRUE; }
15 years, 4 months
1
0
0
0
[gschneider] 42265: RosDbg: - Add support for saving the chosen pipe mode - Create pipe connected and disconnected signaling functions to support code reuse
by gschneider@svn.reactos.org
Author: gschneider Date: Tue Jul 28 13:10:26 2009 New Revision: 42265 URL:
http://svn.reactos.org/svn/reactos?rev=42265&view=rev
Log: RosDbg: - Add support for saving the chosen pipe mode - Create pipe connected and disconnected signaling functions to support code reuse Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs trunk/tools/reactosdbg/RosDBG/Connect.cs trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs trunk/tools/reactosdbg/RosDBG/Settings.cs Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/namedpipe.cs…
============================================================================== --- trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] Tue Jul 28 13:10:26 2009 @@ -44,6 +44,24 @@ cmdList = new List<string>(); } + private void signalConnected() + { + bClientConn = true; + if (ClientConnectedEvent != null) + { + ClientConnectedEvent(this, EventArgs.Empty); + } + } + + private void signalDisconnected() + { + bClientConn = false; + if (ClientDisconnectedEvent != null) + { + ClientDisconnectedEvent(this, EventArgs.Empty); + } + } + private void WaitForConnection() { try @@ -53,11 +71,7 @@ if (sStream.IsConnected) { ioStream = sStream; - bClientConn = true; - if (ClientConnectedEvent != null) - { - ClientConnectedEvent(this, EventArgs.Empty); - } + signalConnected(); } } catch (IOException) @@ -88,11 +102,7 @@ if (cStream.IsConnected) { ioStream = cStream; - bClientConn = true; - if (ClientConnectedEvent != null) - { - ClientConnectedEvent(this, EventArgs.Empty); - } + signalConnected(); return true; } else @@ -216,12 +226,8 @@ * Connecion closed! * We'll hijack this thread and use it to set up our pipe server again. * This thread will terminate once the connection is set up, it does not block. - */ - if (ClientDisconnectedEvent != null) - { - ClientDisconnectedEvent(this, EventArgs.Empty); - } - + */ + signalDisconnected(); break; } } Modified: trunk/tools/reactosdbg/RosDBG/Connect.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Connect.cs…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Connect.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Connect.cs [iso-8859-1] Tue Jul 28 13:10:26 2009 @@ -102,6 +102,7 @@ pipeMode = ConnectionMode.MODE_AUTO; Settings.SelectedConnType = Type; + Settings.Mode = cType.SelectedItem.ToString(); Settings.Save(); Close(); Modified: trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] Tue Jul 28 13:10:26 2009 @@ -39,5 +39,5 @@ // will be increased as well. MSI installers must not be generated with the same Build Number // otherwise they won't upgrade the old installation! -[assembly: AssemblyVersion("1.0.2.66")] -[assembly: AssemblyFileVersion("1.0.2.66")] +[assembly: AssemblyVersion("1.0.2.67")] +[assembly: AssemblyFileVersion("1.0.2.67")] Modified: trunk/tools/reactosdbg/RosDBG/Settings.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Settings.c…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] Tue Jul 28 13:10:26 2009 @@ -265,7 +265,11 @@ public static string SourceDirectory { get { return mProperties.SourceDirectory; } } public static string OutputDirectory { get { return mProperties.OutputDirectory; } } - public static string Mode { get { return mProperties.Mode; } } + public static string Mode + { + get { return mProperties.Mode; } + set { mProperties.Mode = value; } + } public static string Pipe { get { return mProperties.Pipe; } } public static string ComPort { get { return mProperties.Port; } } public static string Baudrate { get { return mProperties.Baudrate; } }
15 years, 4 months
1
0
0
0
[janderwald] 42264: - Implement KoDriverInitialize, KoDeviceInitialize - Fix storing of device descriptor in KsInitializeDriver, KsAddDevice
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jul 28 12:22:02 2009 New Revision: 42264 URL:
http://svn.reactos.org/svn/reactos?rev=42264&view=rev
Log: - Implement KoDriverInitialize, KoDeviceInitialize - Fix storing of device descriptor in KsInitializeDriver, KsAddDevice Modified: trunk/reactos/drivers/ksfilter/ks/api.c trunk/reactos/drivers/ksfilter/ks/device.c trunk/reactos/drivers/ksfilter/ks/driver.c trunk/reactos/drivers/ksfilter/ks/kstypes.h Modified: trunk/reactos/drivers/ksfilter/ks/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/api.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] Tue Jul 28 12:22:02 2009 @@ -8,7 +8,6 @@ #include "priv.h" - /* @unimplemented @@ -1167,8 +1166,209 @@ } -/* - @unimplemented +NTSTATUS +NTAPI +KopDispatchClose( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PKO_OBJECT_HEADER Header; + PIO_STACK_LOCATION IoStack; + PDEVICE_EXTENSION DeviceExtension; + + /* get current irp stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* get ko object header */ + Header = (PKO_OBJECT_HEADER)IoStack->FileObject->FsContext2; + + /* free ks object header */ + KsFreeObjectHeader(Header->ObjectHeader); + + /* free ko object header */ + FreeItem(Header); + + /* get device extension */ + DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; + + /* release bus object */ + KsDereferenceBusObject((KSDEVICE_HEADER)DeviceExtension->DeviceHeader); + + /* complete request */ + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; +} + + + +static KSDISPATCH_TABLE KoDispatchTable = +{ + KsDispatchInvalidDeviceRequest, + KsDispatchInvalidDeviceRequest, + KsDispatchInvalidDeviceRequest, + KsDispatchInvalidDeviceRequest, + KopDispatchClose, + KsDispatchQuerySecurity, + KsDispatchSetSecurity, + KsDispatchFastIoDeviceControlFailure, + KsDispatchFastReadFailure, + KsDispatchFastReadFailure, +}; + + +NTSTATUS +NTAPI +KopDispatchCreate( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PKO_OBJECT_HEADER Header = NULL; + PIO_STACK_LOCATION IoStack; + PKO_DRIVER_EXTENSION DriverObjectExtension; + NTSTATUS Status; + + /* get current irp stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + if (!IoStack->FileObject) + { + DPRINT1("FileObject not attached!\n"); + Status = STATUS_UNSUCCESSFUL; + goto cleanup; + } + + /* get driver object extension */ + DriverObjectExtension = (PKO_DRIVER_EXTENSION)IoGetDriverObjectExtension(DeviceObject->DriverObject, (PVOID)KoDriverInitialize); + if (!DriverObjectExtension) + { + DPRINT1("FileObject not attached!\n"); + Status = STATUS_UNSUCCESSFUL; + goto cleanup; + } + + /* allocate ko object header */ + Header = (PKO_OBJECT_HEADER)AllocateItem(NonPagedPool, sizeof(KO_OBJECT_HEADER)); + if (!Header) + { + DPRINT1("failed to allocate KO_OBJECT_HEADER\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + /* initialize create item */ + Header->CreateItem.Create = KopDispatchCreate; + RtlInitUnicodeString(&Header->CreateItem.ObjectClass, KOSTRING_CreateObject); + + + /* now allocate the object header */ + Status = KsAllocateObjectHeader(&Header->ObjectHeader, 1, &Header->CreateItem, Irp, &KoDispatchTable); + if (!NT_SUCCESS(Status)) + { + /* failed */ + goto cleanup; + } + + /* FIXME + * extract clsid and interface id from irp + * call the standard create handler + */ + + UNIMPLEMENTED + + IoStack->FileObject->FsContext2 = (PVOID)Header; + + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; + +cleanup: + + if (Header && Header->ObjectHeader) + KsFreeObjectHeader(Header->ObjectHeader); + + if (Header) + FreeItem(Header); + + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; +} + + + +NTSTATUS +NTAPI +KopAddDevice( + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT PhysicalDeviceObject) +{ + NTSTATUS Status = STATUS_DEVICE_REMOVED; + PDEVICE_OBJECT FunctionalDeviceObject= NULL; + PDEVICE_OBJECT NextDeviceObject; + PDEVICE_EXTENSION DeviceExtension; + PKSOBJECT_CREATE_ITEM CreateItem; + + /* create the device object */ + Status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), NULL, FILE_DEVICE_KS, FILE_DEVICE_SECURE_OPEN, FALSE, &FunctionalDeviceObject); + if (!NT_SUCCESS(Status)) + return Status; + + /* allocate the create item */ + CreateItem = AllocateItem(NonPagedPool, sizeof(KSOBJECT_CREATE_ITEM)); + + if (!CreateItem) + { + /* not enough memory */ + IoDeleteDevice(FunctionalDeviceObject); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* initialize create item */ + CreateItem->Create = KopDispatchCreate; + RtlInitUnicodeString(&CreateItem->ObjectClass, KOSTRING_CreateObject); + + /* get device extension */ + DeviceExtension = (PDEVICE_EXTENSION)FunctionalDeviceObject->DeviceExtension; + + /* now allocate the device header */ + Status = KsAllocateDeviceHeader((KSDEVICE_HEADER*)&DeviceExtension->DeviceHeader, 1, CreateItem); + if (!NT_SUCCESS(Status)) + { + /* failed */ + IoDeleteDevice(FunctionalDeviceObject); + FreeItem(CreateItem); + return Status; + } + + /* now attach to device stack */ + NextDeviceObject = IoAttachDeviceToDeviceStack(FunctionalDeviceObject, PhysicalDeviceObject); + if (NextDeviceObject) + { + /* store pnp base object */ + KsSetDevicePnpAndBaseObject((KSDEVICE_HEADER)DeviceExtension->DeviceHeader, NextDeviceObject, FunctionalDeviceObject); + /* set device flags */ + FunctionalDeviceObject->Flags |= DO_DIRECT_IO | DO_POWER_PAGABLE; + FunctionalDeviceObject->Flags &= ~ DO_DEVICE_INITIALIZING; + } + else + { + /* failed */ + KsFreeDeviceHeader((KSDEVICE_HEADER)DeviceExtension->DeviceHeader); + FreeItem(CreateItem); + IoDeleteDevice(FunctionalDeviceObject); + Status = STATUS_DEVICE_REMOVED; + } + + /* return result */ + return Status; +} + + +/* + @implemented */ COMDDKAPI NTSTATUS @@ -1176,12 +1376,16 @@ KoDeviceInitialize( IN PDEVICE_OBJECT DeviceObject) { - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL; -} - -/* - @unimplemented + PDEVICE_EXTENSION DeviceExtension; + + /* get device extension */ + DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; + + return KsAddObjectCreateItemToDeviceHeader((KSDEVICE_HEADER)DeviceExtension->DeviceHeader, KopDispatchCreate, NULL, KOSTRING_CreateObject, NULL); +} + +/* + @implemented */ COMDDKAPI NTSTATUS @@ -1191,8 +1395,38 @@ IN PUNICODE_STRING RegistryPathName, IN KoCreateObjectHandler CreateObjectHandler) { - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL; + PKO_DRIVER_EXTENSION DriverObjectExtension; + NTSTATUS Status; + + /* allocate driver object extension */ + Status = IoAllocateDriverObjectExtension(DriverObject, (PVOID)KoDriverInitialize, sizeof(KO_DRIVER_EXTENSION), (PVOID*)&DriverObjectExtension); + + /* did it work */ + if (NT_SUCCESS(Status)) + { + /* store create handler */ + DriverObjectExtension->CreateObjectHandler = CreateObjectHandler; + + /* Setting our IRP handlers */ + DriverObject->MajorFunction[IRP_MJ_PNP] = KsDefaultDispatchPnp; + DriverObject->MajorFunction[IRP_MJ_POWER] = KsDefaultDispatchPower; + DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = KsDefaultForwardIrp; + + /* The driver unload routine */ + DriverObject->DriverUnload = KsNullDriverUnload; + + /* The driver-supplied AddDevice */ + DriverObject->DriverExtension->AddDevice = KopAddDevice; + + /* KS handles these */ + DPRINT1("Setting KS function handlers\n"); + KsSetMajorFunctionHandler(DriverObject, IRP_MJ_CREATE); + KsSetMajorFunctionHandler(DriverObject, IRP_MJ_CLOSE); + KsSetMajorFunctionHandler(DriverObject, IRP_MJ_DEVICE_CONTROL); + + } + + return Status; } /* Modified: trunk/reactos/drivers/ksfilter/ks/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] Tue Jul 28 12:22:02 2009 @@ -688,7 +688,7 @@ } /* - @unimplemented + @implemented */ KSDDKAPI NTSTATUS @@ -712,7 +712,7 @@ } /* - @unimplemented + @implemented */ KSDDKAPI NTSTATUS @@ -737,7 +737,7 @@ } /* - @unimplemented + @implemented */ KSDDKAPI VOID @@ -759,7 +759,7 @@ } /* - @unimplemented + @implemented */ KSDDKAPI VOID Modified: trunk/reactos/drivers/ksfilter/ks/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/driver…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/driver.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/driver.c [iso-8859-1] Tue Jul 28 12:22:02 2009 @@ -116,13 +116,16 @@ IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject) { - PKSDEVICE_DESCRIPTOR *DriverObjectExtension; - PKSDEVICE_DESCRIPTOR Descriptor = NULL; + PKS_DRIVER_EXTENSION DriverObjectExtension; + const KSDEVICE_DESCRIPTOR *Descriptor = NULL; + /* get stored driver object extension */ DriverObjectExtension = IoGetDriverObjectExtension(DriverObject, (PVOID)KsAddDevice); + if (DriverObjectExtension) { - Descriptor = *DriverObjectExtension; + /* get the stored descriptor see KsInitializeDriver */ + Descriptor = DriverObjectExtension->Descriptor; } return KsCreateDevice(DriverObject, PhysicalDeviceObject, Descriptor, 0, NULL); @@ -140,17 +143,18 @@ IN const KSDEVICE_DESCRIPTOR *Descriptor OPTIONAL ) { - PKSDEVICE_DESCRIPTOR *DriverObjectExtension; + PKS_DRIVER_EXTENSION DriverObjectExtension; NTSTATUS Status; if (Descriptor) { - Status = IoAllocateDriverObjectExtension(DriverObject, (PVOID)KsAddDevice, sizeof(PKSDEVICE_DESCRIPTOR), (PVOID*)&DriverObjectExtension); + Status = IoAllocateDriverObjectExtension(DriverObject, (PVOID)KsAddDevice, sizeof(KS_DRIVER_EXTENSION), (PVOID*)&DriverObjectExtension); if (NT_SUCCESS(Status)) { - *DriverObjectExtension = (KSDEVICE_DESCRIPTOR*)Descriptor; + DriverObjectExtension->Descriptor = Descriptor; } } + /* Setting our IRP handlers */ DriverObject->MajorFunction[IRP_MJ_CREATE] = IKsDevice_Create; DriverObject->MajorFunction[IRP_MJ_PNP] = IKsDevice_Pnp; Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Tue Jul 28 12:22:02 2009 @@ -1,5 +1,22 @@ #ifndef KSTYPES_H__ #define KSTYPES_H__ + +typedef struct +{ + KoCreateObjectHandler CreateObjectHandler; +}KO_DRIVER_EXTENSION, *PKO_DRIVER_EXTENSION; + +typedef struct +{ + const KSDEVICE_DESCRIPTOR *Descriptor; +}KS_DRIVER_EXTENSION, *PKS_DRIVER_EXTENSION; + +typedef struct +{ + KSOBJECT_HEADER ObjectHeader; + KSOBJECT_CREATE_ITEM CreateItem; +}KO_OBJECT_HEADER, *PKO_OBJECT_HEADER; + typedef struct {
15 years, 4 months
1
0
0
0
[fireball] 42263: - Fix a regression introduced in 40710, which caused all machine-specific memory regions to be concatenated into one big LoaderSpecialMemory. Restore previous behaviour by properly matching Arc and bootloader memory types.
by fireball@svn.reactos.org
Author: fireball Date: Tue Jul 28 12:00:58 2009 New Revision: 42263 URL:
http://svn.reactos.org/svn/reactos?rev=42263&view=rev
Log: - Fix a regression introduced in 40710, which caused all machine-specific memory regions to be concatenated into one big LoaderSpecialMemory. Restore previous behaviour by properly matching Arc and bootloader memory types. Modified: trunk/reactos/boot/freeldr/freeldr/mm/meminit.c Modified: trunk/reactos/boot/freeldr/freeldr/mm/meminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/me…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] Tue Jul 28 12:00:58 2009 @@ -277,6 +277,38 @@ MemoryMapPageAllocated = LoaderFree; break; } + case MemoryFirmwarePermanent: + { + // + // Firmware permanent memory + // + MemoryMapPageAllocated = LoaderFirmwarePermanent; + break; + } + case MemoryFirmwareTemporary: + { + // + // Firmware temporary memory + // + MemoryMapPageAllocated = LoaderFirmwareTemporary; + break; + } + case MemoryLoadedProgram: + { + // + // Bootloader code + // + MemoryMapPageAllocated = LoaderLoadedProgram; + break; + } + case MemorySpecialMemory: + { + // + // Special reserved memory + // + MemoryMapPageAllocated = LoaderSpecialMemory; + break; + } default: { //
15 years, 4 months
1
0
0
0
[gschneider] 42262: RosDbg: Signal if a client connected in pipe client mode, this mode works with QEMU now
by gschneider@svn.reactos.org
Author: gschneider Date: Tue Jul 28 03:25:09 2009 New Revision: 42262 URL:
http://svn.reactos.org/svn/reactos?rev=42262&view=rev
Log: RosDbg: Signal if a client connected in pipe client mode, this mode works with QEMU now Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/namedpipe.cs…
============================================================================== --- trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] Tue Jul 28 03:25:09 2009 @@ -54,7 +54,6 @@ { ioStream = sStream; bClientConn = true; - if (ClientConnectedEvent != null) { ClientConnectedEvent(this, EventArgs.Empty); @@ -89,6 +88,11 @@ if (cStream.IsConnected) { ioStream = cStream; + bClientConn = true; + if (ClientConnectedEvent != null) + { + ClientConnectedEvent(this, EventArgs.Empty); + } return true; } else @@ -120,13 +124,11 @@ case ConnectionMode.MODE_CLIENT: CreateClientPipe(name); - - /* pipe open, everything fine */ return true; case ConnectionMode.MODE_SERVER: CreateServerPipe(name); - return true; + return true; } return false; } Modified: trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] Tue Jul 28 03:25:09 2009 @@ -39,5 +39,5 @@ // will be increased as well. MSI installers must not be generated with the same Build Number // otherwise they won't upgrade the old installation! -[assembly: AssemblyVersion("1.0.2.65")] -[assembly: AssemblyFileVersion("1.0.2.65")] +[assembly: AssemblyVersion("1.0.2.66")] +[assembly: AssemblyFileVersion("1.0.2.66")]
15 years, 5 months
1
0
0
0
[gschneider] 42261: RosDbg: - Handle thread abortions gradually, avoid calling Thread.abort() - Fixes a crash that happened when closing connection to a pipe server waiting for connections - Fix typo
by gschneider@svn.reactos.org
Author: gschneider Date: Tue Jul 28 01:58:40 2009 New Revision: 42261 URL:
http://svn.reactos.org/svn/reactos?rev=42261&view=rev
Log: RosDbg: - Handle thread abortions gradually, avoid calling Thread.abort() - Fixes a crash that happened when closing connection to a pipe server waiting for connections - Fix typo Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs trunk/tools/reactosdbg/RosDBG/MainWindow.cs trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs Modified: trunk/tools/reactosdbg/Pipe/namedpipe.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/Pipe/namedpipe.cs…
============================================================================== --- trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/Pipe/namedpipe.cs [iso-8859-1] Tue Jul 28 01:58:40 2009 @@ -25,6 +25,7 @@ private List<String> cmdList; /*list of commands pending to be written */ private bool bClientConn; private Thread waitThread; + private NamedPipeServerStream sStream; public event EventHandler ClientConnectedEvent; public event EventHandler ClientDisconnectedEvent; @@ -43,34 +44,39 @@ cmdList = new List<string>(); } - private void WaitForConnection(object data) - { - NamedPipeServerStream pipeStream = (NamedPipeServerStream)data; - - pipeStream.WaitForConnection(); - - if (pipeStream.IsConnected) - { - ioStream = pipeStream; - bClientConn = true; - - if (ClientConnectedEvent != null) - { - ClientConnectedEvent(this, EventArgs.Empty); - } + private void WaitForConnection() + { + try + { + sStream.WaitForConnection(); + + if (sStream.IsConnected) + { + ioStream = sStream; + bClientConn = true; + + if (ClientConnectedEvent != null) + { + ClientConnectedEvent(this, EventArgs.Empty); + } + } + } + catch (IOException) + { + /* Pipe got killed externally */ } } public void CreateServerPipe(string name) { /* create a pipe and wait for a client */ - NamedPipeServerStream sStream = new NamedPipeServerStream(name, PipeDirection.InOut, 1, + sStream = new NamedPipeServerStream(name, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous, PIPE_SIZE, PIPE_SIZE); waitThread = new Thread(WaitForConnection); - waitThread.Start(sStream); - } - + waitThread.Start(); + } + public bool CreateClientPipe(string name) { /* try to connect as a client */ @@ -136,7 +142,9 @@ newWriteData.Set(); if (waitThread != null) - waitThread.Abort(); + { + sStream.Close(); + } } public void WriteLoop() Modified: trunk/tools/reactosdbg/RosDBG/MainWindow.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] Tue Jul 28 01:58:40 2009 @@ -315,7 +315,7 @@ mConnection.StartTCP(newConnection.Host, newConnection.Port); break; } - connectToolStripMenuItem.Text = "&Disconect"; + connectToolStripMenuItem.Text = "&Disconnect"; } } else @@ -461,7 +461,7 @@ { Process.Start(((ToolStripMenuItem)sender).Name); } - catch (Exception ex) + catch (Exception) { } Modified: trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] Tue Jul 28 01:58:40 2009 @@ -39,5 +39,5 @@ // will be increased as well. MSI installers must not be generated with the same Build Number // otherwise they won't upgrade the old installation! -[assembly: AssemblyVersion("1.0.2.64")] -[assembly: AssemblyFileVersion("1.0.2.64")] +[assembly: AssemblyVersion("1.0.2.65")] +[assembly: AssemblyFileVersion("1.0.2.65")]
15 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
61
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Results per page:
10
25
50
100
200