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
2025
January
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
May 2010
----- 2025 -----
January 2025
----- 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
21 participants
438 discussions
Start a n
N
ew thread
[jmorlan] 47335: [WIN32CSR] - Make consistent use of RECT/SMALL_RECT structures: a RECT uses pixel coordinates relative to the window client area and is endpoint-exclusive; a SMALL_RECT uses character coordinates relative to the screen buffer and is endpoint-inclusive. - Allow text selections outside of the visible window - Implement GetConsoleSelectionInfo
by jmorlan@svn.reactos.org
Author: jmorlan Date: Mon May 24 00:38:16 2010 New Revision: 47335 URL:
http://svn.reactos.org/svn/reactos?rev=47335&view=rev
Log: [WIN32CSR] - Make consistent use of RECT/SMALL_RECT structures: a RECT uses pixel coordinates relative to the window client area and is endpoint-exclusive; a SMALL_RECT uses character coordinates relative to the screen buffer and is endpoint-inclusive. - Allow text selections outside of the visible window - Implement GetConsoleSelectionInfo Modified: trunk/reactos/dll/win32/kernel32/misc/console.c trunk/reactos/include/reactos/subsys/csrss/csrss.h trunk/reactos/subsystems/win32/csrss/win32csr/conio.c trunk/reactos/subsystems/win32/csrss/win32csr/conio.h trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c Modified: trunk/reactos/dll/win32/kernel32/misc/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/co…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] Mon May 24 00:38:16 2010 @@ -3805,15 +3805,23 @@ /*-------------------------------------------------------------- * GetConsoleSelectionInfo * - * @unimplemented + * @implemented */ BOOL WINAPI GetConsoleSelectionInfo(PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo) { - DPRINT1("GetConsoleSelectionInfo(0x%x) UNIMPLEMENTED!\n", lpConsoleSelectionInfo); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + CSR_API_MESSAGE Request; + ULONG CsrRequest = MAKE_CSR_API(GET_CONSOLE_SELECTION_INFO, CSR_CONSOLE); + NTSTATUS Status = CsrClientCallServer(&Request, NULL, CsrRequest, sizeof(CSR_API_MESSAGE)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + *lpConsoleSelectionInfo = Request.Data.GetConsoleSelectionInfo.Info; + return TRUE; } Modified: trunk/reactos/include/reactos/subsys/csrss/csrss.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
============================================================================== --- trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] Mon May 24 00:38:16 2010 @@ -472,6 +472,11 @@ HANDLE OutputHandle; COORD Size; } CSRSS_SET_SCREEN_BUFFER_SIZE, *PCSRSS_SET_SCREEN_BUFFER_SIZE; + +typedef struct +{ + CONSOLE_SELECTION_INFO Info; +} CSRSS_GET_CONSOLE_SELECTION_INFO, *PCSRSS_GET_CONSOLE_SELECTION_INFO; #define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type)) @@ -552,6 +557,7 @@ #define GENERATE_CTRL_EVENT (0x3E) #define CREATE_THREAD (0x3F) #define SET_SCREEN_BUFFER_SIZE (0x40) +#define GET_CONSOLE_SELECTION_INFO (0x41) /* Keep in sync with definition below. */ #define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS)) @@ -626,6 +632,7 @@ CSRSS_GET_CONSOLE_ALIASES_EXES_LENGTH GetConsoleAliasesExesLength; CSRSS_GENERATE_CTRL_EVENT GenerateCtrlEvent; CSRSS_SET_SCREEN_BUFFER_SIZE SetScreenBufferSize; + CSRSS_GET_CONSOLE_SELECTION_INFO GetConsoleSelectionInfo; } Data; } CSR_API_MESSAGE, *PCSR_API_MESSAGE; Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] Mon May 24 00:38:16 2010 @@ -14,14 +14,14 @@ /* GLOBALS *******************************************************************/ -#define ConioInitRect(Rect, Top, Left, Bottom, Right) \ - ((Rect)->top) = Top; \ - ((Rect)->left) = Left; \ - ((Rect)->bottom) = Bottom; \ - ((Rect)->right) = Right +#define ConioInitRect(Rect, top, left, bottom, right) \ + ((Rect)->Top) = top; \ + ((Rect)->Left) = left; \ + ((Rect)->Bottom) = bottom; \ + ((Rect)->Right) = right #define ConioIsRectEmpty(Rect) \ - (((Rect)->left > (Rect)->right) || ((Rect)->top > (Rect)->bottom)) + (((Rect)->Left > (Rect)->Right) || ((Rect)->Top > (Rect)->Bottom)) #define ConsoleInputUnicodeCharToAnsiChar(Console, dChar, sWChar) \ WideCharToMultiByte((Console)->CodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL) @@ -392,7 +392,7 @@ } static VOID FASTCALL -ConioNextLine(PCSRSS_SCREEN_BUFFER Buff, RECT *UpdateRect, UINT *ScrolledLines) +ConioNextLine(PCSRSS_SCREEN_BUFFER Buff, SMALL_RECT *UpdateRect, UINT *ScrolledLines) { /* If we hit bottom, slide the viewable screen */ if (++Buff->CurrentY == Buff->MaxY) @@ -404,14 +404,14 @@ } (*ScrolledLines)++; ClearLineBuffer(Buff); - if (UpdateRect->top != 0) - { - UpdateRect->top--; - } - } - UpdateRect->left = 0; - UpdateRect->right = Buff->MaxX - 1; - UpdateRect->bottom = Buff->CurrentY; + if (UpdateRect->Top != 0) + { + UpdateRect->Top--; + } + } + UpdateRect->Left = 0; + UpdateRect->Right = Buff->MaxX - 1; + UpdateRect->Bottom = Buff->CurrentY; } static NTSTATUS FASTCALL @@ -420,16 +420,16 @@ { UINT i; PBYTE Ptr; - RECT UpdateRect; + SMALL_RECT UpdateRect; LONG CursorStartX, CursorStartY; UINT ScrolledLines; CursorStartX = Buff->CurrentX; CursorStartY = Buff->CurrentY; - UpdateRect.left = Buff->MaxX; - UpdateRect.top = Buff->CurrentY; - UpdateRect.right = -1; - UpdateRect.bottom = Buff->CurrentY; + UpdateRect.Left = Buff->MaxX; + UpdateRect.Top = Buff->CurrentY; + UpdateRect.Right = -1; + UpdateRect.Bottom = Buff->CurrentY; ScrolledLines = 0; for (i = 0; i < Length; i++) @@ -454,7 +454,7 @@ /* slide virtual position up */ Buff->CurrentX = Buff->MaxX - 1; Buff->CurrentY--; - UpdateRect.top = min(UpdateRect.top, (LONG)Buff->CurrentY); + UpdateRect.Top = min(UpdateRect.Top, (LONG)Buff->CurrentY); } else { @@ -463,8 +463,8 @@ Ptr = ConioCoordToPointer(Buff, Buff->CurrentX, Buff->CurrentY); Ptr[0] = ' '; Ptr[1] = Buff->DefaultAttrib; - UpdateRect.left = min(UpdateRect.left, (LONG) Buff->CurrentX); - UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX); + UpdateRect.Left = min(UpdateRect.Left, (LONG) Buff->CurrentX); + UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX); } continue; } @@ -472,8 +472,8 @@ else if (Buffer[i] == '\r') { Buff->CurrentX = 0; - UpdateRect.left = min(UpdateRect.left, (LONG) Buff->CurrentX); - UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX); + UpdateRect.Left = min(UpdateRect.Left, (LONG) Buff->CurrentX); + UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX); continue; } /* --- TAB --- */ @@ -481,7 +481,7 @@ { UINT EndX; - UpdateRect.left = min(UpdateRect.left, (LONG)Buff->CurrentX); + UpdateRect.Left = min(UpdateRect.Left, (LONG)Buff->CurrentX); EndX = (Buff->CurrentX + 8) & ~7; if (EndX > Buff->MaxX) { @@ -494,7 +494,7 @@ *Ptr++ = Buff->DefaultAttrib; Buff->CurrentX++; } - UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX - 1); + UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX - 1); if (Buff->CurrentX == Buff->MaxX) { if (Buff->Mode & ENABLE_WRAP_AT_EOL_OUTPUT) @@ -510,8 +510,8 @@ continue; } } - UpdateRect.left = min(UpdateRect.left, (LONG)Buff->CurrentX); - UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX); + UpdateRect.Left = min(UpdateRect.Left, (LONG)Buff->CurrentX); + UpdateRect.Right = max(UpdateRect.Right, (LONG) Buff->CurrentX); Ptr = ConioCoordToPointer(Buff, Buff->CurrentX, Buff->CurrentY); Ptr[0] = Buffer[i]; if (Attrib) @@ -684,16 +684,16 @@ } __inline BOOLEAN ConioGetIntersection( - RECT *Intersection, - RECT *Rect1, - RECT *Rect2) + SMALL_RECT *Intersection, + SMALL_RECT *Rect1, + SMALL_RECT *Rect2) { if (ConioIsRectEmpty(Rect1) || (ConioIsRectEmpty(Rect2)) || - (Rect1->top > Rect2->bottom) || - (Rect1->left > Rect2->right) || - (Rect1->bottom < Rect2->top) || - (Rect1->right < Rect2->left)) + (Rect1->Top > Rect2->Bottom) || + (Rect1->Left > Rect2->Right) || + (Rect1->Bottom < Rect2->Top) || + (Rect1->Right < Rect2->Left)) { /* The rectangles do not intersect */ ConioInitRect(Intersection, 0, -1, 0, -1); @@ -701,18 +701,18 @@ } ConioInitRect(Intersection, - max(Rect1->top, Rect2->top), - max(Rect1->left, Rect2->left), - min(Rect1->bottom, Rect2->bottom), - min(Rect1->right, Rect2->right)); + max(Rect1->Top, Rect2->Top), + max(Rect1->Left, Rect2->Left), + min(Rect1->Bottom, Rect2->Bottom), + min(Rect1->Right, Rect2->Right)); return TRUE; } __inline BOOLEAN ConioGetUnion( - RECT *Union, - RECT *Rect1, - RECT *Rect2) + SMALL_RECT *Union, + SMALL_RECT *Rect1, + SMALL_RECT *Rect2) { if (ConioIsRectEmpty(Rect1)) { @@ -733,10 +733,10 @@ else { ConioInitRect(Union, - min(Rect1->top, Rect2->top), - min(Rect1->left, Rect2->left), - max(Rect1->bottom, Rect2->bottom), - max(Rect1->right, Rect2->right)); + min(Rect1->Top, Rect2->Top), + min(Rect1->Left, Rect2->Left), + max(Rect1->Bottom, Rect2->Bottom), + max(Rect1->Right, Rect2->Right)); } return TRUE; @@ -746,9 +746,9 @@ * this is done, to avoid overwriting parts of the source before they are moved. */ static VOID FASTCALL ConioMoveRegion(PCSRSS_SCREEN_BUFFER ScreenBuffer, - RECT *SrcRegion, - RECT *DstRegion, - RECT *ClipRegion, + SMALL_RECT *SrcRegion, + SMALL_RECT *DstRegion, + SMALL_RECT *ClipRegion, WORD Fill) { int Width = ConioRectWidth(SrcRegion); @@ -758,14 +758,14 @@ int XDelta, YDelta; int i, j; - SY = SrcRegion->top; - DY = DstRegion->top; + SY = SrcRegion->Top; + DY = DstRegion->Top; YDelta = 1; if (SY < DY) { /* Moving down: work from bottom up */ - SY = SrcRegion->bottom; - DY = DstRegion->bottom; + SY = SrcRegion->Bottom; + DY = DstRegion->Bottom; YDelta = -1; } for (i = 0; i < Height; i++) @@ -773,26 +773,26 @@ PWORD SRow = (PWORD)ConioCoordToPointer(ScreenBuffer, 0, SY); PWORD DRow = (PWORD)ConioCoordToPointer(ScreenBuffer, 0, DY); - SX = SrcRegion->left; - DX = DstRegion->left; + SX = SrcRegion->Left; + DX = DstRegion->Left; XDelta = 1; if (SX < DX) { /* Moving right: work from right to left */ - SX = SrcRegion->right; - DX = DstRegion->right; + SX = SrcRegion->Right; + DX = DstRegion->Right; XDelta = -1; } for (j = 0; j < Width; j++) { WORD Cell = SRow[SX]; - if (SX >= ClipRegion->left && SX <= ClipRegion->right - && SY >= ClipRegion->top && SY <= ClipRegion->bottom) + if (SX >= ClipRegion->Left && SX <= ClipRegion->Right + && SY >= ClipRegion->Top && SY <= ClipRegion->Bottom) { SRow[SX] = Fill; } - if (DX >= ClipRegion->left && DX <= ClipRegion->right - && DY >= ClipRegion->top && DY <= ClipRegion->bottom) + if (DX >= ClipRegion->Left && DX <= ClipRegion->Right + && DY >= ClipRegion->Top && DY <= ClipRegion->Bottom) { DRow[DX] = Cell; } @@ -920,7 +920,7 @@ VOID FASTCALL ConioDrawConsole(PCSRSS_CONSOLE Console) { - RECT Region; + SMALL_RECT Region; ConioInitRect(&Region, 0, 0, Console->Size.Y - 1, Console->Size.X - 1); @@ -1362,29 +1362,29 @@ } static VOID FASTCALL -ConioComputeUpdateRect(PCSRSS_SCREEN_BUFFER Buff, RECT *UpdateRect, COORD *Start, UINT Length) +ConioComputeUpdateRect(PCSRSS_SCREEN_BUFFER Buff, SMALL_RECT *UpdateRect, COORD *Start, UINT Length) { if (Buff->MaxX <= Start->X + Length) { - UpdateRect->left = 0; + UpdateRect->Left = 0; } else { - UpdateRect->left = Start->X; + UpdateRect->Left = Start->X; } if (Buff->MaxX <= Start->X + Length) { - UpdateRect->right = Buff->MaxX - 1; + UpdateRect->Right = Buff->MaxX - 1; } else { - UpdateRect->right = Start->X + Length - 1; - } - UpdateRect->top = Start->Y; - UpdateRect->bottom = Start->Y+ (Start->X + Length - 1) / Buff->MaxX; - if (Buff->MaxY <= UpdateRect->bottom) - { - UpdateRect->bottom = Buff->MaxY - 1; + UpdateRect->Right = Start->X + Length - 1; + } + UpdateRect->Top = Start->Y; + UpdateRect->Bottom = Start->Y+ (Start->X + Length - 1) / Buff->MaxX; + if (Buff->MaxY <= UpdateRect->Bottom) + { + UpdateRect->Bottom = Buff->MaxY - 1; } } @@ -1396,7 +1396,7 @@ PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; DWORD X, Y, Length, CharSize, Written = 0; - RECT UpdateRect; + SMALL_RECT UpdateRect; DPRINT("CsrWriteConsoleOutputChar\n"); @@ -1498,7 +1498,7 @@ DWORD X, Y, Length, Written = 0; CHAR Char; PBYTE Buffer; - RECT UpdateRect; + SMALL_RECT UpdateRect; DPRINT("CsrFillOutputChar\n"); @@ -1636,7 +1636,7 @@ PWORD Attribute; int X, Y, Length; NTSTATUS Status; - RECT UpdateRect; + SMALL_RECT UpdateRect; DPRINT("CsrWriteConsoleOutputAttrib\n"); @@ -1705,7 +1705,7 @@ NTSTATUS Status; int X, Y, Length; UCHAR Attr; - RECT UpdateRect; + SMALL_RECT UpdateRect; PCSRSS_CONSOLE Console; DPRINT("CsrFillOutputAttrib\n"); @@ -2119,9 +2119,9 @@ SHORT i, X, Y, SizeX, SizeY; PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; - RECT ScreenBuffer; + SMALL_RECT ScreenBuffer; CHAR_INFO* CurCharInfo; - RECT WriteRegion; + SMALL_RECT WriteRegion; CHAR_INFO* CharInfo; COORD BufferCoord; COORD BufferSize; @@ -2154,15 +2154,12 @@ ConioUnlockScreenBuffer(Buff); return STATUS_ACCESS_VIOLATION; } - WriteRegion.left = Request->Data.WriteConsoleOutputRequest.WriteRegion.Left; - WriteRegion.top = Request->Data.WriteConsoleOutputRequest.WriteRegion.Top; - WriteRegion.right = Request->Data.WriteConsoleOutputRequest.WriteRegion.Right; - WriteRegion.bottom = Request->Data.WriteConsoleOutputRequest.WriteRegion.Bottom; + WriteRegion = Request->Data.WriteConsoleOutputRequest.WriteRegion; SizeY = min(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&WriteRegion)); SizeX = min(BufferSize.X - BufferCoord.X, ConioRectWidth(&WriteRegion)); - WriteRegion.bottom = WriteRegion.top + SizeY - 1; - WriteRegion.right = WriteRegion.left + SizeX - 1; + WriteRegion.Bottom = WriteRegion.Top + SizeY - 1; + WriteRegion.Right = WriteRegion.Left + SizeX - 1; /* Make sure WriteRegion is inside the screen buffer */ ConioInitRect(&ScreenBuffer, 0, 0, Buff->MaxY - 1, Buff->MaxX - 1); @@ -2175,11 +2172,11 @@ return STATUS_SUCCESS; } - for (i = 0, Y = WriteRegion.top; Y <= WriteRegion.bottom; i++, Y++) + for (i = 0, Y = WriteRegion.Top; Y <= WriteRegion.Bottom; i++, Y++) { CurCharInfo = CharInfo + (i + BufferCoord.Y) * BufferSize.X + BufferCoord.X; - Ptr = ConioCoordToPointer(Buff, WriteRegion.left, Y); - for (X = WriteRegion.left; X <= WriteRegion.right; X++) + Ptr = ConioCoordToPointer(Buff, WriteRegion.Left, Y); + for (X = WriteRegion.Left; X <= WriteRegion.Right; X++) { CHAR AsciiChar; if (Request->Data.WriteConsoleOutputRequest.Unicode) @@ -2200,10 +2197,10 @@ ConioUnlockScreenBuffer(Buff); - Request->Data.WriteConsoleOutputRequest.WriteRegion.Right = WriteRegion.left + SizeX - 1; - Request->Data.WriteConsoleOutputRequest.WriteRegion.Bottom = WriteRegion.top + SizeY - 1; - Request->Data.WriteConsoleOutputRequest.WriteRegion.Left = WriteRegion.left; - Request->Data.WriteConsoleOutputRequest.WriteRegion.Top = WriteRegion.top; + Request->Data.WriteConsoleOutputRequest.WriteRegion.Right = WriteRegion.Left + SizeX - 1; + Request->Data.WriteConsoleOutputRequest.WriteRegion.Bottom = WriteRegion.Top + SizeY - 1; + Request->Data.WriteConsoleOutputRequest.WriteRegion.Left = WriteRegion.Left; + Request->Data.WriteConsoleOutputRequest.WriteRegion.Top = WriteRegion.Top; return STATUS_SUCCESS; } @@ -2248,12 +2245,12 @@ { PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; - RECT ScreenBuffer; - RECT SrcRegion; - RECT DstRegion; - RECT UpdateRegion; - RECT ScrollRectangle; - RECT ClipRectangle; + SMALL_RECT ScreenBuffer; + SMALL_RECT SrcRegion; + SMALL_RECT DstRegion; + SMALL_RECT UpdateRegion; + SMALL_RECT ScrollRectangle; + SMALL_RECT ClipRectangle; NTSTATUS Status; HANDLE ConsoleHandle; BOOLEAN UseClipRectangle; @@ -2277,10 +2274,7 @@ } Console = Buff->Header.Console; - ScrollRectangle.left = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Left; - ScrollRectangle.top = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Top; - ScrollRectangle.right = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Right; - ScrollRectangle.bottom = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle.Bottom; + ScrollRectangle = Request->Data.ScrollConsoleScreenBufferRequest.ScrollRectangle; /* Make sure source rectangle is inside the screen buffer */ ConioInitRect(&ScreenBuffer, 0, 0, Buff->MaxY - 1, Buff->MaxX - 1); @@ -2291,21 +2285,18 @@ } /* If the source was clipped on the left or top, adjust the destination accordingly */ - if (ScrollRectangle.left < 0) - { - DestinationOrigin.X -= ScrollRectangle.left; - } - if (ScrollRectangle.top < 0) - { - DestinationOrigin.Y -= ScrollRectangle.top; + if (ScrollRectangle.Left < 0) + { + DestinationOrigin.X -= ScrollRectangle.Left; + } + if (ScrollRectangle.Top < 0) + { + DestinationOrigin.Y -= ScrollRectangle.Top; } if (UseClipRectangle) { - ClipRectangle.left = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Left; - ClipRectangle.top = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Top; - ClipRectangle.right = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Right; - ClipRectangle.bottom = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Bottom; + ClipRectangle = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle; if (!ConioGetIntersection(&ClipRectangle, &ClipRectangle, &ScreenBuffer)) { ConioUnlockScreenBuffer(Buff); @@ -2601,8 +2592,8 @@ NTSTATUS Status; COORD BufferSize; COORD BufferCoord; - RECT ReadRegion; - RECT ScreenRect; + SMALL_RECT ReadRegion; + SMALL_RECT ScreenRect; DWORD i; PBYTE Ptr; LONG X, Y; @@ -2620,10 +2611,7 @@ } CharInfo = Request->Data.ReadConsoleOutputRequest.CharInfo; - ReadRegion.left = Request->Data.ReadConsoleOutputRequest.ReadRegion.Left; - ReadRegion.top = Request->Data.ReadConsoleOutputRequest.ReadRegion.Top; - ReadRegion.right = Request->Data.ReadConsoleOutputRequest.ReadRegion.Right; - ReadRegion.bottom = Request->Data.ReadConsoleOutputRequest.ReadRegion.Bottom; + ReadRegion = Request->Data.ReadConsoleOutputRequest.ReadRegion; BufferSize = Request->Data.ReadConsoleOutputRequest.BufferSize; BufferCoord = Request->Data.ReadConsoleOutputRequest.BufferCoord; Length = BufferSize.X * BufferSize.Y; @@ -2641,8 +2629,8 @@ SizeY = min(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&ReadRegion)); SizeX = min(BufferSize.X - BufferCoord.X, ConioRectWidth(&ReadRegion)); - ReadRegion.bottom = ReadRegion.top + SizeY; - ReadRegion.right = ReadRegion.left + SizeX; + ReadRegion.Bottom = ReadRegion.Top + SizeY; + ReadRegion.Right = ReadRegion.Left + SizeX; ConioInitRect(&ScreenRect, 0, 0, Buff->MaxY, Buff->MaxX); if (! ConioGetIntersection(&ReadRegion, &ScreenRect, &ReadRegion)) @@ -2651,12 +2639,12 @@ return STATUS_SUCCESS; } - for (i = 0, Y = ReadRegion.top; Y < ReadRegion.bottom; ++i, ++Y) + for (i = 0, Y = ReadRegion.Top; Y < ReadRegion.Bottom; ++i, ++Y) { CurCharInfo = CharInfo + (i * BufferSize.X); - Ptr = ConioCoordToPointer(Buff, ReadRegion.left, Y); - for (X = ReadRegion.left; X < ReadRegion.right; ++X) + Ptr = ConioCoordToPointer(Buff, ReadRegion.Left, Y); + for (X = ReadRegion.Left; X < ReadRegion.Right; ++X) { if (Request->Data.ReadConsoleOutputRequest.Unicode) { @@ -2675,10 +2663,10 @@ ConioUnlockScreenBuffer(Buff); - Request->Data.ReadConsoleOutputRequest.ReadRegion.Right = ReadRegion.left + SizeX - 1; - Request->Data.ReadConsoleOutputRequest.ReadRegion.Bottom = ReadRegion.top + SizeY - 1; - Request->Data.ReadConsoleOutputRequest.ReadRegion.Left = ReadRegion.left; - Request->Data.ReadConsoleOutputRequest.ReadRegion.Top = ReadRegion.top; + Request->Data.ReadConsoleOutputRequest.ReadRegion.Right = ReadRegion.Left + SizeX - 1; + Request->Data.ReadConsoleOutputRequest.ReadRegion.Bottom = ReadRegion.Top + SizeY - 1; + Request->Data.ReadConsoleOutputRequest.ReadRegion.Left = ReadRegion.Left; + Request->Data.ReadConsoleOutputRequest.ReadRegion.Top = ReadRegion.Top; return STATUS_SUCCESS; } @@ -3063,4 +3051,23 @@ return Status; } +CSR_API(CsrGetConsoleSelectionInfo) +{ + NTSTATUS Status; + PCSRSS_CONSOLE Console; + + Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); + Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); + + Status = ConioConsoleFromProcessData(ProcessData, &Console); + if (NT_SUCCESS(Status)) + { + memset(&Request->Data.GetConsoleSelectionInfo.Info, 0, sizeof(CONSOLE_SELECTION_INFO)); + if (Console->Selection.dwFlags != 0) + Request->Data.GetConsoleSelectionInfo.Info = Console->Selection; + ConioUnlockConsole(Console); + } + return Status; +} + /* EOF */ Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/conio.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.h [iso-8859-1] Mon May 24 00:38:16 2010 @@ -54,9 +54,9 @@ typedef struct tagCSRSS_CONSOLE_VTBL { VOID (WINAPI *InitScreenBuffer)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER ScreenBuffer); - VOID (WINAPI *WriteStream)(PCSRSS_CONSOLE Console, RECT *Block, LONG CursorStartX, LONG CursorStartY, + VOID (WINAPI *WriteStream)(PCSRSS_CONSOLE Console, SMALL_RECT *Block, LONG CursorStartX, LONG CursorStartY, UINT ScrolledLines, CHAR *Buffer, UINT Length); - VOID (WINAPI *DrawRegion)(PCSRSS_CONSOLE Console, RECT *Region); + VOID (WINAPI *DrawRegion)(PCSRSS_CONSOLE Console, SMALL_RECT *Region); BOOL (WINAPI *SetCursorInfo)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER ScreenBuffer); BOOL (WINAPI *SetScreenInfo)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER ScreenBuffer, UINT OldCursorX, UINT OldCursorY); @@ -92,6 +92,7 @@ PCSRSS_CONSOLE_VTBL Vtbl; LIST_ENTRY ProcessList; struct tagALIAS_HEADER *Aliases; + CONSOLE_SELECTION_INFO Selection; } CSRSS_CONSOLE; typedef struct ConsoleInput_t @@ -102,6 +103,13 @@ BOOLEAN Fake; // synthesized, not a real event BOOLEAN NotChar; // message should not be used to return a character } ConsoleInput; + +/* CONSOLE_SELECTION_INFO dwFlags values */ +#define CONSOLE_NO_SELECTION 0x0 +#define CONSOLE_SELECTION_IN_PROGRESS 0x1 +#define CONSOLE_SELECTION_NOT_EMPTY 0x2 +#define CONSOLE_MOUSE_SELECTION 0x4 +#define CONSOLE_MOUSE_DOWN 0x8 NTSTATUS FASTCALL ConioConsoleFromProcessData(PCSRSS_PROCESS_DATA ProcessData, PCSRSS_CONSOLE *Console); VOID WINAPI ConioDeleteConsole(Object_t *Object); @@ -155,6 +163,7 @@ CSR_API(CsrGetProcessList); CSR_API(CsrGenerateCtrlEvent); CSR_API(CsrSetScreenBufferSize); +CSR_API(CsrGetConsoleSelectionInfo); #define ConioInitScreenBuffer(Console, Buff) (Console)->Vtbl->InitScreenBuffer((Console), (Buff)) #define ConioDrawRegion(Console, Region) (Console)->Vtbl->DrawRegion((Console), (Region)) @@ -172,9 +181,9 @@ #define ConioResizeBuffer(Console, Buff, Size) (Console)->Vtbl->ResizeBuffer(Console, Buff, Size) #define ConioRectHeight(Rect) \ - (((Rect)->top) > ((Rect)->bottom) ? 0 : ((Rect)->bottom) - ((Rect)->top) + 1) + (((Rect)->Top) > ((Rect)->Bottom) ? 0 : ((Rect)->Bottom) - ((Rect)->Top) + 1) #define ConioRectWidth(Rect) \ - (((Rect)->left) > ((Rect)->right) ? 0 : ((Rect)->right) - ((Rect)->left) + 1) + (((Rect)->Left) > ((Rect)->Right) ? 0 : ((Rect)->Right) - ((Rect)->Left) + 1) #define ConioLockConsole(ProcessData, Handle, Ptr, Access) \ Win32CsrLockObject((ProcessData), (Handle), (Object_t **)(Ptr), Access, CONIO_CONSOLE_MAGIC) Modified: trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] Mon May 24 00:38:16 2010 @@ -81,6 +81,7 @@ CSRSS_DEFINE_API(GET_CONSOLE_ALIASES_EXES_LENGTH, CsrGetConsoleAliasesExesLength), CSRSS_DEFINE_API(GENERATE_CTRL_EVENT, CsrGenerateCtrlEvent), CSRSS_DEFINE_API(SET_SCREEN_BUFFER_SIZE, CsrSetScreenBufferSize), + CSRSS_DEFINE_API(GET_CONSOLE_SELECTION_INFO, CsrGetConsoleSelectionInfo), { 0, 0, NULL } }; Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] Mon May 24 00:38:16 2010 @@ -25,9 +25,6 @@ BOOL CursorBlinkOn; BOOL ForceCursorOff; CRITICAL_SECTION Lock; - RECT Selection; - POINT SelectionStart; - BOOL MouseDown; HMODULE ConsoleLibrary; HANDLE hGuiInitEvent; WCHAR FontName[LF_FACESIZE]; @@ -773,7 +770,6 @@ GuiData->CursorBlinkOn = TRUE; GuiData->ForceCursorOff = FALSE; - GuiData->Selection.left = -1; DPRINT("Console %p GuiData %p\n", Console, GuiData); Console->PrivateData = GuiData; SetWindowLongPtrW(hWnd, GWL_USERDATA, (DWORD_PTR) Console); @@ -790,40 +786,46 @@ return (BOOL) DefWindowProcW(hWnd, WM_NCCREATE, 0, (LPARAM) Create); } +static VOID +SmallRectToRect(PCSRSS_CONSOLE Console, PRECT Rect, PSMALL_RECT SmallRect) +{ + PCSRSS_SCREEN_BUFFER Buffer = Console->ActiveBuffer; + PGUI_CONSOLE_DATA GuiData = Console->PrivateData; + Rect->left = (SmallRect->Left - Buffer->ShowX) * GuiData->CharWidth; + Rect->top = (SmallRect->Top - Buffer->ShowY) * GuiData->CharHeight; + Rect->right = (SmallRect->Right + 1 - Buffer->ShowX) * GuiData->CharWidth; + Rect->bottom = (SmallRect->Bottom + 1 - Buffer->ShowY) * GuiData->CharHeight; +} + static VOID FASTCALL -GuiConsoleUpdateSelection(HWND hWnd, PRECT rc, PGUI_CONSOLE_DATA GuiData) -{ - RECT oldRect = GuiData->Selection; - - if(rc != NULL) +GuiConsoleUpdateSelection(PCSRSS_CONSOLE Console, PCOORD coord) +{ + RECT oldRect, newRect; + HWND hWnd = Console->hWindow; + + SmallRectToRect(Console, &oldRect, &Console->Selection.srSelection); + + if(coord != NULL) { - RECT changeRect = *rc; - - GuiData->Selection = *rc; - - changeRect.left *= GuiData->CharWidth; - changeRect.top *= GuiData->CharHeight; - changeRect.right *= GuiData->CharWidth; - changeRect.bottom *= GuiData->CharHeight; - - if(rc->left != oldRect.left || - rc->top != oldRect.top || - rc->right != oldRect.right || - rc->bottom != oldRect.bottom) - { - if(oldRect.left != -1) + SMALL_RECT rc; + /* exchange left/top with right/bottom if required */ + rc.Left = min(Console->Selection.dwSelectionAnchor.X, coord->X); + rc.Top = min(Console->Selection.dwSelectionAnchor.Y, coord->Y); + rc.Right = max(Console->Selection.dwSelectionAnchor.X, coord->X); + rc.Bottom = max(Console->Selection.dwSelectionAnchor.Y, coord->Y); + + SmallRectToRect(Console, &newRect, &rc); + + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) + { + if (memcmp(&rc, &Console->Selection.srSelection, sizeof(SMALL_RECT)) != 0) { HRGN rgn1, rgn2; - oldRect.left *= GuiData->CharWidth; - oldRect.top *= GuiData->CharHeight; - oldRect.right *= GuiData->CharWidth; - oldRect.bottom *= GuiData->CharHeight; - /* calculate the region that needs to be updated */ if((rgn1 = CreateRectRgnIndirect(&oldRect))) { - if((rgn2 = CreateRectRgnIndirect(&changeRect))) + if((rgn2 = CreateRectRgnIndirect(&newRect))) { if(CombineRgn(rgn1, rgn2, rgn1, RGN_XOR) != ERROR) { @@ -835,21 +837,22 @@ DeleteObject(rgn1); } } - else - { - InvalidateRect(hWnd, &changeRect, FALSE); - } - } + } + else + { + InvalidateRect(hWnd, &newRect, FALSE); + } + Console->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY; + Console->Selection.srSelection = rc; } - else if(oldRect.left != -1) + else { /* clear the selection */ - GuiData->Selection.left = -1; - oldRect.left *= GuiData->CharWidth; - oldRect.top *= GuiData->CharHeight; - oldRect.right *= GuiData->CharWidth; - oldRect.bottom *= GuiData->CharHeight; - InvalidateRect(hWnd, &oldRect, FALSE); + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) + { + InvalidateRect(hWnd, &oldRect, FALSE); + } + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; } } @@ -1005,14 +1008,10 @@ hDC, &ps.rcPaint); - if (GuiData->Selection.left != -1) + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - RECT rc = GuiData->Selection; - - rc.left *= GuiData->CharWidth; - rc.top *= GuiData->CharHeight; - rc.right *= GuiData->CharWidth; - rc.bottom *= GuiData->CharHeight; + RECT rc; + SmallRectToRect(Console, &rc, &Console->Selection.srSelection); /* invert the selection */ if (IntersectRect(&rc, @@ -1052,51 +1051,29 @@ if(msg == WM_CHAR || msg == WM_SYSKEYDOWN) { /* clear the selection */ - GuiConsoleUpdateSelection(hWnd, NULL, GuiData); + GuiConsoleUpdateSelection(Console, NULL); } ConioProcessKey(&Message, Console, FALSE); } +static VOID WINAPI +GuiDrawRegion(PCSRSS_CONSOLE Console, SMALL_RECT *Region) +{ + RECT RegionRect; + SmallRectToRect(Console, &RegionRect, Region); + InvalidateRect(Console->hWindow, &RegionRect, FALSE); +} + static VOID FASTCALL -GuiIntDrawRegion(PCSRSS_SCREEN_BUFFER Buff, PGUI_CONSOLE_DATA GuiData, HWND Wnd, RECT *Region) -{ - RECT RegionRect; - - RegionRect.left = (Region->left - Buff->ShowX) * GuiData->CharWidth; - RegionRect.top = (Region->top - Buff->ShowY) * GuiData->CharHeight; - RegionRect.right = (Region->right + 1 - Buff->ShowX) * GuiData->CharWidth; - RegionRect.bottom = (Region->bottom + 1 - Buff->ShowY) * GuiData->CharHeight; - - InvalidateRect(Wnd, &RegionRect, FALSE); +GuiInvalidateCell(PCSRSS_CONSOLE Console, UINT x, UINT y) +{ + SMALL_RECT CellRect = { x, y, x, y }; + GuiDrawRegion(Console, &CellRect); } static VOID WINAPI -GuiDrawRegion(PCSRSS_CONSOLE Console, RECT *Region) -{ - PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA) Console->PrivateData; - - if (NULL != Console->hWindow && NULL != GuiData) - { - GuiIntDrawRegion(Console->ActiveBuffer, GuiData, Console->hWindow, Region); - } -} - -static VOID FASTCALL -GuiInvalidateCell(PCSRSS_SCREEN_BUFFER Buff, PGUI_CONSOLE_DATA GuiData, HWND Wnd, UINT x, UINT y) -{ - RECT CellRect; - - CellRect.left = x; - CellRect.top = y; - CellRect.right = x; - CellRect.bottom = y; - - GuiIntDrawRegion(Buff, GuiData, Wnd, &CellRect); -} - -static VOID WINAPI -GuiWriteStream(PCSRSS_CONSOLE Console, RECT *Region, LONG CursorStartX, LONG CursorStartY, +GuiWriteStream(PCSRSS_CONSOLE Console, SMALL_RECT *Region, LONG CursorStartX, LONG CursorStartY, UINT ScrolledLines, CHAR *Buffer, UINT Length) { PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA) Console->PrivateData; @@ -1114,26 +1091,7 @@ ScrollRect.left = 0; ScrollRect.top = 0; ScrollRect.right = Console->Size.X * GuiData->CharWidth; - ScrollRect.bottom = Region->top * GuiData->CharHeight; - - if (GuiData->Selection.left != -1) - { - /* scroll the selection */ - if (GuiData->Selection.top > ScrolledLines) - { - GuiData->Selection.top -= ScrolledLines; - GuiData->Selection.bottom -= ScrolledLines; - } - else if (GuiData->Selection.bottom < ScrolledLines) - { - GuiData->Selection.left = -1; - } - else - { - GuiData->Selection.top = 0; - GuiData->Selection.bottom -= ScrolledLines; - } - } + ScrollRect.bottom = Region->Top * GuiData->CharHeight; ScrollWindowEx(Console->hWindow, 0, @@ -1145,21 +1103,21 @@ SW_INVALIDATE); } - GuiIntDrawRegion(Buff, GuiData, Console->hWindow, Region); - - if (CursorStartX < Region->left || Region->right < CursorStartX - || CursorStartY < Region->top || Region->bottom < CursorStartY) - { - GuiInvalidateCell(Buff, GuiData, Console->hWindow, CursorStartX, CursorStartY); + GuiDrawRegion(Console, Region); + + if (CursorStartX < Region->Left || Region->Right < CursorStartX + || CursorStartY < Region->Top || Region->Bottom < CursorStartY) + { + GuiInvalidateCell(Console, CursorStartX, CursorStartY); } CursorEndX = Buff->CurrentX; CursorEndY = Buff->CurrentY; - if ((CursorEndX < Region->left || Region->right < CursorEndX - || CursorEndY < Region->top || Region->bottom < CursorEndY) + if ((CursorEndX < Region->Left || Region->Right < CursorEndX + || CursorEndY < Region->Top || Region->Bottom < CursorEndY) && (CursorEndX != CursorStartX || CursorEndY != CursorStartY)) { - GuiInvalidateCell(Buff, GuiData, Console->hWindow, CursorEndX, CursorEndY); + GuiInvalidateCell(Console, CursorEndX, CursorEndY); } // Set up the update timer (very short interval) - this is a "hack" for getting the OS to @@ -1171,15 +1129,9 @@ static BOOL WINAPI GuiSetCursorInfo(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff) { - RECT UpdateRect; - if (Console->ActiveBuffer == Buff) { - UpdateRect.left = Buff->CurrentX; - UpdateRect.top = Buff->CurrentY; - UpdateRect.right = UpdateRect.left; - UpdateRect.bottom = UpdateRect.top; - ConioDrawRegion(Console, &UpdateRect); + GuiInvalidateCell(Console, Buff->CurrentX, Buff->CurrentY); } return TRUE; @@ -1188,22 +1140,12 @@ static BOOL WINAPI GuiSetScreenInfo(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff, UINT OldCursorX, UINT OldCursorY) { - RECT UpdateRect; - if (Console->ActiveBuffer == Buff) { /* Redraw char at old position (removes cursor) */ - UpdateRect.left = OldCursorX; - UpdateRect.top = OldCursorY; - UpdateRect.right = OldCursorX; - UpdateRect.bottom = OldCursorY; - ConioDrawRegion(Console, &UpdateRect); + GuiInvalidateCell(Console, OldCursorX, OldCursorY); /* Redraw char at new position (shows cursor) */ - UpdateRect.left = Buff->CurrentX; - UpdateRect.top = Buff->CurrentY; - UpdateRect.right = UpdateRect.left; - UpdateRect.bottom = UpdateRect.top; - ConioDrawRegion(Console, &UpdateRect); + GuiInvalidateCell(Console, Buff->CurrentX, Buff->CurrentY); } return TRUE; @@ -1229,18 +1171,13 @@ PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; PCSRSS_SCREEN_BUFFER Buff; - RECT CursorRect; SetTimer(hWnd, CONGUI_UPDATE_TIMER, CURSOR_BLINK_TIME, NULL); GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); Buff = Console->ActiveBuffer; - CursorRect.left = Buff->CurrentX; - CursorRect.top = Buff->CurrentY; - CursorRect.right = CursorRect.left; - CursorRect.bottom = CursorRect.top; - GuiDrawRegion(Console, &CursorRect); + GuiInvalidateCell(Console, Buff->CurrentX, Buff->CurrentY); GuiData->CursorBlinkOn = ! GuiData->CursorBlinkOn; if((GuiData->OldCursor.x != Buff->CurrentX) || (GuiData->OldCursor.y != Buff->CurrentY)) @@ -1362,32 +1299,39 @@ HeapFree(Win32CsrApiHeap, 0, GuiData); } +static COORD +PointToCoord(PCSRSS_CONSOLE Console, LPARAM lParam) +{ + PCSRSS_SCREEN_BUFFER Buffer = Console->ActiveBuffer; + PGUI_CONSOLE_DATA GuiData = Console->PrivateData; + COORD Coord; + Coord.X = Buffer->ShowX + ((short)LOWORD(lParam) / (int)GuiData->CharWidth); + Coord.Y = Buffer->ShowY + ((short)HIWORD(lParam) / (int)GuiData->CharHeight); + + /* Clip coordinate to ensure it's inside buffer */ + if (Coord.X < 0) Coord.X = 0; + else if (Coord.X >= Buffer->MaxX) Coord.X = Buffer->MaxX - 1; + if (Coord.Y < 0) Coord.Y = 0; + else if (Coord.Y >= Buffer->MaxY) Coord.Y = Buffer->MaxY - 1; + return Coord; +} + static VOID FASTCALL GuiConsoleLeftMouseDown(HWND hWnd, LPARAM lParam) { PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; - POINTS pt; - RECT rc; GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); if (Console == NULL || GuiData == NULL) return; - pt = MAKEPOINTS(lParam); - - rc.left = pt.x / GuiData->CharWidth; - rc.top = pt.y / GuiData->CharHeight; - rc.right = rc.left + 1; - rc.bottom = rc.top + 1; - - GuiData->SelectionStart.x = rc.left; - GuiData->SelectionStart.y = rc.top; + Console->Selection.dwSelectionAnchor = PointToCoord(Console, lParam); SetCapture(hWnd); - GuiData->MouseDown = TRUE; - - GuiConsoleUpdateSelection(hWnd, &rc, GuiData); + Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS | CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; + + GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); } static VOID FASTCALL @@ -1395,39 +1339,17 @@ { PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; - RECT rc; - POINTS pt; + COORD c; GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); if (Console == NULL || GuiData == NULL) return; - if (GuiData->Selection.left == -1 || !GuiData->MouseDown) return; - - pt = MAKEPOINTS(lParam); - - rc.left = GuiData->SelectionStart.x; - rc.top = GuiData->SelectionStart.y; - rc.right = (pt.x >= 0 ? (pt.x / GuiData->CharWidth) + 1 : 0); - rc.bottom = (pt.y >= 0 ? (pt.y / GuiData->CharHeight) + 1 : 0); - - /* exchange left/top with right/bottom if required */ - if(rc.left >= rc.right) - { - LONG tmp; - tmp = rc.left; - rc.left = max(rc.right - 1, 0); - rc.right = tmp + 1; - } - if(rc.top >= rc.bottom) - { - LONG tmp; - tmp = rc.top; - rc.top = max(rc.bottom - 1, 0); - rc.bottom = tmp + 1; - } - - GuiData->MouseDown = FALSE; - - GuiConsoleUpdateSelection(hWnd, &rc, GuiData); + if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) return; + + c = PointToCoord(Console, lParam); + + Console->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN; + + GuiConsoleUpdateSelection(Console, &c); ReleaseCapture(); } @@ -1437,46 +1359,17 @@ { PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; - RECT rc; - POINTS pt; + COORD c; if (!(wParam & MK_LBUTTON)) return; GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); - if (Console == NULL || GuiData == NULL || !GuiData->MouseDown) return; - - pt = MAKEPOINTS(lParam); - - rc.left = GuiData->SelectionStart.x; - rc.top = GuiData->SelectionStart.y; - rc.right = (pt.x >= 0 ? (pt.x / GuiData->CharWidth) + 1 : 0); - if (Console->Size.X < rc.right) - { - rc.right = Console->Size.X; - } - rc.bottom = (pt.y >= 0 ? (pt.y / GuiData->CharHeight) + 1 : 0); - if (Console->Size.Y < rc.bottom) - { - rc.bottom = Console->Size.Y; - } - - /* exchange left/top with right/bottom if required */ - if(rc.left >= rc.right) - { - LONG tmp; - tmp = rc.left; - rc.left = max(rc.right - 1, 0); - rc.right = tmp + 1; - } - if(rc.top >= rc.bottom) - { - LONG tmp; - tmp = rc.top; - rc.top = max(rc.bottom - 1, 0); - rc.bottom = tmp + 1; - } - - GuiConsoleUpdateSelection(hWnd, &rc, GuiData); + if (Console == NULL || GuiData == NULL) return; + if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) return; + + c = PointToCoord(Console, lParam); /* TODO: Scroll buffer to bring c into view */ + + GuiConsoleUpdateSelection(Console, &c); } static VOID FASTCALL @@ -1488,7 +1381,7 @@ GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); if (Console == NULL || GuiData == NULL) return; - if (GuiData->Selection.left == -1) + if (!(Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)) { /* FIXME - paste text from clipboard */ } @@ -1496,7 +1389,7 @@ { /* FIXME - copy selection to clipboard */ - GuiConsoleUpdateSelection(hWnd, NULL, GuiData); + GuiConsoleUpdateSelection(Console, NULL); } }
14 years, 8 months
1
0
0
0
[ekohl] 47334: [REGEDIT] Ignore the case when sorting value names.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 23 22:41:03 2010 New Revision: 47334 URL:
http://svn.reactos.org/svn/reactos?rev=47334&view=rev
Log: [REGEDIT] Ignore the case when sorting value names. Modified: trunk/reactos/base/applications/regedit/listview.c Modified: trunk/reactos/base/applications/regedit/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/listview.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/listview.c [iso-8859-1] Sun May 23 22:41:03 2010 @@ -380,7 +380,7 @@ if (g_columnToSort == 2) { /* FIXME: Sort on value */ } - return g_invertSort ? _tcscmp(r->name, l->name) : _tcscmp(l->name, r->name); + return g_invertSort ? _tcsicmp(r->name, l->name) : _tcsicmp(l->name, r->name); } BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
14 years, 8 months
1
0
0
0
[ekohl] 47333: [SMSS] - Remove the system environment variable OS from the hivesys*.inf files. - Change the type of the system environment variable PATHEXT in the hivesys*.inf files from REG_EXPAND_SZ to REG_SZ. - Let SMSS add the system environment variables OS and NUMBER_OF_PROCESSORS to the registry.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 23 21:27:04 2010 New Revision: 47333 URL:
http://svn.reactos.org/svn/reactos?rev=47333&view=rev
Log: [SMSS] - Remove the system environment variable OS from the hivesys*.inf files. - Change the type of the system environment variable PATHEXT in the hivesys*.inf files from REG_EXPAND_SZ to REG_SZ. - Let SMSS add the system environment variables OS and NUMBER_OF_PROCESSORS to the registry. Modified: trunk/reactos/base/system/smss/initenv.c trunk/reactos/boot/bootdata/hivesys_arm.inf trunk/reactos/boot/bootdata/hivesys_i386.inf Modified: trunk/reactos/base/system/smss/initenv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/initenv.c…
============================================================================== --- trunk/reactos/base/system/smss/initenv.c [iso-8859-1] (original) +++ trunk/reactos/base/system/smss/initenv.c [iso-8859-1] Sun May 23 21:27:04 2010 @@ -65,33 +65,116 @@ NTSTATUS SmSetEnvironmentVariables(VOID) { - PWSTR ProcessorArchitecture = L""; + SYSTEM_BASIC_INFORMATION BasicInformation; + RTL_QUERY_REGISTRY_TABLE QueryTable[3]; UNICODE_STRING Identifier; UNICODE_STRING VendorIdentifier; - UNICODE_STRING ProcessorIdentifier; WCHAR Buffer[256]; + + UNICODE_STRING EnvironmentKeyName; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE EnvironmentKey; + UNICODE_STRING VariableName; + PWSTR VariableData; + NTSTATUS Status; + + Status = NtQuerySystemInformation(SystemBasicInformation, + &BasicInformation, + sizeof(SYSTEM_BASIC_INFORMATION), + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SM: Failed to retrieve system basic information (Status %08lx)", Status); + return Status; + } + + RtlInitUnicodeString(&EnvironmentKeyName, + L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager\\Environment"); + InitializeObjectAttributes(&ObjectAttributes, + &EnvironmentKeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + /* Open the system environment key */ + Status = NtOpenKey(&EnvironmentKey, + GENERIC_WRITE, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SM: Failed to open the environment key (Status %08lx)", Status); + return Status; + } + + /* Set the 'NUMBER_OF_PROCESSORS' system environment variable */ + RtlInitUnicodeString(&VariableName, + L"NUMBER_OF_PROCESSORS"); + + swprintf(Buffer, L"%lu", BasicInformation.NumberOfProcessors); + + Status = NtSetValueKey(EnvironmentKey, + &VariableName, + 0, + REG_SZ, + Buffer, + (wcslen(Buffer) + 1) * sizeof(WCHAR)); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SM: Failed to set the NUMBER_OF_PROCESSORS environment variable (Status %08lx)", Status); + goto done; + } + + /* Set the 'OS' system environment variable */ + RtlInitUnicodeString(&VariableName, + L"OS"); + + VariableData = L"ReactOS"; + + Status = NtSetValueKey(EnvironmentKey, + &VariableName, + 0, + REG_SZ, + VariableData, + (wcslen(VariableData) + 1) * sizeof(WCHAR)); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SM: Failed to set the OS environment variable (Status %08lx)", Status); + goto done; + } + /* Set the 'PROCESSOR_ARCHITECTURE' system environment variable */ + RtlInitUnicodeString(&VariableName, + L"PROCESSOR_ARCHITECTURE"); + #ifdef _M_IX86 - ProcessorArchitecture = L"x86"; + VariableData = L"x86"; #elif _M_MD64 - ProcessorArchitecture = L"AMD64"; + VariableData = L"AMD64"; #elif _M_ARM - ProcessorArchitecture = L"ARM"; + VariableData = L"ARM"; #elif _M_PPC - ProcessorArchitecture = L"PPC"; + VariableData = L"PPC"; #else #error "Unsupported Architecture!\n" #endif - RtlWriteRegistryValue(RTL_REGISTRY_CONTROL, - L"Session Manager\\Environment", - L"PROCESSOR_ARCHITECTURE", - REG_SZ, - ProcessorArchitecture, - (wcslen(ProcessorArchitecture) + 1) * sizeof(WCHAR)); + Status = NtSetValueKey(EnvironmentKey, + &VariableName, + 0, + REG_SZ, + VariableData, + (wcslen(VariableData) + 1) * sizeof(WCHAR)); + if (!NT_SUCCESS(Status)) + { + DPRINT1("SM: Failed to set the PROCESSOR_ARCHITECTURE environment variable (Status %08lx)", Status); + goto done; + } + +done: + NtClose(EnvironmentKey); /* Set the 'PROCESSOR_IDENTIFIER' system environment variable */ @@ -119,18 +202,14 @@ DPRINT("SM: szIdentifier: %wZ\n", &Identifier); DPRINT("SM: szVendorIdentifier: %wZ\n", &VendorIdentifier); - RtlInitEmptyUnicodeString(&ProcessorIdentifier, Buffer, 256 * sizeof(WCHAR)); - - RtlAppendUnicodeStringToString(&ProcessorIdentifier, &Identifier); - RtlAppendUnicodeToString(&ProcessorIdentifier, L", "); - RtlAppendUnicodeStringToString(&ProcessorIdentifier, &VendorIdentifier); + swprintf(Buffer, L"%wZ, %wZ", &Identifier, &VendorIdentifier); RtlWriteRegistryValue(RTL_REGISTRY_CONTROL, L"Session Manager\\Environment", L"PROCESSOR_IDENTIFIER", REG_SZ, - ProcessorIdentifier.Buffer, - (wcslen(ProcessorIdentifier.Buffer) + 1) * sizeof(WCHAR)); + Buffer, + (wcslen(Buffer) + 1) * sizeof(WCHAR)); } RtlFreeUnicodeString(&Identifier); Modified: trunk/reactos/boot/bootdata/hivesys_arm.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_arm.…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] Sun May 23 21:27:04 2010 @@ -754,12 +754,11 @@ ; System environment settings HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","ComSpec",0x00020000,"%SystemRoot%\system32\cmd.exe" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","OS",0x00020000,"ReactOS" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","Path",0x00020000,"%SystemRoot%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","windir",0x00020000,"%SystemRoot%" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TEMP",0x00020000,"%SystemDrive%\TEMP" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TMP",0x00020000,"%SystemDrive%\TEMP" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00020000,".COM;.EXE;.BAT;.CMD" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00000000,".COM;.EXE;.BAT;.CMD" ; Known DLLs Modified: trunk/reactos/boot/bootdata/hivesys_i386.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_i386…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] Sun May 23 21:27:04 2010 @@ -901,12 +901,11 @@ ; System environment settings HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","ComSpec",0x00020000,"%SystemRoot%\system32\cmd.exe" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","OS",0x00020000,"ReactOS" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","Path",0x00020000,"%SystemRoot%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","windir",0x00020000,"%SystemRoot%" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TEMP",0x00020000,"%SystemDrive%\TEMP" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TMP",0x00020000,"%SystemDrive%\TEMP" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00020000,".COM;.EXE;.BAT;.CMD" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00000000,".COM;.EXE;.BAT;.CMD" ; Known DLLs
14 years, 8 months
1
0
0
0
[fireball] 47332: - Implement some base support for window-based cursor icons support. Still work in progress. RosDrv_CreateCursorIcon is unused and will be removed soon, instead creation happens lazily and is implemented in create_cursor(). All possible unimplemented places are marked with TODO or FIXME.
by fireball@svn.reactos.org
Author: fireball Date: Sun May 23 20:36:11 2010 New Revision: 47332 URL:
http://svn.reactos.org/svn/reactos?rev=47332&view=rev
Log: - Implement some base support for window-based cursor icons support. Still work in progress. RosDrv_CreateCursorIcon is unused and will be removed soon, instead creation happens lazily and is implemented in create_cursor(). All possible unimplemented places are marked with TODO or FIXME. Modified: branches/arwinss/reactos/dll/win32/winent.drv/mouse.c branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c Modified: branches/arwinss/reactos/dll/win32/winent.drv/mouse.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/mouse.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/mouse.c [iso-8859-1] Sun May 23 20:36:11 2010 @@ -73,6 +73,8 @@ static BYTE TrackSysKey = 0; /* determine whether ALT key up will cause a WM_SYSKEYUP or a WM_KEYUP message */ +VOID create_cursor( HANDLE handle ); + /*********************************************************************** * set_window_cursor */ @@ -81,12 +83,20 @@ struct ntdrv_win_data *data; if (!(data = NTDRV_get_win_data( hwnd ))) return; + + if (!handle) + { + // FIXME: Special case for removing the cursor + FIXME("TODO: Cursor should be removed!\n"); + data->cursor = handle; + return; + } /* Try to set the cursor */ if (!SwmDefineCursor(hwnd, handle)) { /* This cursor doesn't exist yet, create it */ - DPRINT1("Cursor %p needs to be created!\n", handle); + create_cursor(handle); //SwmDefineCursor(hwnd, handle); } @@ -497,6 +507,61 @@ } /*********************************************************************** + * create_cursor + * + * Create a client cursor from a Windows one. + */ +VOID create_cursor( HANDLE handle ) +{ + HDC hdc; + ICONINFO info; + BITMAP bm; + + //if (!handle) return get_empty_cursor(); + + if (!(hdc = CreateCompatibleDC( 0 ))) return; + if (!GetIconInfo( handle, &info )) + { + DeleteDC( hdc ); + return; + } + + GetObjectW( info.hbmMask, sizeof(bm), &bm ); + if (!info.hbmColor) bm.bmHeight /= 2; + + /* make sure hotspot is valid */ + if (info.xHotspot >= bm.bmWidth || info.yHotspot >= bm.bmHeight) + { + info.xHotspot = bm.bmWidth / 2; + info.yHotspot = bm.bmHeight / 2; + } + + if (info.hbmColor) + { + //cursor = create_xlib_cursor( hdc, &info, bm.bmWidth, bm.bmHeight ); + FIXME("color\n"); + //DeleteObject( info.hbmColor ); + } + else + { + FIXME("bitmaps\n"); + //XColor fg, bg; + //fg.red = fg.green = fg.blue = 0xffff; + //bg.red = bg.green = bg.blue = 0; + //cursor = create_cursor_from_bitmaps( info.hbmMask, info.hbmMask, bm.bmWidth, bm.bmHeight, + // bm.bmHeight, 0, &fg, &bg, info.xHotspot, info.yHotspot ); + + FIXME("bmBits %p\n", bm.bmBits); + //RosGdiCreateBitmap(NULL, info.hbmMask, &bm, bm.bmBits); + + RosUserSetCursor(&info); + } + + //DeleteObject( info.hbmMask ); + DeleteDC( hdc ); +} + +/*********************************************************************** * CreateCursorIcon (NTDRV.@) */ // TODO: Delete this function @@ -535,7 +600,7 @@ */ void CDECL RosDrv_DestroyCursorIcon( HCURSOR handle ) { - ICONINFO IconInfo; + ICONINFO IconInfo = {0}; FIXME( "%p xid %lx\n", handle, /*cursor*/ 0 ); @@ -550,10 +615,10 @@ void CDECL RosDrv_SetCursor( HCURSOR handle ) { + // FIXME: Remove! + RosUserSetCursor(NULL); + if (cursor_window) SendNotifyMessageW( cursor_window, WM_NTDRV_SET_CURSOR, 0, (LPARAM)handle ); FIXME("handle %x, cursor_window %x\n", handle, cursor_window); - - // FIXME: Remove! - RosUserSetCursor(NULL); -} - +} + Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/cursor.h [iso-8859-1] Sun May 23 20:36:11 2010 @@ -34,3 +34,5 @@ VOID NTAPI USER_InitCursorIcons(); VOID USER_LockCursorIcons(); VOID USER_UnlockCursorIcons(); +PCURSORICONENTRY NTAPI USER_GetCursorIcon(HCURSOR Handle); + Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/swm.h [iso-8859-1] Sun May 23 20:36:11 2010 @@ -7,6 +7,7 @@ rectangle_t Window; struct region *Visible; BOOLEAN Hidden; + PCURSORICONENTRY Cursor; LIST_ENTRY Entry; } SWM_WINDOW, *PSWM_WINDOW; Modified: branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/main/cursor.c [iso-8859-1] Sun May 23 20:36:11 2010 @@ -201,6 +201,9 @@ IconInfoUnsafe->hbmColor = pCursorIcon->hbmColor; IconInfoUnsafe->hbmMask = pCursorIcon->hbmMask; + // TODO: Go through all windows and remove this cursor from them! + DPRINT1("Hitting a TODO!\n"); + /* Free memory */ ExFreePool(pCursorIcon); break; @@ -212,6 +215,29 @@ /* Release lock */ USER_UnlockCursorIcons(); +} + +PCURSORICONENTRY +NTAPI +USER_GetCursorIcon(HCURSOR Handle) +{ + PLIST_ENTRY Current; + PCURSORICONENTRY pCursorIcon; + + /* Traverse the list to find our mapping */ + Current = CursorIcons.Flink; + while(Current != &CursorIcons) + { + pCursorIcon = CONTAINING_RECORD(Current, CURSORICONENTRY, Entry); + + /* Check if it's our entry */ + if (pCursorIcon->hUser == Handle) return pCursorIcon; + + /* Advance to the next pair */ + Current = Current->Flink; + } + + return NULL; } VOID NTAPI Modified: branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/swm/winman.c [iso-8859-1] Sun May 23 20:36:11 2010 @@ -804,9 +804,42 @@ NTAPI SwmDefineCursor(HWND hWnd, HCURSOR hCursor) { - /* TODO: Try to find this cursor */ - UNIMPLEMENTED; - return FALSE; + PCURSORICONENTRY pCursorIcon; + PSWM_WINDOW pSwmWindow; + + /* Acquire CI lock */ + USER_LockCursorIcons(); + + /* Try to find this cursor */ + pCursorIcon = USER_GetCursorIcon(hCursor); + + /* Release CI lock */ + USER_UnlockCursorIcons(); + + if (!pCursorIcon) return FALSE; + + /* Acquire the SWM lock */ + SwmAcquire(); + + /* Now find the window */ + pSwmWindow = SwmFindByHwnd(hWnd); + + /* Success is returned in this case */ + if (!pSwmWindow) + { + /* Release the SWM lock */ + SwmRelease(); + + return TRUE; + } + + /* Set a cursor for this window */ + pSwmWindow->Cursor = pCursorIcon; + + /* Release the SWM lock */ + SwmRelease(); + + return TRUE; } VOID
14 years, 8 months
1
0
0
0
[jmorlan] 47331: [KERNEL32], [WIN32CSR] More fixes for console winetest - BasepInitConsole: Initialize console input EXE name - GetConsoleProcessList: Use capture buffer; only copy IDs if buffer has enough room for all of them; return total number of processes.
by jmorlan@svn.reactos.org
Author: jmorlan Date: Sun May 23 19:40:54 2010 New Revision: 47331 URL:
http://svn.reactos.org/svn/reactos?rev=47331&view=rev
Log: [KERNEL32], [WIN32CSR] More fixes for console winetest - BasepInitConsole: Initialize console input EXE name - GetConsoleProcessList: Use capture buffer; only copy IDs if buffer has enough room for all of them; return total number of processes. Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h trunk/reactos/dll/win32/kernel32/misc/console.c trunk/reactos/dll/win32/kernel32/misc/dllmain.c trunk/reactos/include/reactos/subsys/csrss/csrss.h trunk/reactos/subsystems/win32/csrss/win32csr/conio.c Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sun May 23 19:40:54 2010 @@ -84,6 +84,8 @@ DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwShareMode); + +BOOL WINAPI SetConsoleInputExeNameW(LPCWSTR lpInputExeName); PTEB GetTeb(VOID); Modified: trunk/reactos/dll/win32/kernel32/misc/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/co…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] Sun May 23 19:40:54 2010 @@ -3753,7 +3753,8 @@ GetConsoleProcessList(LPDWORD lpdwProcessList, DWORD dwProcessCount) { - PCSR_API_MESSAGE Request; + PCSR_CAPTURE_BUFFER CaptureBuffer; + CSR_API_MESSAGE Request; ULONG CsrRequest; ULONG nProcesses; NTSTATUS Status; @@ -3764,43 +3765,38 @@ return 0; } - Request = RtlAllocateHeap(RtlGetProcessHeap(), - 0, - max(sizeof(CSR_API_MESSAGE), - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_GET_PROCESS_LIST) - + min (dwProcessCount, CSRSS_MAX_GET_PROCESS_LIST / sizeof(DWORD)) * sizeof(DWORD))); - if (Request == NULL) + CaptureBuffer = CsrAllocateCaptureBuffer(1, dwProcessCount * sizeof(DWORD)); + if (CaptureBuffer == NULL) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } CsrRequest = MAKE_CSR_API(GET_PROCESS_LIST, CSR_CONSOLE); - Request->Data.GetProcessListRequest.nMaxIds = min (dwProcessCount, CSRSS_MAX_GET_PROCESS_LIST / sizeof(DWORD)); - - Status = CsrClientCallServer(Request, - NULL, + Request.Data.GetProcessListRequest.nMaxIds = dwProcessCount; + CsrAllocateMessagePointer(CaptureBuffer, + dwProcessCount * sizeof(DWORD), + (PVOID*)&Request.Data.GetProcessListRequest.ProcessId); + + Status = CsrClientCallServer(&Request, + CaptureBuffer, CsrRequest, - max(sizeof(CSR_API_MESSAGE), - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_GET_PROCESS_LIST) - + Request->Data.GetProcessListRequest.nMaxIds * sizeof(DWORD))); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request->Status)) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, Request); + sizeof(CSR_API_MESSAGE)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + { SetLastErrorByStatus (Status); nProcesses = 0; } else { - nProcesses = Request->Data.GetProcessListRequest.nProcessIdsCopied; + nProcesses = Request.Data.GetProcessListRequest.nProcessIdsTotal; if (dwProcessCount >= nProcesses) { - memcpy(lpdwProcessList, Request->Data.GetProcessListRequest.ProcessId, nProcesses * sizeof(DWORD)); + memcpy(lpdwProcessList, Request.Data.GetProcessListRequest.ProcessId, nProcesses * sizeof(DWORD)); } } - RtlFreeHeap(RtlGetProcessHeap(), 0, Request); - + CsrFreeCaptureBuffer(CaptureBuffer); return nProcesses; } Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dl…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] Sun May 23 19:40:54 2010 @@ -130,6 +130,7 @@ NTSTATUS Status; BOOLEAN NotConsole = FALSE; PRTL_USER_PROCESS_PARAMETERS Parameters = NtCurrentPeb()->ProcessParameters; + LPCWSTR ExeName; WCHAR lpTest[MAX_PATH]; GetModuleFileNameW(NULL, lpTest, MAX_PATH); @@ -183,13 +184,17 @@ } } - /* Initialize Console Ctrl Handler */ + /* Initialize Console Ctrl Handler and input EXE name */ ConsoleInitialized = TRUE; RtlInitializeCriticalSection(&ConsoleLock); NrAllocatedHandlers = 1; NrCtrlHandlers = 1; CtrlHandlers = InitialHandler; CtrlHandlers[0] = DefaultConsoleCtrlHandler; + + ExeName = wcsrchr(Parameters->ImagePathName.Buffer, L'\\'); + if (ExeName) + SetConsoleInputExeNameW(ExeName + 1); /* Now use the proper console handle */ Request.Data.AllocConsoleRequest.Console = Parameters->ConsoleHandle; Modified: trunk/reactos/include/reactos/subsys/csrss/csrss.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
============================================================================== --- trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] Sun May 23 19:40:54 2010 @@ -51,10 +51,9 @@ typedef struct { - ULONG nMaxIds; - ULONG nProcessIdsCopied; - ULONG nProcessIdsTotal; - HANDLE ProcessId[0]; + USHORT nMaxIds; + PDWORD ProcessId; + ULONG nProcessIdsTotal; } CSRSS_GET_PROCESS_LIST, *PCSRSS_GET_PROCESS_LIST; typedef struct Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] Sun May 23 19:40:54 2010 @@ -2960,54 +2960,48 @@ CSR_API(CsrGetProcessList) { - PHANDLE Buffer; + PDWORD Buffer; PCSRSS_CONSOLE Console; PCSRSS_PROCESS_DATA current; PLIST_ENTRY current_entry; - ULONG nItems, nCopied, Length; - NTSTATUS Status; + ULONG nItems = 0; + NTSTATUS Status; + ULONG_PTR Offset; DPRINT("CsrGetProcessList\n"); + Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); + Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); + Buffer = Request->Data.GetProcessListRequest.ProcessId; - Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); - Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); - - nItems = nCopied = 0; - Request->Data.GetProcessListRequest.nProcessIdsCopied = 0; - Request->Data.GetProcessListRequest.nProcessIdsTotal = 0; + Offset = (PBYTE)Buffer - (PBYTE)ProcessData->CsrSectionViewBase; + if (Offset >= ProcessData->CsrSectionViewSize + || (Request->Data.GetProcessListRequest.nMaxIds * sizeof(DWORD)) > (ProcessData->CsrSectionViewSize - Offset) + || Offset & (sizeof(DWORD) - 1)) + { + return STATUS_ACCESS_VIOLATION; + } Status = ConioConsoleFromProcessData(ProcessData, &Console); if (! NT_SUCCESS(Status)) { return Status; } - - DPRINT1("Console_Api Ctrl-C\n"); for(current_entry = Console->ProcessList.Flink; current_entry != &Console->ProcessList; current_entry = current_entry->Flink) { current = CONTAINING_RECORD(current_entry, CSRSS_PROCESS_DATA, ProcessEntry); - if(++nItems < Request->Data.GetProcessListRequest.nMaxIds) - { - *(Buffer++) = current->ProcessId; - nCopied++; + if(++nItems <= Request->Data.GetProcessListRequest.nMaxIds) + { + *Buffer++ = (DWORD)current->ProcessId; } } ConioUnlockConsole(Console); - Request->Data.GetProcessListRequest.nProcessIdsCopied = nCopied; Request->Data.GetProcessListRequest.nProcessIdsTotal = nItems; - - Length = CSR_API_MESSAGE_HEADER_SIZE(CSRSS_GET_PROCESS_LIST) + nCopied * sizeof(HANDLE); - if (Length > sizeof(CSR_API_MESSAGE)) - { - Request->Header.u1.s1.TotalLength = Length; - Request->Header.u1.s1.DataLength = Length - sizeof(PORT_MESSAGE); - } return STATUS_SUCCESS; }
14 years, 8 months
1
0
0
0
[ekohl] 47330: [SMSS] - Remove the system environment variable PROCESSOR_ARCHITECTURE from the hivesys*.inf files. - Let SMSS add the system environment variables PROCESSOR_ARCHITECTURE and PROCESSOR_IDENTIFIER to the registry.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 23 19:28:06 2010 New Revision: 47330 URL:
http://svn.reactos.org/svn/reactos?rev=47330&view=rev
Log: [SMSS] - Remove the system environment variable PROCESSOR_ARCHITECTURE from the hivesys*.inf files. - Let SMSS add the system environment variables PROCESSOR_ARCHITECTURE and PROCESSOR_IDENTIFIER to the registry. Modified: trunk/reactos/base/system/smss/initenv.c trunk/reactos/boot/bootdata/hivesys_arm.inf trunk/reactos/boot/bootdata/hivesys_i386.inf Modified: trunk/reactos/base/system/smss/initenv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/initenv.c…
============================================================================== --- trunk/reactos/base/system/smss/initenv.c [iso-8859-1] (original) +++ trunk/reactos/base/system/smss/initenv.c [iso-8859-1] Sun May 23 19:28:06 2010 @@ -29,7 +29,7 @@ static NTSTATUS SmpSetEnvironmentVariable(IN PVOID Context, IN PWSTR ValueName, - IN PVOID ValueData) + IN PWSTR ValueData) { UNICODE_STRING EnvVariable; UNICODE_STRING EnvValue; @@ -37,7 +37,7 @@ RtlInitUnicodeString(&EnvVariable, ValueName); RtlInitUnicodeString(&EnvValue, - (PWSTR)ValueData); + ValueData); return RtlSetEnvironmentVariable(Context, &EnvVariable, &EnvValue); @@ -58,12 +58,93 @@ return STATUS_SUCCESS; DPRINT("ValueData '%S'\n", (PWSTR)ValueData); - return SmpSetEnvironmentVariable(Context,ValueName,ValueData); + return SmpSetEnvironmentVariable(Context,ValueName,(PWSTR)ValueData); } NTSTATUS SmSetEnvironmentVariables(VOID) +{ + PWSTR ProcessorArchitecture = L""; + RTL_QUERY_REGISTRY_TABLE QueryTable[3]; + UNICODE_STRING Identifier; + UNICODE_STRING VendorIdentifier; + UNICODE_STRING ProcessorIdentifier; + WCHAR Buffer[256]; + NTSTATUS Status; + + /* Set the 'PROCESSOR_ARCHITECTURE' system environment variable */ +#ifdef _M_IX86 + ProcessorArchitecture = L"x86"; +#elif _M_MD64 + ProcessorArchitecture = L"AMD64"; +#elif _M_ARM + ProcessorArchitecture = L"ARM"; +#elif _M_PPC + ProcessorArchitecture = L"PPC"; +#else + #error "Unsupported Architecture!\n" +#endif + + RtlWriteRegistryValue(RTL_REGISTRY_CONTROL, + L"Session Manager\\Environment", + L"PROCESSOR_ARCHITECTURE", + REG_SZ, + ProcessorArchitecture, + (wcslen(ProcessorArchitecture) + 1) * sizeof(WCHAR)); + + + /* Set the 'PROCESSOR_IDENTIFIER' system environment variable */ + RtlInitUnicodeString(&Identifier, NULL); + RtlInitUnicodeString(&VendorIdentifier, NULL); + + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); + + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[0].Name = L"Identifier"; + QueryTable[0].EntryContext = &Identifier; + + QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[1].Name = L"VendorIdentifier"; + QueryTable[1].EntryContext = &VendorIdentifier; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, + L"\\Registry\\Machine\\Hardware\\Description\\System\\CentralProcessor\\0", + QueryTable, + NULL, + NULL); + if (NT_SUCCESS(Status)) + { + DPRINT("SM: szIdentifier: %wZ\n", &Identifier); + DPRINT("SM: szVendorIdentifier: %wZ\n", &VendorIdentifier); + + RtlInitEmptyUnicodeString(&ProcessorIdentifier, Buffer, 256 * sizeof(WCHAR)); + + RtlAppendUnicodeStringToString(&ProcessorIdentifier, &Identifier); + RtlAppendUnicodeToString(&ProcessorIdentifier, L", "); + RtlAppendUnicodeStringToString(&ProcessorIdentifier, &VendorIdentifier); + + RtlWriteRegistryValue(RTL_REGISTRY_CONTROL, + L"Session Manager\\Environment", + L"PROCESSOR_IDENTIFIER", + REG_SZ, + ProcessorIdentifier.Buffer, + (wcslen(ProcessorIdentifier.Buffer) + 1) * sizeof(WCHAR)); + } + + RtlFreeUnicodeString(&Identifier); + RtlFreeUnicodeString(&VendorIdentifier); + + return STATUS_SUCCESS; +} + + +/********************************************************************** + * Set environment variables from registry + */ +NTSTATUS +SmUpdateEnvironment(VOID) { RTL_QUERY_REGISTRY_TABLE QueryTable[2]; WCHAR ValueBuffer[MAX_PATH]; @@ -106,14 +187,4 @@ return Status; } -/********************************************************************** - * Set environment variables from registry - */ -NTSTATUS -SmUpdateEnvironment(VOID) -{ - /* TODO */ - return STATUS_SUCCESS; -} - /* EOF */ Modified: trunk/reactos/boot/bootdata/hivesys_arm.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_arm.…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] Sun May 23 19:28:06 2010 @@ -760,7 +760,6 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TEMP",0x00020000,"%SystemDrive%\TEMP" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TMP",0x00020000,"%SystemDrive%\TEMP" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00020000,".COM;.EXE;.BAT;.CMD" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PROCESSOR_ARCHITECTURE",0x00020000,"x86" ; Known DLLs Modified: trunk/reactos/boot/bootdata/hivesys_i386.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_i386…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] Sun May 23 19:28:06 2010 @@ -907,7 +907,6 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TEMP",0x00020000,"%SystemDrive%\TEMP" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","TMP",0x00020000,"%SystemDrive%\TEMP" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00020000,".COM;.EXE;.BAT;.CMD" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PROCESSOR_ARCHITECTURE",0x00020000,"x86" ; Known DLLs
14 years, 8 months
1
0
0
0
[ilardig] 47329: [INTL] - Polish translation of Metric and Imperial by Olaf Siejka.
by ilardig@svn.reactos.org
Author: ilardig Date: Sun May 23 19:07:56 2010 New Revision: 47329 URL:
http://svn.reactos.org/svn/reactos?rev=47329&view=rev
Log: [INTL] - Polish translation of Metric and Imperial by Olaf Siejka. Modified: trunk/reactos/dll/cpl/intl/lang/pl-PL.rc Modified: trunk/reactos/dll/cpl/intl/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/lang/pl-PL.rc…
============================================================================== --- trunk/reactos/dll/cpl/intl/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/intl/lang/pl-PL.rc [iso-8859-1] Sun May 23 19:07:56 2010 @@ -1,5 +1,5 @@ /* - * translated by Caemyr - Olaf Siejka (Jan, 2008) + * translated by Caemyr - Olaf Siejka (Jan, 2008; May 2010) * Use ReactOS forum PM or IRC to contact me *
http://www.reactos.org
* IRC:
irc.freenode.net
#reactos-pl; @@ -195,8 +195,8 @@ BEGIN IDS_CUSTOMIZE_TITLE "Dostosuj Ustawienia regionalne" IDS_SPAIN "Hiszpañski (Hiszpania)" - IDS_METRIC "Metric" - IDS_IMPERIAL "Imperial" + IDS_METRIC "Metryczne" + IDS_IMPERIAL "Imperialne" END STRINGTABLE
14 years, 8 months
1
0
0
0
[ilardig] 47328: [REGEDIT] - Don't display "finished" message if search is aborted. Patch by Katayama Hirofumi. See issue #5421 for more details.
by ilardig@svn.reactos.org
Author: ilardig Date: Sun May 23 19:01:06 2010 New Revision: 47328 URL:
http://svn.reactos.org/svn/reactos?rev=47328&view=rev
Log: [REGEDIT] - Don't display "finished" message if search is aborted. Patch by Katayama Hirofumi. See issue #5421 for more details. Modified: trunk/reactos/base/applications/regedit/find.c Modified: trunk/reactos/base/applications/regedit/find.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/find.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/find.c [iso-8859-1] Sun May 23 19:01:06 2010 @@ -684,7 +684,7 @@ free(pszFoundValueName); SetFocus(g_pChildWnd->hListWnd); } - return fSuccess; + return fSuccess || s_bAbort; } static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -807,7 +807,7 @@ if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FIND), hWnd, FindDialogProc, 0) != 0) { - if (FindNext(hWnd) == FALSE) + if (!FindNext(hWnd)) { TCHAR msg[128], caption[128];
14 years, 8 months
1
0
0
0
[spetreolle] 47327: Perform case insensitive comparison against the selected language id.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sun May 23 18:26:11 2010 New Revision: 47327 URL:
http://svn.reactos.org/svn/reactos?rev=47327&view=rev
Log: Perform case insensitive comparison against the selected language id. Modified: trunk/reactos/base/setup/usetup/interface/usetup.c Modified: trunk/reactos/base/setup/usetup/interface/usetup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
============================================================================== --- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Sun May 23 18:26:11 2010 @@ -829,7 +829,7 @@ while (ListEntry != NULL) { - if (!wcscmp(LocaleID, GetListEntryUserData(ListEntry))) + if (!wcsicmp(LocaleID, GetListEntryUserData(ListEntry))) { DPRINT("found %S in LanguageList\n",GetListEntryUserData(ListEntry)); SetCurrentListEntry(LanguageList, ListEntry); @@ -843,7 +843,7 @@ while (ListEntry != NULL) { - if (!wcscmp(LocaleID, GetListEntryUserData(ListEntry))) + if (!wcsicmp(LocaleID, GetListEntryUserData(ListEntry))) { DPRINT("found %S in LayoutList\n",GetListEntryUserData(ListEntry)); SetCurrentListEntry(LayoutList, ListEntry);
14 years, 8 months
1
0
0
0
[jmorlan] 47326: [KERNEL32], [WIN32CSR] Implement the CREATE_NO_WINDOW flag which creates a console with an invisible window.
by jmorlan@svn.reactos.org
Author: jmorlan Date: Sun May 23 17:56:37 2010 New Revision: 47326 URL:
http://svn.reactos.org/svn/reactos?rev=47326&view=rev
Log: [KERNEL32], [WIN32CSR] Implement the CREATE_NO_WINDOW flag which creates a console with an invisible window. Modified: trunk/reactos/dll/win32/kernel32/misc/console.c trunk/reactos/dll/win32/kernel32/misc/dllmain.c trunk/reactos/include/reactos/subsys/csrss/csrss.h trunk/reactos/subsystems/win32/csrss/win32csr/conio.c trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h Modified: trunk/reactos/dll/win32/kernel32/misc/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/co…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/console.c [iso-8859-1] Sun May 23 17:56:37 2010 @@ -1692,6 +1692,7 @@ Request.Data.AllocConsoleRequest.CtrlDispatcher = ConsoleControlDispatcher; Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE; + Request.Data.AllocConsoleRequest.Visible = TRUE; CsrRequest = MAKE_CSR_API(ALLOC_CONSOLE, CSR_CONSOLE); Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dl…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] Sun May 23 17:56:37 2010 @@ -150,6 +150,7 @@ { /* Assume one is needed */ Request.Data.AllocConsoleRequest.ConsoleNeeded = TRUE; + Request.Data.AllocConsoleRequest.Visible = TRUE; /* Handle the special flags given to us by BasepInitializeEnvironment */ if (Parameters->ConsoleHandle == HANDLE_DETACHED_PROCESS) @@ -168,8 +169,9 @@ else if (Parameters->ConsoleHandle == HANDLE_CREATE_NO_WINDOW) { /* We'll get the real one soon */ - DPRINT1("NOT SUPPORTED: HANDLE_CREATE_NO_WINDOW\n"); + DPRINT("Creating new invisible console\n"); Parameters->ConsoleHandle = NULL; + Request.Data.AllocConsoleRequest.Visible = FALSE; } else { Modified: trunk/reactos/include/reactos/subsys/csrss/csrss.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
============================================================================== --- trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] Sun May 23 17:56:37 2010 @@ -80,7 +80,8 @@ typedef struct { PCONTROLDISPATCHER CtrlDispatcher; - BOOL ConsoleNeeded; + BOOLEAN ConsoleNeeded; + BOOLEAN Visible; HANDLE Console; HANDLE InputHandle; HANDLE OutputHandle; Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] Sun May 23 17:56:37 2010 @@ -142,7 +142,7 @@ } static NTSTATUS WINAPI -CsrInitConsole(PCSRSS_CONSOLE Console) +CsrInitConsole(PCSRSS_CONSOLE Console, BOOL Visible) { NTSTATUS Status; SECURITY_ATTRIBUTES SecurityAttributes; @@ -210,7 +210,7 @@ } if (GuiMode) { - Status = GuiInitConsole(Console); + Status = GuiInitConsole(Console, Visible); if (! NT_SUCCESS(Status)) { HeapFree(Win32CsrApiHeap,0, NewBuffer); @@ -286,7 +286,7 @@ /* insert process data required for GUI initialization */ InsertHeadList(&Console->ProcessList, &ProcessData->ProcessEntry); /* Initialize the Console */ - Status = CsrInitConsole(Console); + Status = CsrInitConsole(Console, Request->Data.AllocConsoleRequest.Visible); if (!NT_SUCCESS(Status)) { DPRINT1("Console init failed\n"); Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] Sun May 23 17:56:37 2010 @@ -2070,7 +2070,10 @@ if (NULL != NewWindow) { SetWindowLongW(hWnd, GWL_USERDATA, GetWindowLongW(hWnd, GWL_USERDATA) + 1); - ShowWindow(NewWindow, SW_SHOW); + if (wParam) + { + ShowWindow(NewWindow, SW_SHOW); + } } return (LRESULT) NewWindow; case PM_DESTROY_CONSOLE: @@ -2250,7 +2253,7 @@ }; NTSTATUS FASTCALL -GuiInitConsole(PCSRSS_CONSOLE Console) +GuiInitConsole(PCSRSS_CONSOLE Console, BOOL Visible) { HANDLE GraphicsStartupEvent; HANDLE ThreadHandle; @@ -2317,7 +2320,7 @@ */ GuiData->hGuiInitEvent = CreateEventW(NULL, FALSE, FALSE, NULL); /* create console */ - PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, 0, (LPARAM) Console); + PostMessageW(NotifyWnd, PM_CREATE_CONSOLE, Visible, (LPARAM) Console); /* wait untill initialization has finished */ WaitForSingleObject(GuiData->hGuiInitEvent, INFINITE); Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.h [iso-8859-1] Sun May 23 17:56:37 2010 @@ -13,6 +13,6 @@ #define CONGUI_UPDATE_TIME 0 #define CONGUI_UPDATE_TIMER 1 -NTSTATUS FASTCALL GuiInitConsole(PCSRSS_CONSOLE Console); +NTSTATUS FASTCALL GuiInitConsole(PCSRSS_CONSOLE Console, BOOL Visible); /*EOF*/
14 years, 8 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
44
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
Results per page:
10
25
50
100
200