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
July 2008
----- 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
25 participants
761 discussions
Start a n
N
ew thread
[sginsberg] 34569: - Fix a typo in the DC_ATTR structure: mxDevicetoWorld -> mxDeviceToWorld
by sginsberg@svn.reactos.org
Author: sginsberg Date: Thu Jul 17 16:54:40 2008 New Revision: 34569 URL:
http://svn.reactos.org/svn/reactos?rev=34569&view=rev
Log: - Fix a typo in the DC_ATTR structure: mxDevicetoWorld -> mxDeviceToWorld Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c trunk/reactos/include/reactos/win32k/ntgdihdl.h trunk/reactos/subsystems/win32/win32k/objects/dcutil.c Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/co…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/coord.c [iso-8859-1] Thu Jul 17 16:54:40 2008 @@ -110,7 +110,7 @@ else { for ( i = 0; i < Count; i++ ) - CoordCnvP ( &Dc_Attr->mxDevicetoWorld, &Points[i] ); + CoordCnvP ( &Dc_Attr->mxDeviceToWorld, &Points[i] ); } return TRUE; #endif Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] Thu Jul 17 16:54:40 2008 @@ -291,7 +291,7 @@ LONG cBreak; HANDLE hlfntNew; MATRIX_S mxWorldToDevice; - MATRIX_S mxDevicetoWorld; + MATRIX_S mxDeviceToWorld; MATRIX_S mxWorldToPage; EFLOAT_S efM11PtoD; EFLOAT_S efM22PtoD; Modified: trunk/reactos/subsystems/win32/win32k/objects/dcutil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dcutil.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dcutil.c [iso-8859-1] Thu Jul 17 16:54:40 2008 @@ -114,7 +114,7 @@ { NTSTATUS Status = STATUS_SUCCESS; dc->Dc_Attr.mxWorldToDevice = dc->DcLevel.mxWorldToDevice; - dc->Dc_Attr.mxDevicetoWorld = dc->DcLevel.mxDeviceToWorld; + dc->Dc_Attr.mxDeviceToWorld = dc->DcLevel.mxDeviceToWorld; dc->Dc_Attr.mxWorldToPage = dc->DcLevel.mxWorldToPage; _SEH_TRY
16 years, 5 months
1
0
0
0
[jmorlan] 34568: Clean up console code a bit: - Get/SetConsoleTitle: Get rid of unnecessary handle creation; instead, just have csrss get the console from the ProcessData. - Instead of using ShowX/ShowY to store the origin of the buffer, use the VirtualX member that was put there for this purpose. Rename it to VirtualY, though, since it's a row number. ShowX/ShowY should hold the position of the visible window, once that's implemented. - From the CSRSS_CONSOLE structure: remove hActiveBuffer (re
by jmorlan@svn.reactos.org
Author: jmorlan Date: Thu Jul 17 16:53:39 2008 New Revision: 34568 URL:
http://svn.reactos.org/svn/reactos?rev=34568&view=rev
Log: Clean up console code a bit: - Get/SetConsoleTitle: Get rid of unnecessary handle creation; instead, just have csrss get the console from the ProcessData. - Instead of using ShowX/ShowY to store the origin of the buffer, use the VirtualX member that was put there for this purpose. Rename it to VirtualY, though, since it's a row number. ShowX/ShowY should hold the position of the visible window, once that's implemented. - From the CSRSS_CONSOLE structure: remove hActiveBuffer (redundant), CodePageId (unused), and hWindowIcon (only used as a temporary) - Make cursor coordinates be "logical", not "physical". This simplifies various things. - ConioConsoleFromProcessData: If process has no console, return STATUS_INVALID_HANDLE; don't pretend to succeed (causing many functions to access memory around address 0, which is probably not a good thing). Remove various Console != NULL checks which are now unnecessary. Modified: trunk/reactos/dll/win32/kernel32/misc/console.c trunk/reactos/subsystems/win32/csrss/include/conio.h trunk/reactos/subsystems/win32/csrss/win32csr/conio.c trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.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] Thu Jul 17 16:53:39 2008 @@ -3285,13 +3285,6 @@ { PCSR_API_MESSAGE Request; ULONG CsrRequest; NTSTATUS Status; - HANDLE hConsole; - - hConsole = CreateFileW(L"CONIN$", GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hConsole == INVALID_HANDLE_VALUE) - { - return 0; - } Request = RtlAllocateHeap(RtlGetProcessHeap(), 0, CSR_API_MESSAGE_HEADER_SIZE(CSRSS_GET_TITLE) + CSRSS_MAX_TITLE_LENGTH * sizeof(WCHAR)); @@ -3302,13 +3295,11 @@ } CsrRequest = MAKE_CSR_API(GET_TITLE, CSR_CONSOLE); - Request->Data.GetTitleRequest.ConsoleHandle = hConsole; Status = CsrClientCallServer(Request, NULL, CsrRequest, CSR_API_MESSAGE_HEADER_SIZE(CSRSS_GET_TITLE) + CSRSS_MAX_TITLE_LENGTH * sizeof(WCHAR)); - CloseHandle(hConsole); if(!NT_SUCCESS(Status) || !(NT_SUCCESS(Status = Request->Status))) { RtlFreeHeap(RtlGetProcessHeap(), 0, Request); @@ -3388,13 +3379,6 @@ PCSR_API_MESSAGE Request; ULONG CsrRequest; NTSTATUS Status; unsigned int c; - HANDLE hConsole; - - hConsole = CreateFileW(L"CONIN$", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hConsole == INVALID_HANDLE_VALUE) - { - return FALSE; - } Request = RtlAllocateHeap(RtlGetProcessHeap(), 0, max (sizeof(CSR_API_MESSAGE), @@ -3407,7 +3391,6 @@ } CsrRequest = MAKE_CSR_API(SET_TITLE, CSR_CONSOLE); - Request->Data.SetTitleRequest.Console = hConsole; for( c = 0; lpConsoleTitle[c] && c < CSRSS_MAX_TITLE_LENGTH; c++ ) Request->Data.SetTitleRequest.Title[c] = lpConsoleTitle[c]; @@ -3416,7 +3399,6 @@ NULL, CsrRequest, max (sizeof(CSR_API_MESSAGE), CSR_API_MESSAGE_HEADER_SIZE(CSRSS_SET_TITLE) + c * sizeof(WCHAR))); - CloseHandle(hConsole); if (!NT_SUCCESS(Status) || !NT_SUCCESS( Status = Request->Status ) ) { RtlFreeHeap(RtlGetProcessHeap(), 0, Request); @@ -3446,13 +3428,6 @@ PCSR_API_MESSAGE Request; ULONG CsrRequest; NTSTATUS Status; unsigned int c; - HANDLE hConsole; - - hConsole = CreateFileW(L"CONIN$", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hConsole == INVALID_HANDLE_VALUE) - { - return FALSE; - } Request = RtlAllocateHeap(RtlGetProcessHeap(), 0, max (sizeof(CSR_API_MESSAGE), @@ -3465,7 +3440,6 @@ } CsrRequest = MAKE_CSR_API(SET_TITLE, CSR_CONSOLE); - Request->Data.SetTitleRequest.Console = hConsole; for( c = 0; lpConsoleTitle[c] && c < CSRSS_MAX_TITLE_LENGTH; c++ ) Request->Data.SetTitleRequest.Title[c] = lpConsoleTitle[c]; @@ -3474,7 +3448,6 @@ NULL, CsrRequest, max (sizeof(CSR_API_MESSAGE), CSR_API_MESSAGE_HEADER_SIZE(CSRSS_SET_TITLE) + c * sizeof(WCHAR))); - CloseHandle(hConsole); if (!NT_SUCCESS(Status) || !NT_SUCCESS( Status = Request->Status ) ) { RtlFreeHeap(RtlGetProcessHeap(), 0, Request); Modified: trunk/reactos/subsystems/win32/csrss/include/conio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/inc…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/include/conio.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/include/conio.h [iso-8859-1] Thu Jul 17 16:53:39 2008 @@ -25,7 +25,7 @@ * do a massive memcpy() to scroll the contents of the buffer up to * * scroll the screen on output, instead I just shift down the position * * to be displayed, and let it wrap around to the top again. * - * The VirtualX member keeps track of the top X coord that win32 * + * The VirtualY member keeps track of the top Y coord that win32 * * clients THINK is currently being displayed, because they think that * * when the display reaches the bottom of the buffer and another line * * being printed causes another line to scroll down, that the buffer IS * @@ -42,7 +42,7 @@ ULONG CurrentX; /* Current X cursor position */ ULONG CurrentY; /* Current Y cursor position */ BYTE DefaultAttrib; /* default char attribute */ - USHORT VirtualX; /* top row of buffer being displayed, reported to callers */ + USHORT VirtualY; /* top row of buffer being displayed, reported to callers */ CONSOLE_CURSOR_INFO CursorInfo; USHORT Mode; } CSRSS_SCREEN_BUFFER, *PCSRSS_SCREEN_BUFFER; @@ -59,7 +59,7 @@ BOOL (STDCALL *UpdateScreenInfo)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER ScreenBuffer); BOOL (STDCALL *ChangeTitle)(PCSRSS_CONSOLE Console); VOID (STDCALL *CleanupConsole)(PCSRSS_CONSOLE Console); - BOOL (STDCALL *ChangeIcon)(PCSRSS_CONSOLE Console); + BOOL (STDCALL *ChangeIcon)(PCSRSS_CONSOLE Console, HICON hWindowIcon); } CSRSS_CONSOLE_VTBL, *PCSRSS_CONSOLE_VTBL; typedef struct tagCSRSS_CONSOLE @@ -71,19 +71,12 @@ WORD WaitingChars; WORD WaitingLines; /* number of chars and lines in input queue */ PCSRSS_SCREEN_BUFFER ActiveBuffer; /* Pointer to currently active screen buffer */ - HANDLE hActiveBuffer; WORD Mode; /* Console mode flags */ WORD EchoCount; /* count of chars to echo, in line buffered mode */ UNICODE_STRING Title; /* Title of console */ - struct /* active code pages */ - { - UINT Input; - UINT Output; - } CodePageId; BOOL EarlyReturn; /* wake client and return data, even if we are in line buffered mode, and we don't have a complete line */ DWORD HardwareState; /* _GDI_MANAGED, _DIRECT */ HWND hWindow; - HICON hWindowIcon; COORD Size; PVOID PrivateData; UINT CodePage; @@ -95,11 +88,7 @@ VOID STDCALL ConioDeleteConsole(Object_t *Object); VOID STDCALL ConioDeleteScreenBuffer(Object_t *Buffer); void STDCALL ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode); -void FASTCALL ConioPhysicalToLogical(PCSRSS_SCREEN_BUFFER Buff, - ULONG PhysicalX, - ULONG PhysicalY, - LONG *LogicalX, - LONG *LogicalY); +DWORD FASTCALL ConioGetBufferOffset(PCSRSS_SCREEN_BUFFER Buf, ULONG X, ULONG Y); VOID FASTCALL ConioDrawConsole(PCSRSS_CONSOLE Console); VOID FASTCALL ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData); VOID FASTCALL ConioConsoleCtrlEventTimeout(DWORD Event, PCSRSS_PROCESS_DATA ProcessData, @@ -171,7 +160,7 @@ Win32CsrLockObject((ProcessData), (Handle), (Object_t **)(Ptr), CONIO_SCREEN_BUFFER_MAGIC) #define ConioUnlockScreenBuffer(Buff) \ Win32CsrUnlockObject((Object_t *) Buff) -#define ConioChangeIcon(Console) (Console)->Vtbl->ChangeIcon(Console) +#define ConioChangeIcon(Console, hWindowIcon) (Console)->Vtbl->ChangeIcon(Console, hWindowIcon) #endif /* CONIO_H_INCLUDED */ 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] Thu Jul 17 16:53:39 2008 @@ -44,7 +44,7 @@ if (!ProcessConsole) { *Console = NULL; - return STATUS_SUCCESS; + return STATUS_INVALID_HANDLE; } EnterCriticalSection(&(ProcessConsole->Header.Lock)); @@ -82,6 +82,12 @@ ConioConsoleCtrlEventTimeout(Event, ProcessData, INFINITE); } +DWORD FASTCALL +ConioGetBufferOffset(PCSRSS_SCREEN_BUFFER Buff, ULONG X, ULONG Y) +{ + return 2 * (((Y + Buff->VirtualY) % Buff->MaxY) * Buff->MaxX + X); +} + #define GET_CELL_BUFFER(b,o)\ (b)->Buffer[(o)++] @@ -92,7 +98,7 @@ static VOID FASTCALL ClearLineBuffer(PCSRSS_SCREEN_BUFFER Buff) { - DWORD Offset = 2 * (Buff->CurrentY * Buff->MaxX); + DWORD Offset = ConioGetBufferOffset(Buff, 0, Buff->CurrentY); UINT Pos; for (Pos = 0; Pos < Buff->MaxX; Pos++) @@ -112,6 +118,7 @@ Buffer->Header.ReferenceCount = 0; Buffer->ShowX = 0; Buffer->ShowY = 0; + Buffer->VirtualY = 0; Buffer->Buffer = HeapAlloc(Win32CsrApiHeap, HEAP_ZERO_MEMORY, Buffer->MaxX * Buffer->MaxY * 2); if (NULL == Buffer->Buffer) { @@ -153,7 +160,6 @@ Console->Mode = ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_MOUSE_INPUT; Console->EarlyReturn = FALSE; Console->ActiveBuffer = NULL; - Console->hActiveBuffer = INVALID_HANDLE_VALUE; InitializeListHead(&Console->InputEvents); Console->CodePage = GetOEMCP(); Console->OutputCodePage = GetOEMCP(); @@ -187,7 +193,6 @@ NewBuffer->CursorInfo.dwSize = 5; /* make console active, and insert into console list */ Console->ActiveBuffer = (PCSRSS_SCREEN_BUFFER) NewBuffer; - Console->hActiveBuffer = INVALID_HANDLE_VALUE; if (! GuiMode) { @@ -335,7 +340,6 @@ ProcessData->Console = 0; return Request->Status = Status; } - Console->hActiveBuffer = Request->Data.AllocConsoleRequest.OutputHandle; } /* Duplicate the Event */ @@ -398,29 +402,23 @@ static VOID FASTCALL ConioNextLine(PCSRSS_SCREEN_BUFFER Buff, RECT *UpdateRect, UINT *ScrolledLines) { + /* If we hit bottom, slide the viewable screen */ if (++Buff->CurrentY == Buff->MaxY) { - Buff->CurrentY = 0; - } - /* If we hit bottom, slide the viewable screen */ - if (Buff->CurrentY == Buff->ShowY) - { - if (++Buff->ShowY == Buff->MaxY) - { - Buff->ShowY = 0; + Buff->CurrentY--; + if (++Buff->VirtualY == Buff->MaxY) + { + Buff->VirtualY = 0; } (*ScrolledLines)++; ClearLineBuffer(Buff); + if (UpdateRect->top != 0) + { + UpdateRect->top--; + } } UpdateRect->left = 0; UpdateRect->right = Buff->MaxX - 1; - if (UpdateRect->top == (LONG)Buff->CurrentY) - { - if (++UpdateRect->top == Buff->MaxY) - { - UpdateRect->top = 0; - } - } UpdateRect->bottom = Buff->CurrentY; } @@ -434,7 +432,8 @@ LONG CursorStartX, CursorStartY; UINT ScrolledLines; - ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, &CursorStartX, &CursorStartY); + CursorStartX = Buff->CurrentX; + CursorStartY = Buff->CurrentY; UpdateRect.left = Buff->MaxX; UpdateRect.top = Buff->CurrentY; UpdateRect.right = -1; @@ -456,31 +455,20 @@ else if (Buffer[i] == '\b') { /* Only handle BS if we're not on the first pos of the first line */ - if (0 != Buff->CurrentX || Buff->ShowY != Buff->CurrentY) + if (0 != Buff->CurrentX || 0 != Buff->CurrentY) { if (0 == Buff->CurrentX) { /* slide virtual position up */ Buff->CurrentX = Buff->MaxX - 1; - if (0 == Buff->CurrentY) - { - Buff->CurrentY = Buff->MaxY; - } - else - { - Buff->CurrentY--; - } - if ((0 == UpdateRect.top && UpdateRect.bottom < (LONG)Buff->CurrentY) - || (0 != UpdateRect.top && (LONG)Buff->CurrentY < UpdateRect.top)) - { - UpdateRect.top = Buff->CurrentY; - } + Buff->CurrentY--; + UpdateRect.top = min(UpdateRect.top, (LONG)Buff->CurrentY); } else { - Buff->CurrentX--; + Buff->CurrentX--; } - Offset = 2 * ((Buff->CurrentY * Buff->MaxX) + Buff->CurrentX); + Offset = ConioGetBufferOffset(Buff, Buff->CurrentX, Buff->CurrentY); SET_CELL_BUFFER(Buff, Offset, ' ', Buff->DefaultAttrib); UpdateRect.left = min(UpdateRect.left, (LONG) Buff->CurrentX); UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX); @@ -506,7 +494,7 @@ { EndX = Buff->MaxX; } - Offset = 2 * (((Buff->CurrentY * Buff->MaxX)) + Buff->CurrentX); + Offset = ConioGetBufferOffset(Buff, Buff->CurrentX, Buff->CurrentY); while (Buff->CurrentX < EndX) { Buff->Buffer[Offset] = ' '; @@ -532,7 +520,7 @@ } UpdateRect.left = min(UpdateRect.left, (LONG)Buff->CurrentX); UpdateRect.right = max(UpdateRect.right, (LONG) Buff->CurrentX); - Offset = 2 * (((Buff->CurrentY * Buff->MaxX)) + Buff->CurrentX); + Offset = ConioGetBufferOffset(Buff, Buff->CurrentX, Buff->CurrentY); Buff->Buffer[Offset++] = Buffer[i]; if (Attrib) { @@ -553,11 +541,7 @@ } } - ConioPhysicalToLogical(Buff, UpdateRect.left, UpdateRect.top, &(UpdateRect.left), - &(UpdateRect.top)); - ConioPhysicalToLogical(Buff, UpdateRect.right, UpdateRect.bottom, &(UpdateRect.right), - &(UpdateRect.bottom)); - if (! ConioIsRectEmpty(&UpdateRect) && NULL != Console && Buff == Console->ActiveBuffer) + if (! ConioIsRectEmpty(&UpdateRect) && Buff == Console->ActiveBuffer) { ConioWriteStream(Console, &UpdateRect, CursorStartX, CursorStartY, ScrolledLines, Buffer, Length); @@ -709,24 +693,6 @@ return Request->Status; } -VOID FASTCALL -ConioPhysicalToLogical(PCSRSS_SCREEN_BUFFER Buff, - ULONG PhysicalX, - ULONG PhysicalY, - LONG *LogicalX, - LONG *LogicalY) -{ - *LogicalX = PhysicalX; - if (PhysicalY < Buff->ShowY) - { - *LogicalY = Buff->MaxY - Buff->ShowY + PhysicalY; - } - else - { - *LogicalY = PhysicalY - Buff->ShowY; - } -} - BOOLEAN __inline ConioGetIntersection( RECT *Intersection, RECT *Rect1, @@ -814,8 +780,8 @@ } for (i = 0; i < Height; i++) { - PWORD SRow = (PWORD)&ScreenBuffer->Buffer[((SY + ScreenBuffer->ShowY) % ScreenBuffer->MaxY) * ScreenBuffer->MaxX * 2]; - PWORD DRow = (PWORD)&ScreenBuffer->Buffer[((DY + ScreenBuffer->ShowY) % ScreenBuffer->MaxY) * ScreenBuffer->MaxX * 2]; + PWORD SRow = (PWORD)&ScreenBuffer->Buffer[ConioGetBufferOffset(ScreenBuffer, 0, SY)]; + PWORD DRow = (PWORD)&ScreenBuffer->Buffer[ConioGetBufferOffset(ScreenBuffer, 0, DY)]; SX = SrcRegion->left; DX = DstRegion->left; @@ -934,10 +900,7 @@ RtlFreeHeap(GetProcessHeap(), 0, Buffer); } } - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); Request->Data.WriteConsoleRequest.NrCharactersWritten = Written; @@ -988,7 +951,6 @@ } Console->ActiveBuffer = NULL; - Console->hActiveBuffer = INVALID_HANDLE_VALUE; CloseHandle(Console->ActiveEvent); DeleteCriticalSection(&Console->Header.Lock); @@ -1050,27 +1012,22 @@ if (VK_UP == KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode) { /* only scroll up if there is room to scroll up into */ - if (Console->ActiveBuffer->ShowY != ((Console->ActiveBuffer->CurrentY + 1) % - Console->ActiveBuffer->MaxY)) + if (Console->ActiveBuffer->CurrentY != Console->ActiveBuffer->MaxY - 1) { - Console->ActiveBuffer->ShowY = (Console->ActiveBuffer->ShowY + - Console->ActiveBuffer->MaxY - 1) % - Console->ActiveBuffer->MaxY; + Console->ActiveBuffer->VirtualY = (Console->ActiveBuffer->VirtualY + + Console->ActiveBuffer->MaxY - 1) % + Console->ActiveBuffer->MaxY; + Console->ActiveBuffer->CurrentY++; } } - else if (Console->ActiveBuffer->ShowY != Console->ActiveBuffer->CurrentY) - /* only scroll down if there is room to scroll down into */ - { - if (Console->ActiveBuffer->ShowY % Console->ActiveBuffer->MaxY != - Console->ActiveBuffer->CurrentY) + else + { + /* only scroll down if there is room to scroll down into */ + if (Console->ActiveBuffer->CurrentY != 0) { - if (((Console->ActiveBuffer->CurrentY + 1) % Console->ActiveBuffer->MaxY) != - (Console->ActiveBuffer->ShowY + Console->ActiveBuffer->MaxY) % - Console->ActiveBuffer->MaxY) - { - Console->ActiveBuffer->ShowY = (Console->ActiveBuffer->ShowY + 1) % - Console->ActiveBuffer->MaxY; - } + Console->ActiveBuffer->VirtualY = (Console->ActiveBuffer->VirtualY + 1) % + Console->ActiveBuffer->MaxY; + Console->ActiveBuffer->CurrentY--; } } ConioDrawConsole(Console); @@ -1363,8 +1320,8 @@ pInfo = &Request->Data.ScreenBufferInfoRequest.Info; pInfo->dwSize.X = Buff->MaxX; pInfo->dwSize.Y = Buff->MaxY; - pInfo->dwCursorPosition.X = Buff->CurrentX - Buff->ShowX; - pInfo->dwCursorPosition.Y = (Buff->CurrentY + Buff->MaxY - Buff->ShowY) % Buff->MaxY; + pInfo->dwCursorPosition.X = Buff->CurrentX; + pInfo->dwCursorPosition.Y = Buff->CurrentY; pInfo->wAttributes = Buff->DefaultAttrib; pInfo->srWindow.Left = 0; pInfo->srWindow.Right = Buff->MaxX - 1; @@ -1401,10 +1358,7 @@ Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetCursorRequest.ConsoleHandle, &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = Status; } @@ -1414,33 +1368,25 @@ NewCursorY < 0 || NewCursorY >= Buff->MaxY) { ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { + ConioUnlockConsole(Console); + return Request->Status = STATUS_INVALID_PARAMETER; + } + OldCursorX = Buff->CurrentX; + OldCursorY = Buff->CurrentY; + Buff->CurrentX = NewCursorX; + Buff->CurrentY = NewCursorY; + if (Buff == Console->ActiveBuffer) + { + if (! ConioSetScreenInfo(Console, Buff, OldCursorX, OldCursorY)) + { + ConioUnlockScreenBuffer(Buff); ConioUnlockConsole(Console); - } - return Request->Status = STATUS_INVALID_PARAMETER; - } - ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, &OldCursorX, &OldCursorY); - Buff->CurrentX = NewCursorX + Buff->ShowX; - Buff->CurrentY = (NewCursorY + Buff->ShowY) % Buff->MaxY; - if (NULL != Console && Buff == Console->ActiveBuffer) - { - if (! ConioSetScreenInfo(Console, Buff, OldCursorX, OldCursorY)) - { - ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } return Request->Status = STATUS_UNSUCCESSFUL; } } ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = STATUS_SUCCESS; } @@ -1532,8 +1478,8 @@ &Buff); if (NT_SUCCESS(Status)) { - X = Request->Data.WriteConsoleOutputCharRequest.Coord.X + Buff->ShowX; - Y = (Request->Data.WriteConsoleOutputCharRequest.Coord.Y + Buff->ShowY) % Buff->MaxY; + X = Request->Data.WriteConsoleOutputCharRequest.Coord.X; + Y = (Request->Data.WriteConsoleOutputCharRequest.Coord.Y + Buff->VirtualY) % Buff->MaxY; Length = Request->Data.WriteConsoleOutputCharRequest.Length; Buffer = &Buff->Buffer[2 * (Y * Buff->MaxX + X)]; while (Length--) @@ -1551,15 +1497,15 @@ X = 0; } } - if (NULL != Console && Buff == Console->ActiveBuffer) + if (Buff == Console->ActiveBuffer) { ConioComputeUpdateRect(Buff, &UpdateRect, &Request->Data.WriteConsoleOutputCharRequest.Coord, Request->Data.WriteConsoleOutputCharRequest.Length); ConioDrawRegion(Console, &UpdateRect); } - Request->Data.WriteConsoleOutputCharRequest.EndCoord.X = X - Buff->ShowX; - Request->Data.WriteConsoleOutputCharRequest.EndCoord.Y = (Y + Buff->MaxY - Buff->ShowY) % Buff->MaxY; + Request->Data.WriteConsoleOutputCharRequest.EndCoord.X = X; + Request->Data.WriteConsoleOutputCharRequest.EndCoord.Y = (Y + Buff->MaxY - Buff->VirtualY) % Buff->MaxY; ConioUnlockScreenBuffer(Buff); } @@ -1568,10 +1514,7 @@ RtlFreeHeap(GetProcessHeap(), 0, tmpString); } } - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); } Request->Data.WriteConsoleOutputCharRequest.NrCharactersWritten = Written; return Request->Status = Status; @@ -1601,15 +1544,12 @@ Status = ConioLockScreenBuffer(ProcessData, Request->Data.FillOutputRequest.ConsoleHandle, &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } - return Request->Status = Status; - } - - X = Request->Data.FillOutputRequest.Position.X + Buff->ShowX; - Y = (Request->Data.FillOutputRequest.Position.Y + Buff->ShowY) % Buff->MaxY; + ConioUnlockConsole(Console); + return Request->Status = Status; + } + + X = Request->Data.FillOutputRequest.Position.X; + Y = (Request->Data.FillOutputRequest.Position.Y + Buff->VirtualY) % Buff->MaxY; Buffer = &Buff->Buffer[2 * (Y * Buff->MaxX + X)]; if(Request->Data.FillOutputRequest.Unicode) ConsoleUnicodeCharToAnsiChar(Console, &Char, &Request->Data.FillOutputRequest.Char.UnicodeChar); @@ -1632,7 +1572,7 @@ } } - if (NULL != Console && Buff == Console->ActiveBuffer) + if (Buff == Console->ActiveBuffer) { ConioComputeUpdateRect(Buff, &UpdateRect, &Request->Data.FillOutputRequest.Position, Request->Data.FillOutputRequest.Length); @@ -1640,10 +1580,7 @@ } ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); Length = Request->Data.FillOutputRequest.Length; Request->Data.FillOutputRequest.NrCharactersWritten = Length; return Request->Status; @@ -1763,15 +1700,12 @@ &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } - return Request->Status = Status; - } - - X = Request->Data.WriteConsoleOutputAttribRequest.Coord.X + Buff->ShowX; - Y = (Request->Data.WriteConsoleOutputAttribRequest.Coord.Y + Buff->ShowY) % Buff->MaxY; + ConioUnlockConsole(Console); + return Request->Status = Status; + } + + X = Request->Data.WriteConsoleOutputAttribRequest.Coord.X; + Y = (Request->Data.WriteConsoleOutputAttribRequest.Coord.Y + Buff->VirtualY) % Buff->MaxY; Length = Request->Data.WriteConsoleOutputAttribRequest.Length; Buffer = &Buff->Buffer[2 * (Y * Buff->MaxX + X) + 1]; Attribute = Request->Data.WriteConsoleOutputAttribRequest.Attribute; @@ -1790,20 +1724,17 @@ } } - if (NULL != Console && Buff == Console->ActiveBuffer) + if (Buff == Console->ActiveBuffer) { ConioComputeUpdateRect(Buff, &UpdateRect, &Request->Data.WriteConsoleOutputAttribRequest.Coord, Request->Data.WriteConsoleOutputAttribRequest.Length); ConioDrawRegion(Console, &UpdateRect); } - if (NULL != Console) - { - ConioUnlockConsole(Console); - } - - Request->Data.WriteConsoleOutputAttribRequest.EndCoord.X = Buff->CurrentX - Buff->ShowX; - Request->Data.WriteConsoleOutputAttribRequest.EndCoord.Y = (Buff->CurrentY + Buff->MaxY - Buff->ShowY) % Buff->MaxY; + ConioUnlockConsole(Console); + + Request->Data.WriteConsoleOutputAttribRequest.EndCoord.X = X; + Request->Data.WriteConsoleOutputAttribRequest.EndCoord.Y = (Y + Buff->MaxY - Buff->VirtualY) % Buff->MaxY; ConioUnlockScreenBuffer(Buff); @@ -1833,15 +1764,12 @@ Status = ConioLockScreenBuffer(ProcessData, Request->Data.FillOutputAttribRequest.ConsoleHandle, &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } - return Request->Status = Status; - } - - X = Request->Data.FillOutputAttribRequest.Coord.X + Buff->ShowX; - Y = (Request->Data.FillOutputAttribRequest.Coord.Y + Buff->ShowY) % Buff->MaxY; + ConioUnlockConsole(Console); + return Request->Status = Status; + } + + X = Request->Data.FillOutputAttribRequest.Coord.X; + Y = (Request->Data.FillOutputAttribRequest.Coord.Y + Buff->VirtualY) % Buff->MaxY; Length = Request->Data.FillOutputAttribRequest.Length; Attr = Request->Data.FillOutputAttribRequest.Attribute; Buffer = &Buff->Buffer[(Y * Buff->MaxX * 2) + (X * 2) + 1]; @@ -1860,7 +1788,7 @@ } } - if (NULL != Console && Buff == Console->ActiveBuffer) + if (Buff == Console->ActiveBuffer) { ConioComputeUpdateRect(Buff, &UpdateRect, &Request->Data.FillOutputAttribRequest.Coord, Request->Data.FillOutputAttribRequest.Length); @@ -1868,10 +1796,7 @@ } ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = STATUS_SUCCESS; } @@ -1921,10 +1846,7 @@ Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetCursorInfoRequest.ConsoleHandle, &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = Status; } @@ -1945,7 +1867,7 @@ Buff->CursorInfo.dwSize = Size; Buff->CursorInfo.bVisible = Visible; - if (NULL != Console && ! ConioSetCursorInfo(Console, Buff)) + if (! ConioSetCursorInfo(Console, Buff)) { ConioUnlockScreenBuffer(Buff); ConioUnlockConsole(Console); @@ -1954,10 +1876,7 @@ } ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = STATUS_SUCCESS; } @@ -1979,15 +1898,12 @@ Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetCursorRequest.ConsoleHandle, &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = Status; } Buff->DefaultAttrib = Request->Data.SetAttribRequest.Attrib; - if (NULL != Console && Buff == Console->ActiveBuffer) + if (Buff == Console->ActiveBuffer) { if (! ConioUpdateScreenInfo(Console, Buff)) { @@ -1998,10 +1914,7 @@ } ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = STATUS_SUCCESS; } @@ -2095,10 +2008,6 @@ { return Request->Status = Status; } - if (NULL == Console) - { - return Request->Status = STATUS_INVALID_HANDLE; - } Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); @@ -2162,11 +2071,6 @@ { return Request->Status = Status; } - if (NULL == Console) - { - DPRINT1("Trying to set screen buffer for app without console\n"); - return Request->Status = STATUS_INVALID_HANDLE; - } Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); @@ -2192,7 +2096,6 @@ } /* tie console to new buffer */ Console->ActiveBuffer = Buff; - Console->hActiveBuffer = Request->Data.SetScreenBufferRequest.OutputHandle; /* inc ref count on new buffer */ InterlockedIncrement(&Buff->Header.ReferenceCount); /* Redraw the console */ @@ -2222,7 +2125,7 @@ return Request->Status = STATUS_INVALID_PARAMETER; } - Status = ConioLockConsole(ProcessData, Request->Data.SetTitleRequest.Console, &Console); + Status = ConioConsoleFromProcessData(ProcessData, &Console); Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); if(! NT_SUCCESS(Status)) @@ -2252,8 +2155,8 @@ { Request->Status = STATUS_NO_MEMORY; } - } - ConioUnlockConsole(Console); + ConioUnlockConsole(Console); + } return Request->Status; } @@ -2268,9 +2171,7 @@ Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); - Status = ConioLockConsole(ProcessData, - Request->Data.GetTitleRequest.ConsoleHandle, - &Console); + Status = ConioConsoleFromProcessData(ProcessData, &Console); if (! NT_SUCCESS(Status)) { DPRINT1("Can't get console\n"); @@ -2327,10 +2228,7 @@ &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = Status; } @@ -2371,7 +2269,7 @@ for (i = 0, Y = WriteRegion.top; Y <= WriteRegion.bottom; i++, Y++) { CurCharInfo = CharInfo + (i + BufferCoord.Y) * BufferSize.X + BufferCoord.X; - Offset = (((Y + Buff->ShowY) % Buff->MaxY) * Buff->MaxX + WriteRegion.left) * 2; + Offset = ConioGetBufferOffset(Buff, WriteRegion.left, Y); for (X = WriteRegion.left; X <= WriteRegion.right; X++) { if (Request->Data.WriteConsoleOutputRequest.Unicode) @@ -2388,10 +2286,7 @@ } } - if (NULL != Console) - { - ConioDrawRegion(Console, &WriteRegion); - } + ConioDrawRegion(Console, &WriteRegion); ConioUnlockScreenBuffer(Buff); ConioUnlockConsole(Console); @@ -2474,10 +2369,7 @@ Status = ConioLockScreenBuffer(ProcessData, ConsoleHandle, &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = Status; } @@ -2491,10 +2383,7 @@ if (! ConioGetIntersection(&SrcRegion, &ScreenBuffer, &ScrollRectangle)) { ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = STATUS_SUCCESS; } @@ -2516,10 +2405,7 @@ ClipRectangle.bottom = Request->Data.ScrollConsoleScreenBufferRequest.ClipRectangle.Bottom; if (!ConioGetIntersection(&ClipRectangle, &ClipRectangle, &ScreenBuffer)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); ConioUnlockScreenBuffer(Buff); return Request->Status = STATUS_SUCCESS; } @@ -2542,7 +2428,7 @@ ConioMoveRegion(Buff, &SrcRegion, &DstRegion, &ClipRectangle, Fill.Attributes << 8 | (BYTE)FillChar); - if (NULL != Console && Buff == Console->ActiveBuffer) + if (Buff == Console->ActiveBuffer) { ConioGetUnion(&UpdateRegion, &SrcRegion, &DstRegion); if (ConioGetIntersection(&UpdateRegion, &UpdateRegion, &ClipRectangle)) @@ -2553,10 +2439,7 @@ } ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); return Request->Status = STATUS_SUCCESS; } @@ -2589,15 +2472,12 @@ Status = ConioLockScreenBuffer(ProcessData, Request->Data.ReadConsoleOutputCharRequest.ConsoleHandle, &Buff); if (! NT_SUCCESS(Status)) { - if (NULL != Console) - { - ConioUnlockConsole(Console); - } - return Request->Status = Status; - } - - Xpos = Request->Data.ReadConsoleOutputCharRequest.ReadCoord.X + Buff->ShowX; - Ypos = (Request->Data.ReadConsoleOutputCharRequest.ReadCoord.Y + Buff->ShowY) % Buff->MaxY; + ConioUnlockConsole(Console); + return Request->Status = Status; + } + + Xpos = Request->Data.ReadConsoleOutputCharRequest.ReadCoord.X; + Ypos = (Request->Data.ReadConsoleOutputCharRequest.ReadCoord.Y + Buff->VirtualY) % Buff->MaxY; for (i = 0; i < Request->Data.ReadConsoleOutputCharRequest.NumCharsToRead; ++i) { @@ -2627,14 +2507,11 @@ *ReadBuffer = 0; Request->Status = STATUS_SUCCESS; - Request->Data.ReadConsoleOutputCharRequest.EndCoord.X = Xpos - Buff->ShowX; - Request->Data.ReadConsoleOutputCharRequest.EndCoord.Y = (Ypos - Buff->ShowY + Buff->MaxY) % Buff->MaxY; + Request->Data.ReadConsoleOutputCharRequest.EndCoord.X = Xpos; + Request->Data.ReadConsoleOutputCharRequest.EndCoord.Y = (Ypos - Buff->VirtualY + Buff->MaxY) % Buff->MaxY; ConioUnlockScreenBuffer(Buff); - if (NULL != Console) - { - ConioUnlockConsole(Console); - } + ConioUnlockConsole(Console); Request->Data.ReadConsoleOutputCharRequest.CharsRead = (DWORD)((ULONG_PTR)ReadBuffer - (ULONG_PTR)Request->Data.ReadConsoleOutputCharRequest.String) / CharSize; if (Request->Data.ReadConsoleOutputCharRequest.CharsRead * CharSize + CSR_API_MESSAGE_HEADER_SIZE(CSRSS_READ_CONSOLE_OUTPUT_CHAR) > sizeof(CSR_API_MESSAGE)) @@ -2668,8 +2545,8 @@ return Request->Status = Status; } - Xpos = Request->Data.ReadConsoleOutputAttribRequest.ReadCoord.X + Buff->ShowX; - Ypos = (Request->Data.ReadConsoleOutputAttribRequest.ReadCoord.Y + Buff->ShowY) % Buff->MaxY; + Xpos = Request->Data.ReadConsoleOutputAttribRequest.ReadCoord.X; + Ypos = (Request->Data.ReadConsoleOutputAttribRequest.ReadCoord.Y + Buff->VirtualY) % Buff->MaxY; for (i = 0; i < Request->Data.ReadConsoleOutputAttribRequest.NumAttrsToRead; ++i) { @@ -2693,8 +2570,8 @@ *ReadBuffer = 0; Request->Status = STATUS_SUCCESS; - Request->Data.ReadConsoleOutputAttribRequest.EndCoord.X = Xpos - Buff->ShowX; - Request->Data.ReadConsoleOutputAttribRequest.EndCoord.Y = (Ypos - Buff->ShowY + Buff->MaxY) % Buff->MaxY; + Request->Data.ReadConsoleOutputAttribRequest.EndCoord.X = Xpos; + Request->Data.ReadConsoleOutputAttribRequest.EndCoord.Y = (Ypos - Buff->VirtualY + Buff->MaxY) % Buff->MaxY; ConioUnlockScreenBuffer(Buff); @@ -2890,7 +2767,7 @@ { CurCharInfo = CharInfo + (i * BufferSize.X); - Offset = (((Y + Buff->ShowY) % Buff->MaxY) * Buff->MaxX + ReadRegion.left) * 2; + Offset = ConioGetBufferOffset(Buff, ReadRegion.left, Y); for (X = ReadRegion.left; X < ReadRegion.right; ++X) { if (Request->Data.ReadConsoleOutputRequest.Unicode) @@ -3095,8 +2972,8 @@ return Request->Status = Status; } - Console->hWindowIcon = Request->Data.SetConsoleIconRequest.WindowIcon; - Request->Status = (ConioChangeIcon(Console) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); + Request->Status = (ConioChangeIcon(Console, Request->Data.SetConsoleIconRequest.WindowIcon) + ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); ConioUnlockConsole(Console); return Request->Status; 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] Thu Jul 17 16:53:39 2008 @@ -780,21 +780,6 @@ } static VOID FASTCALL -GuiConsoleGetLogicalCursorPos(PCSRSS_SCREEN_BUFFER Buff, ULONG *CursorX, ULONG *CursorY) -{ - *CursorX = Buff->CurrentX; - if (Buff->CurrentY < Buff->ShowY) - { - *CursorY = Buff->MaxY - Buff->ShowY + Buff->CurrentY; - } - else - { - *CursorY = Buff->CurrentY - Buff->ShowY; - } -} - - -static VOID FASTCALL GuiConsoleUpdateSelection(HWND hWnd, PRECT rc, PGUI_CONSOLE_DATA GuiData) { RECT oldRect = GuiData->Selection; @@ -895,15 +880,7 @@ for (Line = TopLine; Line <= BottomLine; Line++) { - if (Line + Buff->ShowY < Buff->MaxY) - { - From = Buff->Buffer + ((Line + Buff->ShowY) * Buff->MaxX + LeftChar) * 2; - } - else - { - From = Buff->Buffer + - ((Line - (Buff->MaxY - Buff->ShowY)) * Buff->MaxX + LeftChar) * 2; - } + From = Buff->Buffer + ConioGetBufferOffset(Buff, LeftChar, Line); Start = LeftChar; To = GuiData->LineBuffer; @@ -947,9 +924,8 @@ if (Buff->CursorInfo.bVisible && GuiData->CursorBlinkOn && !GuiData->ForceCursorOff) { - GuiConsoleGetLogicalCursorPos(Buff, - &CursorX, - &CursorY); + CursorX = Buff->CurrentX; + CursorY = Buff->CurrentY; if (LeftChar <= CursorX && CursorX <= RightChar && TopLine <= CursorY && CursorY <= BottomLine) { @@ -958,7 +934,7 @@ { CursorHeight = 1; } - From = Buff->Buffer + (Buff->CurrentY * Buff->MaxX + Buff->CurrentX) * 2 + 1; + From = Buff->Buffer + ConioGetBufferOffset(Buff, Buff->CurrentX, Buff->CurrentY) + 1; if (*From != DEFAULT_ATTRIB) { @@ -1165,8 +1141,8 @@ GuiInvalidateCell(GuiData, Console->hWindow, CursorStartX, CursorStartY); } - ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, - &CursorEndX, &CursorEndY); + CursorEndX = Buff->CurrentX; + CursorEndY = Buff->CurrentY; if ((CursorEndX < Region->left || Region->right < CursorEndX || CursorEndY < Region->top || Region->bottom < CursorEndY) && (CursorEndX != CursorStartX || CursorEndY != CursorStartY)) @@ -1182,8 +1158,8 @@ if (Console->ActiveBuffer == Buff) { - ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, - &UpdateRect.left, &UpdateRect.top); + UpdateRect.left = Buff->CurrentX; + UpdateRect.top = Buff->CurrentY; UpdateRect.right = UpdateRect.left; UpdateRect.bottom = UpdateRect.top; ConioDrawRegion(Console, &UpdateRect); @@ -1206,8 +1182,8 @@ UpdateRect.bottom = OldCursorY; ConioDrawRegion(Console, &UpdateRect); /* Redraw char at new position (shows cursor) */ - ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, - &(UpdateRect.left), &(UpdateRect.top)); + UpdateRect.left = Buff->CurrentX; + UpdateRect.top = Buff->CurrentY; UpdateRect.right = UpdateRect.left; UpdateRect.bottom = UpdateRect.top; ConioDrawRegion(Console, &UpdateRect); @@ -1236,16 +1212,14 @@ PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; RECT CursorRect; - ULONG CursorX, CursorY; GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); GuiData->CursorBlinkOn = ! GuiData->CursorBlinkOn; - GuiConsoleGetLogicalCursorPos(Console->ActiveBuffer, &CursorX, &CursorY); - CursorRect.left = CursorX; - CursorRect.top = CursorY; - CursorRect.right = CursorX; - CursorRect.bottom = CursorY; + CursorRect.left = Console->ActiveBuffer->CurrentX; + CursorRect.top = Console->ActiveBuffer->CurrentY; + CursorRect.right = CursorRect.left; + CursorRect.bottom = CursorRect.top; GuiDrawRegion(Console, &CursorRect); } @@ -1575,21 +1549,16 @@ { DWORD windx, windy; RECT rect; - PCSRSS_SCREEN_BUFFER ActiveBuffer; - PCSRSS_PROCESS_DATA ProcessData = NULL; - - if (Console->ProcessList.Flink != &Console->ProcessList) - { - ProcessData = CONTAINING_RECORD(Console->ProcessList.Flink, CSRSS_PROCESS_DATA, ProcessEntry); - ConioLockScreenBuffer(ProcessData, Console->hActiveBuffer, (Object_t **)&ActiveBuffer); - } + PCSRSS_SCREEN_BUFFER ActiveBuffer = Console->ActiveBuffer; + + EnterCriticalSection(&ActiveBuffer->Header.Lock); /* apply text / background color */ GuiData->ScreenText = pConInfo->ScreenText; GuiData->ScreenBackground = pConInfo->ScreenBackground; /* apply cursor size */ - Console->ActiveBuffer->CursorInfo.dwSize = max(min(pConInfo->CursorSize, 1), 100); + ActiveBuffer->CursorInfo.dwSize = max(min(pConInfo->CursorSize, 1), 100); windx = LOWORD(pConInfo->ScreenBuffer); windy = HIWORD(pConInfo->ScreenBuffer); @@ -1640,13 +1609,13 @@ } #endif Offset += (diff * 2); - BufferOffset += (Console->ActiveBuffer->MaxX * 2); + BufferOffset += (ActiveBuffer->MaxX * 2); } } - if (windy > Console->ActiveBuffer->MaxY) - { - diff = windy - Console->ActiveBuffer->MaxX; + if (windy > ActiveBuffer->MaxY) + { + diff = windy - ActiveBuffer->MaxX; #if HAVE_WMEMSET wmemset((WCHAR*)&Buffer[Offset], value, diff * windx); #else @@ -1658,18 +1627,15 @@ #endif } - (void)InterlockedExchangePointer((PVOID volatile *)&Console->ActiveBuffer->Buffer, Buffer); + (void)InterlockedExchangePointer((PVOID volatile *)&ActiveBuffer->Buffer, Buffer); HeapFree(Win32CsrApiHeap, 0, OldBuffer); - Console->ActiveBuffer->MaxX = windx; - Console->ActiveBuffer->MaxY = windy; + ActiveBuffer->MaxX = windx; + ActiveBuffer->MaxY = windy; InvalidateRect(pConInfo->hConsoleWindow, NULL, TRUE); } else { - if (ProcessData) - { - ConioUnlockScreenBuffer(ActiveBuffer); - } + LeaveCriticalSection(&ActiveBuffer->Header.Lock); return; } } @@ -1687,10 +1653,7 @@ } else { - if (ProcessData) - { - ConioUnlockScreenBuffer(ActiveBuffer); - } + LeaveCriticalSection(&ActiveBuffer->Header.Lock); return; } } @@ -1709,7 +1672,7 @@ MoveWindow(pConInfo->hConsoleWindow, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, FALSE); - if (Console->Size.X < Console->ActiveBuffer->MaxX) + if (Console->Size.X < ActiveBuffer->MaxX) { /* show scrollbar when window becomes smaller than active screen buffer */ ShowScrollBar(pConInfo->hConsoleWindow, SB_CTL, TRUE); @@ -1720,10 +1683,7 @@ ShowScrollBar(pConInfo->hConsoleWindow, SB_CTL, FALSE); } } - if (ProcessData) - { - ConioUnlockScreenBuffer(ActiveBuffer); - } + LeaveCriticalSection(&ActiveBuffer->Header.Lock); InvalidateRect(pConInfo->hConsoleWindow, NULL, TRUE); } @@ -2087,10 +2047,10 @@ } static BOOL STDCALL -GuiChangeIcon(PCSRSS_CONSOLE Console) -{ - SendMessageW(Console->hWindow, WM_SETICON, ICON_BIG, (LPARAM)Console->hWindowIcon); - SendMessageW(Console->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)Console->hWindowIcon); +GuiChangeIcon(PCSRSS_CONSOLE Console, HICON hWindowIcon) +{ + SendMessageW(Console->hWindow, WM_SETICON, ICON_BIG, (LPARAM)hWindowIcon); + SendMessageW(Console->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)hWindowIcon); return TRUE; } Modified: trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c [iso-8859-1] Thu Jul 17 16:53:39 2008 @@ -86,8 +86,7 @@ LONG i; PBYTE Src, SrcEnd; - Src = Buff->Buffer + (((Region->top + Buff->ShowY) % Buff->MaxY) * Buff->MaxX - + Region->left + Buff->ShowX) * 2; + Src = Buff->Buffer + ConioGetBufferOffset(Buff, Region->left, Region->top); SrcDelta = Buff->MaxX * 2; SrcEnd = Buff->Buffer + Buff->MaxY * Buff->MaxX * 2; DestDelta = ConioRectWidth(Region) * 2; @@ -108,7 +107,6 @@ { DWORD BytesReturned; PCSRSS_SCREEN_BUFFER Buff = Console->ActiveBuffer; - LONG CursorX, CursorY; PCONSOLE_DRAW ConsoleDraw; UINT ConsoleDrawSize; @@ -125,13 +123,12 @@ DPRINT1("HeapAlloc failed\n"); return; } - ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, &CursorX, &CursorY); ConsoleDraw->X = Region->left; ConsoleDraw->Y = Region->top; ConsoleDraw->SizeX = ConioRectWidth(Region); ConsoleDraw->SizeY = ConioRectHeight(Region); - ConsoleDraw->CursorX = CursorX; - ConsoleDraw->CursorY = CursorY; + ConsoleDraw->CursorX = Buff->CurrentX; + ConsoleDraw->CursorY = Buff->CurrentY; TuiCopyRect((char *) (ConsoleDraw + 1), Buff, Region); @@ -189,7 +186,6 @@ TuiSetScreenInfo(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER Buff, UINT OldCursorX, UINT OldCursorY) { CONSOLE_SCREEN_BUFFER_INFO Info; - LONG CursorX, CursorY; DWORD BytesReturned; if (ActiveConsole->ActiveBuffer != Buff) @@ -197,9 +193,8 @@ return TRUE; } - ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, &CursorX, &CursorY); - Info.dwCursorPosition.X = CursorX; - Info.dwCursorPosition.Y = CursorY; + Info.dwCursorPosition.X = Buff->CurrentX; + Info.dwCursorPosition.Y = Buff->CurrentY; Info.wAttributes = Buff->DefaultAttrib; if (! DeviceIoControl(ConsoleDeviceHandle, IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO,
16 years, 5 months
1
0
0
0
[arty] 34567: Patch by Cameron Gutman (aicommander <at> gmail <dot> com) - Don't mess with cancelled IRPs - Don't attempt to cancel an already cancelled IRP - Unmap MDL when then IRP gets completed
by arty@svn.reactos.org
Author: arty Date: Thu Jul 17 14:42:26 2008 New Revision: 34567 URL:
http://svn.reactos.org/svn/reactos?rev=34567&view=rev
Log: Patch by Cameron Gutman (aicommander <at> gmail <dot> com) - Don't mess with cancelled IRPs - Don't attempt to cancel an already cancelled IRP - Unmap MDL when then IRP gets completed Modified: trunk/reactos/drivers/network/afd/afd/listen.c trunk/reactos/drivers/network/afd/afd/lock.c trunk/reactos/drivers/network/afd/afd/read.c trunk/reactos/drivers/network/afd/afd/write.c Modified: trunk/reactos/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Thu Jul 17 14:42:26 2008 @@ -82,6 +82,7 @@ if ( Irp->Cancel ) { /* FIXME: is this anything else we need to do? */ + FCB->ListenIrp.InFlightRequest = NULL; return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Thu Jul 17 14:42:26 2008 @@ -243,7 +243,9 @@ otherwise it may be completed by StreamSocketConnectComplete() before we return from SocketStateUnlock(). */ IoMarkIrpPending( Irp ); - SocketStateUnlock( FCB ); + SocketStateUnlock( FCB ); + if( ShouldUnlock ) + UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) ); } else { SocketStateUnlock( FCB ); Irp->IoStatus.Status = Status; Modified: trunk/reactos/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Thu Jul 17 14:42:26 2008 @@ -154,6 +154,7 @@ FCB->Overread ? STATUS_END_OF_FILE : STATUS_SUCCESS; NextIrp->IoStatus.Information = 0; if( NextIrp == Irp ) RetStatus = Status; + UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) ); IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT ); FCB->Overread = TRUE; //FCB->PollState |= AFD_EVENT_DISCONNECT; @@ -197,6 +198,7 @@ NextIrp->IoStatus.Status = Status; NextIrp->IoStatus.Information = TotalBytesCopied; if( NextIrp == Irp ) RetStatus = Status; + UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) ); IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT ); } } @@ -224,6 +226,11 @@ AFD_DbgPrint(MID_TRACE,("Called\n")); ASSERT_IRQL(APC_LEVEL); + + if (Irp->Cancel) { + FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_SUCCESS; + } if( !SocketAcquireStateLock( FCB ) ) return Status; @@ -299,7 +306,7 @@ if( !RecvReq->BufferArray ) { return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION, - Irp, 0, NULL, FALSE ); + Irp, 0, NULL, TRUE ); } Irp->IoStatus.Status = STATUS_PENDING; @@ -440,6 +447,11 @@ UINT DGSize = Irp->IoStatus.Information + sizeof( AFD_STORED_DATAGRAM ); AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + + if (Irp->Cancel) { + FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_SUCCESS; + } if( !SocketAcquireStateLock( FCB ) ) return STATUS_UNSUCCESSFUL; Modified: trunk/reactos/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Thu Jul 17 14:42:26 2008 @@ -40,6 +40,11 @@ ASSERT_IRQL(APC_LEVEL); + if (Irp->Cancel) { + FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_SUCCESS; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->SendIrp.InFlightRequest = NULL; @@ -169,6 +174,11 @@ Irp->IoStatus.Status, Irp->IoStatus.Information)); + if (Irp->Cancel) { + FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_SUCCESS; + } + /* It's ok if the FCB already died */ if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS;
16 years, 5 months
1
0
0
0
[jmorlan] 34566: Fix argument parsing for label command. It should not split the arguments by spaces; on Windows you can do 'label c:x y z' and it will set the label to X Y Z. (Bug 3530 #2)
by jmorlan@svn.reactos.org
Author: jmorlan Date: Thu Jul 17 11:46:09 2008 New Revision: 34566 URL:
http://svn.reactos.org/svn/reactos?rev=34566&view=rev
Log: Fix argument parsing for label command. It should not split the arguments by spaces; on Windows you can do 'label c:x y z' and it will set the label to X Y Z. (Bug 3530 #2) Modified: trunk/reactos/base/shell/cmd/label.c Modified: trunk/reactos/base/shell/cmd/label.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/label.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/label.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/label.c [iso-8859-1] Thu Jul 17 11:46:09 2008 @@ -29,11 +29,11 @@ TCHAR szLabel[80]; TCHAR szOldLabel[80]; DWORD dwSerialNr; - LPTSTR *arg; - INT args; /* set empty label string */ szLabel[0] = _T('\0'); + + nErrorLevel = 0; /* print help */ if (!_tcsncmp (param, _T("/?"), 2)) @@ -42,55 +42,34 @@ return 0; } - nErrorLevel = 0; - /* get parameters */ - arg = split (param, &args, FALSE); - - if (args > 2) + if (param[0] != _T('\0') && param[1] == _T(':')) { - /* too many parameters */ - error_too_many_parameters (arg[args - 1]); - freep (arg); - nErrorLevel = 1; - return 1; + szRootPath[0] = toupper(*param); + param += 2; + while (_istspace(*param)) + param++; } - - if (args == 0) + else { /* get label of current drive */ TCHAR szCurPath[MAX_PATH]; GetCurrentDirectory (MAX_PATH, szCurPath); szRootPath[0] = szCurPath[0]; } - else - { - if ((_tcslen (arg[0]) >= 2) && (arg[0][1] == _T(':'))) - { - szRootPath[0] = toupper (*arg[0]); - if (args == 2) - _tcsncpy (szLabel, arg[1], 12); - } - else - { - TCHAR szCurPath[MAX_PATH]; - GetCurrentDirectory (MAX_PATH, szCurPath); - szRootPath[0] = szCurPath[0]; - _tcsncpy (szLabel, arg[0], 12); - } - } + + _tcsncpy (szLabel, param, 12); /* check root path */ if (!IsValidPathName (szRootPath)) { error_invalid_drive (); - freep (arg); - nErrorLevel = 1; + nErrorLevel = 1; return 1; } GetVolumeInformation(szRootPath, szOldLabel, 80, &dwSerialNr, - NULL, NULL, NULL, 0); + NULL, NULL, NULL, 0); /* print drive info */ if (szOldLabel[0] != _T('\0')) @@ -110,7 +89,6 @@ if (szLabel[0] == _T('\0')) { - LoadString(CMD_ModuleHandle, STRING_LABEL_HELP5, szMsg, RC_STRING_MAX_SIZE); ConOutResPuts(STRING_LABEL_HELP5); ConInString(szLabel, 80); @@ -118,8 +96,6 @@ SetVolumeLabel(szRootPath, szLabel); - freep(arg); - return 0; }
16 years, 5 months
1
0
0
0
[pschweitzer] 34565: Header update: - Added FsRtlIsFatDbcsLegal() - Code cleanup
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jul 17 10:54:26 2008 New Revision: 34565 URL:
http://svn.reactos.org/svn/reactos?rev=34565&view=rev
Log: Header update: - Added FsRtlIsFatDbcsLegal() - Code cleanup Modified: branches/pierre-fsd/include/ddk/ntifs.h Modified: branches/pierre-fsd/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/include/ddk/ntifs.h?…
============================================================================== --- branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] (original) +++ branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] Thu Jul 17 10:54:26 2008 @@ -2482,6 +2482,36 @@ #define FlagOn(x, f) ((x) & (f)) NTKERNELAPI +BOOLEAN +NTAPI +FsRtlAddBaseMcbEntry ( + IN PBASE_MCB Mcb, + IN LONGLONG Vbn, + IN LONGLONG Lbn, + IN LONGLONG SectorCount +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlAddLargeMcbEntry ( + IN PLARGE_MCB Mcb, + IN LONGLONG Vbn, + IN LONGLONG Lbn, + IN LONGLONG SectorCount +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlAddMcbEntry ( + IN PMCB Mcb, + IN VBN Vbn, + IN LBN Lbn, + IN ULONG SectorCount +); + +NTKERNELAPI VOID NTAPI FsRtlAddToTunnelCache ( @@ -2545,8 +2575,8 @@ FsRtlAreNamesEqual ( IN PCUNICODE_STRING Name1, IN PCUNICODE_STRING Name2, - IN BOOLEAN IgnoreCase, - IN PCWCH UpcaseTable OPTIONAL + IN BOOLEAN IgnoreCase, + IN PCWCH UpcaseTable OPTIONAL ); #define FsRtlAreThereCurrentFileLocks(FL) ( \ @@ -2688,18 +2718,18 @@ VOID NTAPI FsRtlDissectDbcs ( - IN ANSI_STRING Name, - OUT PANSI_STRING FirstPart, - OUT PANSI_STRING RemainingPart + IN ANSI_STRING Name, + OUT PANSI_STRING FirstPart, + OUT PANSI_STRING RemainingPart ); NTKERNELAPI VOID NTAPI FsRtlDissectName ( - IN UNICODE_STRING Name, - OUT PUNICODE_STRING FirstPart, - OUT PUNICODE_STRING RemainingPart + IN UNICODE_STRING Name, + OUT PUNICODE_STRING FirstPart, + OUT PUNICODE_STRING RemainingPart ); NTKERNELAPI @@ -2823,6 +2853,17 @@ IN OUT PLARGE_INTEGER FileSize ); +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlGetNextBaseMcbEntry ( + IN PBASE_MCB Mcb, + IN ULONG RunIndex, + OUT PLONGLONG Vbn, + OUT PLONGLONG Lbn, + OUT PLONGLONG SectorCount +); + /* FsRtlGetNextFileLock: @@ -2844,6 +2885,36 @@ ); NTKERNELAPI +BOOLEAN +NTAPI +FsRtlGetNextLargeMcbEntry ( + IN PLARGE_MCB Mcb, + IN ULONG RunIndex, + OUT PLONGLONG Vbn, + OUT PLONGLONG Lbn, + OUT PLONGLONG SectorCount +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlGetNextMcbEntry ( + IN PMCB Mcb, + IN ULONG RunIndex, + OUT PVBN Vbn, + OUT PLBN Lbn, + OUT PULONG SectorCount +); + +NTKERNELAPI +VOID +NTAPI +FsRtlInitializeBaseMcb ( + IN PBASE_MCB Mcb, + IN POOL_TYPE PoolType +); + +NTKERNELAPI VOID NTAPI FsRtlInitializeFileLock ( @@ -2855,6 +2926,22 @@ NTKERNELAPI VOID NTAPI +FsRtlInitializeLargeMcb ( + IN PLARGE_MCB Mcb, + IN POOL_TYPE PoolType +); + +NTKERNELAPI +VOID +NTAPI +FsRtlInitializeMcb ( + IN PMCB Mcb, + IN POOL_TYPE PoolType +); + +NTKERNELAPI +VOID +NTAPI FsRtlInitializeOplock ( IN OUT POPLOCK Oplock ); @@ -2864,6 +2951,16 @@ NTAPI FsRtlInitializeTunnelCache ( IN PTUNNEL Cache +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlIsFatDbcsLegal ( + IN ANSI_STRING DbcsName, + IN BOOLEAN WildCardsPermissible, + IN BOOLEAN PathNamePermissible, + IN BOOLEAN LeadingBackslashPermissible ); NTKERNELAPI @@ -2902,6 +2999,90 @@ FALSE : \ FlagOn(FsRtlLegalAnsiCharacterArray[(C)], FSRTL_WILD_CHARACTER )) \ ) + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupBaseMcbEntry ( + IN PBASE_MCB Mcb, + IN LONGLONG Vbn, + OUT PLONGLONG Lbn OPTIONAL, + OUT PLONGLONG SectorCountFromLbn OPTIONAL, + OUT PLONGLONG StartingLbn OPTIONAL, + OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, + OUT PULONG Index OPTIONAL +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupLargeMcbEntry ( + IN PLARGE_MCB Mcb, + IN LONGLONG Vbn, + OUT PLONGLONG Lbn OPTIONAL, + OUT PLONGLONG SectorCountFromLbn OPTIONAL, + OUT PLONGLONG StartingLbn OPTIONAL, + OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, + OUT PULONG Index OPTIONAL +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupLastBaseMcbEntry ( + IN PBASE_MCB Mcb, + OUT PLONGLONG Vbn, + OUT PLONGLONG Lbn +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupLastLargeMcbEntry ( + IN PLARGE_MCB Mcb, + OUT PLONGLONG Vbn, + OUT PLONGLONG Lbn +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupLastMcbEntry ( + IN PMCB Mcb, + OUT PVBN Vbn, + OUT PLBN Lbn +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupLastBaseMcbEntryAndIndex ( + IN PBASE_MCB OpaqueMcb, + IN OUT PLONGLONG LargeVbn, + IN OUT PLONGLONG LargeLbn, + IN OUT PULONG Index +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupLastLargeMcbEntryAndIndex ( + IN PLARGE_MCB OpaqueMcb, + OUT PLONGLONG LargeVbn, + OUT PLONGLONG LargeLbn, + OUT PULONG Index +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlLookupMcbEntry ( + IN PMCB Mcb, + IN VBN Vbn, + OUT PLBN Lbn, + OUT PULONG SectorCount OPTIONAL, + OUT PULONG Index +); NTKERNELAPI BOOLEAN @@ -3070,6 +3251,27 @@ #endif /* (VER_PRODUCTBUILD >= 2195) */ NTKERNELAPI +ULONG +NTAPI +FsRtlNumberOfRunsInBaseMcb ( + IN PBASE_MCB Mcb +); + +NTKERNELAPI +ULONG +NTAPI +FsRtlNumberOfRunsInLargeMcb ( + IN PLARGE_MCB Mcb +); + +NTKERNELAPI +ULONG +NTAPI +FsRtlNumberOfRunsInMcb ( + IN PMCB Mcb +); + +NTKERNELAPI NTSTATUS NTAPI FsRtlOplockFsctrl ( @@ -3083,6 +3285,30 @@ NTAPI FsRtlOplockIsFastIoPossible ( IN POPLOCK Oplock +); + +NTKERNELAPI +VOID +NTAPI +FsRtlPostPagingFileStackOverflow ( + IN PVOID Context, + IN PKEVENT Event, + IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine +); + +typedef VOID +(NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE) ( + IN PVOID Context, + IN PKEVENT Event +); + +NTKERNELAPI +VOID +NTAPI +FsRtlPostStackOverflow ( + IN PVOID Context, + IN PKEVENT Event, + IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine ); /* @@ -3151,28 +3377,95 @@ IN BOOLEAN MailslotsSupported ); -typedef VOID -(NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE) ( - IN PVOID Context, - IN PKEVENT Event -); - -NTKERNELAPI -VOID -NTAPI -FsRtlPostStackOverflow ( - IN PVOID Context, - IN PKEVENT Event, - IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine -); - -NTKERNELAPI -VOID -NTAPI -FsRtlPostPagingFileStackOverflow ( - IN PVOID Context, - IN PKEVENT Event, - IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlRemoveBaseMcbEntry ( + IN PBASE_MCB Mcb, + IN LONGLONG Vbn, + IN LONGLONG SectorCount +); + +NTKERNELAPI +VOID +NTAPI +FsRtlRemoveLargeMcbEntry ( + IN PLARGE_MCB Mcb, + IN LONGLONG Vbn, + IN LONGLONG SectorCount +); + +NTKERNELAPI +VOID +NTAPI +FsRtlRemoveMcbEntry ( + IN PMCB Mcb, + IN VBN Vbn, + IN ULONG SectorCount +); + +NTKERNELAPI +VOID +NTAPI +FsRtlResetBaseMcb ( + IN PBASE_MCB Mcb +); + +NTKERNELAPI +VOID +NTAPI +FsRtlResetLargeMcb ( + IN PLARGE_MCB Mcb, + IN BOOLEAN SelfSynchronized +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlSplitBaseMcb ( + IN PBASE_MCB Mcb, + IN LONGLONG Vbn, + IN LONGLONG Amount +); + +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlSplitLargeMcb ( + IN PLARGE_MCB Mcb, + IN LONGLONG Vbn, + IN LONGLONG Amount +); + +NTKERNELAPI +VOID +NTAPI +FsRtlTruncateBaseMcb ( + IN PBASE_MCB Mcb, + IN LONGLONG Vbn +); + +NTKERNELAPI +VOID +NTAPI +FsRtlTruncateLargeMcb ( + IN PLARGE_MCB Mcb, + IN LONGLONG Vbn +); + +NTKERNELAPI +VOID +NTAPI +FsRtlTruncateMcb ( + IN PMCB Mcb, + IN VBN Vbn +); + +NTKERNELAPI +VOID +NTAPI +FsRtlUninitializeBaseMcb ( + IN PBASE_MCB Mcb ); NTKERNELAPI @@ -3185,305 +3478,22 @@ NTKERNELAPI VOID NTAPI +FsRtlUninitializeLargeMcb ( + IN PLARGE_MCB Mcb +); + +NTKERNELAPI +VOID +NTAPI +FsRtlUninitializeMcb ( + IN PMCB Mcb +); + +NTKERNELAPI +VOID +NTAPI FsRtlUninitializeOplock ( IN OUT POPLOCK Oplock -); - -NTKERNELAPI -VOID -NTAPI -FsRtlInitializeLargeMcb ( - IN PLARGE_MCB Mcb, - IN POOL_TYPE PoolType -); - -NTKERNELAPI -VOID -NTAPI -FsRtlUninitializeLargeMcb ( - IN PLARGE_MCB Mcb -); - -NTKERNELAPI -VOID -NTAPI -FsRtlResetLargeMcb ( - IN PLARGE_MCB Mcb, - IN BOOLEAN SelfSynchronized -); - -NTKERNELAPI -VOID -NTAPI -FsRtlTruncateLargeMcb ( - IN PLARGE_MCB Mcb, - IN LONGLONG Vbn -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlAddLargeMcbEntry ( - IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG Lbn, - IN LONGLONG SectorCount -); - -NTKERNELAPI -VOID -NTAPI -FsRtlRemoveLargeMcbEntry ( - IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG SectorCount -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupLargeMcbEntry ( - IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - OUT PLONGLONG Lbn OPTIONAL, - OUT PLONGLONG SectorCountFromLbn OPTIONAL, - OUT PLONGLONG StartingLbn OPTIONAL, - OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, - OUT PULONG Index OPTIONAL -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupLastLargeMcbEntry ( - IN PLARGE_MCB Mcb, - OUT PLONGLONG Vbn, - OUT PLONGLONG Lbn -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupLastLargeMcbEntryAndIndex ( - IN PLARGE_MCB OpaqueMcb, - OUT PLONGLONG LargeVbn, - OUT PLONGLONG LargeLbn, - OUT PULONG Index -); - -NTKERNELAPI -ULONG -NTAPI -FsRtlNumberOfRunsInLargeMcb ( - IN PLARGE_MCB Mcb -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlGetNextLargeMcbEntry ( - IN PLARGE_MCB Mcb, - IN ULONG RunIndex, - OUT PLONGLONG Vbn, - OUT PLONGLONG Lbn, - OUT PLONGLONG SectorCount -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlSplitLargeMcb ( - IN PLARGE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG Amount -); - -NTKERNELAPI -VOID -NTAPI -FsRtlInitializeBaseMcb ( - IN PBASE_MCB Mcb, - IN POOL_TYPE PoolType -); - -NTKERNELAPI -VOID -NTAPI -FsRtlUninitializeBaseMcb ( - IN PBASE_MCB Mcb -); - -NTKERNELAPI -VOID -NTAPI -FsRtlResetBaseMcb ( - IN PBASE_MCB Mcb -); - -NTKERNELAPI -VOID -NTAPI -FsRtlTruncateBaseMcb ( - IN PBASE_MCB Mcb, - IN LONGLONG Vbn -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlAddBaseMcbEntry ( - IN PBASE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG Lbn, - IN LONGLONG SectorCount -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlRemoveBaseMcbEntry ( - IN PBASE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG SectorCount -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupBaseMcbEntry ( - IN PBASE_MCB Mcb, - IN LONGLONG Vbn, - OUT PLONGLONG Lbn OPTIONAL, - OUT PLONGLONG SectorCountFromLbn OPTIONAL, - OUT PLONGLONG StartingLbn OPTIONAL, - OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, - OUT PULONG Index OPTIONAL -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupLastBaseMcbEntry ( - IN PBASE_MCB Mcb, - OUT PLONGLONG Vbn, - OUT PLONGLONG Lbn -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupLastBaseMcbEntryAndIndex ( - IN PBASE_MCB OpaqueMcb, - IN OUT PLONGLONG LargeVbn, - IN OUT PLONGLONG LargeLbn, - IN OUT PULONG Index -); - -NTKERNELAPI -ULONG -NTAPI -FsRtlNumberOfRunsInBaseMcb ( - IN PBASE_MCB Mcb -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlGetNextBaseMcbEntry ( - IN PBASE_MCB Mcb, - IN ULONG RunIndex, - OUT PLONGLONG Vbn, - OUT PLONGLONG Lbn, - OUT PLONGLONG SectorCount -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlSplitBaseMcb ( - IN PBASE_MCB Mcb, - IN LONGLONG Vbn, - IN LONGLONG Amount -); - -NTKERNELAPI -VOID -NTAPI -FsRtlInitializeMcb ( - IN PMCB Mcb, - IN POOL_TYPE PoolType -); - -NTKERNELAPI -VOID -NTAPI -FsRtlUninitializeMcb ( - IN PMCB Mcb -); - -NTKERNELAPI -VOID -NTAPI -FsRtlTruncateMcb ( - IN PMCB Mcb, - IN VBN Vbn -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlAddMcbEntry ( - IN PMCB Mcb, - IN VBN Vbn, - IN LBN Lbn, - IN ULONG SectorCount -); - -NTKERNELAPI -VOID -NTAPI -FsRtlRemoveMcbEntry ( - IN PMCB Mcb, - IN VBN Vbn, - IN ULONG SectorCount -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupMcbEntry ( - IN PMCB Mcb, - IN VBN Vbn, - OUT PLBN Lbn, - OUT PULONG SectorCount OPTIONAL, - OUT PULONG Index -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlLookupLastMcbEntry ( - IN PMCB Mcb, - OUT PVBN Vbn, - OUT PLBN Lbn -); - -NTKERNELAPI -ULONG -NTAPI -FsRtlNumberOfRunsInMcb ( - IN PMCB Mcb -); - -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlGetNextMcbEntry ( - IN PMCB Mcb, - IN ULONG RunIndex, - OUT PVBN Vbn, - OUT PLBN Lbn, - OUT PULONG SectorCount ); NTHALAPI
16 years, 5 months
1
0
0
0
[sginsberg] 34564: - Patch by Cameron Gutman aicommander <at> gmail <dot> com - Don't release the device spinlock twice if KeSynchronizeExecution returns false See issue #3520 for more details.
by sginsberg@svn.reactos.org
Author: sginsberg Date: Thu Jul 17 09:43:36 2008 New Revision: 34564 URL:
http://svn.reactos.org/svn/reactos?rev=34564&view=rev
Log: - Patch by Cameron Gutman aicommander <at> gmail <dot> com - Don't release the device spinlock twice if KeSynchronizeExecution returns false See issue #3520 for more details. Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
============================================================================== --- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Thu Jul 17 09:43:36 2008 @@ -2894,8 +2894,12 @@ IoCompleteRequest(Irp, IO_NO_INCREMENT); } - - KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); + else + { + /* Release the spinlock only */ + KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); + } + DPRINT("ScsiPortStartIo() done\n"); }
16 years, 5 months
1
0
0
0
[pschweitzer] 34563: Fixed bugs in FsRtlIsFatDbcsLegal
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jul 17 07:41:20 2008 New Revision: 34563 URL:
http://svn.reactos.org/svn/reactos?rev=34563&view=rev
Log: Fixed bugs in FsRtlIsFatDbcsLegal Modified: branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c Modified: branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/dbcsn…
============================================================================== --- branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] (original) +++ branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] Thu Jul 17 07:41:20 2008 @@ -217,10 +217,10 @@ return FALSE; /* Now, only work on filename */ - if (LastSlash) + if (LastSlash || FirstSlash) { FileName.Buffer = DbcsName.Buffer + LastSlash + 1; - FileName.Length = (DbcsName.Length - LastSlash) * sizeof(CHAR); + FileName.Length = (DbcsName.Length - LastSlash - 1) * sizeof(CHAR); FileName.MaximumLength = DbcsName.MaximumLength - FileName.Length; }
16 years, 5 months
1
0
0
0
[sginsberg] 34562: -PCHify OpenGL32
by sginsberg@svn.reactos.org
Author: sginsberg Date: Thu Jul 17 06:37:49 2008 New Revision: 34562 URL:
http://svn.reactos.org/svn/reactos?rev=34562&view=rev
Log: -PCHify OpenGL32 Removed: trunk/reactos/dll/win32/opengl32/teb.h Modified: trunk/reactos/dll/win32/opengl32/gl.c trunk/reactos/dll/win32/opengl32/opengl32.c trunk/reactos/dll/win32/opengl32/opengl32.h trunk/reactos/dll/win32/opengl32/opengl32.rbuild trunk/reactos/dll/win32/opengl32/wgl.c Modified: trunk/reactos/dll/win32/opengl32/gl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/gl.c?re…
============================================================================== --- trunk/reactos/dll/win32/opengl32/gl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/gl.c [iso-8859-1] Thu Jul 17 06:37:49 2008 @@ -19,15 +19,10 @@ * * On other machines we use C to forward the calls (slow...) */ - -#define WIN32_LEANER_AND_MEANER -#define WIN32_NO_STATUS -#include <windows.h> -#include "teb.h" + +#include "opengl32.h" C_ASSERT(FIELD_OFFSET(TEB, glTable) == 0xbe8); - -#include "opengl32.h" int STDCALL glEmptyFunc0() { return 0; } int STDCALL glEmptyFunc4( long l1 ) { return 0; } Modified: trunk/reactos/dll/win32/opengl32/opengl32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl3…
============================================================================== --- trunk/reactos/dll/win32/opengl32/opengl32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/opengl32.c [iso-8859-1] Thu Jul 17 06:37:49 2008 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: lib/opengl32/opengl32.c @@ -9,15 +8,7 @@ * Feb 1, 2004: Created */ -#define WIN32_LEAN_AND_MEAN -#define WIN32_NO_STATUS -#include <windows.h> -#include <winreg.h> -#include "teb.h" - -#include <string.h> #include "opengl32.h" - /* function prototypes */ static void OPENGL32_AppendICD( GLDRIVERDATA *icd ); Modified: trunk/reactos/dll/win32/opengl32/opengl32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl3…
============================================================================== --- trunk/reactos/dll/win32/opengl32/opengl32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/opengl32.h [iso-8859-1] Thu Jul 17 06:37:49 2008 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: lib/opengl32/opengl32.h @@ -28,6 +27,22 @@ #define OPENGL_DRIVERS_SUBKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers" #define OPENGL_DRIVERS_SUBKEY2 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers\\" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define WIN32_LEAN_AND_MEAN +#define WIN32_NO_STATUS +#include <windows.h> + +#include <winreg.h> + +#define NTOS_MODE_USER +#include <ddraw.h> +#include <ddrawi.h> +#include <winddi.h> +#include <ndk/ntndk.h> /* gl function list */ #include "glfuncs.h" Modified: trunk/reactos/dll/win32/opengl32/opengl32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl3…
============================================================================== --- trunk/reactos/dll/win32/opengl32/opengl32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/opengl32.rbuild [iso-8859-1] Thu Jul 17 06:37:49 2008 @@ -6,6 +6,7 @@ <library>gdi32</library> <library>user32</library> <library>advapi32</library> + <pch>opengl32.h</pch> <file>gl.c</file> <file>opengl32.c</file> <file>wgl.c</file> Removed: trunk/reactos/dll/win32/opengl32/teb.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/teb.h?r…
============================================================================== --- trunk/reactos/dll/win32/opengl32/teb.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/teb.h (removed) @@ -1,5 +1,0 @@ -// teb.h - -#define NTOS_MODE_USER -#include <ndk/ntndk.h> - Modified: trunk/reactos/dll/win32/opengl32/wgl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/wgl.c?r…
============================================================================== --- trunk/reactos/dll/win32/opengl32/wgl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/wgl.c [iso-8859-1] Thu Jul 17 06:37:49 2008 @@ -7,21 +7,6 @@ * UPDATE HISTORY: * Feb 2, 2004: Created */ - -#define WIN32_LEAN_AND_MEAN -#define WIN32_NO_STATUS -#include <windows.h> - -#define NTOS_MODE_USER -#include <ddraw.h> -#include <ddrawi.h> -#include <winddi.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "teb.h" #define OPENGL32_GL_FUNC_PROTOTYPES #include "opengl32.h"
16 years, 5 months
1
0
0
0
[pschweitzer] 34561: - Implemented FsRtlDissectDbcs, FsRtlIsFatDbcsLegal - Updated comments
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jul 17 04:57:23 2008 New Revision: 34561 URL:
http://svn.reactos.org/svn/reactos?rev=34561&view=rev
Log: - Implemented FsRtlDissectDbcs, FsRtlIsFatDbcsLegal - Updated comments Modified: branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c Modified: branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/dbcsn…
============================================================================== --- branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] (original) +++ branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] Thu Jul 17 04:57:23 2008 @@ -45,19 +45,58 @@ OUT PANSI_STRING FirstPart, OUT PANSI_STRING RemainingPart) { - KEBUGCHECK(0); + ULONG FirstPosition, i; + ULONG SkipFirstSlash = 0; + + /* Just quit if the string is empty */ + if (!Name.Length) return; + + /* Find first backslash */ + FirstPosition = Name.Length / sizeof(CHAR) ; + for (i = 0; i < Name.Length / sizeof(CHAR); i++) + { + /* If we found one... */ + if (Name.Buffer[i] == '\\') + { + /* If it begins string, just notice it and continue */ + if (i == 0) + { + SkipFirstSlash = 1; + } + else + { + /* Else, save its position and break out of the loop */ + FirstPosition = i; + break; + } + } + } + + /* Set up the first result string */ + FirstPart->Buffer = Name.Buffer + SkipFirstSlash; + FirstPart->Length = (FirstPosition - SkipFirstSlash) * sizeof(CHAR); + FirstPart->MaximumLength = Name.MaximumLength - FirstPart->Length; + + /* And second one, if necessary */ + if (FirstPosition < (Name.Length / sizeof(CHAR))) + { + RemainingPart->Buffer = Name.Buffer + FirstPosition + 1; + RemainingPart->Length = (Name.Length - FirstPosition) * sizeof(CHAR); + RemainingPart->MaximumLength = Name.MaximumLength - RemainingPart->Length; + } } /*++ * @name FsRtlDoesDbcsContainWildCards * @implemented * - * FILLME + * Returns TRUE if the given DbcsName contains wildcards such as *, ?, + * ANSI_DOS_STAR, ANSI_DOS_DOT, and ANSI_DOS_QM * * @param Name - * FILLME - * - * @return None + * The Name to check + * + * @return TRUE if there are wildcards, FALSE otherwise * * @remarks None * @@ -115,21 +154,24 @@ /*++ * @name FsRtlIsFatDbcsLegal - * @unimplemented - * - * FILLME + * @implemented + * + * Returns TRUE if the given DbcsName is a valid FAT filename (in 8.3) * * @param DbcsName - * FILLME + * The filename to check. It can also contains pathname. * * @param WildCardsPermissible - * FILLME + * If this is set to FALSE and if filename contains wildcard, the function + * will fail * * @param PathNamePermissible - * FILLME + * If this is set to FALSE and if the filename comes with a pathname, the + * function will fail * * @param LeadingBackslashPermissible - * FILLME + * If this is set to FALSE and if the filename starts with a backslash, the + * function will fail * * @return TRUE if the DbcsName is legal, FALSE otherwise * @@ -143,8 +185,98 @@ IN BOOLEAN PathNamePermissible, IN BOOLEAN LeadingBackslashPermissible) { - KEBUGCHECK(0); - return FALSE; + BOOLEAN FirstSlash = FALSE, IsIllegal = FALSE; + ULONG i, LastSlash = 0, LastDot = 0; + ANSI_STRING FileName; + + /* Just quit if the string is empty */ + if (!DbcsName.Length) + return FALSE; + + /* Check if we have a filename and a pathname + * Continue until we get the last one to extract the filename + */ + for (i = 0; i < DbcsName.Length / sizeof(CHAR); i++) + { + if (DbcsName.Buffer[i] == '\\') + { + LastSlash = i; + if (!i) + { + FirstSlash = TRUE; + } + } + } + + /* DbcsName was to be a filename */ + if (!PathNamePermissible && LastSlash) + return FALSE; + + /* DbcsName wasn't supposed to be started with \ if it's a filename */ + if (!LeadingBackslashPermissible && !LastSlash && FirstSlash) + return FALSE; + + /* Now, only work on filename */ + if (LastSlash) + { + FileName.Buffer = DbcsName.Buffer + LastSlash + 1; + FileName.Length = (DbcsName.Length - LastSlash) * sizeof(CHAR); + FileName.MaximumLength = DbcsName.MaximumLength - FileName.Length; + + } + else + { + FileName.Buffer = DbcsName.Buffer; + FileName.Length = DbcsName.Length; + FileName.MaximumLength = DbcsName.MaximumLength; + } + + /* Filename must be 8.3 filename */ + if (FileName.Length < 3 || FileName.Length > 12) + return FALSE; + + if (!WildCardsPermissible && FsRtlDoesDbcsContainWildCards(&FileName)) + return FALSE; + + /* Now, we will parse the filename to find everything bad in + * It mustn't contain: + * 0x00-0x1F, 0x22, 0x2B, 0x2C, 0x2F, 0x3A, 0x3B, 0x3D, 0x5B, 0x5D, 0x7C */ + for (i = 0; i < FileName.Length / sizeof(CHAR); i++) + { + if ((FileName.Buffer[i] < 0x1F) || (FileName.Buffer[i] == 0x22) || + (FileName.Buffer[i] == 0x2B) || (FileName.Buffer[i] == 0x2C) || + (FileName.Buffer[i] == 0x2F) || (FileName.Buffer[i] == 0x3A) || + (FileName.Buffer[i] == 0x3B) || (FileName.Buffer[i] == 0x3D) || + (FileName.Buffer[i] == 0x5B) || (FileName.Buffer[i] == 0x5D) || + (FileName.Buffer[i] == 0x7C)) + { + IsIllegal = TRUE; + break; + } + if (FileName.Buffer[i] == '.') + { + LastDot = i; + if (!i) + { + IsIllegal = TRUE; + break; + } + } + } + if (IsIllegal || LastDot == (FileName.Length / sizeof(CHAR)) - 1) + return FALSE; + + /* We mustn't have spaces before dot or at the end of the filename */ + if ((LastDot && FileName.Buffer[LastDot - 1] == ' ') || + (FileName.Buffer[FileName.Length / sizeof(CHAR) - 1] == ' ')) + return FALSE; + + /* Filename must be 8.3 filename and not 3.8 filename */ + if (LastDot && ((FileName.Length / sizeof(CHAR) - 1) - LastDot > 3)) + return FALSE; + + /* We have a valid filename */ + return TRUE; } /*++
16 years, 5 months
1
0
0
0
[cwittich] 34560: fix for getaddrinfo patch by Yuri Sidorov <jura at cp-lab dot com>
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Jul 17 03:07:37 2008 New Revision: 34560 URL:
http://svn.reactos.org/svn/reactos?rev=34560&view=rev
Log: fix for getaddrinfo patch by Yuri Sidorov <jura at cp-lab dot com> Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/ns.c…
============================================================================== --- trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] Thu Jul 17 03:07:37 2008 @@ -1427,7 +1427,9 @@ return WSAHOST_NOT_FOUND; port = se->s_port; } - + else + port = htons(port); + if (nodename) { /* Is it an IPv6 address? */
16 years, 5 months
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200