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
June 2014
----- 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
15 participants
157 discussions
Start a n
N
ew thread
[hbelusca] 63560: Simplify the math.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Jun 8 17:36:12 2014 New Revision: 63560 URL:
http://svn.reactos.org/svn/reactos?rev=63560&view=rev
Log: Simplify the math. Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Sun Jun 8 17:36:12 2014 @@ -167,12 +167,11 @@ } else // if (End->Y > Begin->Y) { - NumChars = (Buffer->ScreenBufferSize.X - 1) - (Begin->X) + 1; - - if (Begin->Y + 1 <= End->Y - 1) - { - NumChars += ( (Buffer->ScreenBufferSize.X - 1) + 1 ) * - ( (End->Y - 1) - (Begin->Y + 1) + 1); + NumChars = Buffer->ScreenBufferSize.X - Begin->X; + + if (End->Y >= Begin->Y + 2) + { + NumChars += (End->Y - Begin->Y - 1) * Buffer->ScreenBufferSize.X; } NumChars += End->X + 1;
10 years, 6 months
1
0
0
0
[hbelusca] 63559: [CONSRV] Have you ever dreamt of doing per-line text selection in a windows-like console, instead of only being able to select rectangular blocks of text? Even if it is still not ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Jun 8 17:26:07 2014 New Revision: 63559 URL:
http://svn.reactos.org/svn/reactos?rev=63559&view=rev
Log: [CONSRV] Have you ever dreamt of doing per-line text selection in a windows-like console, instead of only being able to select rectangular blocks of text? Even if it is still not possible on Windows (unless you use one of those hackish hooking libraries on the Internet to do that), it now becomes possible on ReactOS!! Just press Ctrl while you're selecting text, and enjoy! Also, you need to keep Ctrl key pressed while you release the mouse (if you select text via the mouse), to be (afterwards) able to copy the text in line-mode, otherwise it will switch back to block-mode selection. Enjoy! Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Sun Jun 8 17:26:07 2014 @@ -301,7 +301,9 @@ static VOID Paste(PGUI_CONSOLE_DATA GuiData); static VOID -UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord); +UpdateSelection(PGUI_CONSOLE_DATA GuiData, + PCOORD SelectionAnchor OPTIONAL, + PCOORD coord); static VOID Mark(PGUI_CONSOLE_DATA GuiData) @@ -309,30 +311,28 @@ PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; /* Clear the old selection */ - // UpdateSelection(GuiData, NULL); GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; /* Restart a new selection */ - GuiData->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X; - GuiData->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y; - GuiData->Selection.dwSelectionAnchor = GuiData->dwSelectionCursor; - UpdateSelection(GuiData, &GuiData->Selection.dwSelectionAnchor); + GuiData->dwSelectionCursor = ActiveBuffer->ViewOrigin; + UpdateSelection(GuiData, + &GuiData->dwSelectionCursor, + &GuiData->dwSelectionCursor); } static VOID SelectAll(PGUI_CONSOLE_DATA GuiData) { PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + COORD SelectionAnchor; /* Clear the old selection */ - // UpdateSelection(GuiData, NULL); GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; /* * The selection area extends to the whole screen buffer's width. */ - GuiData->Selection.dwSelectionAnchor.X = 0; - GuiData->Selection.dwSelectionAnchor.Y = 0; + SelectionAnchor.X = SelectionAnchor.Y = 0; GuiData->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1; /* @@ -358,7 +358,7 @@ /* Restart a new selection */ GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION; - UpdateSelection(GuiData, &GuiData->dwSelectionCursor); + UpdateSelection(GuiData, &SelectionAnchor, &GuiData->dwSelectionCursor); } static LRESULT @@ -678,18 +678,171 @@ Rect->bottom = (SmallRect->Bottom + 1 - Buffer->ViewOrigin.Y) * HeightUnit; } +VOID +GetSelectionBeginEnd(PCOORD Begin, PCOORD End, + PCOORD SelectionAnchor, + PSMALL_RECT SmallRect) +{ + if (Begin == NULL || End == NULL) return; + + *Begin = *SelectionAnchor; + End->X = (SelectionAnchor->X == SmallRect->Left) ? SmallRect->Right + /* Case X != Left, must be == Right */ : SmallRect->Left; + End->Y = (SelectionAnchor->Y == SmallRect->Top ) ? SmallRect->Bottom + /* Case Y != Top, must be == Bottom */ : SmallRect->Top; + + /* Exchange Begin / End if Begin > End lexicographically */ + if (Begin->Y > End->Y || (Begin->Y == End->Y && Begin->X > End->X)) + { + SHORT tmp; + + // End->X = InterlockedExchange16(&Begin->X, End->X); + tmp = Begin->X; + Begin->X = End->X; + End->X = tmp; + + // End->Y = InterlockedExchange16(&Begin->Y, End->Y); + tmp = Begin->Y; + Begin->Y = End->Y; + End->Y = tmp; + } +} + +static HRGN +CreateSelectionRgn(PGUI_CONSOLE_DATA GuiData, + BOOL LineSelection, + PCOORD SelectionAnchor, + PSMALL_RECT SmallRect) +{ + if (!LineSelection) + { + RECT rect; + SmallRectToRect(GuiData, &rect, SmallRect); + return CreateRectRgnIndirect(&rect); + } + else + { + HRGN SelRgn; + COORD Begin, End; + + GetSelectionBeginEnd(&Begin, &End, SelectionAnchor, SmallRect); + + if (Begin.Y == End.Y) + { + SMALL_RECT sr; + RECT r ; + + sr.Left = Begin.X; + sr.Top = Begin.Y; + sr.Right = End.X; + sr.Bottom = End.Y; + + // Debug thingie to see whether I can put this corner case + // together with the previous one. + if (SmallRect->Left != sr.Left || + SmallRect->Top != sr.Top || + SmallRect->Right != sr.Right || + SmallRect->Bottom != sr.Bottom) + { + DPRINT1("\n" + "SmallRect = (%d, %d, %d, %d)\n" + "sr = (%d, %d, %d, %d)\n" + "\n", + SmallRect->Left, SmallRect->Top, SmallRect->Right, SmallRect->Bottom, + sr.Left, sr.Top, sr.Right, sr.Bottom); + } + + SmallRectToRect(GuiData, &r, &sr); + SelRgn = CreateRectRgnIndirect(&r); + } + else + { + PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + + HRGN rg1, rg2, rg3; + SMALL_RECT sr1, sr2, sr3; + RECT r1 , r2 , r3 ; + + sr1.Left = Begin.X; + sr1.Top = Begin.Y; + sr1.Right = ActiveBuffer->ScreenBufferSize.X - 1; + sr1.Bottom = Begin.Y; + + sr2.Left = 0; + sr2.Top = Begin.Y + 1; + sr2.Right = ActiveBuffer->ScreenBufferSize.X - 1; + sr2.Bottom = End.Y - 1; + + sr3.Left = 0; + sr3.Top = End.Y; + sr3.Right = End.X; + sr3.Bottom = End.Y; + + SmallRectToRect(GuiData, &r1, &sr1); + SmallRectToRect(GuiData, &r2, &sr2); + SmallRectToRect(GuiData, &r3, &sr3); + + rg1 = CreateRectRgnIndirect(&r1); + rg2 = CreateRectRgnIndirect(&r2); + rg3 = CreateRectRgnIndirect(&r3); + + CombineRgn(rg1, rg1, rg2, RGN_XOR); + CombineRgn(rg1, rg1, rg3, RGN_XOR); + DeleteObject(rg3); + DeleteObject(rg2); + + SelRgn = rg1; + } + + return SelRgn; + } +} + static VOID -UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord) +PaintSelectionRect(PGUI_CONSOLE_DATA GuiData, PPAINTSTRUCT pps) +{ + HRGN rgnPaint = CreateRectRgnIndirect(&pps->rcPaint); + HRGN rgnSel = CreateSelectionRgn(GuiData, GuiData->LineSelection, + &GuiData->Selection.dwSelectionAnchor, + &GuiData->Selection.srSelection); + + /* Invert the selection */ + + int ErrorCode = CombineRgn(rgnPaint, rgnPaint, rgnSel, RGN_AND); + if (ErrorCode != ERROR && ErrorCode != NULLREGION) + { + InvertRgn(pps->hdc, rgnPaint); + } + + DeleteObject(rgnSel); + DeleteObject(rgnPaint); +} + +static VOID +UpdateSelection(PGUI_CONSOLE_DATA GuiData, + PCOORD SelectionAnchor OPTIONAL, + PCOORD coord) { PCONSOLE Console = GuiData->Console; - RECT oldRect; - - SmallRectToRect(GuiData, &oldRect, &GuiData->Selection.srSelection); + HRGN oldRgn = CreateSelectionRgn(GuiData, GuiData->LineSelection, + &GuiData->Selection.dwSelectionAnchor, + &GuiData->Selection.srSelection); + + /* Update the anchor if needed (use the old one if NULL) */ + if (SelectionAnchor) + GuiData->Selection.dwSelectionAnchor = *SelectionAnchor; if (coord != NULL) { - RECT newRect; SMALL_RECT rc; + HRGN newRgn; + + /* + * Pressing the Control key while selecting text, allows us to enter + * into line-selection mode, the selection mode of *nix terminals. + */ + BOOL OldLineSel = GuiData->LineSelection; + GuiData->LineSelection = !!(GetKeyState(VK_CONTROL) & 0x8000); /* Exchange left/top with right/bottom if required */ rc.Left = min(GuiData->Selection.dwSelectionAnchor.X, coord->X); @@ -697,33 +850,28 @@ rc.Right = max(GuiData->Selection.dwSelectionAnchor.X, coord->X); rc.Bottom = max(GuiData->Selection.dwSelectionAnchor.Y, coord->Y); - SmallRectToRect(GuiData, &newRect, &rc); + newRgn = CreateSelectionRgn(GuiData, GuiData->LineSelection, + &GuiData->Selection.dwSelectionAnchor, + &rc); if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - if (memcmp(&rc, &GuiData->Selection.srSelection, sizeof(SMALL_RECT)) != 0) - { - HRGN rgn1, rgn2; - + if (OldLineSel != GuiData->LineSelection || + memcmp(&rc, &GuiData->Selection.srSelection, sizeof(SMALL_RECT)) != 0) + { /* Calculate the region that needs to be updated */ - if ((rgn1 = CreateRectRgnIndirect(&oldRect))) + if (oldRgn && newRgn && CombineRgn(newRgn, newRgn, oldRgn, RGN_XOR) != ERROR) { - if ((rgn2 = CreateRectRgnIndirect(&newRect))) - { - if (CombineRgn(rgn1, rgn2, rgn1, RGN_XOR) != ERROR) - { - InvalidateRgn(GuiData->hWindow, rgn1, FALSE); - } - DeleteObject(rgn2); - } - DeleteObject(rgn1); + InvalidateRgn(GuiData->hWindow, newRgn, FALSE); } } } else { - InvalidateRect(GuiData->hWindow, &newRect, FALSE); - } + InvalidateRgn(GuiData->hWindow, newRgn, FALSE); + } + + DeleteObject(newRgn); GuiData->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY; GuiData->Selection.srSelection = rc; @@ -737,7 +885,7 @@ /* Clear the old selection */ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - InvalidateRect(GuiData->hWindow, &oldRect, FALSE); + InvalidateRgn(GuiData->hWindow, oldRgn, FALSE); } /* @@ -778,7 +926,7 @@ /* Clear the selection */ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - InvalidateRect(GuiData->hWindow, &oldRect, FALSE); + InvalidateRgn(GuiData->hWindow, oldRgn, FALSE); } GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; @@ -787,6 +935,8 @@ /* Restore the console title */ SetWindowText(GuiData->hWindow, Console->Title.Buffer); } + + DeleteObject(oldRgn); } @@ -840,15 +990,10 @@ rcPaint.top, SRCCOPY); + /* Draw the selection region if needed */ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - SmallRectToRect(GuiData, &rcPaint, &GuiData->Selection.srSelection); - - /* Invert the selection */ - if (IntersectRect(&rcPaint, &ps.rcPaint, &rcPaint)) - { - InvertRect(ps.hdc, &rcPaint); - } + PaintSelectionRect(GuiData, &ps); } LeaveCriticalSection(&GuiData->Lock); @@ -925,10 +1070,10 @@ goto Quit; } else if ( VirtualKeyCode == VK_ESCAPE || - (VirtualKeyCode == 'C' && GetKeyState(VK_CONTROL) & 0x8000) ) + (VirtualKeyCode == 'C' && (GetKeyState(VK_CONTROL) & 0x8000)) ) { /* Cancel selection if ESC or Ctrl-C are pressed */ - UpdateSelection(GuiData, NULL); + UpdateSelection(GuiData, NULL, NULL); goto Quit; } @@ -936,7 +1081,7 @@ { /* Keyboard selection mode */ BOOL Interpreted = FALSE; - BOOL MajPressed = (GetKeyState(VK_SHIFT) & 0x8000); + BOOL MajPressed = !!(GetKeyState(VK_SHIFT) & 0x8000); switch (VirtualKeyCode) { @@ -1017,10 +1162,9 @@ if (Interpreted) { - if (!MajPressed) - GuiData->Selection.dwSelectionAnchor = GuiData->dwSelectionCursor; - - UpdateSelection(GuiData, &GuiData->dwSelectionCursor); + UpdateSelection(GuiData, + !MajPressed ? &GuiData->dwSelectionCursor : NULL, + &GuiData->dwSelectionCursor); } else if (!IsSystemKey(VirtualKeyCode)) { @@ -1037,7 +1181,7 @@ if (!IsSystemKey(VirtualKeyCode)) { /* Clear the selection and send the key into the input buffer */ - UpdateSelection(GuiData, NULL); + UpdateSelection(GuiData, NULL, NULL); } else { @@ -1287,27 +1431,26 @@ case WM_LBUTTONDOWN: { /* Clear the old selection */ - // UpdateSelection(GuiData, NULL); GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION; /* Restart a new selection */ - GuiData->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam); + GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam); SetCapture(GuiData->hWindow); GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - UpdateSelection(GuiData, &GuiData->Selection.dwSelectionAnchor); + UpdateSelection(GuiData, + &GuiData->dwSelectionCursor, + &GuiData->dwSelectionCursor); break; } case WM_LBUTTONUP: { - // COORD c; - if (!(GuiData->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; - // c = PointToCoord(GuiData, lParam); + // GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam); GuiData->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN; - // UpdateSelection(GuiData, &c); + // UpdateSelection(GuiData, NULL, &GuiData->dwSelectionCursor); ReleaseCapture(); break; @@ -1349,11 +1492,8 @@ * Update the selection started with the single * left-click that preceded this double-click. */ - GuiData->Selection.dwSelectionAnchor = cL; - GuiData->dwSelectionCursor = cR; - GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - UpdateSelection(GuiData, &GuiData->dwSelectionCursor); + UpdateSelection(GuiData, &cL, &cR); /* Ignore the next mouse move signal */ GuiData->IgnoreNextMouseSignal = TRUE; @@ -1381,13 +1521,12 @@ case WM_MOUSEMOVE: { - COORD c; - if (!(wParam & MK_LBUTTON)) break; if (!(GuiData->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; - c = PointToCoord(GuiData, lParam); /* TODO: Scroll buffer to bring c into view */ - UpdateSelection(GuiData, &c); + // TODO: Scroll buffer to bring SelectionCursor into view + GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam); + UpdateSelection(GuiData, NULL, &GuiData->dwSelectionCursor); break; } @@ -1557,7 +1696,7 @@ } /* Clear the selection */ - UpdateSelection(GuiData, NULL); + UpdateSelection(GuiData, NULL, NULL); } VOID Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] Sun Jun 8 17:26:07 2014 @@ -65,6 +65,7 @@ PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to the active screen buffer (then maybe the previous Console member is redundant?? Or not...) */ CONSOLE_SELECTION_INFO Selection; /* Contains information about the selection */ COORD dwSelectionCursor; /* Selection cursor position, most of the time different from Selection.dwSelectionAnchor */ + BOOL LineSelection; /* TRUE if line-oriented selection (a la *nix terminals), FALSE if block-oriented selection (default on Windows) */ GUI_CONSOLE_INFO GuiInfo; /* GUI terminal settings */ } GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA; Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Sun Jun 8 17:26:07 2014 @@ -18,6 +18,10 @@ #include "guiterm.h" +/* GLOBALS ********************************************************************/ + +#define IS_WHITESPACE(c) ((c) == L'\0' || (c) == L' ' || (c) == L'\t') + /* FUNCTIONS ******************************************************************/ COLORREF PaletteRGBFromAttrib(PCONSOLE Console, WORD Attribute) @@ -31,35 +35,33 @@ return PALETTERGB(pe.peRed, pe.peGreen, pe.peBlue); } -VOID -GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData) -{ - /* - * This function supposes that the system clipboard was opened. - */ - +static VOID +CopyBlock(PTEXTMODE_SCREEN_BUFFER Buffer, + PSMALL_RECT Selection) +{ /* * Pressing the Shift key while copying text, allows us to copy * text without newline characters (inline-text copy mode). */ - BOOL InlineCopyMode = (GetKeyState(VK_SHIFT) & 0x8000); + BOOL InlineCopyMode = !!(GetKeyState(VK_SHIFT) & 0x8000); HANDLE hData; PCHAR_INFO ptr; LPWSTR data, dstPos; ULONG selWidth, selHeight; - ULONG xPos, yPos, size; - - selWidth = GuiData->Selection.srSelection.Right - GuiData->Selection.srSelection.Left + 1; - selHeight = GuiData->Selection.srSelection.Bottom - GuiData->Selection.srSelection.Top + 1; - DPRINT("Selection is (%d|%d) to (%d|%d)\n", - GuiData->Selection.srSelection.Left, - GuiData->Selection.srSelection.Top, - GuiData->Selection.srSelection.Right, - GuiData->Selection.srSelection.Bottom); - -#define IS_WHITESPACE(c) ((c) == L'\0' || (c) == L' ' || (c) == L'\t') + ULONG xPos, yPos; + ULONG size; + + DPRINT("CopyBlock(%u, %u, %u, %u)\n", + Selection->Left, Selection->Top, Selection->Right, Selection->Bottom); + + /* Prevent against empty blocks */ + if (Selection == NULL) return; + if (Selection->Left > Selection->Right || Selection->Top > Selection->Bottom) + return; + + selWidth = Selection->Right - Selection->Left + 1; + selHeight = Selection->Bottom - Selection->Top + 1; /* Basic size for one line... */ size = selWidth; @@ -72,6 +74,11 @@ */ size += (selWidth + (!InlineCopyMode ? 2 : 0)) * (selHeight - 1); } + else + { + DPRINT1("This case must never happen, because selHeight is at least == 1\n"); + } + size += 1; /* Null-termination */ size *= sizeof(WCHAR); @@ -94,8 +101,8 @@ ULONG length = selWidth; ptr = ConioCoordToPointer(Buffer, - GuiData->Selection.srSelection.Left, - GuiData->Selection.srSelection.Top + yPos); + Selection->Left, + Selection->Top + yPos); /* Trim whitespace from the right */ while (length > 0) @@ -113,16 +120,15 @@ * Sometimes, applications can put NULL chars into the screen-buffer * (this behaviour is allowed). Detect this and replace by a space. */ - dstPos[xPos] = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' '); - } - dstPos += length; + *dstPos++ = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' '); + } /* Add newline characters if we are not in inline-text copy mode */ if (!InlineCopyMode) { if (yPos != (selHeight - 1)) { - wcscat(data, L"\r\n"); + wcscat(dstPos, L"\r\n"); dstPos += 2; } } @@ -133,6 +139,128 @@ EmptyClipboard(); SetClipboardData(CF_UNICODETEXT, hData); +} + +static VOID +CopyLines(PTEXTMODE_SCREEN_BUFFER Buffer, + PCOORD Begin, + PCOORD End) +{ + HANDLE hData; + PCHAR_INFO ptr; + LPWSTR data, dstPos; + ULONG NumChars, size; + ULONG xPos, yPos, xBeg, xEnd; + + DPRINT("CopyLines((%u, %u) ; (%u, %u))\n", + Begin->X, Begin->Y, End->X, End->Y); + + /* Prevent against empty blocks... */ + if (Begin == NULL || End == NULL) return; + /* ... or malformed blocks */ + if (Begin->Y > End->Y || (Begin->Y == End->Y && Begin->X > End->X)) return; + + /* Compute the number of characters to copy */ + if (End->Y == Begin->Y) // top == bottom + { + NumChars = End->X - Begin->X + 1; + } + else // if (End->Y > Begin->Y) + { + NumChars = (Buffer->ScreenBufferSize.X - 1) - (Begin->X) + 1; + + if (Begin->Y + 1 <= End->Y - 1) + { + NumChars += ( (Buffer->ScreenBufferSize.X - 1) + 1 ) * + ( (End->Y - 1) - (Begin->Y + 1) + 1); + } + + NumChars += End->X + 1; + } + + size = (NumChars + 1) * sizeof(WCHAR); /* Null-terminated */ + + /* Allocate some memory area to be given to the clipboard, so it will not be freed here */ + hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size); + if (hData == NULL) return; + + data = GlobalLock(hData); + if (data == NULL) + { + GlobalFree(hData); + return; + } + + DPRINT("Copying %d characters\n", NumChars); + dstPos = data; + + /* + * We need to walk per-lines, and not just looping in the big screen-buffer + * array, because of the way things are stored inside it. The downside is + * that it makes the code more complicated. + */ + for (yPos = Begin->Y; (yPos <= End->Y) && (NumChars > 0); yPos++) + { + xBeg = (yPos == Begin->Y ? Begin->X : 0); + xEnd = (yPos == End->Y ? End->X : Buffer->ScreenBufferSize.X - 1); + + ptr = ConioCoordToPointer(Buffer, xBeg, yPos); + + /* Copy only the characters, leave attributes alone */ + for (xPos = xBeg; (xPos <= xEnd) && (NumChars-- > 0); xPos++) + { + /* + * Sometimes, applications can put NULL chars into the screen-buffer + * (this behaviour is allowed). Detect this and replace by a space. + */ + *dstPos++ = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' '); + } + } + + DPRINT("Setting data <%S> to clipboard\n", data); + GlobalUnlock(hData); + + EmptyClipboard(); + SetClipboardData(CF_UNICODETEXT, hData); +} + + +VOID +GetSelectionBeginEnd(PCOORD Begin, PCOORD End, + PCOORD SelectionAnchor, + PSMALL_RECT SmallRect); + +VOID +GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) +{ + /* + * This function supposes that the system clipboard was opened. + */ + + BOOL LineSelection = GuiData->LineSelection; + + DPRINT("Selection is (%d|%d) to (%d|%d) in %s mode\n", + GuiData->Selection.srSelection.Left, + GuiData->Selection.srSelection.Top, + GuiData->Selection.srSelection.Right, + GuiData->Selection.srSelection.Bottom, + (LineSelection ? "line" : "block")); + + if (!LineSelection) + { + CopyBlock(Buffer, &GuiData->Selection.srSelection); + } + else + { + COORD Begin, End; + + GetSelectionBeginEnd(&Begin, &End, + &GuiData->Selection.dwSelectionAnchor, + &GuiData->Selection.srSelection); + + CopyLines(Buffer, &Begin, &End); + } } VOID
10 years, 6 months
1
0
0
0
[akhaldi] 63558: [RPCRT4] * Do not rely on RegDeleteTreeW which shouldn't be exported. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 17:11:47 2014 New Revision: 63558 URL:
http://svn.reactos.org/svn/reactos?rev=63558&view=rev
Log: [RPCRT4] * Do not rely on RegDeleteTreeW which shouldn't be exported. CORE-8174 Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt trunk/reactos/dll/win32/rpcrt4/cpsf.c Modified: trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/CMakeLists.txt [iso-8859-1] Sun Jun 8 17:11:47 2014 @@ -52,6 +52,6 @@ target_link_libraries(rpcrt4 wine uuid ${PSEH_LIB}) add_delay_importlibs(rpcrt4 iphlpapi wininet secur32 user32) -add_importlibs(rpcrt4 msvcrt advapi32 ws2_32 kernel32 ntdll) +add_importlibs(rpcrt4 advapi32 ws2_32 shlwapi msvcrt kernel32 ntdll) add_pch(rpcrt4 precomp.h SOURCE) add_cd_file(TARGET rpcrt4 DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/rpcrt4/cpsf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cpsf.c?re…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cpsf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cpsf.c [iso-8859-1] Sun Jun 8 17:11:47 2014 @@ -22,6 +22,12 @@ #include <winreg.h> +#define NO_SHLWAPI_PATH +#define NO_SHLWAPI_STRFCNS +#define NO_SHLWAPI_GDI +#define NO_SHLWAPI_STREAM +#include <shlwapi.h> + WINE_DEFAULT_DEBUG_CHANNEL(ole); static void format_clsid( WCHAR *buffer, const CLSID *clsid ) @@ -308,7 +314,7 @@ strcpyW( keyname, interfaceW ); format_clsid( keyname + strlenW(keyname), proxy->header.piid ); - RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); + SHDeleteKeyW(HKEY_CLASSES_ROOT, keyname); } pProxyFileList++; } @@ -316,7 +322,7 @@ /* unregister clsid */ strcpyW( keyname, clsidW ); strcatW( keyname, clsid ); - RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); + SHDeleteKeyW(HKEY_CLASSES_ROOT, keyname); return S_OK; }
10 years, 6 months
1
0
0
0
[akhaldi] 63557: [MSI] * Do not rely on RegDeleteTreeW which shouldn't be exported. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 17:05:26 2014 New Revision: 63557 URL:
http://svn.reactos.org/svn/reactos?rev=63557&view=rev
Log: [MSI] * Do not rely on RegDeleteTreeW which shouldn't be exported. CORE-8174 Modified: trunk/reactos/dll/win32/msi/action.c trunk/reactos/dll/win32/msi/classes.c trunk/reactos/dll/win32/msi/registry.c Modified: trunk/reactos/dll/win32/msi/action.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/action.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/action.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/action.c [iso-8859-1] Sun Jun 8 17:05:26 2014 @@ -2989,7 +2989,7 @@ HKEY hkey; if (!(hkey = open_key( root, path, FALSE ))) return; - res = RegDeleteTreeW( hkey, NULL ); + res = SHDeleteKeyW( hkey, NULL ); if (res) TRACE("failed to delete subtree of %s (%d)\n", debugstr_w(path), res); delete_key( root, path ); RegCloseKey( hkey ); Modified: trunk/reactos/dll/win32/msi/classes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/classes.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/classes.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/classes.c [iso-8859-1] Sun Jun 8 17:05:26 2014 @@ -953,7 +953,7 @@ cls->action = INSTALLSTATE_ABSENT; - res = RegDeleteTreeW( hkey, cls->clsid ); + res = SHDeleteKeyW( hkey, cls->clsid ); if (res != ERROR_SUCCESS) WARN("Failed to delete class key %d\n", res); @@ -975,7 +975,7 @@ { strcpyW( filetype, szFileType ); strcatW( filetype, cls->clsid ); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, filetype ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, filetype ); msi_free( filetype ); if (res != ERROR_SUCCESS) @@ -1148,7 +1148,7 @@ } TRACE("Unregistering progid %s\n", debugstr_w(progid->ProgID)); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid->ProgID ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, progid->ProgID ); if (res != ERROR_SUCCESS) TRACE("Failed to delete progid key %d\n", res); @@ -1392,7 +1392,7 @@ { extension[0] = '.'; strcpyW( extension + 1, ext->Extension ); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, extension ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, extension ); msi_free( extension ); if (res != ERROR_SUCCESS) WARN("Failed to delete extension key %d\n", res); @@ -1414,7 +1414,7 @@ { strcpyW( progid_shell, progid ); strcatW( progid_shell, shellW ); - res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid_shell ); + res = SHDeleteKeyW( HKEY_CLASSES_ROOT, progid_shell ); msi_free( progid_shell ); if (res != ERROR_SUCCESS) WARN("Failed to delete shell key %d\n", res); Modified: trunk/reactos/dll/win32/msi/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/registry.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/registry.c [iso-8859-1] Sun Jun 8 17:05:26 2014 @@ -477,7 +477,7 @@ strcpyW(keypath, szUninstall); strcatW(keypath, product); } - return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); + return SHDeleteKeyW(HKEY_LOCAL_MACHINE, keypath); } UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) @@ -528,7 +528,7 @@ strcpyW(keypath, szUserProducts); strcatW(keypath, squished_pc); - return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); + return SHDeleteKeyW(HKEY_CURRENT_USER, keypath); } UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY *key, BOOL create) @@ -593,7 +593,7 @@ strcpyW(keypath, szUserFeatures); strcatW(keypath, squished_pc); - return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); + return SHDeleteKeyW(HKEY_CURRENT_USER, keypath); } static UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create) @@ -707,7 +707,7 @@ sprintfW(keypath, szUserDataComponents_fmt, szUserSid); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, comp); + r = SHDeleteKeyW(hkey, comp); RegCloseKey(hkey); return r; } @@ -788,7 +788,7 @@ LocalFree(usersid); } if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_patch); + r = SHDeleteKeyW(hkey, squished_patch); RegCloseKey(hkey); return r; } @@ -865,7 +865,7 @@ LocalFree(usersid); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -881,7 +881,7 @@ TRACE("%s squished %s\n", debugstr_w(szProduct), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_Products, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -938,7 +938,7 @@ strcpyW(keypath, szInstaller_UserUpgradeCodes); strcatW(keypath, squished_pc); - return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); + return SHDeleteKeyW(HKEY_CURRENT_USER, keypath); } UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) @@ -952,7 +952,7 @@ TRACE("%s squished %s\n", debugstr_w(szProductCode), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesProducts, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -968,7 +968,7 @@ TRACE("%s squished %s\n", debugstr_w(szProductCode), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesFeatures, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; } @@ -999,7 +999,7 @@ TRACE("%s squished %s\n", debugstr_w(szUpgradeCode), debugstr_w(squished_pc)); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_ClassesUpgradeCodes, 0, access, &hkey)) return ERROR_SUCCESS; - r = RegDeleteTreeW(hkey, squished_pc); + r = SHDeleteKeyW(hkey, squished_pc); RegCloseKey(hkey); return r; }
10 years, 6 months
1
0
0
0
[akhaldi] 63556: [NTMARTA] * {Set, Query}SecurityAccessMask should not be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 17:01:26 2014 New Revision: 63556 URL:
http://svn.reactos.org/svn/reactos?rev=63556&view=rev
Log: [NTMARTA] * {Set,Query}SecurityAccessMask should not be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174 Modified: trunk/reactos/dll/win32/ntmarta/CMakeLists.txt trunk/reactos/dll/win32/ntmarta/ntmarta.c Modified: trunk/reactos/dll/win32/ntmarta/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntmarta/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/ntmarta/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ntmarta/CMakeLists.txt [iso-8859-1] Sun Jun 8 17:01:26 2014 @@ -1,9 +1,5 @@ - add_definitions(-D__WINESRC__) - -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) spec2def(ntmarta.dll ntmarta.spec) Modified: trunk/reactos/dll/win32/ntmarta/ntmarta.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntmarta/ntmarta.…
============================================================================== --- trunk/reactos/dll/win32/ntmarta/ntmarta.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ntmarta/ntmarta.c [iso-8859-1] Sun Jun 8 17:01:26 2014 @@ -25,12 +25,49 @@ * UPDATE HISTORY: * 07/26/2005 Created */ + #include "ntmarta.h" #define NDEBUG #include <debug.h> HINSTANCE hDllInstance; + +/* FIXME: Vista+ API */ +VOID +WINAPI +SetSecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, + OUT LPDWORD DesiredAccess) +{ + *DesiredAccess = 0; + + if (SecurityInformation & (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION)) + *DesiredAccess |= WRITE_OWNER; + + if (SecurityInformation & DACL_SECURITY_INFORMATION) + *DesiredAccess |= WRITE_DAC; + + if (SecurityInformation & SACL_SECURITY_INFORMATION) + *DesiredAccess |= ACCESS_SYSTEM_SECURITY; +} + +/* FIXME: Vista+ API */ +VOID +WINAPI +QuerySecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, + OUT LPDWORD DesiredAccess) +{ + *DesiredAccess = 0; + + if (SecurityInformation & (OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION)) + { + *DesiredAccess |= READ_CONTROL; + } + + if (SecurityInformation & SACL_SECURITY_INFORMATION) + *DesiredAccess |= ACCESS_SYSTEM_SECURITY; +} static ACCESS_MODE AccpGetAceAccessMode(IN PACE_HEADER AceHeader)
10 years, 6 months
1
0
0
0
[akhaldi] 63555: [MSCTF] * Do not rely on RegDeleteTreeW which shouldn't be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 15:00:51 2014 New Revision: 63555 URL:
http://svn.reactos.org/svn/reactos?rev=63555&view=rev
Log: [MSCTF] * Do not rely on RegDeleteTreeW which shouldn't be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174 Modified: trunk/reactos/dll/win32/msctf/CMakeLists.txt trunk/reactos/dll/win32/msctf/categorymgr.c trunk/reactos/dll/win32/msctf/inputprocessor.c trunk/reactos/dll/win32/msctf/msctf_internal.h Modified: trunk/reactos/dll/win32/msctf/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/CMakeLists…
============================================================================== --- trunk/reactos/dll/win32/msctf/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/CMakeLists.txt [iso-8859-1] Sun Jun 8 15:00:51 2014 @@ -1,6 +1,3 @@ - -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) @@ -27,6 +24,6 @@ set_module_type(msctf win32dll) target_link_libraries(msctf uuid wine) -add_importlibs(msctf ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(msctf ole32 oleaut32 user32 advapi32 shlwapi msvcrt kernel32 ntdll) add_pch(msctf msctf_internal.h SOURCE) add_cd_file(TARGET msctf DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/msctf/categorymgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/categorymg…
============================================================================== --- trunk/reactos/dll/win32/msctf/categorymgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/categorymgr.c [iso-8859-1] Sun Jun 8 15:00:51 2014 @@ -154,9 +154,9 @@ sprintfW(fullkey,fmt2,ctg,ctg,buf,buf2); sprintfW(fullkey,fmt2,ctg,itm,buf2,buf); - RegDeleteTreeW(tipkey, fullkey); + SHDeleteKeyW(tipkey, fullkey); sprintfW(fullkey,fmt2,ctg,itm,buf2,buf); - RegDeleteTreeW(tipkey, fullkey); + SHDeleteKeyW(tipkey, fullkey); RegCloseKey(tipkey); return S_OK; Modified: trunk/reactos/dll/win32/msctf/inputprocessor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/inputproce…
============================================================================== --- trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] Sun Jun 8 15:00:51 2014 @@ -227,8 +227,8 @@ StringFromGUID2(rclsid, buf, 39); sprintfW(fullkey,szwTipfmt,szwSystemTIPKey,buf); - RegDeleteTreeW(HKEY_LOCAL_MACHINE, fullkey); - RegDeleteTreeW(HKEY_CURRENT_USER, fullkey); + SHDeleteKeyW(HKEY_LOCAL_MACHINE, fullkey); + SHDeleteKeyW(HKEY_CURRENT_USER, fullkey); return S_OK; } Modified: trunk/reactos/dll/win32/msctf/msctf_internal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf_inte…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] Sun Jun 8 15:00:51 2014 @@ -37,6 +37,7 @@ #include <objbase.h> #include <olectl.h> #include <msctf.h> +#include <shlwapi.h> #include <wine/list.h> #include <wine/unicode.h>
10 years, 6 months
1
0
0
0
[akhaldi] 63554: [LOCALSPL] * Do not rely on RegDeleteTreeW which shouldn't be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 14:51:07 2014 New Revision: 63554 URL:
http://svn.reactos.org/svn/reactos?rev=63554&view=rev
Log: [LOCALSPL] * Do not rely on RegDeleteTreeW which shouldn't be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174 Modified: trunk/reactos/dll/win32/localspl/CMakeLists.txt trunk/reactos/dll/win32/localspl/provider.c Modified: trunk/reactos/dll/win32/localspl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/localspl/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/localspl/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/localspl/CMakeLists.txt [iso-8859-1] Sun Jun 8 14:51:07 2014 @@ -1,6 +1,3 @@ - -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) @@ -20,6 +17,6 @@ set_module_type(localspl win32dll) target_link_libraries(localspl wine) -add_importlibs(localspl spoolss user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(localspl spoolss user32 advapi32 shlwapi msvcrt kernel32 ntdll) add_pch(localspl localspl_private.h SOURCE) add_cd_file(TARGET localspl DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/localspl/provider.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/localspl/provide…
============================================================================== --- trunk/reactos/dll/win32/localspl/provider.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/localspl/provider.c [iso-8859-1] Sun Jun 8 14:51:07 2014 @@ -20,6 +20,7 @@ #include "localspl_private.h" +#include <shlwapi.h> #include <ddk/winddiui.h> /* ############################### */ @@ -1846,7 +1847,7 @@ return FALSE; } - if(RegDeleteTreeW(hroot, pMonitorName) == ERROR_SUCCESS) { + if(SHDeleteKeyW(hroot, pMonitorName) == ERROR_SUCCESS) { TRACE("%s deleted\n", debugstr_w(pMonitorName)); RegCloseKey(hroot); return TRUE;
10 years, 6 months
1
0
0
0
[akhaldi] 63553: [CRYPT32] * Do not rely on RegDeleteTreeW which shouldn't be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 12:45:39 2014 New Revision: 63553 URL:
http://svn.reactos.org/svn/reactos?rev=63553&view=rev
Log: [CRYPT32] * Do not rely on RegDeleteTreeW which shouldn't be exported. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174 Modified: trunk/reactos/dll/win32/crypt32/CMakeLists.txt trunk/reactos/dll/win32/crypt32/regstore.c Modified: trunk/reactos/dll/win32/crypt32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/crypt32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/CMakeLists.txt [iso-8859-1] Sun Jun 8 12:45:39 2014 @@ -3,9 +3,6 @@ -D__WINESRC__ -D_WINE -D_CRYPT32_) - -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) spec2def(crypt32.dll crypt32.spec ADD_IMPORTLIB) @@ -45,7 +42,7 @@ set_module_type(crypt32 win32dll) target_link_libraries(crypt32 wine ${PSEH_LIB} oldnames) -add_importlibs(crypt32 user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(crypt32 user32 advapi32 shlwapi msvcrt kernel32 ntdll) add_delay_importlibs(crypt32 cryptnet) add_pch(crypt32 crypt32_private.h SOURCE) add_cd_file(TARGET crypt32 DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/crypt32/regstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/regstore…
============================================================================== --- trunk/reactos/dll/win32/crypt32/regstore.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/regstore.c [iso-8859-1] Sun Jun 8 12:45:39 2014 @@ -17,6 +17,8 @@ */ #include "crypt32_private.h" + +#include <shlwapi.h> WINE_DEFAULT_DEBUG_CHANNEL(crypt); @@ -507,12 +509,12 @@ if (dwFlags & CERT_STORE_DELETE_FLAG) { - DWORD rc = RegDeleteTreeW((HKEY)pvPara, CertsW); + DWORD rc = SHDeleteKeyW((HKEY)pvPara, CertsW); if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS) - rc = RegDeleteTreeW((HKEY)pvPara, CRLsW); + rc = SHDeleteKeyW((HKEY)pvPara, CRLsW); if (rc == ERROR_SUCCESS || rc == ERROR_NO_MORE_ITEMS) - rc = RegDeleteTreeW((HKEY)pvPara, CTLsW); + rc = SHDeleteKeyW((HKEY)pvPara, CTLsW); if (rc == ERROR_NO_MORE_ITEMS) rc = ERROR_SUCCESS; SetLastError(rc);
10 years, 6 months
1
0
0
0
[akhaldi] 63552: [QUARTZ] * Do not rely on RegDeleteTree{A, W} which shouldn't be exported. * Move shlwapi.h inclusion to the PCH. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 12:14:06 2014 New Revision: 63552 URL:
http://svn.reactos.org/svn/reactos?rev=63552&view=rev
Log: [QUARTZ] * Do not rely on RegDeleteTree{A,W} which shouldn't be exported. * Move shlwapi.h inclusion to the PCH. * We no longer need to define _WIN32_WINNT as 0x600. CORE-8174 Modified: trunk/reactos/dll/directx/wine/quartz/CMakeLists.txt trunk/reactos/dll/directx/wine/quartz/filesource.c trunk/reactos/dll/directx/wine/quartz/filtermapper.c trunk/reactos/dll/directx/wine/quartz/quartz_private.h trunk/reactos/dll/directx/wine/quartz/regsvr.c Modified: trunk/reactos/dll/directx/wine/quartz/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/CM…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/CMakeLists.txt [iso-8859-1] Sun Jun 8 12:14:06 2014 @@ -1,6 +1,3 @@ - -remove_definitions(-D_WIN32_WINNT=0x502) -add_definitions(-D_WIN32_WINNT=0x600) add_definitions( -D__WINESRC__ Modified: trunk/reactos/dll/directx/wine/quartz/filesource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/fi…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/filesource.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/filesource.c [iso-8859-1] Sun Jun 8 12:14:06 2014 @@ -19,8 +19,6 @@ */ #include "quartz_private.h" - -#include <shlwapi.h> static const WCHAR wszOutputPinName[] = { 'O','u','t','p','u','t',0 }; Modified: trunk/reactos/dll/directx/wine/quartz/filtermapper.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/fi…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/filtermapper.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/filtermapper.c [iso-8859-1] Sun Jun 8 12:14:06 2014 @@ -1513,7 +1513,7 @@ if (lRet != ERROR_SUCCESS) hr = HRESULT_FROM_WIN32(lRet); - lRet = RegDeleteTreeW(hKey, wszPins); + lRet = SHDeleteKeyW(hKey, wszPins); if (lRet != ERROR_SUCCESS) hr = HRESULT_FROM_WIN32(lRet); @@ -1572,7 +1572,7 @@ strcatW(wszPinNameKey, wszSlash); strcatW(wszPinNameKey, Name); - lRet = RegDeleteTreeW(hKey, wszPinNameKey); + lRet = SHDeleteKeyW(hKey, wszPinNameKey); hr = HRESULT_FROM_WIN32(lRet); CoTaskMemFree(wszPinNameKey); } Modified: trunk/reactos/dll/directx/wine/quartz/quartz_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/qu…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/quartz_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/quartz_private.h [iso-8859-1] Sun Jun 8 12:14:06 2014 @@ -41,6 +41,7 @@ #include <dvdmedia.h> #include <vfw.h> #include <aviriff.h> +#include <shlwapi.h> #include <wine/strmbase.h> #include <wine/unicode.h> Modified: trunk/reactos/dll/directx/wine/quartz/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/re…
============================================================================== --- trunk/reactos/dll/directx/wine/quartz/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/regsvr.c [iso-8859-1] Sun Jun 8 12:14:06 2014 @@ -240,7 +240,7 @@ WCHAR buf[39]; StringFromGUID2(list->iid, buf, 39); - res = RegDeleteTreeW(interface_key, buf); + res = SHDeleteKeyW(interface_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; } @@ -346,18 +346,18 @@ WCHAR buf[39]; StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); + res = SHDeleteKeyW(coclass_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->progid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); + res = SHDeleteKeyA(HKEY_CLASSES_ROOT, list->progid); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } if (list->viprogid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid); + res = SHDeleteKeyA(HKEY_CLASSES_ROOT, list->viprogid); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; if (res != ERROR_SUCCESS) goto error_close_coclass_key; } @@ -500,7 +500,7 @@ if (res != ERROR_SUCCESS) break; StringFromGUID2(list->subtype, buf, 39); - res = RegDeleteTreeW(majortype_key, buf); + res = SHDeleteKeyW(majortype_key, buf); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; /* Removed majortype key if there is no more subtype key */ @@ -535,7 +535,7 @@ res = ERROR_SUCCESS; else if (res == ERROR_SUCCESS) for (; res == ERROR_SUCCESS && list->majortype; ++list) { - res = RegDeleteTreeA(extensions_root_key, list->extension); + res = SHDeleteKeyA(extensions_root_key, list->extension); if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; }
10 years, 6 months
1
0
0
0
[akhaldi] 63551: * Use SHDeleteKeyW explicitly here.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 8 12:08:16 2014 New Revision: 63551 URL:
http://svn.reactos.org/svn/reactos?rev=63551&view=rev
Log: * Use SHDeleteKeyW explicitly here. Modified: trunk/reactos/base/applications/cmdutils/reg/reg.c Modified: trunk/reactos/base/applications/cmdutils/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/reg.c [iso-8859-1] Sun Jun 8 12:08:16 2014 @@ -294,7 +294,7 @@ /* Delete subtree only if no /v* option is given */ if (!value_name && !value_empty && !value_all) { - if (SHDeleteKey(root, p) != ERROR_SUCCESS) + if (SHDeleteKeyW(root, p) != ERROR_SUCCESS) { reg_message(STRING_CANNOT_FIND); return 1;
10 years, 6 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200