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
March 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
28 participants
483 discussions
Start a n
N
ew thread
[tkreuzer] 40246: Hack cleanup: IntGdiBrushXlate is a dirty ros hack, it is needed due to the fact that we handle brushes totally wrong. Replace it with a static function IntUpdateBrushXlate and move it to dcobjs.c.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Mar 26 06:41:57 2009 New Revision: 40246 URL:
http://svn.reactos.org/svn/reactos?rev=40246&view=rev
Log: Hack cleanup: IntGdiBrushXlate is a dirty ros hack, it is needed due to the fact that we handle brushes totally wrong. Replace it with a static function IntUpdateBrushXlate and move it to dcobjs.c. Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h trunk/reactos/subsystems/win32/win32k/objects/brush.c trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/intgdi.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/intgdi.h [iso-8859-1] Thu Mar 26 06:41:57 2009 @@ -7,9 +7,6 @@ extern HDC hSystemBM; extern HSEMAPHORE hsemDriverMgmt; - -XLATEOBJ* FASTCALL -IntGdiCreateBrushXlate(PDC Dc, BRUSH *BrushObj, BOOLEAN *Failed); XLATEOBJ* FASTCALL Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] Thu Mar 26 06:41:57 2009 @@ -112,58 +112,6 @@ /* FIXME */ return sizeof(LOGBRUSH); -} - - -XLATEOBJ* FASTCALL -IntGdiCreateBrushXlate(PDC Dc, BRUSH *pbrush, BOOLEAN *Failed) -{ - XLATEOBJ *Result = NULL; - SURFACE * psurf; - HPALETTE hPalette = NULL; - - psurf = SURFACE_LockSurface(Dc->rosdc.hBitmap); - if (psurf) - { - hPalette = psurf->hDIBPalette; - SURFACE_UnlockSurface(psurf); - } - if (!hPalette) hPalette = pPrimarySurface->DevInfo.hpalDefault; - - if (pbrush->flAttrs & GDIBRUSH_IS_NULL) - { - Result = NULL; - *Failed = FALSE; - } - else if (pbrush->flAttrs & GDIBRUSH_IS_SOLID) - { - Result = IntEngCreateXlate(0, PAL_RGB, hPalette, NULL); - *Failed = FALSE; - } - else - { - SURFACE *Pattern = SURFACE_LockSurface(pbrush->hbmPattern); - if (Pattern == NULL) - return NULL; - - /* Special case: 1bpp pattern */ - if (Pattern->SurfObj.iBitmapFormat == BMF_1BPP) - { - PDC_ATTR pdcattr = Dc->pdcattr; - - if (Dc->rosdc.bitsPerPixel != 1) - Result = IntEngCreateSrcMonoXlate(hPalette, pdcattr->crBackgroundClr, pbrush->BrushAttr.lbColor); - } - else if (pbrush->flAttrs & GDIBRUSH_IS_DIB) - { - Result = IntEngCreateXlate(0, 0, hPalette, Pattern->hDIBPalette); - } - - SURFACE_UnlockSurface(Pattern); - *Failed = FALSE; - } - - return Result; } /** Modified: trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Thu Mar 26 06:41:57 2009 @@ -10,6 +10,60 @@ #define NDEBUG #include <debug.h> + +// HACK! +static +BOOLEAN +IntUpdateBrushXlate(PDC pdc, XLATEOBJ **ppxlo, BRUSH *pbrush) +{ + SURFACE * psurf; + XLATEOBJ *pxlo = NULL; + HPALETTE hPalette = NULL; + + psurf = SURFACE_LockSurface(pdc->rosdc.hBitmap); + if (psurf) + { + hPalette = psurf->hDIBPalette; + SURFACE_UnlockSurface(psurf); + } + if (!hPalette) hPalette = pPrimarySurface->DevInfo.hpalDefault; + + if (pbrush->flAttrs & GDIBRUSH_IS_NULL) + { + pxlo = NULL; + } + else if (pbrush->flAttrs & GDIBRUSH_IS_SOLID) + { + pxlo = IntEngCreateXlate(0, PAL_RGB, hPalette, NULL); + } + else + { + SURFACE *psurfPattern = SURFACE_LockSurface(pbrush->hbmPattern); + if (psurfPattern == NULL) + return FALSE; + + /* Special case: 1bpp pattern */ + if (psurfPattern->SurfObj.iBitmapFormat == BMF_1BPP) + { + if (pdc->rosdc.bitsPerPixel != 1) + pxlo = IntEngCreateSrcMonoXlate(hPalette, + pdc->pdcattr->crBackgroundClr, + pbrush->BrushAttr.lbColor); + } + else if (pbrush->flAttrs & GDIBRUSH_IS_DIB) + { + pxlo = IntEngCreateXlate(0, 0, hPalette, psurfPattern->hDIBPalette); + } + + SURFACE_UnlockSurface(psurfPattern); + } + + if (*ppxlo != NULL) + EngDeleteXlate(*ppxlo); + + *ppxlo = pxlo; + return TRUE; +} VOID @@ -102,8 +156,8 @@ EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboLine, iSolidColor); } - /* Clear flag */ - pdcattr->ulDirty_ &= ~DIRTY_LINE; + /* Clear flags */ + pdcattr->ulDirty_ &= ~(DIRTY_LINE | DC_PEN_DIRTY); } VOID @@ -202,8 +256,7 @@ PDC_ATTR pdcattr; HBRUSH hOrgBrush; PBRUSH pbrush; - XLATEOBJ *XlateObj; - BOOLEAN bFailed; + BOOLEAN bSuccess; if (pDC == NULL || hBrush == NULL) return NULL; @@ -216,23 +269,17 @@ return NULL; } - DC_vSelectFillBrush(pDC, pbrush); - - XlateObj = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); - BRUSH_UnlockBrush(pbrush); - if(bFailed) - { - return NULL; - } - hOrgBrush = pdcattr->hbrush; pdcattr->hbrush = hBrush; - if (pDC->rosdc.XlateBrush != NULL) - { - EngDeleteXlate(pDC->rosdc.XlateBrush); - } - pDC->rosdc.XlateBrush = XlateObj; + DC_vSelectFillBrush(pDC, pbrush); + + bSuccess = IntUpdateBrushXlate(pDC, &pDC->rosdc.XlateBrush, pbrush); + BRUSH_UnlockBrush(pbrush); + if(!bSuccess) + { + return NULL; + } pdcattr->ulDirty_ &= ~DC_BRUSH_DIRTY; @@ -248,8 +295,7 @@ PDC_ATTR pdcattr; HPEN hOrgPen = NULL; PBRUSH pbrushPen; - XLATEOBJ *XlateObj; - BOOLEAN bFailed; + BOOLEAN bSuccess; if (pDC == NULL || hPen == NULL) return NULL; @@ -261,26 +307,20 @@ return NULL; } - DC_vSelectLineBrush(pDC, pbrushPen); - - XlateObj = IntGdiCreateBrushXlate(pDC, pbrushPen, &bFailed); - PEN_UnlockPen(pbrushPen); - if (bFailed) - { - SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); - return NULL; - } - hOrgPen = pdcattr->hpen; pdcattr->hpen = hPen; - if (pDC->rosdc.XlatePen != NULL) - { - EngDeleteXlate(pDC->rosdc.XlatePen); - } + DC_vSelectLineBrush(pDC, pbrushPen); + + bSuccess = IntUpdateBrushXlate(pDC, &pDC->rosdc.XlatePen, pbrushPen); + PEN_UnlockPen(pbrushPen); + if (!bSuccess) + { + SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); + return NULL; + } + pdcattr->ulDirty_ &= ~DC_PEN_DIRTY; - - pDC->rosdc.XlatePen = XlateObj; return hOrgPen; } @@ -354,7 +394,6 @@ HBITMAP hOrgBmp; PSURFACE psurfBmp, psurfOld; HRGN hVisRgn; - BOOLEAN bFailed; PBRUSH pbrush; if (hDC == NULL || hBmp == NULL) return NULL; @@ -420,22 +459,14 @@ pbrush = BRUSH_LockBrush(pdcattr->hbrush); if (pbrush) { - if (pDC->rosdc.XlateBrush) - { - EngDeleteXlate(pDC->rosdc.XlateBrush); - } - pDC->rosdc.XlateBrush = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); + IntUpdateBrushXlate(pDC, &pDC->rosdc.XlateBrush, pbrush); BRUSH_UnlockBrush(pbrush); } pbrush = PEN_LockPen(pdcattr->hpen); if (pbrush) { - if (pDC->rosdc.XlatePen) - { - EngDeleteXlate(pDC->rosdc.XlatePen); - } - pDC->rosdc.XlatePen = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); + IntUpdateBrushXlate(pDC, &pDC->rosdc.XlatePen, pbrush); PEN_UnlockPen(pbrush); }
15 years, 9 months
1
0
0
0
[arty] 40245: Prevent a double lock on the surface by splitting FillSolid into a locking and unlocked version, allowing surface.c to use the locking version.
by arty@svn.reactos.org
Author: arty Date: Thu Mar 26 05:33:15 2009 New Revision: 40245 URL:
http://svn.reactos.org/svn/reactos?rev=40245&view=rev
Log: Prevent a double lock on the surface by splitting FillSolid into a locking and unlocked version, allowing surface.c to use the locking version. Modified: trunk/reactos/subsystems/win32/win32k/eng/paint.c Modified: trunk/reactos/subsystems/win32/win32k/eng/paint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/paint.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/paint.c [iso-8859-1] Thu Mar 26 05:33:15 2009 @@ -32,7 +32,7 @@ #define NDEBUG #include <debug.h> -BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor) +static BOOL APIENTRY FillSolidUnlocked(SURFOBJ *pso, PRECTL pRect, ULONG iColor) { LONG y; ULONG LineWidth; @@ -41,7 +41,6 @@ ASSERT(pso); ASSERT(pRect); psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj); - SURFACE_LockBitmapBits(psurf); MouseSafetyOnDrawStart(pso, pRect->left, pRect->top, pRect->right, pRect->bottom); LineWidth = pRect->right - pRect->left; DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth, pRect->top, pRect->bottom); @@ -51,9 +50,19 @@ pso, pRect->left, pRect->right, y, iColor); } MouseSafetyOnDrawEnd(pso); - SURFACE_UnlockBitmapBits(psurf); return TRUE; +} + +BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor) +{ + SURFACE *psurf; + BOOL Result; + psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj); + SURFACE_LockBitmapBits(psurf); + Result = FillSolidUnlocked(pso, pRect, iColor); + SURFACE_UnlockBitmapBits(psurf); + return Result; } BOOL APIENTRY @@ -78,7 +87,7 @@ if (ClipRegion->iDComplexity == DC_RECT) { - FillSolid(pso, &(ClipRegion->rclBounds), iColor); + FillSolidUnlocked(pso, &(ClipRegion->rclBounds), iColor); } else { /* Enumerate all the rectangles and draw them */ @@ -87,7 +96,7 @@ do { EnumMore = CLIPOBJ_bEnum(ClipRegion, sizeof(RectEnum), (PVOID) &RectEnum); for (i = 0; i < RectEnum.c; i++) { - FillSolid(pso, RectEnum.arcl + i, iColor); + FillSolidUnlocked(pso, RectEnum.arcl + i, iColor); } } while (EnumMore); }
15 years, 9 months
1
0
0
0
[jmorlan] 40244: - Implement CMD /D, /Q, and /R switches - Do %envvar% expansions in CMD /C or /K commands - Make SETLOCAL recognize ENABLEEXTENSIONS and DISABLEEXTENSIONS, although it doesn't do anything yet - Make VERIFY set the errorlevel (documented in SETLOCAL /?). Also make it recognize when ON/OFF is followed by space - Make ECHOSERR actually print to stderr, not stdout - Make echoed display of ( ... ) blocks look nicer (Bug 4022) - Fix some other minor display bugs
by jmorlan@svn.reactos.org
Author: jmorlan Date: Thu Mar 26 04:14:25 2009 New Revision: 40244 URL:
http://svn.reactos.org/svn/reactos?rev=40244&view=rev
Log: - Implement CMD /D, /Q, and /R switches - Do %envvar% expansions in CMD /C or /K commands - Make SETLOCAL recognize ENABLEEXTENSIONS and DISABLEEXTENSIONS, although it doesn't do anything yet - Make VERIFY set the errorlevel (documented in SETLOCAL /?). Also make it recognize when ON/OFF is followed by space - Make ECHOSERR actually print to stderr, not stdout - Make echoed display of ( ... ) blocks look nicer (Bug 4022) - Fix some other minor display bugs Modified: trunk/reactos/base/shell/cmd/batch.c trunk/reactos/base/shell/cmd/cmd.c trunk/reactos/base/shell/cmd/cmd.h trunk/reactos/base/shell/cmd/echo.c trunk/reactos/base/shell/cmd/error.c trunk/reactos/base/shell/cmd/for.c trunk/reactos/base/shell/cmd/parser.c trunk/reactos/base/shell/cmd/setlocal.c trunk/reactos/base/shell/cmd/verify.c Modified: trunk/reactos/base/shell/cmd/batch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/batch.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/batch.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/batch.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -293,9 +293,10 @@ /* JPP 19980807 */ /* Echo batch file line */ - if (bEcho && Cmd->Type != C_QUIET) + if (bEcho && !bDisableBatchEcho && Cmd->Type != C_QUIET) { - ConOutChar(_T('\n')); + if (!bIgnoreEcho) + ConOutChar(_T('\n')); PrintPrompt(); EchoCommand(Cmd); ConOutChar(_T('\n')); Modified: trunk/reactos/base/shell/cmd/cmd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=4…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -157,6 +157,7 @@ BOOL bIgnoreEcho = FALSE; /* Set this to TRUE to prevent a newline, when executing a command */ INT nErrorLevel = 0; /* Errorlevel of last launched external program */ BOOL bChildProcessRunning = FALSE; +BOOL bDisableBatchEcho = FALSE; BOOL bDelayedExpansion = FALSE; DWORD dwChildProcessId = 0; OSVERSIONINFO osvi; @@ -1509,7 +1510,11 @@ { /* JPP 19980807 - if echo off, don't print prompt */ if (bEcho) + { + if (!bIgnoreEcho) + ConOutChar('\n'); PrintPrompt(); + } } ReadCommand (readline, CMDLINE_LENGTH - 1); @@ -1542,10 +1547,7 @@ continue; ExecuteCommand(Cmd); - if (bEcho && !bIgnoreEcho) - ConOutChar ('\n'); FreeCommand(Cmd); - bIgnoreEcho = FALSE; } while (!bCanExit || !bExit); @@ -1676,7 +1678,8 @@ (LPBYTE)autorun, &len) == ERROR_SUCCESS) { - ParseCommandLine (autorun); + if (*autorun) + ParseCommandLine(autorun); } } @@ -1748,9 +1751,9 @@ TCHAR lpBuffer[2]; //INT len; - TCHAR *ptr, *cmdLine; + TCHAR *ptr, *cmdLine, option = 0; BOOL AlwaysStrip = FALSE; - BOOL ShowVersion = TRUE; + BOOL AutoRun = TRUE; /* get version information */ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -1793,12 +1796,13 @@ { if (*ptr == _T('/')) { - if (ptr[1] == _T('?')) + option = _totupper(ptr[1]); + if (option == _T('?')) { ConOutResPaging(TRUE,STRING_CMD_HELP8); cmd_exit(0); } - else if (_totlower(ptr[1]) == _T('p')) + else if (option == _T('P')) { if (!IsExistingFile (_T("\\autoexec.bat"))) { @@ -1815,27 +1819,25 @@ } bCanExit = FALSE; } - else if (_totlower(ptr[1]) == _T('c')) - { - /* This just runs a program and exits */ - GetCmdLineCommand(commandline, &ptr[2], AlwaysStrip); - ParseCommandLine(commandline); - cmd_exit(nErrorLevel); - } - else if (_totlower(ptr[1]) == _T('k')) - { - /* This just runs a program and remains */ - GetCmdLineCommand(commandline, &ptr[2], AlwaysStrip); - ParseCommandLine(commandline); - ShowVersion = FALSE; + else if (option == _T('C') || option == _T('K') || option == _T('R')) + { + /* Remainder of command line is a command to be run */ break; } - else if (_totlower(ptr[1]) == _T('s')) + else if (option == _T('D')) + { + AutoRun = FALSE; + } + else if (option == _T('Q')) + { + bDisableBatchEcho = TRUE; + } + else if (option == _T('S')) { AlwaysStrip = TRUE; } #ifdef INCLUDE_CMD_COLOR - else if (!_tcsnicmp(ptr, _T("/t:"), 3)) + else if (!_tcsnicmp(ptr, _T("/T:"), 3)) { /* process /t (color) argument */ wDefColor = (WORD)_tcstoul(&ptr[3], &ptr, 16); @@ -1843,24 +1845,21 @@ SetScreenColor (wColor, TRUE); } #endif - else if (_totlower(ptr[1]) == _T('v')) - { - bDelayedExpansion = _tcsnicmp(&ptr[2], _T(":off"), 4); - } - } - } - - if (ShowVersion) - { - /* Display a simple version string */ + else if (option == _T('V')) + { + bDelayedExpansion = _tcsnicmp(&ptr[2], _T(":OFF"), 4); + } + } + } + + if (!*ptr) + { + /* If neither /C or /K was given, display a simple version string */ ConOutResPrintf(STRING_REACTOS_VERSION, - _T(KERNEL_RELEASE_STR), - _T(KERNEL_VERSION_BUILD_STR)); - - ConOutPuts (_T("(C) Copyright 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team.\n")); - } - - ExecuteAutoRunFile (); + _T(KERNEL_RELEASE_STR), + _T(KERNEL_VERSION_BUILD_STR)); + ConOutPuts(_T("(C) Copyright 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team.")); + } #ifdef FEATURE_DIR_STACK /* initialize directory stack */ @@ -1882,6 +1881,18 @@ /* add ctrl break handler */ AddBreakHandler (); + + if (AutoRun) + ExecuteAutoRunFile(); + + if (*ptr) + { + /* Do the /C or /K command */ + GetCmdLineCommand(commandline, &ptr[2], AlwaysStrip); + ParseCommandLine(commandline); + if (option != _T('K')) + cmd_exit(nErrorLevel); + } } Modified: trunk/reactos/base/shell/cmd/cmd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=4…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -60,6 +60,7 @@ extern BOOL bCtrlBreak; extern BOOL bIgnoreEcho; extern BOOL bExit; +extern BOOL bDisableBatchEcho; extern BOOL bDelayedExpansion; extern INT nErrorLevel; extern SHORT maxx; @@ -211,6 +212,7 @@ /* Prototypes for ECHO.C */ +BOOL OnOffCommand(LPTSTR param, LPBOOL flag, INT message); INT CommandEcho (LPTSTR); INT CommandEchos (LPTSTR); INT CommandEchoerr (LPTSTR); Modified: trunk/reactos/base/shell/cmd/echo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/echo.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/echo.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/echo.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -28,10 +28,43 @@ #include <precomp.h> +BOOL +OnOffCommand(LPTSTR param, LPBOOL flag, INT message) +{ + TCHAR *p2; + if (_tcsnicmp(param, D_OFF, sizeof(D_OFF)/sizeof(TCHAR) - 1) == 0) + { + p2 = param + sizeof(D_OFF)/sizeof(TCHAR) - 1; + while (_istspace(*p2)) + p2++; + if (*p2 == _T('\0')) + { + *flag = FALSE; + return TRUE; + } + } + else if (_tcsnicmp(param, D_ON, sizeof(D_ON)/sizeof(TCHAR) - 1) == 0) + { + p2 = param + sizeof(D_ON)/sizeof(TCHAR) - 1; + while (_istspace(*p2)) + p2++; + if (*p2 == _T('\0')) + { + *flag = TRUE; + return TRUE; + } + } + else if (*param == _T('\0')) + { + ConOutResPrintf(message, *flag ? D_ON : D_OFF); + return TRUE; + } + return FALSE; +} INT CommandEcho (LPTSTR param) { - LPTSTR p1, p2; + LPTSTR p1; TRACE ("CommandEcho: '%s'\n", debugstr_aw(param)); @@ -46,45 +79,16 @@ return 0; } - if (_tcsnicmp (p1, D_OFF, sizeof(D_OFF)/sizeof(TCHAR) - 1) == 0) - { - p2 = p1 + sizeof(D_OFF)/sizeof(TCHAR) - 1; - while (_istspace(*p2)) - p2++; - if (*p2 == _T('\0')) - { - bEcho = FALSE; - return 0; - } - } - else if (_tcsnicmp (p1, D_ON, sizeof(D_ON)/sizeof(TCHAR) - 1) == 0) - { - p2 = p1 + sizeof(D_ON)/sizeof(TCHAR) - 1; - while (_istspace(*p2)) - p2++; - if (*p2 == _T('\0')) - { - bEcho = TRUE; - return 0; - } - } - if (*p1 != _T('\0')) - { - /* skip the first character */ - ConOutPuts(param + 1); - } - else - { - ConOutResPrintf(STRING_ECHO_HELP5, bEcho ? D_ON : D_OFF); - } - + if (!OnOffCommand(p1, &bEcho, STRING_ECHO_HELP5)) + { + /* skip the first character */ + ConOutPuts(param + 1); + } return 0; } - INT CommandEchos (LPTSTR param) { - TRACE ("CommandEchos: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) @@ -93,16 +97,13 @@ return 0; } - if (*param) - ConOutPrintf (_T("%s"), param); - + ConOutPrintf (_T("%s"), param); return 0; } INT CommandEchoerr (LPTSTR param) { - TRACE ("CommandEchoerr: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) @@ -112,14 +113,12 @@ } ConErrPuts (param); - return 0; } INT CommandEchoserr (LPTSTR param) { - TRACE ("CommandEchoserr: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) @@ -128,9 +127,7 @@ return 0; } - if (*param) - ConOutPrintf (_T("%s"), param); - + ConErrPrintf (_T("%s"), param); return 0; } Modified: trunk/reactos/base/shell/cmd/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/error.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/error.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/error.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -141,7 +141,7 @@ VOID error_invalid_parameter_format (LPTSTR s) { - ConErrResPuts(STRING_ERROR_INVALID_PARAM_FORMAT); + ConErrResPrintf(STRING_ERROR_INVALID_PARAM_FORMAT, s); nErrorLevel = 1; } Modified: trunk/reactos/base/shell/cmd/for.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/for.c?rev=4…
============================================================================== --- trunk/reactos/base/shell/cmd/for.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/for.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -71,9 +71,10 @@ /* Execute a single instance of a FOR command */ static void RunInstance(PARSED_COMMAND *Cmd) { - if (bEcho && Cmd->Subcommands->Type != C_QUIET) - { - ConOutChar(_T('\n')); + if (bEcho && !bDisableBatchEcho && Cmd->Subcommands->Type != C_QUIET) + { + if (!bIgnoreEcho) + ConOutChar(_T('\n')); PrintPrompt(); EchoCommand(Cmd->Subcommands); ConOutChar(_T('\n')); Modified: trunk/reactos/base/shell/cmd/parser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/parser.c?re…
============================================================================== --- trunk/reactos/base/shell/cmd/parser.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/parser.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -701,7 +701,8 @@ if (Line) { - _tcscpy(ParseLine, Line); + if (!SubstituteVars(Line, ParseLine, _T('%'))) + return NULL; bLineContinuations = FALSE; } else @@ -724,6 +725,11 @@ FreeCommand(Cmd); Cmd = NULL; } + bIgnoreEcho = FALSE; + } + else + { + bIgnoreEcho = TRUE; } return Cmd; } @@ -748,10 +754,22 @@ return; case C_BLOCK: ConOutChar(_T('(')); - for (Sub = Cmd->Subcommands; Sub; Sub = Sub->Next) - { + Sub = Cmd->Subcommands; + if (Sub && !Sub->Next) + { + /* Single-command block: display all on one line */ EchoCommand(Sub); + } + else if (Sub) + { + /* Multi-command block: display parenthesis on separate lines */ ConOutChar(_T('\n')); + do + { + EchoCommand(Sub); + ConOutChar(_T('\n')); + Sub = Sub->Next; + } while (Sub); } ConOutChar(_T(')')); break; Modified: trunk/reactos/base/shell/cmd/setlocal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/setlocal.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/setlocal.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/setlocal.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -35,6 +35,8 @@ INT cmd_setlocal(LPTSTR param) { SETLOCAL *Saved; + LPTSTR *arg; + INT argc, i; /* SETLOCAL only works inside a batch file */ if (!bc) @@ -59,14 +61,24 @@ nErrorLevel = 0; - if (*param == _T('\0')) - /* nothing */; - else if (!_tcsicmp(param, _T("enabledelayedexpansion"))) - bDelayedExpansion = TRUE; - else if (!_tcsicmp(param, _T("disabledelayedexpansion"))) - bDelayedExpansion = FALSE; - else - error_invalid_parameter_format(param); + arg = splitspace(param, &argc); + for (i = 0; i < argc; i++) + { + if (!_tcsicmp(arg[i], _T("enableextensions"))) + /* not implemented, ignore */; + else if (!_tcsicmp(arg[i], _T("disableextensions"))) + /* not implemented, ignore */; + else if (!_tcsicmp(arg[i], _T("enabledelayedexpansion"))) + bDelayedExpansion = TRUE; + else if (!_tcsicmp(arg[i], _T("disabledelayedexpansion"))) + bDelayedExpansion = FALSE; + else + { + error_invalid_parameter_format(arg[i]); + break; + } + } + freep(arg); return nErrorLevel; } Modified: trunk/reactos/base/shell/cmd/verify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/verify.c?re…
============================================================================== --- trunk/reactos/base/shell/cmd/verify.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/verify.c [iso-8859-1] Thu Mar 26 04:14:25 2009 @@ -35,22 +35,13 @@ return 0; } - nErrorLevel = 0; - - if (!*param) + if (!OnOffCommand(param, &bVerify, STRING_VERIFY_HELP2)) { - ConOutResPrintf(STRING_VERIFY_HELP2, bVerify ? D_ON : D_OFF); - } - else if (_tcsicmp (param, D_OFF) == 0) - bVerify = FALSE; - else if (_tcsicmp (param, D_ON) == 0) - bVerify = TRUE; - else - { - ConOutResPuts(STRING_VERIFY_HELP3); + ConErrResPuts(STRING_VERIFY_HELP3); + return nErrorLevel = 1; } - return 0; + return nErrorLevel = 0; } #endif
15 years, 9 months
1
0
0
0
[tkreuzer] 40243: Move NtGdiSelectBitmap to dcobjs.c, implement DC_vSelectFillBrush and DC_vSelectLineBrush, use them in IntGdiSelectBrush and IntGdiSelectPen, DC_Cleanup and DC_vCopyState. Should fix leaking brushes/pens on process cleanup. Remove the flag checks from DC_vUpdateXxxBrush functions.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Mar 26 03:56:46 2009 New Revision: 40243 URL:
http://svn.reactos.org/svn/reactos?rev=40243&view=rev
Log: Move NtGdiSelectBitmap to dcobjs.c, implement DC_vSelectFillBrush and DC_vSelectLineBrush, use them in IntGdiSelectBrush and IntGdiSelectPen, DC_Cleanup and DC_vCopyState. Should fix leaking brushes/pens on process cleanup. Remove the flag checks from DC_vUpdateXxxBrush functions. Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c trunk/reactos/subsystems/win32/win32k/objects/dclife.c trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c trunk/reactos/subsystems/win32/win32k/objects/dcstate.c Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Thu Mar 26 03:56:46 2009 @@ -278,11 +278,33 @@ PSURFACE psurfOld = pdc->dclevel.pSurface; if (psurfOld) SURFACE_ShareUnlockSurface(psurfOld); - if (psurfNew) GDIOBJ_IncrementShareCount((POBJ)psurfNew); - pdc->dclevel.pSurface = psurfNew; +} + +VOID +FORCEINLINE +DC_vSelectFillBrush(PDC pdc, PBRUSH pbrFill) +{ + PBRUSH pbrFillOld = pdc->dclevel.pbrFill; + if (pbrFillOld) + BRUSH_ShareUnlockBrush(pbrFillOld); + if (pbrFill) + GDIOBJ_IncrementShareCount((POBJ)pbrFill); + pdc->dclevel.pbrFill = pbrFill; +} + +VOID +FORCEINLINE +DC_vSelectLineBrush(PDC pdc, PBRUSH pbrLine) +{ + PBRUSH pbrLineOld = pdc->dclevel.pbrLine; + if (pbrLineOld) + BRUSH_ShareUnlockBrush(pbrLineOld); + if (pbrLine) + GDIOBJ_IncrementShareCount((POBJ)pbrLine); + pdc->dclevel.pbrLine = pbrLine; } BOOL FASTCALL Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Thu Mar 26 03:56:46 2009 @@ -920,115 +920,4 @@ return hDC; } -/* - * @implemented - */ -HBITMAP -APIENTRY -NtGdiSelectBitmap( - IN HDC hDC, - IN HBITMAP hBmp) -{ - PDC pDC; - PDC_ATTR pdcattr; - HBITMAP hOrgBmp; - PSURFACE psurfBmp, psurfOld; - HRGN hVisRgn; - BOOLEAN bFailed; - PBRUSH pbrush; - - if (hDC == NULL || hBmp == NULL) return NULL; - - pDC = DC_LockDc(hDC); - if (!pDC) - { - return NULL; - } - - pdcattr = pDC->pdcattr; - - /* must be memory dc to select bitmap */ - if (pDC->dctype != DC_TYPE_MEMORY) - { - DC_UnlockDc(pDC); - return NULL; - } - - psurfBmp = SURFACE_LockSurface(hBmp); - if (!psurfBmp) - { - DC_UnlockDc(pDC); - return NULL; - } - - /* Get the handle for the old bitmap */ - psurfOld = pDC->dclevel.pSurface; - hOrgBmp = psurfOld ? psurfOld->BaseObject.hHmgr : NULL; - - /* FIXME: ros hack */ - hOrgBmp = pDC->rosdc.hBitmap; - - pDC->rosdc.hBitmap = hBmp; - - /* Release the old bitmap, reference the new */ - DC_vSelectSurface(pDC, psurfBmp); - - // If Info DC this is zero and pSurface is moved to DC->pSurfInfo. - psurfBmp->hDC = hDC; - - // if we're working with a DIB, get the palette - // [fixme: only create if the selected palette is null] - if (psurfBmp->hSecure) - { -// pDC->rosdc.bitsPerPixel = psurfBmp->dib->dsBmih.biBitCount; ??? - pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); - } - else - { - pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); - } - - /* FIXME; improve by using a region without a handle and selecting it */ - hVisRgn = NtGdiCreateRectRgn(0, - 0, - psurfBmp->SurfObj.sizlBitmap.cx, - psurfBmp->SurfObj.sizlBitmap.cy); - - /* Release the exclusive lock */ - SURFACE_UnlockSurface(psurfBmp); - - /* Regenerate the XLATEOBJs. (hack!) */ - pbrush = BRUSH_LockBrush(pdcattr->hbrush); - if (pbrush) - { - if (pDC->rosdc.XlateBrush) - { - EngDeleteXlate(pDC->rosdc.XlateBrush); - } - pDC->rosdc.XlateBrush = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); - BRUSH_UnlockBrush(pbrush); - } - - pbrush = PEN_LockPen(pdcattr->hpen); - if (pbrush) - { - if (pDC->rosdc.XlatePen) - { - EngDeleteXlate(pDC->rosdc.XlatePen); - } - pDC->rosdc.XlatePen = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); - PEN_UnlockPen(pbrush); - } - - DC_UnlockDc(pDC); - - if (hVisRgn) - { - GdiSelectVisRgn(hDC, hVisRgn); - GreDeleteObject(hVisRgn); - } - - return hOrgBmp; -} - /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Thu Mar 26 03:56:46 2009 @@ -139,9 +139,16 @@ DC_Cleanup(PVOID ObjectBody) { PDC pDC = (PDC)ObjectBody; + + /* Free driver name (HACK) */ if (pDC->rosdc.DriverName.Buffer) ExFreePoolWithTag(pDC->rosdc.DriverName.Buffer, TAG_DC); + + /* Clean up selected objects */ DC_vSelectSurface(pDC, NULL); + DC_vSelectFillBrush(pDC, NULL); + DC_vSelectLineBrush(pDC, NULL); + return TRUE; } Modified: trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Thu Mar 26 03:56:46 2009 @@ -21,46 +21,42 @@ XLATEOBJ *pxlo; ULONG iSolidColor; - /* Check if update of eboFill is needed */ - if (pdcattr->ulDirty_ & DIRTY_FILL) - { - /* ROS HACK, should use surf xlate */ - pxlo = pdc->rosdc.XlatePen; - - /* Check if the brush handle has changed */ - if (pdcattr->hbrush != pdc->dclevel.pbrFill->BaseObject.hHmgr) + /* ROS HACK, should use surf xlate */ + pxlo = pdc->rosdc.XlatePen; + + /* Check if the brush handle has changed */ + if (pdcattr->hbrush != pdc->dclevel.pbrFill->BaseObject.hHmgr) + { + /* Try to lock the new brush */ + pbrFill = BRUSH_ShareLockBrush(pdcattr->hbrush); + if (pbrFill) { - /* Try to lock the new brush */ - pbrFill = BRUSH_ShareLockBrush(pdcattr->hbrush); - if (pbrFill) - { - /* Unlock old brush, set new brush */ - BRUSH_ShareUnlockBrush(pdc->dclevel.pbrFill); - pdc->dclevel.pbrFill = pbrFill; - - /* Update eboFill, realizing it, if needed */ - EBRUSHOBJ_vUpdate(&pdc->eboFill, pbrFill, pxlo); - } - else - { - /* Invalid brush handle, restore old one */ - pdcattr->hbrush = pdc->dclevel.pbrFill->BaseObject.hHmgr; - } + /* Unlock old brush, set new brush */ + BRUSH_ShareUnlockBrush(pdc->dclevel.pbrFill); + pdc->dclevel.pbrFill = pbrFill; + + /* Update eboFill, realizing it, if needed */ + EBRUSHOBJ_vUpdate(&pdc->eboFill, pbrFill, pxlo); } - - /* Check for DC brush */ - if (pdcattr->hbrush == StockObjects[DC_BRUSH]) + else { - /* Translate the color to the target format */ - iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crPenClr); - - /* Update the eboFill's solid color */ - EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboFill, iSolidColor); + /* Invalid brush handle, restore old one */ + pdcattr->hbrush = pdc->dclevel.pbrFill->BaseObject.hHmgr; } - - /* Clear flag */ - pdcattr->ulDirty_ &= ~DIRTY_FILL; - } + } + + /* Check for DC brush */ + if (pdcattr->hbrush == StockObjects[DC_BRUSH]) + { + /* Translate the color to the target format */ + iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crPenClr); + + /* Update the eboFill's solid color */ + EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboFill, iSolidColor); + } + + /* Clear flags */ + pdcattr->ulDirty_ &= ~(DIRTY_FILL | DC_BRUSH_DIRTY); } VOID @@ -72,46 +68,42 @@ XLATEOBJ *pxlo; ULONG iSolidColor; - /* Check if update of eboLine is needed */ - if (pdcattr->ulDirty_ & DIRTY_LINE) - { - /* ROS HACK, should use surf xlate */ - pxlo = pdc->rosdc.XlatePen; - - /* Check if the pen handle has changed */ - if (pdcattr->hpen != pdc->dclevel.pbrLine->BaseObject.hHmgr) + /* ROS HACK, should use surf xlate */ + pxlo = pdc->rosdc.XlatePen; + + /* Check if the pen handle has changed */ + if (pdcattr->hpen != pdc->dclevel.pbrLine->BaseObject.hHmgr) + { + /* Try to lock the new pen */ + pbrLine = BRUSH_ShareLockBrush(pdcattr->hpen); + if (pbrLine) { - /* Try to lock the new pen */ - pbrLine = BRUSH_ShareLockBrush(pdcattr->hpen); - if (pbrLine) - { - /* Unlock old brush, set new brush */ - BRUSH_ShareUnlockBrush(pdc->dclevel.pbrLine); - pdc->dclevel.pbrLine = pbrLine; - - /* Update eboLine, realizing it, if needed */ - EBRUSHOBJ_vUpdate(&pdc->eboLine, pbrLine, pxlo); - } - else - { - /* Invalid pen handle, restore old one */ - pdcattr->hpen = pdc->dclevel.pbrLine->BaseObject.hHmgr; - } + /* Unlock old brush, set new brush */ + BRUSH_ShareUnlockBrush(pdc->dclevel.pbrLine); + pdc->dclevel.pbrLine = pbrLine; + + /* Update eboLine, realizing it, if needed */ + EBRUSHOBJ_vUpdate(&pdc->eboLine, pbrLine, pxlo); } - - /* Check for DC pen */ - if (pdcattr->hpen == StockObjects[DC_PEN]) + else { - /* Translate the color to the target format */ - iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crPenClr); - - /* Update the eboLine's solid color */ - EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboLine, iSolidColor); + /* Invalid pen handle, restore old one */ + pdcattr->hpen = pdc->dclevel.pbrLine->BaseObject.hHmgr; } - - /* Clear flag */ - pdcattr->ulDirty_ &= ~DIRTY_LINE; - } + } + + /* Check for DC pen */ + if (pdcattr->hpen == StockObjects[DC_PEN]) + { + /* Translate the color to the target format */ + iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crPenClr); + + /* Update the eboLine's solid color */ + EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboLine, iSolidColor); + } + + /* Clear flag */ + pdcattr->ulDirty_ &= ~DIRTY_LINE; } VOID @@ -122,21 +114,17 @@ XLATEOBJ *pxlo; ULONG iSolidColor; - /* Check if update of eboText is needed */ - if (pdcattr->ulDirty_ & DIRTY_TEXT) - { - /* ROS HACK, should use surf xlate */ - pxlo = pdc->rosdc.XlatePen; - - /* Translate the color to the target format */ - iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crForegroundClr); - - /* Update the eboText's solid color */ - EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboText, iSolidColor); - - /* Clear flag */ - pdcattr->ulDirty_ &= ~DIRTY_TEXT; - } + /* ROS HACK, should use surf xlate */ + pxlo = pdc->rosdc.XlatePen; + + /* Translate the color to the target format */ + iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crForegroundClr); + + /* Update the eboText's solid color */ + EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboText, iSolidColor); + + /* Clear flag */ + pdcattr->ulDirty_ &= ~DIRTY_TEXT; } VOID @@ -147,21 +135,17 @@ XLATEOBJ *pxlo; ULONG iSolidColor; - /* Check if update of eboBackground is needed */ - if (pdcattr->ulDirty_ & DIRTY_BACKGROUND) - { - /* ROS HACK, should use surf xlate */ - pxlo = pdc->rosdc.XlatePen; - - /* Translate the color to the target format */ - iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crBackgroundClr); - - /* Update the eboBackground's solid color */ - EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboBackground, iSolidColor); - - /* Clear flag */ - pdcattr->ulDirty_ &= ~DIRTY_BACKGROUND; - } + /* ROS HACK, should use surf xlate */ + pxlo = pdc->rosdc.XlatePen; + + /* Translate the color to the target format */ + iSolidColor = XLATEOBJ_iXlate(pxlo, pdcattr->crBackgroundClr); + + /* Update the eboBackground's solid color */ + EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboBackground, iSolidColor); + + /* Clear flag */ + pdcattr->ulDirty_ &= ~DIRTY_BACKGROUND; } HPALETTE @@ -232,6 +216,8 @@ return NULL; } + DC_vSelectFillBrush(pDC, pbrush); + XlateObj = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); BRUSH_UnlockBrush(pbrush); if(bFailed) @@ -274,6 +260,8 @@ { return NULL; } + + DC_vSelectLineBrush(pDC, pbrushPen); XlateObj = IntGdiCreateBrushXlate(pDC, pbrushPen, &bFailed); PEN_UnlockPen(pbrushPen); @@ -352,6 +340,117 @@ return hOrgPen; } +/* + * @implemented + */ +HBITMAP +APIENTRY +NtGdiSelectBitmap( + IN HDC hDC, + IN HBITMAP hBmp) +{ + PDC pDC; + PDC_ATTR pdcattr; + HBITMAP hOrgBmp; + PSURFACE psurfBmp, psurfOld; + HRGN hVisRgn; + BOOLEAN bFailed; + PBRUSH pbrush; + + if (hDC == NULL || hBmp == NULL) return NULL; + + pDC = DC_LockDc(hDC); + if (!pDC) + { + return NULL; + } + pdcattr = pDC->pdcattr; + + /* must be memory dc to select bitmap */ + if (pDC->dctype != DC_TYPE_MEMORY) + { + DC_UnlockDc(pDC); + return NULL; + } + + psurfBmp = SURFACE_LockSurface(hBmp); + if (!psurfBmp) + { + DC_UnlockDc(pDC); + return NULL; + } + + /* Get the handle for the old bitmap */ + psurfOld = pDC->dclevel.pSurface; + hOrgBmp = psurfOld ? psurfOld->BaseObject.hHmgr : NULL; + + /* FIXME: ros hack */ + hOrgBmp = pDC->rosdc.hBitmap; + + pDC->rosdc.hBitmap = hBmp; + + /* Release the old bitmap, reference the new */ + DC_vSelectSurface(pDC, psurfBmp); + + // If Info DC this is zero and pSurface is moved to DC->pSurfInfo. + psurfBmp->hDC = hDC; + + // if we're working with a DIB, get the palette + // [fixme: only create if the selected palette is null] + if (psurfBmp->hSecure) + { +// pDC->rosdc.bitsPerPixel = psurfBmp->dib->dsBmih.biBitCount; ??? + pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); + } + else + { + pDC->rosdc.bitsPerPixel = BitsPerFormat(psurfBmp->SurfObj.iBitmapFormat); + } + + /* FIXME; improve by using a region without a handle and selecting it */ + hVisRgn = NtGdiCreateRectRgn(0, + 0, + psurfBmp->SurfObj.sizlBitmap.cx, + psurfBmp->SurfObj.sizlBitmap.cy); + + /* Release the exclusive lock */ + SURFACE_UnlockSurface(psurfBmp); + + /* Regenerate the XLATEOBJs. (hack!) */ + pbrush = BRUSH_LockBrush(pdcattr->hbrush); + if (pbrush) + { + if (pDC->rosdc.XlateBrush) + { + EngDeleteXlate(pDC->rosdc.XlateBrush); + } + pDC->rosdc.XlateBrush = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); + BRUSH_UnlockBrush(pbrush); + } + + pbrush = PEN_LockPen(pdcattr->hpen); + if (pbrush) + { + if (pDC->rosdc.XlatePen) + { + EngDeleteXlate(pDC->rosdc.XlatePen); + } + pDC->rosdc.XlatePen = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); + PEN_UnlockPen(pbrush); + } + + DC_UnlockDc(pDC); + + if (hVisRgn) + { + GdiSelectVisRgn(hDC, hVisRgn); + GreDeleteObject(hVisRgn); + } + + return hOrgBmp; +} + + BOOL APIENTRY NtGdiSelectClipPath( Modified: trunk/reactos/subsystems/win32/win32k/objects/dcstate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] Thu Mar 26 03:56:46 2009 @@ -39,12 +39,12 @@ /* Handle references here correctly */ DC_vSelectSurface(pdcDst, pdcSrc->dclevel.pSurface); + DC_vSelectFillBrush(pdcDst, pdcSrc->dclevel.pbrFill); + DC_vSelectLineBrush(pdcDst, pdcSrc->dclevel.pbrLine); // FIXME: handle refs pdcDst->dclevel.hpal = pdcSrc->dclevel.hpal; pdcDst->dclevel.ppal = pdcSrc->dclevel.ppal; - pdcDst->dclevel.pbrFill = pdcSrc->dclevel.pbrFill; - pdcDst->dclevel.pbrLine = pdcSrc->dclevel.pbrLine; pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt; /* ROS hacks */
15 years, 9 months
1
0
0
0
[tkreuzer] 40242: Move NtGdiSelectClipPath, Nt/IntGdiSelectBrush, Nt/IntGdiSelectpen to dcobj.c, improve formatting, no code change.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Mar 26 01:14:20 2009 New Revision: 40242 URL:
http://svn.reactos.org/svn/reactos?rev=40242&view=rev
Log: Move NtGdiSelectClipPath, Nt/IntGdiSelectBrush, Nt/IntGdiSelectpen to dcobj.c, improve formatting, no code change. Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c trunk/reactos/subsystems/win32/win32k/objects/path.c trunk/reactos/subsystems/win32/win32k/objects/pen.c Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] Thu Mar 26 01:14:20 2009 @@ -482,50 +482,6 @@ BRUSH_UnlockBrush(pbrush); return hBrush; -} - -HBRUSH -FASTCALL -IntGdiSelectBrush( - PDC pDC, - HBRUSH hBrush) -{ - PDC_ATTR pdcattr; - HBRUSH hOrgBrush; - PBRUSH pbrush; - XLATEOBJ *XlateObj; - BOOLEAN bFailed; - - if (pDC == NULL || hBrush == NULL) return NULL; - - pdcattr = pDC->pdcattr; - - pbrush = BRUSH_LockBrush(hBrush); - if (pbrush == NULL) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return NULL; - } - - XlateObj = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); - BRUSH_UnlockBrush(pbrush); - if(bFailed) - { - return NULL; - } - - hOrgBrush = pdcattr->hbrush; - pdcattr->hbrush = hBrush; - - if (pDC->rosdc.XlateBrush != NULL) - { - EngDeleteXlate(pDC->rosdc.XlateBrush); - } - pDC->rosdc.XlateBrush = XlateObj; - - pdcattr->ulDirty_ &= ~DC_BRUSH_DIRTY; - - return hOrgBrush; } @@ -675,31 +631,4 @@ BRUSH_UnlockBrush(pbrush); } - /* - * @implemented - */ -HBRUSH -APIENTRY -NtGdiSelectBrush( - IN HDC hDC, - IN HBRUSH hBrush) -{ - PDC pDC; - HBRUSH hOrgBrush; - - if (hDC == NULL || hBrush == NULL) return NULL; - - pDC = DC_LockDc(hDC); - if (!pDC) - { - return NULL; - } - - hOrgBrush = IntGdiSelectBrush(pDC,hBrush); - - DC_UnlockDc(pDC); - - return hOrgBrush; -} - /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Thu Mar 26 01:14:20 2009 @@ -164,8 +164,309 @@ } } - - +HPALETTE +FASTCALL +GdiSelectPalette( + HDC hDC, + HPALETTE hpal, + BOOL ForceBackground) +{ + PDC pdc; + HPALETTE oldPal = NULL; + PPALGDI ppal; + + // FIXME: mark the palette as a [fore\back]ground pal + pdc = DC_LockDc(hDC); + if (!pdc) + { + return NULL; + } + + /* Check if this is a valid palette handle */ + ppal = PALETTE_LockPalette(hpal); + if (!ppal) + { + DC_UnlockDc(pdc); + return NULL; + } + + /* Is this a valid palette for this depth? */ + if ((pdc->rosdc.bitsPerPixel <= 8 && ppal->Mode == PAL_INDEXED) || + (pdc->rosdc.bitsPerPixel > 8 && ppal->Mode != PAL_INDEXED)) + { + oldPal = pdc->dclevel.hpal; + pdc->dclevel.hpal = hpal; + } + else if (pdc->rosdc.bitsPerPixel > 8 && ppal->Mode == PAL_INDEXED) + { + oldPal = pdc->dclevel.hpal; + pdc->dclevel.hpal = hpal; + } + + PALETTE_UnlockPalette(ppal); + DC_UnlockDc(pdc); + + return oldPal; +} + +HBRUSH +FASTCALL +IntGdiSelectBrush( + PDC pDC, + HBRUSH hBrush) +{ + PDC_ATTR pdcattr; + HBRUSH hOrgBrush; + PBRUSH pbrush; + XLATEOBJ *XlateObj; + BOOLEAN bFailed; + + if (pDC == NULL || hBrush == NULL) return NULL; + + pdcattr = pDC->pdcattr; + + pbrush = BRUSH_LockBrush(hBrush); + if (pbrush == NULL) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return NULL; + } + + XlateObj = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed); + BRUSH_UnlockBrush(pbrush); + if(bFailed) + { + return NULL; + } + + hOrgBrush = pdcattr->hbrush; + pdcattr->hbrush = hBrush; + + if (pDC->rosdc.XlateBrush != NULL) + { + EngDeleteXlate(pDC->rosdc.XlateBrush); + } + pDC->rosdc.XlateBrush = XlateObj; + + pdcattr->ulDirty_ &= ~DC_BRUSH_DIRTY; + + return hOrgBrush; +} + +HPEN +FASTCALL +IntGdiSelectPen( + PDC pDC, + HPEN hPen) +{ + PDC_ATTR pdcattr; + HPEN hOrgPen = NULL; + PBRUSH pbrushPen; + XLATEOBJ *XlateObj; + BOOLEAN bFailed; + + if (pDC == NULL || hPen == NULL) return NULL; + + pdcattr = pDC->pdcattr; + + pbrushPen = PEN_LockPen(hPen); + if (pbrushPen == NULL) + { + return NULL; + } + + XlateObj = IntGdiCreateBrushXlate(pDC, pbrushPen, &bFailed); + PEN_UnlockPen(pbrushPen); + if (bFailed) + { + SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); + return NULL; + } + + hOrgPen = pdcattr->hpen; + pdcattr->hpen = hPen; + + if (pDC->rosdc.XlatePen != NULL) + { + EngDeleteXlate(pDC->rosdc.XlatePen); + } + pdcattr->ulDirty_ &= ~DC_PEN_DIRTY; + + pDC->rosdc.XlatePen = XlateObj; + + return hOrgPen; +} + + + /* + * @implemented + */ +HBRUSH +APIENTRY +NtGdiSelectBrush( + IN HDC hDC, + IN HBRUSH hBrush) +{ + PDC pDC; + HBRUSH hOrgBrush; + + if (hDC == NULL || hBrush == NULL) return NULL; + + pDC = DC_LockDc(hDC); + if (!pDC) + { + return NULL; + } + + hOrgBrush = IntGdiSelectBrush(pDC,hBrush); + + DC_UnlockDc(pDC); + + return hOrgBrush; +} + + /* + * @implemented + */ +HPEN +APIENTRY +NtGdiSelectPen( + IN HDC hDC, + IN HPEN hPen) +{ + PDC pDC; + HPEN hOrgPen; + + if (hDC == NULL || hPen == NULL) return NULL; + + pDC = DC_LockDc(hDC); + if (!pDC) + { + return NULL; + } + + hOrgPen = IntGdiSelectPen(pDC, hPen); + + DC_UnlockDc(pDC); + + return hOrgPen; +} + +BOOL +APIENTRY +NtGdiSelectClipPath( + HDC hDC, + int Mode) +{ + HRGN hrgnPath; + PPATH pPath; + BOOL success = FALSE; + PDC_ATTR pdcattr; + PDC pdc; + + pdc = DC_LockDc(hDC); + if (!pdc) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + pdcattr = pdc->pdcattr; + + pPath = PATH_LockPath(pdc->dclevel.hPath); + if (!pPath) + { + DC_UnlockDc(pdc); + return FALSE; + } + + /* Check that path is closed */ + if (pPath->state != PATH_Closed) + { + SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); + return FALSE; + } + + /* Construct a region from the path */ + else if (PATH_PathToRegion(pPath, pdcattr->jFillMode, &hrgnPath)) + { + success = GdiExtSelectClipRgn(pdc, hrgnPath, Mode) != ERROR; + GreDeleteObject( hrgnPath ); + + /* Empty the path */ + if (success) + PATH_EmptyPath(pPath); + + /* FIXME: Should this function delete the path even if it failed? */ + } + + PATH_UnlockPath(pPath); + DC_UnlockDc(pdc); + + return success; +} + +HANDLE +APIENTRY +NtGdiGetDCObject(HDC hDC, INT ObjectType) +{ + HGDIOBJ SelObject; + DC *pdc; + PDC_ATTR pdcattr; + + /* From Wine: GetCurrentObject does not SetLastError() on a null object */ + if(!hDC) return NULL; + + if(!(pdc = DC_LockDc(hDC))) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return NULL; + } + pdcattr = pdc->pdcattr; + + if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY) + IntGdiSelectBrush(pdc, pdcattr->hbrush); + + if (pdcattr->ulDirty_ & DC_PEN_DIRTY) + IntGdiSelectPen(pdc, pdcattr->hpen); + + switch(ObjectType) + { + case GDI_OBJECT_TYPE_EXTPEN: + case GDI_OBJECT_TYPE_PEN: + SelObject = pdcattr->hpen; + break; + + case GDI_OBJECT_TYPE_BRUSH: + SelObject = pdcattr->hbrush; + break; + + case GDI_OBJECT_TYPE_PALETTE: + SelObject = pdc->dclevel.hpal; + break; + + case GDI_OBJECT_TYPE_FONT: + SelObject = pdcattr->hlfntNew; + break; + + case GDI_OBJECT_TYPE_BITMAP: + SelObject = pdc->rosdc.hBitmap; + break; + + case GDI_OBJECT_TYPE_COLORSPACE: + DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_COLORSPACE not supported yet!\n"); + // SelObject = dc->dclevel.pColorSpace.BaseObject.hHmgr; ? + SelObject = NULL; + break; + + default: + SelObject = NULL; + SetLastWin32Error(ERROR_INVALID_PARAMETER); + break; + } + + DC_UnlockDc(pdc); + return SelObject; +} ULONG APIENTRY @@ -175,107 +476,7 @@ IN ULONG cjBuf, OUT OPTIONAL PVOID pvBuf) { - UNIMPLEMENTED; - return 0; -} - -HANDLE -APIENTRY -NtGdiGetDCObject(HDC hDC, INT ObjectType) -{ - HGDIOBJ SelObject; - DC *dc; - PDC_ATTR pdcattr; - - /* From Wine: GetCurrentObject does not SetLastError() on a null object */ - if(!hDC) return NULL; - - if(!(dc = DC_LockDc(hDC))) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return NULL; - } - pdcattr = dc->pdcattr; - - if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY) - IntGdiSelectBrush(dc,pdcattr->hbrush); - - if (pdcattr->ulDirty_ & DC_PEN_DIRTY) - IntGdiSelectPen(dc,pdcattr->hpen); - - switch(ObjectType) - { - case GDI_OBJECT_TYPE_EXTPEN: - case GDI_OBJECT_TYPE_PEN: - SelObject = pdcattr->hpen; - break; - case GDI_OBJECT_TYPE_BRUSH: - SelObject = pdcattr->hbrush; - break; - case GDI_OBJECT_TYPE_PALETTE: - SelObject = dc->dclevel.hpal; - break; - case GDI_OBJECT_TYPE_FONT: - SelObject = pdcattr->hlfntNew; - break; - case GDI_OBJECT_TYPE_BITMAP: - SelObject = dc->rosdc.hBitmap; - break; - case GDI_OBJECT_TYPE_COLORSPACE: - DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_COLORSPACE not supported yet!\n"); - // SelObject = dc->dclevel.pColorSpace.BaseObject.hHmgr; ? - SelObject = NULL; - break; - default: - SelObject = NULL; - SetLastWin32Error(ERROR_INVALID_PARAMETER); - break; - } - - DC_UnlockDc(dc); - return SelObject; -} - -HPALETTE -FASTCALL -GdiSelectPalette(HDC hDC, - HPALETTE hpal, - BOOL ForceBackground) -{ - PDC dc; - HPALETTE oldPal = NULL; - PPALGDI PalGDI; - - // FIXME: mark the palette as a [fore\back]ground pal - dc = DC_LockDc(hDC); - if (!dc) - { - return NULL; - } - - /* Check if this is a valid palette handle */ - PalGDI = PALETTE_LockPalette(hpal); - if (!PalGDI) - { - DC_UnlockDc(dc); - return NULL; - } - - /* Is this a valid palette for this depth? */ - if ((dc->rosdc.bitsPerPixel <= 8 && PalGDI->Mode == PAL_INDEXED) || - (dc->rosdc.bitsPerPixel > 8 && PalGDI->Mode != PAL_INDEXED)) - { - oldPal = dc->dclevel.hpal; - dc->dclevel.hpal = hpal; - } - else if (8 < dc->rosdc.bitsPerPixel && PAL_INDEXED == PalGDI->Mode) - { - oldPal = dc->dclevel.hpal; - dc->dclevel.hpal = hpal; - } - - PALETTE_UnlockPalette(PalGDI); - DC_UnlockDc(dc); - - return oldPal; -} + UNIMPLEMENTED; + return 0; +} + Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] Thu Mar 26 01:14:20 2009 @@ -2635,51 +2635,4 @@ return Ret; } -BOOL -APIENTRY -NtGdiSelectClipPath(HDC hDC, - int Mode) -{ - HRGN hrgnPath; - PPATH pPath; - BOOL success = FALSE; - PDC_ATTR pdcattr; - PDC dc = DC_LockDc ( hDC ); - - if ( !dc ) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - - pdcattr = dc->pdcattr; - - pPath = PATH_LockPath( dc->dclevel.hPath ); - if (!pPath) - { - DC_UnlockDc ( dc ); - return FALSE; - } - /* Check that path is closed */ - if( pPath->state != PATH_Closed ) - { - SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); - return FALSE; - } - /* Construct a region from the path */ - else if( PATH_PathToRegion( pPath, pdcattr->jFillMode, &hrgnPath ) ) - { - success = GdiExtSelectClipRgn( dc, hrgnPath, Mode ) != ERROR; - GreDeleteObject( hrgnPath ); - - /* Empty the path */ - if( success ) - PATH_EmptyPath( pPath); - /* FIXME: Should this function delete the path even if it failed? */ - } - PATH_UnlockPath( pPath ); - DC_UnlockDc ( dc ); - return success; -} - /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/objects/pen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] Thu Mar 26 01:14:20 2009 @@ -276,50 +276,6 @@ } -HPEN -FASTCALL -IntGdiSelectPen( - PDC pDC, - HPEN hPen) -{ - PDC_ATTR pdcattr; - HPEN hOrgPen = NULL; - PBRUSH pbrushPen; - XLATEOBJ *XlateObj; - BOOLEAN bFailed; - - if (pDC == NULL || hPen == NULL) return NULL; - - pdcattr = pDC->pdcattr; - - pbrushPen = PEN_LockPen(hPen); - if (pbrushPen == NULL) - { - return NULL; - } - - XlateObj = IntGdiCreateBrushXlate(pDC, pbrushPen, &bFailed); - PEN_UnlockPen(pbrushPen); - if (bFailed) - { - SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); - return NULL; - } - - hOrgPen = pdcattr->hpen; - pdcattr->hpen = hPen; - - if (pDC->rosdc.XlatePen != NULL) - { - EngDeleteXlate(pDC->rosdc.XlatePen); - } - pdcattr->ulDirty_ &= ~DC_PEN_DIRTY; - - pDC->rosdc.XlatePen = XlateObj; - - return hOrgPen; -} - /* PUBLIC FUNCTIONS ***********************************************************/ HPEN APIENTRY @@ -439,31 +395,6 @@ return hPen; } - /* - * @implemented - */ -HPEN -APIENTRY -NtGdiSelectPen( - IN HDC hDC, - IN HPEN hPen) -{ - PDC pDC; - HPEN hOrgPen; - - if (hDC == NULL || hPen == NULL) return NULL; - - pDC = DC_LockDc(hDC); - if (!pDC) - { - return NULL; - } - - hOrgPen = IntGdiSelectPen(pDC,hPen); - - DC_UnlockDc(pDC); - - return hOrgPen; -} + /* EOF */
15 years, 9 months
1
0
0
0
[cwittich] 40241: kill the vm if it is already running (quick and dirty)
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 26 00:45:45 2009 New Revision: 40241 URL:
http://svn.reactos.org/svn/reactos?rev=40241&view=rev
Log: kill the vm if it is already running (quick and dirty) Modified: trunk/tools/sysreg2/virt.c Modified: trunk/tools/sysreg2/virt.c URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/virt.c?rev=40241&r1=…
============================================================================== --- trunk/tools/sysreg2/virt.c [iso-8859-1] (original) +++ trunk/tools/sysreg2/virt.c [iso-8859-1] Thu Mar 26 00:45:45 2009 @@ -167,8 +167,9 @@ if (IsVirtualMachineRunning(vConn, AppSettings.Name)) { - SysregPrintf("Error: Virtual Machine is already running.\n"); - goto cleanup; + /* SysregPrintf("Error: Virtual Machine is already running.\n"); + goto cleanup; */ + system("virsh destroy ReactOS"); } /* If the HD image already exists, delete it */
15 years, 9 months
1
0
0
0
[tkreuzer] 40240: Rename NtGdiDeleteObject to GreDeleteObject
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Mar 25 23:24:34 2009 New Revision: 40240 URL:
http://svn.reactos.org/svn/reactos?rev=40240&view=rev
Log: Rename NtGdiDeleteObject to GreDeleteObject Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c trunk/reactos/subsystems/win32/win32k/include/gdiobj.h trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/message.c trunk/reactos/subsystems/win32/win32k/ntuser/painting.c trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c trunk/reactos/subsystems/win32/win32k/ntuser/vis.c trunk/reactos/subsystems/win32/win32k/ntuser/windc.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c trunk/reactos/subsystems/win32/win32k/objects/bitblt.c trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c trunk/reactos/subsystems/win32/win32k/objects/brush.c trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c trunk/reactos/subsystems/win32/win32k/objects/dclife.c trunk/reactos/subsystems/win32/win32k/objects/dcstate.c trunk/reactos/subsystems/win32/win32k/objects/dibobj.c trunk/reactos/subsystems/win32/win32k/objects/freetype.c trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c trunk/reactos/subsystems/win32/win32k/objects/path.c trunk/reactos/subsystems/win32/win32k/objects/region.c Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/surface.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/surface.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -132,7 +132,7 @@ if (psurf->hDIBPalette != NULL) { - NtGdiDeleteObject(psurf->hDIBPalette); + GreDeleteObject(psurf->hDIBPalette); } } Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -79,7 +79,7 @@ #define GDIOBJFLAG_IGNOREPID (0x1) #define GDIOBJFLAG_IGNORELOCK (0x2) -BOOL FASTCALL NtGdiDeleteObject(HGDIOBJ hObject); +BOOL FASTCALL GreDeleteObject(HGDIOBJ hObject); BOOL FASTCALL IsObjectDead(HGDIOBJ); BOOL FASTCALL IntGdiSetDCOwnerEx( HDC, DWORD, BOOL); 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 Mar 25 23:24:34 2009 @@ -470,13 +470,13 @@ if(bmpMask) { GDIOBJ_SetOwnership(bmpMask, PsGetCurrentProcess()); - NtGdiDeleteObject(bmpMask); + GreDeleteObject(bmpMask); CurIcon->IconInfo.hbmMask = NULL; } if(bmpColor) { GDIOBJ_SetOwnership(bmpColor, PsGetCurrentProcess()); - NtGdiDeleteObject(bmpColor); + GreDeleteObject(bmpColor); CurIcon->IconInfo.hbmColor = NULL; } @@ -1152,11 +1152,11 @@ /* Delete old bitmaps */ if (CurIcon->IconInfo.hbmColor != IconInfo.hbmColor) { - NtGdiDeleteObject(CurIcon->IconInfo.hbmColor); + GreDeleteObject(CurIcon->IconInfo.hbmColor); } if (CurIcon->IconInfo.hbmMask != IconInfo.hbmMask) { - NtGdiDeleteObject(CurIcon->IconInfo.hbmMask); + GreDeleteObject(CurIcon->IconInfo.hbmMask); } /* Copy new IconInfo field */ @@ -1683,7 +1683,7 @@ { if(hOldOffBmp) NtGdiSelectBitmap(hdcOff, hOldOffBmp); if(hOldOffBrush) NtGdiSelectBrush(hdcOff, hOldOffBrush); - if(hbmOff) NtGdiDeleteObject(hbmOff); + if(hbmOff) GreDeleteObject(hbmOff); if(hdcOff) NtGdiDeleteObjectApp(hdcOff); } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -398,7 +398,7 @@ /* send a WM_NCPAINT and WM_ERASEBKGND if the non-client area is still invalid */ HRGN hrgn = NtGdiCreateRectRgn( 0, 0, 0, 0 ); co_UserGetUpdateRgn( Window, hrgn, TRUE ); - NtGdiDeleteObject( hrgn ); + GreDeleteObject( hrgn ); } return retval; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -182,7 +182,7 @@ hRgnWindow = IntCalcWindowRgn(Window, TRUE); if (hRgnWindow == NULL) { - NtGdiDeleteObject(hRgnNonClient); + GreDeleteObject(hRgnNonClient); return (HRGN)1; } @@ -190,14 +190,14 @@ hRgnWindow, RGN_DIFF); if (RgnType == ERROR) { - NtGdiDeleteObject(hRgnWindow); - NtGdiDeleteObject(hRgnNonClient); + GreDeleteObject(hRgnWindow); + GreDeleteObject(hRgnNonClient); return (HRGN)1; } else if (RgnType == NULLREGION) { - NtGdiDeleteObject(hRgnWindow); - NtGdiDeleteObject(hRgnNonClient); + GreDeleteObject(hRgnWindow); + GreDeleteObject(hRgnNonClient); return NULL; } @@ -212,14 +212,14 @@ hRgnWindow, RGN_AND) == NULLREGION) { GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); - NtGdiDeleteObject(Window->UpdateRegion); + GreDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; if (!(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT)) MsqDecPaintCountQueue(Window->MessageQueue); } } - NtGdiDeleteObject(hRgnWindow); + GreDeleteObject(hRgnWindow); return hRgnNonClient; } @@ -355,7 +355,7 @@ hRgnClient = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->ClientRect); RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND); - NtGdiDeleteObject(hRgnClient); + GreDeleteObject(hRgnClient); } /* @@ -368,7 +368,7 @@ hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect); RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND); - NtGdiDeleteObject(hRgnWindow); + GreDeleteObject(hRgnWindow); } else { @@ -405,7 +405,7 @@ hRgn, RGN_OR) == NULLREGION) { GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); - NtGdiDeleteObject(Window->UpdateRegion); + GreDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; } @@ -425,7 +425,7 @@ hRgn, RGN_DIFF) == NULLREGION) { GDIOBJ_SetOwnership(Window->UpdateRegion, PsGetCurrentProcess()); - NtGdiDeleteObject(Window->UpdateRegion); + GreDeleteObject(Window->UpdateRegion); Window->UpdateRegion = NULL; } } @@ -467,7 +467,7 @@ HRGN hRgnTemp = NtGdiCreateRectRgn(0, 0, 0, 0); NtGdiCombineRgn(hRgnTemp, hRgn, 0, RGN_COPY); IntInvalidateWindows(Child, hRgnTemp, Flags); - NtGdiDeleteObject(hRgnTemp); + GreDeleteObject(hRgnTemp); } } @@ -564,7 +564,7 @@ hRgn = NtGdiCreateRectRgn(0, 0, 0, 0); if (NtGdiCombineRgn(hRgn, UpdateRgn, NULL, RGN_COPY) == NULLREGION) { - NtGdiDeleteObject(hRgn); + GreDeleteObject(hRgn); hRgn = NULL; } else @@ -619,7 +619,7 @@ if (hRgn != NULL) { - NtGdiDeleteObject(hRgn); + GreDeleteObject(hRgn); } return TRUE; @@ -1209,7 +1209,7 @@ NtGdiOffsetRgn(hrgnTmp, dx, dy); Result = NtGdiCombineRgn(hrgnOwn, hrgnOwn, hrgnTmp, RGN_DIFF); - NtGdiDeleteObject(hrgnTmp); + GreDeleteObject(hrgnTmp); if (prcUpdate) { @@ -1218,7 +1218,7 @@ if (!hrgnUpdate) { - NtGdiDeleteObject(hrgnOwn); + GreDeleteObject(hrgnOwn); } } else @@ -1412,9 +1412,9 @@ NtGdiOffsetRgn(hrgnTemp, dx, dy); NtGdiCombineRgn(hrgnTemp, hrgnTemp, hrgnClip, RGN_AND); co_UserRedrawWindow(Window, NULL, hrgnTemp, RDW_INVALIDATE | RDW_ERASE); - NtGdiDeleteObject(hrgnClip); - } - NtGdiDeleteObject(hrgnTemp); + GreDeleteObject(hrgnClip); + } + GreDeleteObject(hrgnTemp); if (flags & SW_SCROLLCHILDREN) { @@ -1487,7 +1487,7 @@ CLEANUP: if (hrgnOwn && !hrgnUpdate) { - NtGdiDeleteObject(hrgnOwn); + GreDeleteObject(hrgnOwn); } if (Window) @@ -1583,7 +1583,7 @@ if(!hOldFont) { DPRINT1("%s: SelectFont() failed!\n", __FUNCTION__); - NtGdiDeleteObject(hFont); + GreDeleteObject(hFont); return FALSE; } @@ -1600,7 +1600,7 @@ IntGdiSetTextColor(hDc, OldTextColor); NtGdiSelectFont(hDc, hOldFont); - NtGdiDeleteObject(hFont); + GreDeleteObject(hFont); return TRUE; } @@ -1864,7 +1864,7 @@ cleanup: if (hOldBrush) NtGdiSelectBrush(hMemDc, hOldBrush); if (hOldBmp) NtGdiSelectBitmap(hMemDc, hOldBmp); - if (hMemBmp) NtGdiDeleteObject(hMemBmp); + if (hMemBmp) GreDeleteObject(hMemBmp); if (hMemDc) NtGdiDeleteObjectApp(hMemDc); return Ret; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -376,7 +376,7 @@ if(hOldBitmap != NULL) { /* delete the old wallpaper */ - NtGdiDeleteObject(hOldBitmap); + GreDeleteObject(hOldBitmap); } /* Set the style */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/vis.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/vis.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/vis.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -71,13 +71,13 @@ CurrentWnd = CurrentWindow->Wnd; if (!(CurrentWnd) || !(CurrentWnd->Style & WS_VISIBLE)) { - NtGdiDeleteObject(VisRgn); + GreDeleteObject(VisRgn); return NULL; } ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWnd->ClientRect); NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND); - NtGdiDeleteObject(ClipRgn); + GreDeleteObject(ClipRgn); if ((PreviousWnd->Style & WS_CLIPSIBLINGS) || (PreviousWnd == Wnd && ClipSiblings)) @@ -98,7 +98,7 @@ NtGdiOffsetRgn(ClipRgn, CurrentSiblingWnd->WindowRect.left, CurrentSiblingWnd->WindowRect.top); } NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF); - NtGdiDeleteObject(ClipRgn); + GreDeleteObject(ClipRgn); } CurrentSibling = CurrentSibling->NextSibling; } @@ -127,7 +127,7 @@ NtGdiOffsetRgn(ClipRgn, CurrentWnd->WindowRect.left, CurrentWnd->WindowRect.top); } NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF); - NtGdiDeleteObject(ClipRgn); + GreDeleteObject(ClipRgn); } CurrentWindow = CurrentWindow->NextSibling; } @@ -174,7 +174,7 @@ RDW_ALLCHILDREN); UserDerefObjectCo(Parent); } - NtGdiDeleteObject(Temp); + GreDeleteObject(Temp); } /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -176,7 +176,7 @@ } else if (Dce->hClipRgn != NULL) { - NtGdiDeleteObject(Dce->hClipRgn); + GreDeleteObject(Dce->hClipRgn); } Dce->hClipRgn = NULL; @@ -290,7 +290,7 @@ { if(hRgnVisible != NULL) { - NtGdiDeleteObject(hRgnVisible); + GreDeleteObject(hRgnVisible); } hRgnVisible = NtGdiCreateRectRgn(0, 0, 0, 0); } @@ -311,7 +311,7 @@ if (hRgnVisible != NULL) { - NtGdiDeleteObject(hRgnVisible); + GreDeleteObject(hRgnVisible); } } @@ -519,7 +519,7 @@ if (!(Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && ClipRegion) { if (!(Flags & DCX_KEEPCLIPRGN)) - NtGdiDeleteObject(ClipRegion); + GreDeleteObject(ClipRegion); ClipRegion = NULL; } @@ -609,7 +609,7 @@ if (pdce->hClipRgn && ! (pdce->DCXFlags & DCX_KEEPCLIPRGN)) { - NtGdiDeleteObject(pdce->hClipRgn); + GreDeleteObject(pdce->hClipRgn); } RemoveEntryList(&pdce->List); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -505,7 +505,7 @@ if(Window->WindowRegion) { - NtGdiDeleteObject(Window->WindowRegion); + GreDeleteObject(Window->WindowRegion); } ASSERT(Window->Wnd != NULL); @@ -4478,7 +4478,7 @@ else Ret = ERROR; - NtGdiDeleteObject(VisRgn); + GreDeleteObject(VisRgn); return Ret; } @@ -4518,7 +4518,7 @@ else Ret = ERROR; - NtGdiDeleteObject(VisRgn); + GreDeleteObject(VisRgn); return Ret; } @@ -4550,7 +4550,7 @@ if(Window->WindowRegion) { /* Delete no longer needed region handle */ - NtGdiDeleteObject(Window->WindowRegion); + GreDeleteObject(Window->WindowRegion); } Window->WindowRegion = hRgn; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -947,7 +947,7 @@ REGION_GetRgnBox(VisRgn, &TempRect) == NULLREGION) { REGION_UnlockRgn(VisRgn); - NtGdiDeleteObject(VisBefore); + GreDeleteObject(VisBefore); VisBefore = NULL; } else if(VisRgn) @@ -1097,7 +1097,7 @@ REGION_GetRgnBox(VisRgn, &TempRect) == NULLREGION) { REGION_UnlockRgn(VisRgn); - NtGdiDeleteObject(VisAfter); + GreDeleteObject(VisAfter); VisAfter = NULL; } else if(VisRgn) @@ -1160,7 +1160,7 @@ { /* Nothing to copy, clean up */ REGION_UnlockRgn(VisRgn); - NtGdiDeleteObject(CopyRgn); + GreDeleteObject(CopyRgn); CopyRgn = NULL; } else if (OldWindowRect.left != NewWindowRect.left || @@ -1222,7 +1222,7 @@ IntInvalidateWindows(Window, DirtyRgn, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN); } - NtGdiDeleteObject(DirtyRgn); + GreDeleteObject(DirtyRgn); */ PWINDOW_OBJECT Parent = Window->Parent; @@ -1244,12 +1244,12 @@ RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN); } } - NtGdiDeleteObject(DirtyRgn); + GreDeleteObject(DirtyRgn); } if (CopyRgn != NULL) { - NtGdiDeleteObject(CopyRgn); + GreDeleteObject(CopyRgn); } /* Expose what was covered before but not covered anymore */ @@ -1268,13 +1268,13 @@ { co_VIS_WindowLayoutChanged(Window, ExposedRgn); } - NtGdiDeleteObject(ExposedRgn); - NtGdiDeleteObject(VisBefore); + GreDeleteObject(ExposedRgn); + GreDeleteObject(VisBefore); } if (VisAfter != NULL) { - NtGdiDeleteObject(VisAfter); + GreDeleteObject(VisAfter); } if (!(WinPos.flags & SWP_NOACTIVATE)) Modified: trunk/reactos/subsystems/win32/win32k/objects/bitblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -703,8 +703,8 @@ NtGdiSelectBitmap(hDC2, hOldBitmap3); /* 6. delete all temp objects */ - NtGdiDeleteObject(hBitmap2); - NtGdiDeleteObject(hBitmap3); + GreDeleteObject(hBitmap2); + GreDeleteObject(hBitmap3); NtGdiDeleteObjectApp(hDC1); NtGdiDeleteObjectApp(hDC2); Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -76,7 +76,7 @@ psurfBmp = SURFACE_LockSurface(hBitmap); if (psurfBmp == NULL) { - NtGdiDeleteObject(hBitmap); + GreDeleteObject(hBitmap); return NULL; } @@ -428,7 +428,7 @@ SURFACE_UnlockSurface(psurf); } } - NtGdiDeleteObject(hBmpTmp); + GreDeleteObject(hBmpTmp); } NtGdiDeleteObjectApp(hDCTmp); } @@ -667,13 +667,13 @@ OldBrush = NtGdiSelectBrush(hDC, hbrush); if (OldBrush == NULL) { - NtGdiDeleteObject(hbrush); + GreDeleteObject(hbrush); return(FALSE); } NtGdiPatBlt(hDC, X, Y, 1, 1, PATCOPY); NtGdiSelectBrush(hDC, OldBrush); - NtGdiDeleteObject(hbrush); + GreDeleteObject(hbrush); return TRUE; } @@ -801,7 +801,7 @@ { GDIOBJ_UnlockObjByPtr((POBJ)resBitmap); GDIOBJ_UnlockObjByPtr((POBJ)Bitmap); - NtGdiDeleteObject(res); + GreDeleteObject(res); return 0; } IntGetBitmapBits(Bitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf); @@ -812,7 +812,7 @@ } else { - NtGdiDeleteObject(res); + GreDeleteObject(res); res = NULL; } } @@ -1025,7 +1025,7 @@ if (hVisRgn) { GdiSelectVisRgn(hDC, hVisRgn); - NtGdiDeleteObject(hVisRgn); + GreDeleteObject(hVisRgn); } return hOrgBmp; Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -43,7 +43,7 @@ { ASSERT(pbrush->hbmPattern); GDIOBJ_SetOwnership(pbrush->hbmPattern, PsGetCurrentProcess()); - NtGdiDeleteObject(pbrush->hbmPattern); + GreDeleteObject(pbrush->hbmPattern); } /* Free the kmode styles array of EXTPENS */ @@ -346,7 +346,7 @@ pbrush = BRUSH_AllocBrushWithHandle(); if (pbrush == NULL) { - NtGdiDeleteObject(hPattern); + GreDeleteObject(hPattern); SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); return NULL; } @@ -387,7 +387,7 @@ pbrush = BRUSH_AllocBrushWithHandle(); if (pbrush == NULL) { - NtGdiDeleteObject(hPattern); + GreDeleteObject(hPattern); SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); return NULL; } @@ -422,7 +422,7 @@ pbrush = BRUSH_AllocBrushWithHandle(); if (pbrush == NULL) { - NtGdiDeleteObject(hPattern); + GreDeleteObject(hPattern); SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); return NULL; } Modified: trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/cliprgn.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -108,7 +108,7 @@ { if (dc->rosdc.hClipRgn != NULL) { - NtGdiDeleteObject(dc->rosdc.hClipRgn); + GreDeleteObject(dc->rosdc.hClipRgn); dc->rosdc.hClipRgn = NULL; retval = NULLREGION; } @@ -265,7 +265,7 @@ { Result = NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, NewRgn, RGN_DIFF); } - NtGdiDeleteObject(NewRgn); + GreDeleteObject(NewRgn); } if (Result != ERROR) CLIPPING_UpdateGCRegion(dc); @@ -315,7 +315,7 @@ else { Result = NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, NewRgn, RGN_AND); - NtGdiDeleteObject(NewRgn); + GreDeleteObject(NewRgn); } if (Result != ERROR) CLIPPING_UpdateGCRegion(dc); Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -319,7 +319,7 @@ if (hVisRgn) { GdiSelectVisRgn(hdc, hVisRgn); - NtGdiDeleteObject(hVisRgn); + GreDeleteObject(hVisRgn); } IntGdiSetTextAlign(hdc, TA_TOP); @@ -482,11 +482,11 @@ } if (DCToDelete->rosdc.hClipRgn) { - NtGdiDeleteObject(DCToDelete->rosdc.hClipRgn); + GreDeleteObject(DCToDelete->rosdc.hClipRgn); } if (DCToDelete->rosdc.hVisRgn) { - NtGdiDeleteObject(DCToDelete->rosdc.hVisRgn); + GreDeleteObject(DCToDelete->rosdc.hVisRgn); } if (NULL != DCToDelete->rosdc.CombinedClip) { @@ -494,7 +494,7 @@ } if (DCToDelete->rosdc.hGCClipRgn) { - NtGdiDeleteObject(DCToDelete->rosdc.hGCClipRgn); + GreDeleteObject(DCToDelete->rosdc.hGCClipRgn); } PATH_Delete(DCToDelete->dclevel.hPath); @@ -635,7 +635,7 @@ if (hVisRgn) { GdiSelectVisRgn(hdcNew, hVisRgn); - NtGdiDeleteObject(hVisRgn); + GreDeleteObject(hVisRgn); } if (Layout) NtGdiSetLayout(hdcNew, -1, Layout); @@ -654,7 +654,7 @@ if (GDI_HANDLE_IS_STOCKOBJ(DCHandle)) return TRUE; if (GDI_HANDLE_GET_TYPE(DCHandle) != GDI_OBJECT_TYPE_DC) - return NtGdiDeleteObject((HGDIOBJ) DCHandle); + return GreDeleteObject((HGDIOBJ) DCHandle); if (IsObjectDead((HGDIOBJ)DCHandle)) return TRUE; @@ -689,7 +689,7 @@ case GDIObjType_PAL_TYPE: case GDIObjType_LFONT_TYPE: case GDIObjType_BRUSH_TYPE: - return NtGdiDeleteObject((HGDIOBJ) DCHandle); + return GreDeleteObject((HGDIOBJ) DCHandle); default: return FALSE; Modified: trunk/reactos/subsystems/win32/win32k/objects/dcstate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * PURPOSE: Functions for creation and destruction of DCs + * PURPOSE: Functions for saving and restoring dc states * FILE: subsystem/win32/win32k/objects/dcstate.c * PROGRAMER: Timo Kreuzer (timo.kreuzer(a)rectos.org) */ Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -1095,7 +1095,7 @@ NtGdiDeleteObjectApp(hdcMem); - NtGdiDeleteObject(hBitmap); + GreDeleteObject(hBitmap); return SrcHeight; } @@ -1476,7 +1476,7 @@ ExFreePoolWithTag(lpRGB, TAG_COLORMAP); } SetLastWin32Error(ERROR_INVALID_HANDLE); - NtGdiDeleteObject(bmp); + GreDeleteObject(bmp); return NULL; } Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -3641,10 +3641,10 @@ if (hbrushBackGnd != NULL) { BRUSH_UnlockBrush(pbrushBackGnd); - NtGdiDeleteObject(hbrushBackGnd); + GreDeleteObject(hbrushBackGnd); } BRUSH_UnlockBrush(pbrushText); - NtGdiDeleteObject(hbrushText); + GreDeleteObject(hbrushText); good: DC_UnlockDc( dc ); @@ -3662,12 +3662,12 @@ if (hbrushBackGnd != NULL) { BRUSH_UnlockBrush(pbrushBackGnd); - NtGdiDeleteObject(hbrushBackGnd); + GreDeleteObject(hbrushBackGnd); } if (hbrushText != NULL) { BRUSH_UnlockBrush(pbrushText); - NtGdiDeleteObject(hbrushText); + GreDeleteObject(hbrushText); } DC_UnlockDc(dc); Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -102,7 +102,7 @@ case GdiBCDelRgn: { PGDIBSOBJECT pgO = (PGDIBSOBJECT) pHdr; - NtGdiDeleteObject( pgO->hgdiobj ); + GreDeleteObject( pgO->hgdiobj ); break; } default: Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -661,7 +661,7 @@ */ BOOL FASTCALL -NtGdiDeleteObject(HGDIOBJ hObject) +GreDeleteObject(HGDIOBJ hObject) { DPRINT("NtGdiDeleteObject handle 0x%08x\n", hObject); if (!IsObjectDead(hObject)) Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -149,7 +149,7 @@ /* Paint the region */ IntGdiPaintRgn( dc, hrgn ); - NtGdiDeleteObject( hrgn ); + GreDeleteObject( hrgn ); /* Restore the old mapping mode */ // IntGdiSetMapMode( dc, mapMode ); // pdcattr->szlViewportExt = ptViewportExt; @@ -2670,7 +2670,7 @@ else if( PATH_PathToRegion( pPath, pdcattr->jFillMode, &hrgnPath ) ) { success = GdiExtSelectClipRgn( dc, hrgnPath, Mode ) != ERROR; - NtGdiDeleteObject( hrgnPath ); + GreDeleteObject( hrgnPath ); /* Empty the path */ if( success ) Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Wed Mar 25 23:24:34 2009 @@ -1740,7 +1740,7 @@ if (!trb) { REGION_UnlockRgn(tra); - NtGdiDeleteObject(htra); + GreDeleteObject(htra); return; } htrb = trb->BaseObject.hHmgr; @@ -1751,8 +1751,8 @@ REGION_UnlockRgn(tra); REGION_UnlockRgn(trb); - NtGdiDeleteObject(htra); - NtGdiDeleteObject(htrb); + GreDeleteObject(htra); + GreDeleteObject(htrb); return; } @@ -2577,7 +2577,7 @@ { SetLastWin32Error(ERROR_INVALID_PARAMETER); REGION_UnlockRgn(Region); - NtGdiDeleteObject(hRgn); + GreDeleteObject(hRgn); return NULL; } @@ -2639,13 +2639,13 @@ } if (!REGION_CreateFrameRgn(FrameRgn, hRgn, Width, Height)) { - NtGdiDeleteObject(FrameRgn); + GreDeleteObject(FrameRgn); return FALSE; } Ret = NtGdiFillRgn(hDC, FrameRgn, hBrush); - NtGdiDeleteObject(FrameRgn); + GreDeleteObject(FrameRgn); return Ret; } @@ -2918,7 +2918,7 @@ if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) || NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR) { - NtGdiDeleteObject(tmpVisRgn); + GreDeleteObject(tmpVisRgn); return FALSE; } @@ -2927,7 +2927,7 @@ visrgn = REGION_LockRgn(tmpVisRgn); if (visrgn == NULL) { - NtGdiDeleteObject(tmpVisRgn); + GreDeleteObject(tmpVisRgn); return FALSE; } @@ -2953,7 +2953,7 @@ SURFACE_UnlockSurface(psurf); BRUSH_UnlockBrush(pbrush); REGION_UnlockRgn(visrgn); - NtGdiDeleteObject(tmpVisRgn); + GreDeleteObject(tmpVisRgn); // Fill the region return TRUE; @@ -3708,7 +3708,7 @@ total += Count[poly]; if (! (pETEs = ExAllocatePoolWithTag(PagedPool, sizeof(EdgeTableEntry) * total, TAG_REGION)) ) { - NtGdiDeleteObject(hrgn); + GreDeleteObject(hrgn); return 0; } pts = FirstPtBlock.pts; @@ -3812,7 +3812,7 @@ { DPRINT1("Can't alloc tPB\n"); ExFreePoolWithTag(pETEs, TAG_REGION); - NtGdiDeleteObject(hrgn); + GreDeleteObject(hrgn); return 0; } curPtBlock->next = tmpPtBlock;
15 years, 9 months
1
0
0
0
[cfinck] 40239: ROSCMS_PATH was superseded by ROOT_PATH in this website tree
by cfinck@svn.reactos.org
Author: cfinck Date: Wed Mar 25 22:16:03 2009 New Revision: 40239 URL:
http://svn.reactos.org/svn/reactos?rev=40239&view=rev
Log: ROSCMS_PATH was superseded by ROOT_PATH in this website tree Modified:
trunk/web/reactos.org/htdocs/wiki/LocalSettings.php
Modified:
trunk/web/reactos.org/htdocs/wiki/LocalSettings.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/wiki/LocalS…
============================================================================== ---
trunk/web/reactos.org/htdocs/wiki/LocalSettings.php
[iso-8859-1] (original) +++
trunk/web/reactos.org/htdocs/wiki/LocalSettings.php
[iso-8859-1] Wed Mar 25 22:16:03 2009 @@ -152,6 +152,6 @@ require_once("$IP/extensions/ParserFunctions/ParserFunctions.php"); # RosCMS-specific settings -define("ROSCMS_PATH", "$IP/../roscms/"); +define("ROOT_PATH", "$IP/../"); ?>
15 years, 9 months
1
0
0
0
[janderwald] 40238: - Export KsNullDriverUnload - Stop the audio stream at PASSIVE_LEVEL - Refactor sysaudio code to make it less complex and remove code which is not used - Add a few comments
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 25 22:14:04 2009 New Revision: 40238 URL:
http://svn.reactos.org/svn/reactos?rev=40238&view=rev
Log: - Export KsNullDriverUnload - Stop the audio stream at PASSIVE_LEVEL - Refactor sysaudio code to make it less complex and remove code which is not used - Add a few comments Modified: trunk/reactos/drivers/ksfilter/ks/ks.spec trunk/reactos/drivers/ksfilter/ks/misc.c trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c trunk/reactos/drivers/wdm/audio/sysaudio/control.c trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c trunk/reactos/drivers/wdm/audio/sysaudio/main.c trunk/reactos/drivers/wdm/audio/sysaudio/pin.c trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h Modified: trunk/reactos/drivers/ksfilter/ks/ks.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/ks.spe…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/ks.spec [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/ks.spec [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -98,7 +98,7 @@ @ stdcall KsFreeObjectCreateItem(ptr ptr) @ stdcall KsFreeObjectCreateItemsByContext(ptr ptr) @ stdcall KsLoadResource(ptr long ptr long ptr ptr) -; KsNullDriverUnload@4 +@ stdcall KsNullDriverUnload(ptr) @ stdcall KsPinDataIntersectionEx(ptr ptr ptr long ptr long ptr ptr) @ stdcall KsQueryDevicePnpObject(ptr) @ stdcall KsRecalculateStackDepth(ptr long) 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] Wed Mar 25 22:14:04 2009 @@ -165,7 +165,7 @@ /* @unimplemented */ -VOID +KSDDKAPI VOID NTAPI KsNullDriverUnload( IN PDRIVER_OBJECT DriverObject) { Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -16,6 +16,7 @@ KSSTATE State; PKSDATAFORMAT Format; KSPIN_CONNECT * ConnectDetails; + KDPC Dpc; PVOID CommonBuffer; ULONG CommonBufferSize; @@ -183,6 +184,42 @@ UpdateCommonBuffer(This, Position); } +VOID +NTAPI +StopStreamWorkerRoutine( + IN PDEVICE_OBJECT DeviceObject, + IN PVOID Context) +{ + IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)Context; + + DPRINT1("Stopping %u Irql %u\n", This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue), KeGetCurrentIrql()); + + This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP); + This->State = KSSTATE_STOP; +} + +VOID +NTAPI +StopStreamRoutine( + IN PKDPC Dpc, + IN PVOID DeferredContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2) +{ + IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)DeferredContext; + PIO_WORKITEM WorkItem; + + if (This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue)) + return; + + WorkItem = IoAllocateWorkItem(GetDeviceObject(This->Port)); + if (!WorkItem) + return; + + IoQueueWorkItem(WorkItem, StopStreamWorkerRoutine, DelayedWorkQueue, (PVOID)This); +} + + static VOID @@ -194,32 +231,18 @@ NTSTATUS Status; PUCHAR Buffer; ULONG BufferSize; - IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)CONTAINING_RECORD(iface, IPortPinWaveCyclicImpl, lpVtblServiceSink); Status = This->IrpQueue->lpVtbl->GetMapping(This->IrpQueue, &Buffer, &BufferSize); if (!NT_SUCCESS(Status)) { - if (!This->IrpQueue->lpVtbl->CancelBuffers(This->IrpQueue)) - { - /* there is an active dpc pending - * wait untill this dpc is done, in order to complete the remaining irps - */ - return; - } - DPRINT1("Stopping %u\n", This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue)); - - This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP); - This->State = KSSTATE_STOP; + KeInsertQueueDpc(&This->Dpc, NULL, NULL); return; } - if (KeGetCurrentIrql() == DISPATCH_LEVEL) - return; - Status = This->Stream->lpVtbl->GetPosition(This->Stream, &Position); - DPRINT("Position %u BufferSize %u ActiveIrpOffset %u\n", Position, This->CommonBufferSize, BufferSize); + DPRINT1("Position %u Buffer %p BufferSize %u ActiveIrpOffset %u\n", Position, Buffer, This->CommonBufferSize, BufferSize); if (Position < This->CommonBufferOffset) { @@ -836,6 +859,7 @@ This->KsPinDescriptor = KsPinDescriptor; This->ConnectDetails = ConnectDetails; This->Miniport = GetWaveCyclicMiniport(Port); + KeInitializeDpc(&This->Dpc, StopStreamRoutine, (PVOID)This); DeviceObject = GetDeviceObject(Port); @@ -904,7 +928,7 @@ This->CommonBuffer = This->DmaChannel->lpVtbl->SystemAddress(This->DmaChannel); This->Capture = Capture; - //Status = This->Stream->lpVtbl->SetNotificationFreq(This->Stream, 10, &This->FrameSize); + Status = This->Stream->lpVtbl->SetNotificationFreq(This->Stream, 10, &This->FrameSize); return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -67,8 +67,6 @@ IN ULONG DeviceNumber, PSYSAUDIODEVEXT DeviceExtension) { - PSYSAUDIO_CLIENT_HANDELS Index; - ULONG Count; PSYSAUDIO_CLIENT ClientInfo; PKSAUDIO_DEVICE_ENTRY Entry; PKSOBJECT_CREATE_ITEM CreateItem; @@ -83,66 +81,26 @@ return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); } + /* get client context */ + ClientInfo = (PSYSAUDIO_CLIENT)CreateItem->Context; + + /* sanity check */ + ASSERT(ClientInfo); + + /* check for valid device index */ + if (DeviceNumber >= ClientInfo->NumDevices) + { + /* invalid device index */ + return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); + } + /* get device context */ Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, DeviceNumber); ASSERT(Entry != NULL); - /* get client context */ - ClientInfo = (PSYSAUDIO_CLIENT)CreateItem->Context; - /* does the client already use a device */ - if (!ClientInfo->NumDevices) - { - /* first device to be openend */ - ClientInfo->Devs = ExAllocatePool(NonPagedPool, sizeof(SYSAUDIO_CLIENT_HANDELS)); - if (!ClientInfo->Devs) - { - /* no memory */ - return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); - } - - ClientInfo->NumDevices = 1; - ClientInfo->Devs[0].DeviceId = DeviceNumber; - ClientInfo->Devs[0].ClientHandles = NULL; - ClientInfo->Devs[0].ClientHandlesCount = 0; - /* increase usage count */ - Entry->NumberOfClients++; - return SetIrpIoStatus(Irp, STATUS_SUCCESS, 0); - } - - /* check if device has already been openend */ - for(Count = 0; Count < ClientInfo->NumDevices; Count++) - { - if (ClientInfo->Devs[Count].DeviceId == DeviceNumber) - { - /* device has already been opened */ - return SetIrpIoStatus(Irp, STATUS_SUCCESS, 0); - } - } - /* new device to be openend */ - Index = ExAllocatePool(NonPagedPool, sizeof(SYSAUDIO_CLIENT_HANDELS) * (ClientInfo->NumDevices + 1)); - if (!Index) - { - /* no memory */ - return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); - } - - if (ClientInfo->NumDevices) - { - /* copy device count array */ - RtlMoveMemory(Index, ClientInfo->Devs, ClientInfo->NumDevices * sizeof(SYSAUDIO_CLIENT_HANDELS)); - } - - Index[ClientInfo->NumDevices].DeviceId = DeviceNumber; - Index[ClientInfo->NumDevices].ClientHandlesCount = 0; - Index[ClientInfo->NumDevices].ClientHandles = NULL; - /* increase usage count */ Entry->NumberOfClients++; - ExFreePool(ClientInfo->Devs); - - ClientInfo->Devs = Index; - ClientInfo->NumDevices++; return SetIrpIoStatus(Irp, STATUS_SUCCESS, 0); } @@ -362,7 +320,7 @@ if (WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].MaxPinInstanceCount == 1) { - /* store the pin handle there is the pin can only be instantiated once*/ + /* store the pin handle there if the pin can only be instantiated once*/ WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].PinHandle = RealPinHandle; } @@ -955,8 +913,7 @@ PSYSAUDIODEVEXT DeviceExtension; PKSAUDIO_DEVICE_ENTRY Entry; PSYSAUDIO_INSTANCE_INFO InstanceInfo; - PSYSAUDIO_CLIENT ClientInfo; - ULONG Count, BytesReturned; + ULONG BytesReturned; PKSOBJECT_CREATE_ITEM CreateItem; UNICODE_STRING GuidString; @@ -1034,7 +991,7 @@ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG)) { /* too small buffer */ - return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSCOMPONENTID)); + return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(ULONG)); } if (Property->Flags & KSPROPERTY_TYPE_SET) @@ -1042,23 +999,6 @@ Index = (PULONG)Irp->UserBuffer; return SysAudioOpenVirtualDevice(Irp, *Index, DeviceExtension); } - else if (Property->Flags & KSPROPERTY_TYPE_GET) - { - Index = (PULONG)Irp->UserBuffer; - /* get client context */ - ClientInfo = (PSYSAUDIO_CLIENT)CreateItem->Context; - ASSERT(ClientInfo); - /* does the client already use a device */ - if (!ClientInfo->NumDevices) - { - /* no device open */ - return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); - } - /* store last opened device number */ - *Index = ClientInfo->Devs[ClientInfo->NumDevices-1].DeviceId; - /* found no device with that device index open */ - return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(ULONG)); - } } else if (Property->Id == KSPROPERTY_SYSAUDIO_INSTANCE_INFO) { @@ -1074,28 +1014,6 @@ if (Property->Flags & KSPROPERTY_TYPE_SET) { return SysAudioOpenVirtualDevice(Irp, InstanceInfo->DeviceNumber, DeviceExtension); - } - else if (Property->Flags & KSPROPERTY_TYPE_GET) - { - /* get client context */ - ClientInfo = (PSYSAUDIO_CLIENT)CreateItem->Context; - ASSERT(ClientInfo); - /* does the client already use a device */ - if (!ClientInfo->NumDevices) - { - /* no device open */ - return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); - } - for(Count = 0; Count < ClientInfo->NumDevices; Count++) - { - if (ClientInfo->Devs[Count].DeviceId == InstanceInfo->DeviceNumber) - { - /* specified device is open */ - return SetIrpIoStatus(Irp, STATUS_SUCCESS, 0); - } - } - /* found no device with that device index open */ - return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); } } else if (Property->Id == (ULONG)-1) Modified: trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/deviface.c [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -178,7 +178,7 @@ DeviceEntry = ExAllocatePool(NonPagedPool, sizeof(KSAUDIO_DEVICE_ENTRY)); if (!DeviceEntry) { - DPRINT1("No Mem\n"); + return STATUS_INSUFFICIENT_RESOURCES; } @@ -188,14 +188,12 @@ DeviceEntry->DeviceName.Buffer = ExAllocatePool(NonPagedPool, DeviceEntry->DeviceName.MaximumLength); if (!DeviceEntry->DeviceName.Buffer) { - DPRINT1("No Mem\n"); ExFreePool(DeviceEntry); return STATUS_INSUFFICIENT_RESOURCES; } if (!NT_SUCCESS(RtlAppendUnicodeToString(&DeviceEntry->DeviceName, L"\\??\\"))) { - DPRINT1("No Mem\n"); ExFreePool(DeviceEntry->DeviceName.Buffer); ExFreePool(DeviceEntry); return STATUS_INSUFFICIENT_RESOURCES; @@ -203,14 +201,11 @@ if (!NT_SUCCESS(RtlAppendUnicodeStringToString(&DeviceEntry->DeviceName, Event->SymbolicLinkName))) { - DPRINT1("No Mem\n"); ExFreePool(DeviceEntry->DeviceName.Buffer); ExFreePool(DeviceEntry); return STATUS_INSUFFICIENT_RESOURCES; } - DPRINT1("Sym %wZ\n", &DeviceEntry->DeviceName); - Status = OpenDevice(&DeviceEntry->DeviceName, &DeviceEntry->Handle, &DeviceEntry->FileObject); if (!NT_SUCCESS(Status)) { @@ -231,24 +226,12 @@ return Status; } - else if (IsEqualGUIDAligned(&Event->Event, - &GUID_DEVICE_INTERFACE_REMOVAL)) + else { DPRINT1("Remove interface to audio device!\n"); - ///FIXME - /// + UNIMPLEMENTED return STATUS_SUCCESS; } - else - { - UNICODE_STRING EventName, InterfaceGuid; - - RtlStringFromGUID(&Event->Event, &EventName); - RtlStringFromGUID(&Event->InterfaceClassGuid, &InterfaceGuid); - DPRINT1("Unknown event: Event %wZ GUID %wZ\n", &EventName, &InterfaceGuid); - return STATUS_SUCCESS; - } - } NTSTATUS Modified: trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -24,17 +24,13 @@ { PIO_STACK_LOCATION IoStack; - //DPRINT("Dispatch_fnDeviceIoControl called DeviceObject %p Irp %p\n", DeviceObject); - IoStack = IoGetCurrentIrpStackLocation(Irp); if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY) { return SysAudioHandleProperty(DeviceObject, Irp); } - DPRINT1("Dispatch_fnDeviceIoControl Unhandeled %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode); - DbgBreakPoint(); - + /* unsupported request */ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -47,8 +43,7 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT1("Dispatch_fnRead called DeviceObject %p Irp %p\n", DeviceObject); - + /* unsupported request */ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -61,8 +56,7 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT1("Dispatch_fnWrite called DeviceObject %p Irp %p\n", DeviceObject); - + /* unsupported request */ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -75,9 +69,6 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT1("Dispatch_fnFlush called DeviceObject %p Irp %p\n", DeviceObject); - //FIXME - // cleanup resources Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -127,8 +118,9 @@ } else { - /* this is pin which can only be instantiated once - * so we just need to release the reference count on that pin */ + /* this is a pin which can only be instantiated once + * so we just need to release the reference count on that pin + */ Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].References--; DispatchContext = (PDISPATCH_CONTEXT)Client->Devs[Index].ClientHandles[SubIndex].DispatchContext; @@ -274,6 +266,8 @@ PKSOBJECT_CREATE_ITEM CreateItem; PIO_STACK_LOCATION IoStatus; LPWSTR Buffer; + PSYSAUDIODEVEXT DeviceExtension; + ULONG Index; static LPWSTR KS_NAME_PIN = L"{146F1A80-4791-11D0-A5D6-28DB04C10000}"; @@ -300,16 +294,55 @@ /* allocate create item */ CreateItem = ExAllocatePool(NonPagedPool, sizeof(KSOBJECT_CREATE_ITEM)); if (!CreateItem) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_INSUFFICIENT_RESOURCES; + } Client = ExAllocatePool(NonPagedPool, sizeof(SYSAUDIO_CLIENT)); if (!Client) { ExFreePool(CreateItem); + + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_INSUFFICIENT_RESOURCES; } - /* initialize client struct */ - RtlZeroMemory(Client, sizeof(SYSAUDIO_CLIENT)); + + /* get device extension */ + DeviceExtension = (PSYSAUDIODEVEXT) DeviceObject->DeviceExtension; + + Client->NumDevices = DeviceExtension->NumberOfKsAudioDevices; + /* has sysaudio found any devices */ + if (Client->NumDevices) + { + Client->Devs = ExAllocatePool(NonPagedPool, sizeof(SYSAUDIO_CLIENT_HANDELS) * Client->NumDevices); + if (!Client->Devs) + { + ExFreePool(CreateItem); + ExFreePool(Client); + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INSUFFICIENT_RESOURCES; + } + } + else + { + /* no devices yet available */ + Client->Devs = NULL; + } + + /* Initialize devs array */ + for(Index = 0; Index < Client->NumDevices; Index++) + { + Client->Devs[Index].DeviceId = Index; + Client->Devs[Index].ClientHandles = NULL; + Client->Devs[Index].ClientHandlesCount = 0; + } /* zero create struct */ RtlZeroMemory(CreateItem, sizeof(KSOBJECT_CREATE_ITEM)); Modified: trunk/reactos/drivers/wdm/audio/sysaudio/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/main.c [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -46,27 +46,33 @@ UNICODE_STRING SymlinkName = RTL_CONSTANT_STRING(L"\\DosDevices\\sysaudio"); SYSAUDIODEVEXT *DeviceExtension; + /* Get current irp stack */ IrpStack = IoGetCurrentIrpStackLocation(Irp); - DPRINT("SysAudio_Pnp called for func %x\n", IrpStack->MinorFunction); - + /* Fetch the device extension */ DeviceExtension = (SYSAUDIODEVEXT*)DeviceObject->DeviceExtension; + ASSERT(DeviceExtension); if (IrpStack->MinorFunction == IRP_MN_REMOVE_DEVICE) { + /* Unregister the echo cancel hook */ if (DeviceExtension->EchoCancelNotificationEntry) IoUnregisterPlugPlayNotification(DeviceExtension->EchoCancelNotificationEntry); + /* Unregister the ks audio hook */ if (DeviceExtension->KsAudioNotificationEntry) IoUnregisterPlugPlayNotification(DeviceExtension->KsAudioNotificationEntry); + /* Destroy our symbolic link */ IoDeleteSymbolicLink(&SymlinkName); } else if (IrpStack->MinorFunction == IRP_MN_QUERY_PNP_DEVICE_STATE) { + /* Sysaudio can not be disabled */ Irp->IoStatus.Information |= PNP_DEVICE_NOT_DISABLEABLE; } + /* Perform default pnp actions */ return KsDefaultDispatchPnp(DeviceObject, Irp); } @@ -79,13 +85,12 @@ UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\sysaudio"); UNICODE_STRING SymlinkName = RTL_CONSTANT_STRING(L"\\DosDevices\\sysaudio"); PDEVICE_OBJECT DeviceObject; - //PDEVICE_OBJECT NextDeviceObject; SYSAUDIODEVEXT *DeviceExtension; DPRINT1("SysAudio_InstallDevice called\n"); - /* create the device */ + /* Create the device */ Status = IoCreateDevice(DriverObject, sizeof(SYSAUDIODEVEXT), &DeviceName, @@ -94,19 +99,19 @@ FALSE, &DeviceObject); - /* check for success */ + /* Check for success */ if (!NT_SUCCESS(Status)) { DPRINT("Failed to create \\Device\\sysaudio !\n"); return Status; } - /* register device interfaces */ + /* Register device interfaces */ Status = SysAudioRegisterDeviceInterfaces(DeviceObject); if (!NT_SUCCESS(Status)) { - /* failed to register - * create a hack interface + /* Failed to register + * Create a hack interface */ Status = IoCreateSymbolicLink(&SymlinkName, &DeviceName); if (!NT_SUCCESS(Status)) @@ -116,15 +121,18 @@ return Status; } } - + /* Acquire device extension */ DeviceExtension = (SYSAUDIODEVEXT*)DeviceObject->DeviceExtension; - /* initialize device extension */ + /* Initialize device extension */ RtlZeroMemory(DeviceExtension, sizeof(SYSAUDIODEVEXT)); + /* Initialize the mutex */ KeInitializeMutex(&DeviceExtension->Mutex, 0); - //DeviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; + + /* Initialize the ks audio device list */ InitializeListHead(&DeviceExtension->KsAudioDeviceList); + /* Allocate kernel streaming device header */ Status = SysAudioAllocateDeviceHeader(DeviceExtension); if (!NT_SUCCESS(Status)) { @@ -132,6 +140,7 @@ goto cleanup; } + /* Register device notification hooks */ Status = SysAudioRegisterNotifications(DriverObject, DeviceObject); if (!NT_SUCCESS(Status)) @@ -140,6 +149,7 @@ goto cleanup; } + /* Load kmixer */ Status = SysAudioOpenKMixer(DeviceExtension); if (!NT_SUCCESS(Status)) { @@ -152,7 +162,7 @@ /* clear initializing flag */ DeviceObject->Flags &= ~ DO_DEVICE_INITIALIZING; - DPRINT("Device SysAudio_InstallDevice result %x\n", Status); + /* Done */ return STATUS_SUCCESS; cleanup: @@ -168,22 +178,30 @@ return Status; } -NTSTATUS NTAPI +NTSTATUS +NTAPI DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { DPRINT1("System audio graph builder (sysaudio) started\n"); + /* Let ks handle these */ KsSetMajorFunctionHandler(DriverObject, IRP_MJ_CREATE); KsSetMajorFunctionHandler(DriverObject, IRP_MJ_CLOSE); KsSetMajorFunctionHandler(DriverObject, IRP_MJ_WRITE); KsSetMajorFunctionHandler(DriverObject, IRP_MJ_DEVICE_CONTROL); + /* Let ks handle these */ DriverObject->MajorFunction[IRP_MJ_POWER] = KsDefaultDispatchPower; DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = KsDefaultForwardIrp; + + /* Use provided ks unload function */ + DriverObject->DriverUnload = KsNullDriverUnload; + + /* Sysaudio needs to do work on pnp, so handle it */ DriverObject->MajorFunction[IRP_MJ_PNP] = SysAudio_Pnp; - DriverObject->DriverUnload = SysAudio_Unload; - + + /* Call our initialization function */ return SysAudio_InstallDevice(DriverObject); } Modified: trunk/reactos/drivers/wdm/audio/sysaudio/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -27,13 +27,19 @@ ULONG BytesReturned; PIO_STACK_LOCATION IoStack; - DPRINT1("Pin_fnDeviceIoControl called DeviceObject %p Irp %p\n", DeviceObject); - + DPRINT("Pin_fnDeviceIoControl called DeviceObject %p Irp %p\n", DeviceObject); + + /* Get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); + /* The dispatch context is stored in the FsContext2 member */ Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext2; + + /* Sanity check */ ASSERT(Context); - + ASSERT(Context->FileObject != NULL); + + /* Re-dispatch the request to the real target pin */ Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.Type3InputBuffer, IoStack->Parameters.DeviceIoControl.InputBufferLength, @@ -41,46 +47,18 @@ IoStack->Parameters.DeviceIoControl.OutputBufferLength, &BytesReturned); - DPRINT1("Status %x\n", Status); - + /* Save status and information */ Irp->IoStatus.Information = BytesReturned; Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* Done */ return Status; } NTSTATUS NTAPI Pin_fnRead( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - DPRINT1("Pin_fnRead called DeviceObject %p Irp %p\n", DeviceObject); - - Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_UNSUCCESSFUL; -} - -NTSTATUS -NTAPI -PinWriteCompletionRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PVOID Context) -{ - PIRP CIrp = (PIRP)Context; - - CIrp->IoStatus.Status = STATUS_SUCCESS; - CIrp->IoStatus.Information = 0; - IoCompleteRequest(CIrp, IO_NO_INCREMENT); - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -Pin_fnWrite( PDEVICE_OBJECT DeviceObject, PIRP Irp) { @@ -89,23 +67,83 @@ ULONG BytesReturned; NTSTATUS Status; - DPRINT1("Pin_fnWrite called DeviceObject %p Irp %p\n", DeviceObject); - + /* Get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); + /* The dispatch context is stored in the FsContext2 member */ Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext2; + + /* Sanity check */ ASSERT(Context); - - Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IOCTL_KS_WRITE_STREAM, + ASSERT(Context->FileObject != NULL); + + /* Re-dispatch the request to the real target pin */ + Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IOCTL_KS_READ_STREAM, MmGetMdlVirtualAddress(Irp->MdlAddress), - IoStack->Parameters.Write.Length, + IoStack->Parameters.Read.Length, NULL, 0, &BytesReturned); - Irp->IoStatus.Information = BytesReturned; + if (Context->hMixerPin && Context->MixerFileObject) + { + // FIXME + // call kmixer to convert stream + UNIMPLEMENTED + } + + /* Save status and information */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + Irp->IoStatus.Information = 0; + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* Done */ + return Status; +} + +NTSTATUS +NTAPI +Pin_fnWrite( + PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + PDISPATCH_CONTEXT Context; + PIO_STACK_LOCATION IoStack; + ULONG BytesReturned; + NTSTATUS Status; + + /* Get current stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* The dispatch context is stored in the FsContext2 member */ + Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext2; + + /* Sanity check */ + ASSERT(Context); + ASSERT(Context->FileObject != NULL); + + if (Context->hMixerPin && Context->MixerFileObject) + { + // FIXME + // call kmixer to convert stream + UNIMPLEMENTED + } + + + /* Re-dispatch the request to the real target pin */ + Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IOCTL_KS_WRITE_STREAM, + MmGetMdlVirtualAddress(Irp->MdlAddress), + IoStack->Parameters.Read.Length, + NULL, + 0, + &BytesReturned); + + /* Save status and information */ + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* Done */ return Status; } @@ -115,12 +153,59 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT1("Pin_fnFlush called DeviceObject %p Irp %p\n", DeviceObject); - - Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_UNSUCCESSFUL; + PDISPATCH_CONTEXT Context; + PIO_STACK_LOCATION IoStack; + PDEVICE_OBJECT PinDeviceObject; + PIRP PinIrp; + IO_STATUS_BLOCK IoStatus; + KEVENT Event; + NTSTATUS Status = STATUS_UNSUCCESSFUL; + + /* Get current stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* The dispatch context is stored in the FsContext2 member */ + Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext2; + + /* Sanity check */ + ASSERT(Context); + ASSERT(Context->FileObject != NULL); + + /* Get Pin's device object */ + PinDeviceObject = IoGetRelatedDeviceObject(Context->FileObject); + + /* Initialize notification event */ + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + /* build target irp */ + PinIrp = IoBuildSynchronousFsdRequest(IRP_MJ_FLUSH_BUFFERS, PinDeviceObject, NULL, 0, NULL, &Event, &IoStatus); + if (PinIrp) + { + + /* Get the next stack location */ + IoStack = IoGetNextIrpStackLocation(PinIrp); + /* The file object must be present in the irp as it contains the KSOBJECT_HEADER */ + IoStack->FileObject = Context->FileObject; + + /* call the driver */ + Status = IoCallDriver(PinDeviceObject, PinIrp); + /* Has request already completed ? */ + if (Status == STATUS_PENDING) + { + /* Wait untill the request has completed */ + KeWaitForSingleObject(&Event, UserRequest, KernelMode, FALSE, NULL); + /* Update status */ + Status = IoStatus.Status; + } + } + + /* store status */ + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* Done */ + return Status; } NTSTATUS Modified: trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] Wed Mar 25 22:14:04 2009 @@ -3,84 +3,93 @@ typedef struct { - BOOL bHandle; - ULONG PinId; - HANDLE hPin; - HANDLE hMixer; - PVOID DispatchContext; + BOOL bHandle; // indicates if an audio pin can be instantated more than once + ULONG PinId; // specifies the pin id + HANDLE hPin; // handle to audio irp pin + HANDLE hMixer; // handle to mixer pin + PVOID DispatchContext; // pointer to dispatch context }SYSAUDIO_PIN_HANDLE, *PSYSAUDIO_PIN_HANDLE; typedef struct { - ULONG DeviceId; - ULONG ClientHandlesCount; - PSYSAUDIO_PIN_HANDLE ClientHandles; - + ULONG DeviceId; //specifies the device id + ULONG ClientHandlesCount; // number of client handles + PSYSAUDIO_PIN_HANDLE ClientHandles; // array of client handles }SYSAUDIO_CLIENT_HANDELS, *PSYSAUDIO_CLIENT_HANDELS; typedef struct { - ULONG NumDevices; - PSYSAUDIO_CLIENT_HANDELS Devs; + ULONG NumDevices; // number of devices in Devs array + PSYSAUDIO_CLIENT_HANDELS Devs; // array of client handles }SYSAUDIO_CLIENT, *PSYSAUDIO_CLIENT; typedef struct { - ULONG MaxPinInstanceCount; - HANDLE PinHandle; - ULONG References; - KSPIN_DATAFLOW DataFlow; - KSPIN_COMMUNICATION Communication; + ULONG MaxPinInstanceCount; // maximum times a audio irp pin can be instantiated + HANDLE PinHandle; // handle to audio irp pin + ULONG References; // number of clients having a reference to this audio irp pin + KSPIN_DATAFLOW DataFlow; // specifies data flow + KSPIN_COMMUNICATION Communication; // pin type }PIN_INFO; typedef struct { - LIST_ENTRY Entry; - HANDLE Handle; - PFILE_OBJECT FileObject; - UNICODE_STRING DeviceName; - ULONG NumberOfClients; + LIST_ENTRY Entry; // device entry for KsAudioDeviceList + HANDLE Handle; // handle to audio device + PFILE_OBJECT FileObject; // file object for audio device + UNICODE_STRING DeviceName; // symbolic link of audio device + ULONG NumberOfClients; // number of clients referenced audio device - ULONG NumberOfPins; - PIN_INFO * Pins; + ULONG NumberOfPins; // number of pins of audio device + PIN_INFO * Pins; // array of PIN_INFO - ULONG NumWaveOutPin; - ULONG NumWaveInPin; + ULONG NumWaveOutPin; // number of wave out pins + ULONG NumWaveInPin; // number of wave in pins }KSAUDIO_DEVICE_ENTRY, *PKSAUDIO_DEVICE_ENTRY; +typedef struct +{ + KSDEVICE_HEADER KsDeviceHeader; // ks streaming header - must always be first item in device extension + PDEVICE_OBJECT PhysicalDeviceObject; // pdo + PDEVICE_OBJECT NextDeviceObject; // lower device object + ULONG NumberOfKsAudioDevices; // number of audio devices + + LIST_ENTRY KsAudioDeviceList; // audio device list + PVOID KsAudioNotificationEntry; // ks audio notification hook + PVOID EchoCancelNotificationEntry; // ks echo cancel notification hook + KMUTEX Mutex; // audio device list mutex + + PFILE_OBJECT KMixerFileObject; // mixer file object + HANDLE KMixerHandle; // mixer file handle + +}SYSAUDIODEVEXT, *PSYSAUDIODEVEXT; + +// struct DISPATCH_CONTEXT +// +// This structure is used to dispatch read / write / device io requests +// It is stored in the file object FsContext2 member +// Note: FsContext member is reserved for ks object header typedef struct { - KSDEVICE_HEADER KsDeviceHeader; - PDEVICE_OBJECT PhysicalDeviceObject; - PDEVICE_OBJECT NextDeviceObject; - ULONG NumberOfKsAudioDevices; + HANDLE Handle; // audio irp pin handle + PFILE_OBJECT FileObject; // audio irp pin file object + ULONG PinId; // pin id of device + PKSAUDIO_DEVICE_ENTRY AudioEntry; // pointer to audio device entry - LIST_ENTRY KsAudioDeviceList; - PVOID KsAudioNotificationEntry; - PVOID EchoCancelNotificationEntry; - KMUTEX Mutex; - - PFILE_OBJECT KMixerFileObject; - HANDLE KMixerHandle; - -}SYSAUDIODEVEXT, *PSYSAUDIODEVEXT; - -typedef struct -{ - HANDLE Handle; - PFILE_OBJECT FileObject; - ULONG PinId; - PKSAUDIO_DEVICE_ENTRY AudioEntry; - - HANDLE hMixerPin; - PFILE_OBJECT MixerFileObject; + HANDLE hMixerPin; // handle to mixer pin + PFILE_OBJECT MixerFileObject; // mixer file object }DISPATCH_CONTEXT, *PDISPATCH_CONTEXT; +// struct PIN_WORKER_CONTEXT +// +// This structure holds all information required +// to create audio irp pin, mixer pin and virtual sysaudio pin +// typedef struct { PIRP Irp;
15 years, 9 months
1
0
0
0
[janderwald] 40237: - Fix calling convention for KsNullDriverUnload
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 25 22:01:27 2009 New Revision: 40237 URL:
http://svn.reactos.org/svn/reactos?rev=40237&view=rev
Log: - Fix calling convention for KsNullDriverUnload Modified: trunk/reactos/include/psdk/ks.h Modified: trunk/reactos/include/psdk/ks.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ks.h?rev=4023…
============================================================================== --- trunk/reactos/include/psdk/ks.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ks.h [iso-8859-1] Wed Mar 25 22:01:27 2009 @@ -2975,7 +2975,7 @@ IN KSDEVICE_HEADER Header, IN PVOID Context); -VOID +KSDDKAPI VOID NTAPI KsNullDriverUnload( IN PDRIVER_OBJECT DriverObject);
15 years, 9 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
49
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
Results per page:
10
25
50
100
200