ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
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
November 2012
----- 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
11 participants
124 discussions
Start a n
N
ew thread
[ekohl] 57735: [LSASRV] Implement LsarQuerySecurityObject.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Nov 18 21:42:14 2012 New Revision: 57735 URL:
http://svn.reactos.org/svn/reactos?rev=57735&view=rev
Log: [LSASRV] Implement LsarQuerySecurityObject. Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Sun Nov 18 21:42:14 2012 @@ -138,8 +138,80 @@ SECURITY_INFORMATION SecurityInformation, PLSAPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PLSA_DB_OBJECT DbObject = NULL; + PSECURITY_DESCRIPTOR RelativeSd = NULL; + PLSAPR_SR_SECURITY_DESCRIPTOR SdData = NULL; + ACCESS_MASK DesiredAccess = 0; + ULONG RelativeSdSize = 0; + NTSTATUS Status; + + if (SecurityDescriptor == NULL) + return STATUS_INVALID_PARAMETER; + + if ((SecurityInformation & OWNER_SECURITY_INFORMATION) || + (SecurityInformation & GROUP_SECURITY_INFORMATION) || + (SecurityInformation & DACL_SECURITY_INFORMATION)) + DesiredAccess |= READ_CONTROL; + + if (SecurityInformation & SACL_SECURITY_INFORMATION) + DesiredAccess |= ACCESS_SYSTEM_SECURITY; + + /* Validate the ObjectHandle */ + Status = LsapValidateDbObject(ObjectHandle, + LsaDbIgnoreObject, + DesiredAccess, + &DbObject); + if (!NT_SUCCESS(Status)) + return Status; + + /* Get the size of the SD */ + Status = LsapGetObjectAttribute(DbObject, + L"SecDesc", + NULL, + &RelativeSdSize); + if (!NT_SUCCESS(Status)) + return Status; + + /* Allocate a buffer for the SD */ + RelativeSd = MIDL_user_allocate(RelativeSdSize); + if (RelativeSd == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + /* Get the SD */ + Status = LsapGetObjectAttribute(DbObject, + L"SecDesc", + RelativeSd, + &RelativeSdSize); + if (!NT_SUCCESS(Status)) + goto done; + + /* + * FIXME: Invalidate the SD information that was not requested. + * (see SecurityInformation) + */ + + /* Allocate the SD data buffer */ + SdData = MIDL_user_allocate(sizeof(LSAPR_SR_SECURITY_DESCRIPTOR)); + if (SdData == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + /* Fill the SD data buffer and return it to the caller */ + SdData->Length = RelativeSdSize; + SdData->SecurityDescriptor = (PBYTE)RelativeSd; + + *SecurityDescriptor = SdData; + +done: + if (!NT_SUCCESS(Status)) + { + if (RelativeSd != NULL) + MIDL_user_free(RelativeSd); + } + + return Status; }
11 years, 11 months
1
0
0
0
[hbelusca] 57734: [KERNEL32/CONSRV] - Merge IntFillConsoleOutputCharacter and FillConsoleOutputAttribute functions into IntFillConsoleOutputCode helper and make it used by FillConsoleOutputAttribut...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 18 17:06:48 2012 New Revision: 57734 URL:
http://svn.reactos.org/svn/reactos?rev=57734&view=rev
Log: [KERNEL32/CONSRV] - Merge IntFillConsoleOutputCharacter and FillConsoleOutputAttribute functions into IntFillConsoleOutputCode helper and make it used by FillConsoleOutputAttribute/CharacterW/A. - In server-side, CsrFillOutputChar and CsrFillOutputAttrib are merged into SrvFillConsoleOutput. - Merge CSRSS_FILL_OUTPUT and CSRSS_FILL_OUTPUT_ATTRIB structures into CSRSS_FILL_OUTPUT. Modified: branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c branches/ros-csrss/include/reactos/subsys/win/conmsg.h branches/ros-csrss/win32ss/user/consrv/conoutput.c Modified: branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/kernel32/cl…
============================================================================== --- branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] (original) +++ branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] Sun Nov 18 17:06:48 2012 @@ -328,7 +328,7 @@ static BOOL IntReadConsoleOutputCode(HANDLE hConsoleOutput, - USHORT CodeType, + CODE_TYPE CodeType, PVOID pCode, DWORD nLength, COORD dwReadCoord, @@ -721,42 +721,55 @@ static BOOL -IntFillConsoleOutputCharacter(HANDLE hConsoleOutput, - PVOID cCharacter, - DWORD nLength, - COORD dwWriteCoord, - LPDWORD lpNumberOfCharsWritten, - BOOL bUnicode) -{ - CSR_API_MESSAGE Request; +IntFillConsoleOutputCode(HANDLE hConsoleOutput, + CODE_TYPE CodeType, + PVOID pCode, + DWORD nLength, + COORD dwWriteCoord, + LPDWORD lpNumberOfCodesWritten) +{ NTSTATUS Status; - - Request.Data.FillOutputRequest.ConsoleHandle = hConsoleOutput; - Request.Data.FillOutputRequest.Unicode = bUnicode; - - if(bUnicode) - Request.Data.FillOutputRequest.Char.UnicodeChar = *((WCHAR*)cCharacter); - else - Request.Data.FillOutputRequest.Char.AsciiChar = *((CHAR*)cCharacter); - - Request.Data.FillOutputRequest.Position = dwWriteCoord; - Request.Data.FillOutputRequest.Length = (WORD)nLength; - - Status = CsrClientCallServer(&Request, + CONSOLE_API_MESSAGE ApiMessage; + PCSRSS_FILL_OUTPUT FillOutputRequest = &ApiMessage.Data.FillOutputRequest; + + FillOutputRequest->ConsoleHandle = hConsoleOutput; + FillOutputRequest->CodeType = CodeType; + + switch (CodeType) + { + case CODE_ASCII: + FillOutputRequest->Code.AsciiChar = *(PCHAR)pCode; + break; + + case CODE_UNICODE: + FillOutputRequest->Code.UnicodeChar = *(PWCHAR)pCode; + break; + + case CODE_ATTRIBUTE: + FillOutputRequest->Code.Attribute = *(PWORD)pCode; + break; + + default: + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + FillOutputRequest->Coord = dwWriteCoord; + FillOutputRequest->Length = nLength; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, FILL_OUTPUT), - sizeof(CSR_API_MESSAGE)); - - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFillConsoleOutput), + sizeof(CSRSS_FILL_OUTPUT)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; } - if(lpNumberOfCharsWritten != NULL) - { - *lpNumberOfCharsWritten = Request.Data.FillOutputRequest.NrCharactersWritten; - } + if (lpNumberOfCodesWritten) + *lpNumberOfCodesWritten = FillOutputRequest->Length; + // *lpNumberOfCharsWritten = Request.Data.FillOutputRequest.NrCharactersWritten; return TRUE; } @@ -1277,12 +1290,12 @@ COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten) { - return IntFillConsoleOutputCharacter(hConsoleOutput, - &cCharacter, - nLength, - dwWriteCoord, - lpNumberOfCharsWritten, - TRUE); + return IntFillConsoleOutputCode(hConsoleOutput, + CODE_UNICODE, + &cCharacter, + nLength, + dwWriteCoord, + lpNumberOfCharsWritten); } @@ -1299,12 +1312,12 @@ COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten) { - return IntFillConsoleOutputCharacter(hConsoleOutput, - &cCharacter, - nLength, - dwWriteCoord, - lpNumberOfCharsWritten, - FALSE); + return IntFillConsoleOutputCode(hConsoleOutput, + CODE_ASCII, + &cCharacter, + nLength, + dwWriteCoord, + lpNumberOfCharsWritten); } @@ -1321,28 +1334,12 @@ COORD dwWriteCoord, LPDWORD lpNumberOfAttrsWritten) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.FillOutputAttribRequest.ConsoleHandle = hConsoleOutput; - Request.Data.FillOutputAttribRequest.Attribute = (CHAR)wAttribute; - Request.Data.FillOutputAttribRequest.Coord = dwWriteCoord; - Request.Data.FillOutputAttribRequest.Length = (WORD)nLength; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, FILL_OUTPUT_ATTRIB), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - BaseSetLastNTError ( Status ); - return FALSE; - } - - if (lpNumberOfAttrsWritten) - *lpNumberOfAttrsWritten = nLength; - - return TRUE; + return IntFillConsoleOutputCode(hConsoleOutput, + CODE_ATTRIBUTE, + &wAttribute, + nLength, + dwWriteCoord, + lpNumberOfAttrsWritten); } /* EOF */ Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
============================================================================== --- branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original) +++ branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] Sun Nov 18 17:06:48 2012 @@ -27,7 +27,7 @@ ConsolepWriteConsoleOutput, ConsolepReadConsoleOutputString, // ConsolepWriteConsoleOutputString, - // ConsolepFillConsoleOutput, + ConsolepFillConsoleOutput, ConsolepGetMode, // ConsolepGetNumberOfFonts, ConsolepGetNumberOfInputEvents, @@ -187,28 +187,6 @@ { HANDLE ConsoleHandle; BOOL Unicode; - union - { - CHAR AsciiChar; - WCHAR UnicodeChar; - } Char; - COORD Position; - WORD Length; - ULONG NrCharactersWritten; -} CSRSS_FILL_OUTPUT, *PCSRSS_FILL_OUTPUT; - -typedef struct -{ - HANDLE ConsoleHandle; - CHAR Attribute; - COORD Coord; - WORD Length; -} CSRSS_FILL_OUTPUT_ATTRIB, *PCSRSS_FILL_OUTPUT_ATTRIB; - -typedef struct -{ - HANDLE ConsoleHandle; - BOOL Unicode; WORD Length; COORD Coord; COORD EndCoord; @@ -303,8 +281,7 @@ typedef struct { - HANDLE ConsoleHandle; - CODE_TYPE CodeType; + HANDLE ConsoleHandle; DWORD NumCodesToRead; COORD ReadCoord; @@ -312,6 +289,7 @@ DWORD CodesRead; + CODE_TYPE CodeType; union { PVOID pCode; @@ -321,6 +299,23 @@ } pCode; // Either a pointer to a character or to an attribute. } CSRSS_READ_CONSOLE_OUTPUT_CODE, *PCSRSS_READ_CONSOLE_OUTPUT_CODE; +typedef struct +{ + HANDLE ConsoleHandle; + + CODE_TYPE CodeType; + union + { + CHAR AsciiChar; + WCHAR UnicodeChar; + WORD Attribute; + } Code; // Either a character or an attribute. + + COORD Coord; + ULONG Length; + + ULONG NrCharactersWritten; // FIXME: Only for chars, is it removable ? +} CSRSS_FILL_OUTPUT, *PCSRSS_FILL_OUTPUT; typedef struct { @@ -595,7 +590,6 @@ CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB WriteConsoleOutputAttribRequest; CSRSS_FILL_OUTPUT FillOutputRequest; - CSRSS_FILL_OUTPUT_ATTRIB FillOutputAttribRequest; CSRSS_SET_ATTRIB SetAttribRequest; /* Aliases */ Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Nov 18 17:06:48 2012 @@ -991,45 +991,63 @@ return STATUS_SUCCESS; } -CSR_API(CsrFillOutputChar) +CSR_API(SrvFillConsoleOutput) { NTSTATUS Status; PCSRSS_FILL_OUTPUT FillOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.FillOutputRequest; PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; - DWORD X, Y, Length, Written = 0; - CHAR Char; + DWORD X, Y, Length, Start; // , Written = 0; + USHORT CodeType; + BYTE Code; PBYTE Buffer; SMALL_RECT UpdateRect; - DPRINT("CsrFillOutputChar\n"); - - Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, FillOutputRequest->ConsoleHandle, &Buff, GENERIC_WRITE); - if (! NT_SUCCESS(Status)) - { - return Status; - } + DPRINT("SrvFillConsoleOutput\n"); + + Status = ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), FillOutputRequest->ConsoleHandle, &Buff, GENERIC_WRITE); + if (!NT_SUCCESS(Status)) return Status; + Console = Buff->Header.Console; - X = FillOutputRequest->Position.X; - Y = (FillOutputRequest->Position.Y + Buff->VirtualY) % Buff->MaxY; - Buffer = &Buff->Buffer[2 * (Y * Buff->MaxX + X)]; - if(FillOutputRequest->Unicode) - ConsoleUnicodeCharToAnsiChar(Console, &Char, &FillOutputRequest->Char.UnicodeChar); - else - Char = FillOutputRequest->Char.AsciiChar; + CodeType = FillOutputRequest->CodeType; + + X = FillOutputRequest->Coord.X; + Y = (FillOutputRequest->Coord.Y + Buff->VirtualY) % Buff->MaxY; Length = FillOutputRequest->Length; + Start = 2 * (Y * Buff->MaxX + X) + (CodeType == CODE_ATTRIBUTE ? 1 : 0); + Buffer = &Buff->Buffer[Start]; + + switch (CodeType) + { + case CODE_ASCII: + Code = (BYTE)FillOutputRequest->Code.AsciiChar; + break; + + case CODE_UNICODE: + ConsoleUnicodeCharToAnsiChar(Console, (PCHAR)&Code, &FillOutputRequest->Code.UnicodeChar); + break; + + case CODE_ATTRIBUTE: + Code = (BYTE)FillOutputRequest->Code.Attribute; + break; + + default: + ConioUnlockScreenBuffer(Buff); + return STATUS_INVALID_PARAMETER; + } + while (Length--) { - *Buffer = Char; + *Buffer = Code; Buffer += 2; - Written++; + // Written++; if (++X == Buff->MaxX) { if (++Y == Buff->MaxY) { Y = 0; - Buffer = Buff->Buffer; + Buffer = Buff->Buffer + (CodeType == CODE_ATTRIBUTE ? 1 : 0); } X = 0; } @@ -1037,66 +1055,16 @@ if (Buff == Console->ActiveBuffer) { - ConioComputeUpdateRect(Buff, &UpdateRect, &FillOutputRequest->Position, + ConioComputeUpdateRect(Buff, &UpdateRect, &FillOutputRequest->Coord, FillOutputRequest->Length); ConioDrawRegion(Console, &UpdateRect); } ConioUnlockScreenBuffer(Buff); +/* Length = FillOutputRequest->Length; FillOutputRequest->NrCharactersWritten = Length; - return STATUS_SUCCESS; -} - -CSR_API(CsrFillOutputAttrib) -{ - PCSRSS_FILL_OUTPUT_ATTRIB FillOutputAttribRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.FillOutputAttribRequest; - PCSRSS_SCREEN_BUFFER Buff; - PUCHAR Buffer; - NTSTATUS Status; - int X, Y, Length; - UCHAR Attr; - SMALL_RECT UpdateRect; - PCSRSS_CONSOLE Console; - - DPRINT("CsrFillOutputAttrib\n"); - - Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, FillOutputAttribRequest->ConsoleHandle, &Buff, GENERIC_WRITE); - if (! NT_SUCCESS(Status)) - { - return Status; - } - Console = Buff->Header.Console; - - X = FillOutputAttribRequest->Coord.X; - Y = (FillOutputAttribRequest->Coord.Y + Buff->VirtualY) % Buff->MaxY; - Length = FillOutputAttribRequest->Length; - Attr = FillOutputAttribRequest->Attribute; - Buffer = &Buff->Buffer[(Y * Buff->MaxX * 2) + (X * 2) + 1]; - while (Length--) - { - *Buffer = Attr; - Buffer += 2; - if (++X == Buff->MaxX) - { - if (++Y == Buff->MaxY) - { - Y = 0; - Buffer = Buff->Buffer + 1; - } - X = 0; - } - } - - if (Buff == Console->ActiveBuffer) - { - ConioComputeUpdateRect(Buff, &UpdateRect, &FillOutputAttribRequest->Coord, - FillOutputAttribRequest->Length); - ConioDrawRegion(Console, &UpdateRect); - } - - ConioUnlockScreenBuffer(Buff); - +*/ return STATUS_SUCCESS; }
11 years, 11 months
1
0
0
0
[ekohl] 57733: [LSASRV] Create a security descriptor for the policy object and store as attribute "SecDesc".
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Nov 18 15:19:14 2012 New Revision: 57733 URL:
http://svn.reactos.org/svn/reactos?rev=57733&view=rev
Log: [LSASRV] Create a security descriptor for the policy object and store as attribute "SecDesc". Modified: trunk/reactos/dll/win32/lsasrv/database.c Modified: trunk/reactos/dll/win32/lsasrv/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/database.…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] Sun Nov 18 15:19:14 2012 @@ -234,6 +234,260 @@ static NTSTATUS +LsapCreatePolicySd(PSECURITY_DESCRIPTOR *PolicySd, + PULONG PolicySdSize) +{ + SECURITY_DESCRIPTOR AbsoluteSd; + PSECURITY_DESCRIPTOR RelativeSd = NULL; + ULONG RelativeSdSize = 0; + PSID AnonymousSid = NULL; + PSID AdministratorsSid = NULL; + PSID EveryoneSid = NULL; + PSID LocalServiceSid = NULL; + PSID NetworkServiceSid = NULL; + PSID LocalSystemSid = NULL; + PACL Dacl = NULL; + ULONG DaclSize; + NTSTATUS Status; + + if (PolicySd == NULL || PolicySdSize == NULL) + return STATUS_INVALID_PARAMETER; + + *PolicySd = NULL; + *PolicySdSize = 0; + + /* Initialize the SD */ + Status = RtlCreateSecurityDescriptor(&AbsoluteSd, + SECURITY_DESCRIPTOR_REVISION); + if (!NT_SUCCESS(Status)) + return Status; + + Status = RtlAllocateAndInitializeSid(&NtAuthority, + 1, + SECURITY_ANONYMOUS_LOGON_RID, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + &AnonymousSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAllocateAndInitializeSid(&NtAuthority, + 2, + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + 0, + 0, + 0, + 0, + 0, + 0, + &AdministratorsSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAllocateAndInitializeSid(&WorldSidAuthority, + 1, + SECURITY_WORLD_RID, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + &EveryoneSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAllocateAndInitializeSid(&NtAuthority, + 1, + SECURITY_LOCAL_SERVICE_RID, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + &LocalServiceSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAllocateAndInitializeSid(&NtAuthority, + 1, + SECURITY_NETWORK_SERVICE_RID, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + &NetworkServiceSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAllocateAndInitializeSid(&NtAuthority, + 1, + SECURITY_LOCAL_SYSTEM_RID, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + &LocalSystemSid); + if (!NT_SUCCESS(Status)) + goto done; + + /* Allocate and initialize the DACL */ + DaclSize = sizeof(ACL) + + sizeof(ACCESS_DENIED_ACE) - sizeof(ULONG) + RtlLengthSid(AnonymousSid) + + sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(AdministratorsSid) + + sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(EveryoneSid) + + sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(AnonymousSid) + + sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(LocalServiceSid) + + sizeof(ACCESS_ALLOWED_ACE) - sizeof(ULONG) + RtlLengthSid(NetworkServiceSid); + + Dacl = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + DaclSize); + if (Dacl == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + Status = RtlCreateAcl(Dacl, + DaclSize, + ACL_REVISION); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAddAccessDeniedAce(Dacl, + ACL_REVISION, + POLICY_LOOKUP_NAMES, + AnonymousSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + POLICY_ALL_ACCESS | POLICY_NOTIFICATION, + AdministratorsSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + POLICY_EXECUTE, + EveryoneSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + POLICY_LOOKUP_NAMES | POLICY_VIEW_LOCAL_INFORMATION, + AnonymousSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + POLICY_NOTIFICATION, + LocalServiceSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + POLICY_NOTIFICATION, + NetworkServiceSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlSetDaclSecurityDescriptor(&AbsoluteSd, + TRUE, + Dacl, + FALSE); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlSetGroupSecurityDescriptor(&AbsoluteSd, + LocalSystemSid, + FALSE); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlSetOwnerSecurityDescriptor(&AbsoluteSd, + AdministratorsSid, + FALSE); + if (!NT_SUCCESS(Status)) + goto done; + + Status = RtlAbsoluteToSelfRelativeSD(&AbsoluteSd, + RelativeSd, + &RelativeSdSize); + if (Status != STATUS_BUFFER_TOO_SMALL) + goto done; + + RelativeSd = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + RelativeSdSize); + if (RelativeSd == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + Status = RtlAbsoluteToSelfRelativeSD(&AbsoluteSd, + RelativeSd, + &RelativeSdSize); + if (!NT_SUCCESS(Status)) + goto done; + + *PolicySd = RelativeSd; + *PolicySdSize = RelativeSdSize; + +done: + if (Dacl != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, Dacl); + + if (AnonymousSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, AnonymousSid); + + if (AdministratorsSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, AdministratorsSid); + + if (EveryoneSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, EveryoneSid); + + if (LocalServiceSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, LocalServiceSid); + + if (NetworkServiceSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, NetworkServiceSid); + + if (LocalSystemSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, LocalSystemSid); + + if (!NT_SUCCESS(Status)) + { + if (RelativeSd != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, RelativeSd); + } + + return Status; +} + + +static NTSTATUS LsapCreateDatabaseObjects(VOID) { PLSAP_POLICY_AUDIT_EVENTS_DATA AuditEventsInfo = NULL; @@ -244,6 +498,8 @@ GUID DnsDomainGuid; PLSA_DB_OBJECT PolicyObject = NULL; PSID AccountDomainSid = NULL; + PSECURITY_DESCRIPTOR PolicySd = NULL; + ULONG PolicySdSize = 0; ULONG AuditEventsCount; ULONG AuditEventsSize; ULONG i; @@ -269,7 +525,7 @@ AuditEventsCount = AuditCategoryAccountLogon - AuditCategorySystem + 1; AuditEventsSize = sizeof(LSAP_POLICY_AUDIT_EVENTS_DATA) + AuditEventsCount * sizeof(DWORD); AuditEventsInfo = RtlAllocateHeap(RtlGetProcessHeap(), - 0, + HEAP_ZERO_MEMORY, AuditEventsSize); if (AuditEventsInfo == NULL) return STATUS_INSUFFICIENT_RESOURCES; @@ -288,6 +544,11 @@ /* Create a random domain SID */ Status = LsapCreateRandomDomainSid(&AccountDomainSid); + if (!NT_SUCCESS(Status)) + goto done; + + Status = LsapCreatePolicySd(&PolicySd, + &PolicySdSize); if (!NT_SUCCESS(Status)) goto done; @@ -369,6 +630,12 @@ &DnsDomainGuid, sizeof(GUID)); + /* Set the Sceurity Descriptor */ + LsapSetObjectAttribute(PolicyObject, + L"SecDesc", + PolicySd, + PolicySdSize); + done: if (AuditEventsInfo != NULL) RtlFreeHeap(RtlGetProcessHeap(), 0, AuditEventsInfo); @@ -378,6 +645,9 @@ if (AccountDomainSid != NULL) RtlFreeSid(AccountDomainSid); + + if (PolicySd != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, PolicySd); return Status; }
11 years, 11 months
1
0
0
0
[hbelusca] 57732: [CONSRV] CsrSetTextAttrib --> SrvSetConsoleTextAttribute and activate it in the list of APIs indices.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 18 14:30:25 2012 New Revision: 57732 URL:
http://svn.reactos.org/svn/reactos?rev=57732&view=rev
Log: [CONSRV] CsrSetTextAttrib --> SrvSetConsoleTextAttribute and activate it in the list of APIs indices. Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h branches/ros-csrss/win32ss/user/consrv/conoutput.c Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
============================================================================== --- branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original) +++ branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] Sun Nov 18 14:30:25 2012 @@ -46,7 +46,7 @@ ConsolepSetCursorInfo, // ConsolepSetWindowInfo, ConsolepScrollScreenBuffer, - // ConsolepSetTextAttribute, + ConsolepSetTextAttribute, // ConsolepSetFont, ConsolepSetIcon, ConsolepReadConsole, Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Nov 18 14:30:25 2012 @@ -1206,26 +1206,24 @@ return STATUS_SUCCESS; } -CSR_API(CsrSetTextAttrib) +CSR_API(SrvSetConsoleTextAttribute) { NTSTATUS Status; PCSRSS_SET_ATTRIB SetAttribRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetAttribRequest; PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; - DPRINT("CsrSetTextAttrib\n"); - - Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, SetAttribRequest->ConsoleHandle, &Buff, GENERIC_WRITE); - if (! NT_SUCCESS(Status)) - { - return Status; - } + DPRINT("SrvSetConsoleTextAttribute\n"); + + Status = ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), SetAttribRequest->ConsoleHandle, &Buff, GENERIC_WRITE); + if (!NT_SUCCESS(Status)) return Status; + Console = Buff->Header.Console; Buff->DefaultAttrib = SetAttribRequest->Attrib; if (Buff == Console->ActiveBuffer) { - if (! ConioUpdateScreenInfo(Console, Buff)) + if (!ConioUpdateScreenInfo(Console, Buff)) { ConioUnlockScreenBuffer(Buff); return STATUS_UNSUCCESSFUL;
11 years, 11 months
1
0
0
0
[hbelusca] 57731: [CONSRV] - Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure). - Do not forget to leave a critical section if we fail.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 18 14:21:21 2012 New Revision: 57731 URL:
http://svn.reactos.org/svn/reactos?rev=57731&view=rev
Log: [CONSRV] - Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure). - Do not forget to leave a critical section if we fail. Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Nov 18 14:21:21 2012 @@ -1239,23 +1239,24 @@ CSR_API(SrvCreateConsoleScreenBuffer) { + NTSTATUS Status; PCSRSS_CREATE_SCREEN_BUFFER CreateScreenBufferRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.CreateScreenBufferRequest; - PCSR_PROCESS ProcessData = CsrGetClientThread()->Process; + PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; - NTSTATUS Status; DPRINT("SrvCreateConsoleScreenBuffer\n"); RtlEnterCriticalSection(&ProcessData->HandleTableLock); + Status = ConioConsoleFromProcessData(ProcessData, &Console); - if (! NT_SUCCESS(Status)) - { + if (!NT_SUCCESS(Status)) + { + RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return Status; } Buff = HeapAlloc(ConSrvHeap, HEAP_ZERO_MEMORY, sizeof(CSRSS_SCREEN_BUFFER)); - if (Buff != NULL) { if (Console->ActiveBuffer) @@ -1298,7 +1299,9 @@ } ConioUnlockConsole(Console); + RtlLeaveCriticalSection(&ProcessData->HandleTableLock); + return Status; }
11 years, 11 months
1
0
0
0
[hbelusca] 57730: [CONSRV] Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure).
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 18 14:17:47 2012 New Revision: 57730 URL:
http://svn.reactos.org/svn/reactos?rev=57730&view=rev
Log: [CONSRV] Use the ConsoleGetPerProcessData macro (--> CONSOLE_PROCESS_DATA structure). Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Nov 18 14:17:47 2012 @@ -1302,7 +1302,7 @@ return Status; } -CSR_API(SrvGetConsoleScreenBufferInfo) // CsrGetScreenBufferInfo +CSR_API(SrvGetConsoleScreenBufferInfo) { NTSTATUS Status; PCSRSS_SCREEN_BUFFER_INFO ScreenBufferInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ScreenBufferInfoRequest; @@ -1312,11 +1312,9 @@ DPRINT("SrvGetConsoleScreenBufferInfo\n"); - Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, ScreenBufferInfoRequest->ConsoleHandle, &Buff, GENERIC_READ); - if (! NT_SUCCESS(Status)) - { - return Status; - } + Status = ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), ScreenBufferInfoRequest->ConsoleHandle, &Buff, GENERIC_READ); + if (!NT_SUCCESS(Status)) return Status; + Console = Buff->Header.Console; pInfo = &ScreenBufferInfoRequest->Info; pInfo->dwSize.X = Buff->MaxX; @@ -1344,11 +1342,9 @@ DPRINT("SrvSetConsoleActiveScreenBuffer\n"); - Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, SetScreenBufferRequest->OutputHandle, &Buff, GENERIC_WRITE); - if (! NT_SUCCESS(Status)) - { - return Status; - } + Status = ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), SetScreenBufferRequest->OutputHandle, &Buff, GENERIC_WRITE); + if (!NT_SUCCESS(Status)) return Status; + Console = Buff->Header.Console; if (Buff == Console->ActiveBuffer) @@ -1362,8 +1358,10 @@ { ConioDeleteScreenBuffer(Console->ActiveBuffer); } - /* tie console to new buffer */ + + /* Tie console to new buffer */ Console->ActiveBuffer = Buff; + /* Redraw the console */ ConioDrawConsole(Console); @@ -1397,11 +1395,9 @@ DestinationOrigin = ScrollConsoleScreenBufferRequest->DestinationOrigin; Fill = ScrollConsoleScreenBufferRequest->Fill; - Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, ConsoleHandle, &Buff, GENERIC_WRITE); - if (! NT_SUCCESS(Status)) - { - return Status; - } + Status = ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), ConsoleHandle, &Buff, GENERIC_WRITE); + if (!NT_SUCCESS(Status)) return Status; + Console = Buff->Header.Console; ScrollRectangle = ScrollConsoleScreenBufferRequest->ScrollRectangle; @@ -1470,17 +1466,12 @@ { NTSTATUS Status; PCSRSS_SET_SCREEN_BUFFER_SIZE SetScreenBufferSize = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetScreenBufferSize; - PCSRSS_CONSOLE Console; - PCSRSS_SCREEN_BUFFER Buff; - - Status = ConioLockScreenBuffer(CsrGetClientThread()->Process, SetScreenBufferSize->OutputHandle, &Buff, GENERIC_WRITE); - if (!NT_SUCCESS(Status)) - { - return Status; - } - Console = Buff->Header.Console; - - Status = ConioResizeBuffer(Console, Buff, SetScreenBufferSize->Size); + PCSRSS_SCREEN_BUFFER Buff; + + Status = ConioLockScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), SetScreenBufferSize->OutputHandle, &Buff, GENERIC_WRITE); + if (!NT_SUCCESS(Status)) return Status; + + Status = ConioResizeBuffer(Buff->Header.Console, Buff, SetScreenBufferSize->Size); ConioUnlockScreenBuffer(Buff); return Status;
11 years, 11 months
1
0
0
0
[hbelusca] 57729: [KERNEL32] Use new structures and api indices namings. [CONSRV] Use CsrValidateMessageBuffer instead of Win32CsrValidateBuffer.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 18 13:54:32 2012 New Revision: 57729 URL:
http://svn.reactos.org/svn/reactos?rev=57729&view=rev
Log: [KERNEL32] Use new structures and api indices namings. [CONSRV] Use CsrValidateMessageBuffer instead of Win32CsrValidateBuffer. Modified: branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c branches/ros-csrss/win32ss/user/consrv/coninput.c branches/ros-csrss/win32ss/user/consrv/conoutput.c Modified: branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/kernel32/cl…
============================================================================== --- branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] (original) +++ branches/ros-csrss/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] Sun Nov 18 13:54:32 2012 @@ -503,7 +503,8 @@ LPDWORD lpNumberOfEventsWritten, BOOL bUnicode) { - CSR_API_MESSAGE Request; + CONSOLE_API_MESSAGE ApiMessage; + PCSRSS_WRITE_CONSOLE_INPUT WriteConsoleInputRequest = &ApiMessage.Data.WriteConsoleInputRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; DWORD Size; @@ -515,8 +516,9 @@ Size = nLength * sizeof(INPUT_RECORD); + DPRINT("IntWriteConsoleInput: %lx %p\n", Size, lpNumberOfEventsWritten); + /* Allocate a Capture Buffer */ - DPRINT("IntWriteConsoleInput: %lx %p\n", Size, lpNumberOfEventsWritten); CaptureBuffer = CsrAllocateCaptureBuffer(1, Size); if (CaptureBuffer == NULL) { @@ -525,43 +527,47 @@ return FALSE; } - /* Allocate space in the Buffer */ + /* Capture the user buffer */ CsrCaptureMessageBuffer(CaptureBuffer, lpBuffer, Size, - (PVOID*)&Request.Data.WriteConsoleInputRequest.InputRecord); + (PVOID*)&WriteConsoleInputRequest->InputRecord); /* Set up the data to send to the Console Server */ - Request.Data.WriteConsoleInputRequest.ConsoleHandle = hConsoleInput; - Request.Data.WriteConsoleInputRequest.Unicode = bUnicode; - Request.Data.WriteConsoleInputRequest.Length = nLength; + WriteConsoleInputRequest->ConsoleHandle = hConsoleInput; + WriteConsoleInputRequest->Unicode = bUnicode; + WriteConsoleInputRequest->Length = nLength; /* Call the server */ - CsrClientCallServer(&Request, + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, CaptureBuffer, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, WRITE_CONSOLE_INPUT), - sizeof(CSR_API_MESSAGE)); - DPRINT("Server returned: %x\n", Request.Status); + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleInput), + sizeof(CSRSS_WRITE_CONSOLE_INPUT)); + DPRINT("Server returned: %x\n", ApiMessage.Status); /* Check for success*/ - if (NT_SUCCESS(Request.Status)) + if (NT_SUCCESS(ApiMessage.Status)) { /* Return the number of events read */ - DPRINT("Events read: %lx\n", Request.Data.WriteConsoleInputRequest.Length); - *lpNumberOfEventsWritten = Request.Data.WriteConsoleInputRequest.Length; + DPRINT("Events read: %lx\n", WriteConsoleInputRequest->Length); + + if (lpNumberOfEventsWritten != NULL) + *lpNumberOfEventsWritten = WriteConsoleInputRequest->Length; } else { + if (lpNumberOfEventsWritten != NULL) + *lpNumberOfEventsWritten = 0; + /* Error out */ - *lpNumberOfEventsWritten = 0; - BaseSetLastNTError(Request.Status); + BaseSetLastNTError(ApiMessage.Status); } /* Release the capture buffer */ CsrFreeCaptureBuffer(CaptureBuffer); /* Return TRUE or FALSE */ - return NT_SUCCESS(Request.Status); + return NT_SUCCESS(ApiMessage.Status); } @@ -574,14 +580,22 @@ PSMALL_RECT lpWriteRegion, BOOL bUnicode) { - CSR_API_MESSAGE Request; + CONSOLE_API_MESSAGE ApiMessage; + PCSRSS_WRITE_CONSOLE_OUTPUT WriteConsoleOutputRequest = &ApiMessage.Data.WriteConsoleOutputRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; ULONG Size; + if ((lpBuffer == NULL) || (lpWriteRegion == NULL)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + Size = dwBufferSize.Y * dwBufferSize.X * sizeof(CHAR_INFO); + DPRINT("IntWriteConsoleOutput: %lx %p\n", Size, lpWriteRegion); + /* Allocate a Capture Buffer */ - DPRINT("IntWriteConsoleOutput: %lx %p\n", Size, lpWriteRegion); CaptureBuffer = CsrAllocateCaptureBuffer(1, Size); if (CaptureBuffer == NULL) { @@ -590,45 +604,42 @@ return FALSE; } - /* Allocate space in the Buffer */ + /* Capture the user buffer */ CsrCaptureMessageBuffer(CaptureBuffer, - NULL, + (PVOID)lpBuffer, Size, - (PVOID*)&Request.Data.WriteConsoleOutputRequest.CharInfo); - - /* Copy from the buffer */ - RtlCopyMemory(Request.Data.WriteConsoleOutputRequest.CharInfo, lpBuffer, Size); + (PVOID*)&WriteConsoleOutputRequest->CharInfo); /* Set up the data to send to the Console Server */ - Request.Data.WriteConsoleOutputRequest.ConsoleHandle = hConsoleOutput; - Request.Data.WriteConsoleOutputRequest.Unicode = bUnicode; - Request.Data.WriteConsoleOutputRequest.BufferSize = dwBufferSize; - Request.Data.WriteConsoleOutputRequest.BufferCoord = dwBufferCoord; - Request.Data.WriteConsoleOutputRequest.WriteRegion = *lpWriteRegion; + WriteConsoleOutputRequest->ConsoleHandle = hConsoleOutput; + WriteConsoleOutputRequest->Unicode = bUnicode; + WriteConsoleOutputRequest->BufferSize = dwBufferSize; + WriteConsoleOutputRequest->BufferCoord = dwBufferCoord; + WriteConsoleOutputRequest->WriteRegion = *lpWriteRegion; /* Call the server */ - CsrClientCallServer(&Request, + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, CaptureBuffer, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, WRITE_CONSOLE_OUTPUT), - sizeof(CSR_API_MESSAGE)); - DPRINT("Server returned: %x\n", Request.Status); + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepWriteConsoleOutput), + sizeof(CSRSS_WRITE_CONSOLE_OUTPUT)); + DPRINT("Server returned: %x\n", ApiMessage.Status); /* Check for success*/ - if (!NT_SUCCESS(Request.Status)) + if (!NT_SUCCESS(ApiMessage.Status)) { /* Error out */ - BaseSetLastNTError(Request.Status); + BaseSetLastNTError(ApiMessage.Status); } /* Return the read region */ - DPRINT("read region: %lx\n", Request.Data.WriteConsoleOutputRequest.WriteRegion); - *lpWriteRegion = Request.Data.WriteConsoleOutputRequest.WriteRegion; + DPRINT("read region: %lx\n", WriteConsoleOutputRequest->WriteRegion); + *lpWriteRegion = WriteConsoleOutputRequest->WriteRegion; /* Release the capture buffer */ CsrFreeCaptureBuffer(CaptureBuffer); /* Return TRUE or FALSE */ - return NT_SUCCESS(Request.Status); + return NT_SUCCESS(ApiMessage.Status); } Modified: branches/ros-csrss/win32ss/user/consrv/coninput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/coninput.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/coninput.c [iso-8859-1] Sun Nov 18 13:54:32 2012 @@ -457,20 +457,27 @@ DPRINT("SrvWriteConsoleInput\n"); + if (!CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&WriteConsoleInputRequest->InputRecord, + WriteConsoleInputRequest->Length, + sizeof(INPUT_RECORD))) + { + return STATUS_INVALID_PARAMETER; + } + Status = ConioLockConsole(ProcessData, WriteConsoleInputRequest->ConsoleHandle, &Console, GENERIC_WRITE); - if (! NT_SUCCESS(Status)) - { - return Status; - } + if (!NT_SUCCESS(Status)) return Status; InputRecord = WriteConsoleInputRequest->InputRecord; Length = WriteConsoleInputRequest->Length; +/* if (!Win32CsrValidateBuffer(ProcessData->Process, InputRecord, Length, sizeof(INPUT_RECORD))) { ConioUnlockConsole(Console); return STATUS_ACCESS_VIOLATION; } +*/ for (i = 0; i < Length && NT_SUCCESS(Status); i++) { @@ -482,6 +489,7 @@ &InputRecord->Event.KeyEvent.uChar.UnicodeChar, &AsciiChar); } + Status = ConioProcessChar(Console, InputRecord++); } Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Nov 18 13:54:32 2012 @@ -453,18 +453,22 @@ DPRINT("SrvReadConsoleOutput\n"); + if (!CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&ReadConsoleOutputRequest->CharInfo, + BufferSize.X * BufferSize.Y, + sizeof(CHAR_INFO))) + { + return STATUS_INVALID_PARAMETER; + } + + Status = ConioLockScreenBuffer(ProcessData, ReadConsoleOutputRequest->ConsoleHandle, &Buff, GENERIC_READ); + if (!NT_SUCCESS(Status)) return Status; + CharInfo = ReadConsoleOutputRequest->CharInfo; ReadRegion = ReadConsoleOutputRequest->ReadRegion; BufferSize = ReadConsoleOutputRequest->BufferSize; BufferCoord = ReadConsoleOutputRequest->BufferCoord; - if (!CsrValidateMessageBuffer(ApiMessage, - (PVOID*)&ReadConsoleOutputRequest->CharInfo, - BufferSize.X * BufferSize.Y, - sizeof(CHAR_INFO))) - { - return STATUS_INVALID_PARAMETER; - } /* if (!Win32CsrValidateBuffer(ProcessData->Process, CharInfo, BufferSize.X * BufferSize.Y, sizeof(CHAR_INFO))) @@ -473,9 +477,6 @@ return STATUS_ACCESS_VIOLATION; } */ - - Status = ConioLockScreenBuffer(ProcessData, ReadConsoleOutputRequest->ConsoleHandle, &Buff, GENERIC_READ); - if (!NT_SUCCESS(Status)) return Status; /* FIXME: Is this correct? */ CodePage = ProcessData->Console->OutputCodePage; @@ -613,8 +614,8 @@ CSR_API(SrvWriteConsoleOutput) { PCSRSS_WRITE_CONSOLE_OUTPUT WriteConsoleOutputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteConsoleOutputRequest; + PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); SHORT i, X, Y, SizeX, SizeY; - PCSR_PROCESS ProcessData = CsrGetClientThread()->Process; PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; SMALL_RECT ScreenBuffer; @@ -628,25 +629,35 @@ DPRINT("SrvWriteConsoleOutput\n"); + if (!CsrValidateMessageBuffer(ApiMessage, + (PVOID*)&WriteConsoleOutputRequest->CharInfo, + BufferSize.X * BufferSize.Y, + sizeof(CHAR_INFO))) + { + return STATUS_INVALID_PARAMETER; + } + Status = ConioLockScreenBuffer(ProcessData, WriteConsoleOutputRequest->ConsoleHandle, &Buff, GENERIC_WRITE); - if (! NT_SUCCESS(Status)) - { - return Status; - } + if (!NT_SUCCESS(Status)) return Status; + Console = Buff->Header.Console; BufferSize = WriteConsoleOutputRequest->BufferSize; BufferCoord = WriteConsoleOutputRequest->BufferCoord; CharInfo = WriteConsoleOutputRequest->CharInfo; - if (!Win32CsrValidateBuffer(ProcessData, CharInfo, + +/* + if (!Win32CsrValidateBuffer(ProcessData->Process, CharInfo, BufferSize.X * BufferSize.Y, sizeof(CHAR_INFO))) { ConioUnlockScreenBuffer(Buff); return STATUS_ACCESS_VIOLATION; } +*/ + WriteRegion = WriteConsoleOutputRequest->WriteRegion; SizeY = min(BufferSize.Y - BufferCoord.Y, ConioRectHeight(&WriteRegion)); @@ -656,7 +667,7 @@ /* Make sure WriteRegion is inside the screen buffer */ ConioInitRect(&ScreenBuffer, 0, 0, Buff->MaxY - 1, Buff->MaxX - 1); - if (! ConioGetIntersection(&WriteRegion, &ScreenBuffer, &WriteRegion)) + if (!ConioGetIntersection(&WriteRegion, &ScreenBuffer, &WriteRegion)) { ConioUnlockScreenBuffer(Buff);
11 years, 11 months
1
0
0
0
[hbelusca] 57728: [CONSRV] Fix a DPRINT.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 18 13:16:58 2012 New Revision: 57728 URL:
http://svn.reactos.org/svn/reactos?rev=57728&view=rev
Log: [CONSRV] Fix a DPRINT. Modified: branches/ros-csrss/win32ss/user/consrv/console.c Modified: branches/ros-csrss/win32ss/user/consrv/console.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] Sun Nov 18 13:16:58 2012 @@ -62,7 +62,7 @@ { HANDLE Thread; - DPRINT("ConioConsoleCtrlEvent Parent pProcessIds = %x\n", ProcessData->Process->ClientId.UniqueProcess); + DPRINT("ConioConsoleCtrlEvent Parent ProcessId = %x\n", ProcessData->Process->ClientId.UniqueProcess); if (ProcessData->CtrlDispatcher) {
11 years, 11 months
1
0
0
0
[hbelusca] 57727: [KERNEL32/CONSRV] - Use new structures and api indices namings (as usual). [CONSRV] - Merge CSRSS_SET_TITLE and CSRSS_GET_TITLE into CSRSS_CONSOLE_TITLE. - Merge CSRSS_GET_CONSOLE...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 18 13:10:03 2012 New Revision: 57727 URL:
http://svn.reactos.org/svn/reactos?rev=57727&view=rev
Log: [KERNEL32/CONSRV] - Use new structures and api indices namings (as usual). [CONSRV] - Merge CSRSS_SET_TITLE and CSRSS_GET_TITLE into CSRSS_CONSOLE_TITLE. - Merge CSRSS_GET_CONSOLE_(OUTPUT_)CP and CSRSS_SET_CONSOLE_(OUTPUT_)CP into CSRSS_CONSOLE_CP. - NtDuplicateObject(GetCurrentProcess(), ... ---> NtDuplicateObject(NtCurrentProcess(), ... - Use CsrValidateMessageBuffer instead of Win32CsrValidateBuffer. - Use CONSOLE_PROCESS_DATA structure. TODO: Remove a DPRINT1 checkpoint in SrvAllocConsole after future tests are OK. Modified: branches/ros-csrss/dll/win32/kernel32/client/console/console.c branches/ros-csrss/include/reactos/subsys/win/conmsg.h branches/ros-csrss/win32ss/user/consrv/conoutput.c branches/ros-csrss/win32ss/user/consrv/console.c Modified: branches/ros-csrss/dll/win32/kernel32/client/console/console.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/kernel32/cl…
============================================================================== --- branches/ros-csrss/dll/win32/kernel32/client/console/console.c [iso-8859-1] (original) +++ branches/ros-csrss/dll/win32/kernel32/client/console/console.c [iso-8859-1] Sun Nov 18 13:10:03 2012 @@ -1448,8 +1448,8 @@ GenerateConsoleCtrlEvent(DWORD dwCtrlEvent, DWORD dwProcessGroupId) { - CSR_API_MESSAGE Request; - NTSTATUS Status; + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; if (dwCtrlEvent != CTRL_C_EVENT && dwCtrlEvent != CTRL_BREAK_EVENT) { @@ -1457,14 +1457,14 @@ return FALSE; } - Request.Data.GenerateCtrlEvent.Event = dwCtrlEvent; - Request.Data.GenerateCtrlEvent.ProcessGroup = dwProcessGroupId; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GENERATE_CTRL_EVENT), - sizeof(CSR_API_MESSAGE)); - if(!NT_SUCCESS(Status) || !(NT_SUCCESS(Status = Request.Status))) + ApiMessage.Data.GenerateCtrlEvent.Event = dwCtrlEvent; + ApiMessage.Data.GenerateCtrlEvent.ProcessGroup = dwProcessGroupId; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGenerateCtrlEvent), + sizeof(CSRSS_GENERATE_CTRL_EVENT)); + if(!NT_SUCCESS(Status) || !(NT_SUCCESS(Status = ApiMessage.Status))) { BaseSetLastNTError(Status); return FALSE; @@ -1477,15 +1477,16 @@ static DWORD IntGetConsoleTitle(LPVOID lpConsoleTitle, DWORD nSize, BOOL bUnicode) { - CSR_API_MESSAGE Request; + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + PCSRSS_CONSOLE_TITLE TitleRequest = &ApiMessage.Data.TitleRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; - NTSTATUS Status; if (nSize == 0) return 0; - Request.Data.GetTitleRequest.Length = nSize * (bUnicode ? 1 : sizeof(WCHAR)); - CaptureBuffer = CsrAllocateCaptureBuffer(1, Request.Data.GetTitleRequest.Length); + TitleRequest->Length = nSize * (bUnicode ? 1 : sizeof(WCHAR)); + CaptureBuffer = CsrAllocateCaptureBuffer(1, TitleRequest->Length); if (CaptureBuffer == NULL) { DPRINT1("CsrAllocateCaptureBuffer failed!\n"); @@ -1494,14 +1495,14 @@ } CsrAllocateMessagePointer(CaptureBuffer, - Request.Data.GetTitleRequest.Length, - (PVOID*)&Request.Data.GetTitleRequest.Title); - - Status = CsrClientCallServer(&Request, + TitleRequest->Length, + (PVOID*)&TitleRequest->Title); + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, CaptureBuffer, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GET_TITLE), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !(NT_SUCCESS(Status = Request.Status))) + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetTitle), + sizeof(CSRSS_CONSOLE_TITLE)); + if (!NT_SUCCESS(Status) || !(NT_SUCCESS(Status = ApiMessage.Status))) { CsrFreeCaptureBuffer(CaptureBuffer); BaseSetLastNTError(Status); @@ -1511,14 +1512,14 @@ if (bUnicode) { if (nSize >= sizeof(WCHAR)) - wcscpy((LPWSTR)lpConsoleTitle, Request.Data.GetTitleRequest.Title); + wcscpy((LPWSTR)lpConsoleTitle, TitleRequest->Title); } else { - if (nSize < Request.Data.GetTitleRequest.Length / sizeof(WCHAR) || + if (nSize < TitleRequest->Length / sizeof(WCHAR) || !WideCharToMultiByte(CP_ACP, // ANSI code page 0, // performance and mapping flags - Request.Data.GetTitleRequest.Title, // address of wide-character string + TitleRequest->Title, // address of wide-character string -1, // number of characters in string (LPSTR)lpConsoleTitle, // address of buffer for new string nSize, // size of buffer @@ -1527,13 +1528,14 @@ { /* Yes, if the buffer isn't big enough, it returns 0... Bad API */ *(LPSTR)lpConsoleTitle = '\0'; - Request.Data.GetTitleRequest.Length = 0; + TitleRequest->Length = 0; } } CsrFreeCaptureBuffer(CaptureBuffer); - return Request.Data.GetTitleRequest.Length / sizeof(WCHAR); -} + return TitleRequest->Length / sizeof(WCHAR); +} + /*-------------------------------------------------------------- * GetConsoleTitleW @@ -1548,6 +1550,7 @@ return IntGetConsoleTitle(lpConsoleTitle, nSize, TRUE); } + /*-------------------------------------------------------------- * GetConsoleTitleA * @@ -1571,13 +1574,14 @@ WINAPI SetConsoleTitleW(LPCWSTR lpConsoleTitle) { - CSR_API_MESSAGE Request; + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + PCSRSS_CONSOLE_TITLE TitleRequest = &ApiMessage.Data.TitleRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; - NTSTATUS Status; - - Request.Data.SetTitleRequest.Length = wcslen(lpConsoleTitle) * sizeof(WCHAR); - - CaptureBuffer = CsrAllocateCaptureBuffer(1, Request.Data.SetTitleRequest.Length); + + TitleRequest->Length = wcslen(lpConsoleTitle) * sizeof(WCHAR); + + CaptureBuffer = CsrAllocateCaptureBuffer(1, TitleRequest->Length); if (CaptureBuffer == NULL) { DPRINT1("CsrAllocateCaptureBuffer failed!\n"); @@ -1587,17 +1591,17 @@ CsrCaptureMessageBuffer(CaptureBuffer, (PVOID)lpConsoleTitle, - Request.Data.SetTitleRequest.Length, - (PVOID*)&Request.Data.SetTitleRequest.Title); - - Status = CsrClientCallServer(&Request, + TitleRequest->Length, + (PVOID*)&TitleRequest->Title); + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, CaptureBuffer, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SET_TITLE), - sizeof(CSR_API_MESSAGE)); + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetTitle), + sizeof(CSRSS_CONSOLE_TITLE)); CsrFreeCaptureBuffer(CaptureBuffer); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; @@ -1683,73 +1687,81 @@ WINAPI GetConsoleCP(VOID) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GET_CONSOLE_CP), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + /* Get the Input Code Page */ + ApiMessage.Data.ConsoleCPRequest.InputCP = TRUE; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCP), + sizeof(CSRSS_CONSOLE_CP)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) + { + BaseSetLastNTError(Status); + return 0; + } + + return ApiMessage.Data.ConsoleCPRequest.CodePage; +} + + +/*-------------------------------------------------------------- + * SetConsoleCP + * + * @implemented + */ +BOOL +WINAPI +SetConsoleCP(UINT wCodePageID) +{ + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + /* Set the Input Code Page */ + ApiMessage.Data.ConsoleCPRequest.InputCP = TRUE; + ApiMessage.Data.ConsoleCPRequest.CodePage = wCodePageID; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCP), + sizeof(CSRSS_CONSOLE_CP)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) + { + BaseSetLastNTError(Status); + } + + return NT_SUCCESS(Status); +} + + +/*-------------------------------------------------------------- + * GetConsoleOutputCP + * + * @implemented + */ +UINT +WINAPI +GetConsoleOutputCP(VOID) +{ + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + /* Get the Output Code Page */ + ApiMessage.Data.ConsoleCPRequest.InputCP = FALSE; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCP), + sizeof(CSRSS_CONSOLE_CP)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError (Status); return 0; } - return Request.Data.GetConsoleCodePage.CodePage; -} - - -/*-------------------------------------------------------------- - * SetConsoleCP - * - * @implemented - */ -BOOL -WINAPI -SetConsoleCP(UINT wCodePageID) -{ - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.SetConsoleCodePage.CodePage = wCodePageID; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SET_CONSOLE_CP), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - BaseSetLastNTError(Status); - } - - return NT_SUCCESS(Status); -} - - -/*-------------------------------------------------------------- - * GetConsoleOutputCP - * - * @implemented - */ -UINT -WINAPI -GetConsoleOutputCP(VOID) -{ - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GET_CONSOLE_OUTPUT_CP), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - BaseSetLastNTError (Status); - return 0; - } - - return Request.Data.GetConsoleOutputCodePage.CodePage; + return ApiMessage.Data.ConsoleCPRequest.CodePage; } @@ -1762,16 +1774,18 @@ WINAPI SetConsoleOutputCP(UINT wCodePageID) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.SetConsoleOutputCodePage.CodePage = wCodePageID; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SET_CONSOLE_OUTPUT_CP), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + /* Set the Output Code Page */ + ApiMessage.Data.ConsoleCPRequest.InputCP = FALSE; + ApiMessage.Data.ConsoleCPRequest.CodePage = wCodePageID; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCP), + sizeof(CSRSS_CONSOLE_CP)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); } @@ -1790,10 +1804,11 @@ GetConsoleProcessList(LPDWORD lpdwProcessList, DWORD dwProcessCount) { + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + PCSRSS_GET_PROCESS_LIST GetProcessListRequest = &ApiMessage.Data.GetProcessListRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; - CSR_API_MESSAGE Request; ULONG nProcesses; - NTSTATUS Status; if (lpdwProcessList == NULL || dwProcessCount == 0) { @@ -1809,26 +1824,27 @@ return FALSE; } - Request.Data.GetProcessListRequest.nMaxIds = dwProcessCount; + GetProcessListRequest->nMaxIds = dwProcessCount; + CsrAllocateMessagePointer(CaptureBuffer, dwProcessCount * sizeof(DWORD), - (PVOID*)&Request.Data.GetProcessListRequest.ProcessId); - - Status = CsrClientCallServer(&Request, + (PVOID*)&GetProcessListRequest->pProcessIds); + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, CaptureBuffer, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GET_PROCESS_LIST), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetProcessList), + sizeof(CSRSS_GET_PROCESS_LIST)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError (Status); nProcesses = 0; } else { - nProcesses = Request.Data.GetProcessListRequest.nProcessIdsTotal; + nProcesses = GetProcessListRequest->nProcessIdsTotal; if (dwProcessCount >= nProcesses) { - memcpy(lpdwProcessList, Request.Data.GetProcessListRequest.ProcessId, nProcesses * sizeof(DWORD)); + memcpy(lpdwProcessList, GetProcessListRequest->pProcessIds, nProcesses * sizeof(DWORD)); } } @@ -2136,7 +2152,7 @@ BOOL WINAPI -RegisterConsoleIME(HWND hWnd, LPDWORD ThreadId) +SetConsoleCursorMode(HANDLE hConsole, BOOL Unknown1, BOOL Unknown2) { STUB; return FALSE; @@ -2144,7 +2160,7 @@ BOOL WINAPI -RegisterConsoleOS2(BOOL bUnknown) +SetConsoleLocalEUDC(DWORD Unknown1, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4) { STUB; return FALSE; @@ -2152,7 +2168,7 @@ BOOL WINAPI -SetConsoleCursorMode(HANDLE hConsole, BOOL Unknown1, BOOL Unknown2) +SetConsoleNlsMode(HANDLE hConsole, DWORD dwMode) { STUB; return FALSE; @@ -2160,7 +2176,7 @@ BOOL WINAPI -SetConsoleLocalEUDC(DWORD Unknown1, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4) +RegisterConsoleIME(HWND hWnd, LPDWORD ThreadId) { STUB; return FALSE; @@ -2168,7 +2184,7 @@ BOOL WINAPI -SetConsoleNlsMode(HANDLE hConsole, DWORD dwMode) +RegisterConsoleOS2(BOOL bUnknown) { STUB; return FALSE; Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
============================================================================== --- branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original) +++ branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] Sun Nov 18 13:10:03 2012 @@ -126,7 +126,7 @@ typedef struct { USHORT nMaxIds; - PDWORD ProcessId; + PDWORD pProcessIds; ULONG nProcessIdsTotal; } CSRSS_GET_PROCESS_LIST, *PCSRSS_GET_PROCESS_LIST; @@ -260,13 +260,7 @@ { DWORD Length; PWCHAR Title; -} CSRSS_SET_TITLE, *PCSRSS_SET_TITLE; - -typedef struct -{ - DWORD Length; - PWCHAR Title; -} CSRSS_GET_TITLE, *PCSRSS_GET_TITLE; +} CSRSS_CONSOLE_TITLE, *PCSRSS_CONSOLE_TITLE; typedef struct { @@ -540,23 +534,9 @@ typedef struct { + BOOL InputCP; // TRUE : Input Code Page ; FALSE : Output Code Page UINT CodePage; -} CSRSS_GET_CONSOLE_CP, *PCSRSS_GET_CONSOLE_CP; - -typedef struct -{ - UINT CodePage; -} CSRSS_SET_CONSOLE_CP, *PCSRSS_SET_CONSOLE_CP; - -typedef struct -{ - UINT CodePage; -} CSRSS_GET_CONSOLE_OUTPUT_CP, *PCSRSS_GET_CONSOLE_OUTPUT_CP; - -typedef struct -{ - UINT CodePage; -} CSRSS_SET_CONSOLE_OUTPUT_CP, *PCSRSS_SET_CONSOLE_OUTPUT_CP; +} CSRSS_CONSOLE_CP, *PCSRSS_CONSOLE_CP; typedef struct _CONSOLE_API_MESSAGE { @@ -597,8 +577,7 @@ CSRSS_CONSOLE_HW_STATE ConsoleHardwareStateRequest; /* Console window */ - CSRSS_SET_TITLE SetTitleRequest; - CSRSS_GET_TITLE GetTitleRequest; + CSRSS_CONSOLE_TITLE TitleRequest; CSRSS_GET_CONSOLE_WINDOW GetConsoleWindowRequest; CSRSS_SET_CONSOLE_ICON SetConsoleIconRequest; @@ -636,11 +615,8 @@ CSRSS_GENERATE_CTRL_EVENT GenerateCtrlEvent; CSRSS_GET_NUM_INPUT_EVENTS GetNumInputEventsRequest; - /* CodePage */ - CSRSS_GET_CONSOLE_CP GetConsoleCodePage; - CSRSS_SET_CONSOLE_CP SetConsoleCodePage; - CSRSS_GET_CONSOLE_OUTPUT_CP GetConsoleOutputCodePage; - CSRSS_SET_CONSOLE_OUTPUT_CP SetConsoleOutputCodePage; + /* Input and Output Code Pages */ + CSRSS_CONSOLE_CP ConsoleCPRequest; CSRSS_GET_PROCESS_LIST GetProcessListRequest; } Data; Modified: branches/ros-csrss/win32ss/user/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/conoutput.c [iso-8859-1] Sun Nov 18 13:10:03 2012 @@ -556,7 +556,7 @@ if (Console->UnpauseEvent) { - Status = NtDuplicateObject(GetCurrentProcess(), Console->UnpauseEvent, + Status = NtDuplicateObject(NtCurrentProcess(), Console->UnpauseEvent, ProcessData->ProcessHandle, &WriteConsoleRequest->UnpauseEvent, SYNCHRONIZE, 0, 0); ConioUnlockScreenBuffer(Buff); Modified: branches/ros-csrss/win32ss/user/consrv/console.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/c…
============================================================================== --- branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] (original) +++ branches/ros-csrss/win32ss/user/consrv/console.c [iso-8859-1] Sun Nov 18 13:10:03 2012 @@ -62,7 +62,7 @@ { HANDLE Thread; - DPRINT("ConioConsoleCtrlEvent Parent ProcessId = %x\n", ProcessData->Process->ClientId.UniqueProcess); + DPRINT("ConioConsoleCtrlEvent Parent pProcessIds = %x\n", ProcessData->Process->ClientId.UniqueProcess); if (ProcessData->CtrlDispatcher) { @@ -250,15 +250,16 @@ CSR_API(SrvAllocConsole) { + NTSTATUS Status = STATUS_SUCCESS; PCSRSS_ALLOC_CONSOLE AllocConsoleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.AllocConsoleRequest; - PCSR_PROCESS ProcessData = CsrGetClientThread()->Process; - PCSRSS_CONSOLE Console; - NTSTATUS Status = STATUS_SUCCESS; + PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); + PCSRSS_CONSOLE Console; BOOLEAN NewConsole = FALSE; DPRINT("SrvAllocConsole\n"); RtlEnterCriticalSection(&ProcessData->HandleTableLock); + if (ProcessData->Console) { DPRINT1("Process already has a console\n"); @@ -266,6 +267,8 @@ return STATUS_INVALID_PARAMETER; } + DPRINT1("SrvAllocConsole - Checkpoint 1\n"); + /* If we don't need a console, then get out of here */ if (!AllocConsoleRequest->ConsoleNeeded) { @@ -276,7 +279,7 @@ /* If we already have one, then don't create a new one... */ if (!AllocConsoleRequest->Console || - AllocConsoleRequest->Console != ProcessData->ParentConsole) + AllocConsoleRequest->Console != ProcessData->ParentConsole) { /* Allocate a console structure */ NewConsole = TRUE; @@ -287,10 +290,13 @@ RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return STATUS_NO_MEMORY; } - /* initialize list head */ + + /* Initialize list head */ InitializeListHead(&Console->ProcessList); - /* insert process data required for GUI initialization */ + + /* Insert process data required for GUI initialization */ InsertHeadList(&Console->ProcessList, &ProcessData->ConsoleLink); + /* Initialize the Console */ Status = CsrInitConsole(Console, AllocConsoleRequest->ShowCmd); if (!NT_SUCCESS(Status)) @@ -329,7 +335,7 @@ { DPRINT1("Failed to insert object\n"); ConioDeleteConsole((Object_t *) Console); - ProcessData->Console = 0; + ProcessData->Console = NULL; RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return Status; } @@ -346,22 +352,21 @@ ConioDeleteConsole((Object_t *) Console); Win32CsrReleaseObject(ProcessData, AllocConsoleRequest->InputHandle); - ProcessData->Console = 0; + ProcessData->Console = NULL; RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return Status; } } /* Duplicate the Event */ - if (!DuplicateHandle(GetCurrentProcess(), - ProcessData->Console->ActiveEvent, - ProcessData->ProcessHandle, - &ProcessData->ConsoleEvent, - EVENT_ALL_ACCESS, - FALSE, - 0)) - { - DPRINT1("DuplicateHandle() failed: %lu\n", GetLastError()); + Status = NtDuplicateObject(NtCurrentProcess(), + ProcessData->Console->ActiveEvent, + ProcessData->Process->ProcessHandle, + &ProcessData->ConsoleEvent, + EVENT_ALL_ACCESS, 0, 0); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtDuplicateObject() failed: %lu\n", Status); ConioDeleteConsole((Object_t *) Console); if (NewConsole || !ProcessData->bInheritHandles) { @@ -370,7 +375,7 @@ Win32CsrReleaseObject(ProcessData, AllocConsoleRequest->InputHandle); } - ProcessData->Console = 0; + ProcessData->Console = NULL; RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return Status; } @@ -531,31 +536,41 @@ CSR_API(SrvSetConsoleTitle) { NTSTATUS Status; - PCSRSS_SET_TITLE SetTitleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetTitleRequest; - PCSR_PROCESS ProcessData = CsrGetClientThread()->Process; + PCSRSS_CONSOLE_TITLE TitleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.TitleRequest; + // PCSR_PROCESS Process = CsrGetClientThread()->Process; PCSRSS_CONSOLE Console; PWCHAR Buffer; DPRINT("SrvSetConsoleTitle\n"); - if (!Win32CsrValidateBuffer(ProcessData, SetTitleRequest->Title, - SetTitleRequest->Length, 1)) + if (!CsrValidateMessageBuffer(ApiMessage, + (PVOID)&TitleRequest->Title, + TitleRequest->Length, + sizeof(BYTE))) + { + return STATUS_INVALID_PARAMETER; + } +/* + if (!Win32CsrValidateBuffer(Process, TitleRequest->Title, + TitleRequest->Length, 1)) { return STATUS_ACCESS_VIOLATION; } - - Status = ConioConsoleFromProcessData(ProcessData, &Console); +*/ + + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); if(NT_SUCCESS(Status)) { - Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, SetTitleRequest->Length); + Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, TitleRequest->Length); if (Buffer) { - /* copy title to console */ + /* Copy title to console */ RtlFreeUnicodeString(&Console->Title); Console->Title.Buffer = Buffer; - Console->Title.Length = Console->Title.MaximumLength = SetTitleRequest->Length; - memcpy(Console->Title.Buffer, SetTitleRequest->Title, Console->Title.Length); - if (! ConioChangeTitle(Console)) + Console->Title.Length = Console->Title.MaximumLength = TitleRequest->Length; + memcpy(Console->Title.Buffer, TitleRequest->Title, Console->Title.Length); + + if (!ConioChangeTitle(Console)) { Status = STATUS_UNSUCCESSFUL; } @@ -568,6 +583,7 @@ { Status = STATUS_NO_MEMORY; } + ConioUnlockConsole(Console); } @@ -577,35 +593,44 @@ CSR_API(SrvGetConsoleTitle) { NTSTATUS Status; - PCSRSS_GET_TITLE GetTitleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetTitleRequest; - PCSR_PROCESS ProcessData = CsrGetClientThread()->Process; + PCSRSS_CONSOLE_TITLE TitleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.TitleRequest; + // PCSR_PROCESS Process = CsrGetClientThread()->Process; PCSRSS_CONSOLE Console; DWORD Length; DPRINT("SrvGetConsoleTitle\n"); - if (!Win32CsrValidateBuffer(ProcessData, GetTitleRequest->Title, - GetTitleRequest->Length, 1)) + if (!CsrValidateMessageBuffer(ApiMessage, + (PVOID)&TitleRequest->Title, + TitleRequest->Length, + sizeof(BYTE))) + { + return STATUS_INVALID_PARAMETER; + } +/* + if (!Win32CsrValidateBuffer(Process, TitleRequest->Title, + TitleRequest->Length, 1)) { return STATUS_ACCESS_VIOLATION; } - - Status = ConioConsoleFromProcessData(ProcessData, &Console); - if (! NT_SUCCESS(Status)) +*/ + + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); + if (!NT_SUCCESS(Status)) { DPRINT1("Can't get console\n"); return Status; } /* Copy title of the console to the user title buffer */ - if (GetTitleRequest->Length >= sizeof(WCHAR)) - { - Length = min(GetTitleRequest->Length - sizeof(WCHAR), Console->Title.Length); - memcpy(GetTitleRequest->Title, Console->Title.Buffer, Length); - GetTitleRequest->Title[Length / sizeof(WCHAR)] = L'\0'; - } - - GetTitleRequest->Length = Console->Title.Length; + if (TitleRequest->Length >= sizeof(WCHAR)) + { + Length = min(TitleRequest->Length - sizeof(WCHAR), Console->Title.Length); + memcpy(TitleRequest->Title, Console->Title.Buffer, Length); + TitleRequest->Title[Length / sizeof(WCHAR)] = L'\0'; + } + + TitleRequest->Length = Console->Title.Length; ConioUnlockConsole(Console); return STATUS_SUCCESS; @@ -699,17 +724,14 @@ CSR_API(SrvGetConsoleWindow) { + NTSTATUS Status; PCSRSS_GET_CONSOLE_WINDOW GetConsoleWindowRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleWindowRequest; PCSRSS_CONSOLE Console; - NTSTATUS Status; DPRINT("SrvGetConsoleWindow\n"); - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); + if (!NT_SUCCESS(Status)) return Status; GetConsoleWindowRequest->WindowHandle = Console->hWindow; ConioUnlockConsole(Console); @@ -719,20 +741,19 @@ CSR_API(SrvSetConsoleIcon) { + NTSTATUS Status; PCSRSS_SET_CONSOLE_ICON SetConsoleIconRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetConsoleIconRequest; PCSRSS_CONSOLE Console; - NTSTATUS Status; DPRINT("SrvSetConsoleIcon\n"); - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); + if (!NT_SUCCESS(Status)) return Status; Status = (ConioChangeIcon(Console, SetConsoleIconRequest->WindowIcon) - ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); + ? STATUS_SUCCESS + : STATUS_UNSUCCESSFUL); + ConioUnlockConsole(Console); return Status; @@ -740,59 +761,41 @@ CSR_API(SrvGetConsoleCP) { - PCSRSS_GET_CONSOLE_CP GetConsoleCodePage = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleCodePage; - PCSRSS_CONSOLE Console; - NTSTATUS Status; - - DPRINT("SrvGetConsoleCP\n"); - - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } - - GetConsoleCodePage->CodePage = Console->CodePage; + NTSTATUS Status; + PCSRSS_CONSOLE_CP ConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleCPRequest; + PCSRSS_CONSOLE Console; + + DPRINT("SrvGetConsoleCP, getting %s Code Page\n", + ConsoleCPRequest->InputCP ? "Input" : "Output"); + + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); + if (!NT_SUCCESS(Status)) return Status; + + ConsoleCPRequest->CodePage = (ConsoleCPRequest->InputCP ? Console->CodePage + : Console->OutputCodePage); ConioUnlockConsole(Console); return STATUS_SUCCESS; } -CSR_API(CsrGetConsoleOutputCodePage) // TODO: Merge this function with the other one. -{ - PCSRSS_GET_CONSOLE_OUTPUT_CP GetConsoleOutputCodePage = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleOutputCodePage; - PCSRSS_CONSOLE Console; - NTSTATUS Status; - - DPRINT("CsrGetConsoleOutputCodePage\n"); - - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } - - GetConsoleOutputCodePage->CodePage = Console->OutputCodePage; - ConioUnlockConsole(Console); - return STATUS_SUCCESS; -} - CSR_API(SrvSetConsoleCP) { - PCSRSS_SET_CONSOLE_CP SetConsoleCodePage = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetConsoleCodePage; - PCSRSS_CONSOLE Console; - NTSTATUS Status; - - DPRINT("SrvSetConsoleCP\n"); - - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } - - if (IsValidCodePage(SetConsoleCodePage->CodePage)) - { - Console->CodePage = SetConsoleCodePage->CodePage; + NTSTATUS Status; + PCSRSS_CONSOLE_CP ConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleCPRequest; + PCSRSS_CONSOLE Console; + + DPRINT("SrvSetConsoleCP, setting %s Code Page\n", + ConsoleCPRequest->InputCP ? "Input" : "Output"); + + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); + if (!NT_SUCCESS(Status)) return Status; + + if (IsValidCodePage(ConsoleCPRequest->CodePage)) + { + if (ConsoleCPRequest->InputCP) + Console->CodePage = ConsoleCPRequest->CodePage; + else + Console->OutputCodePage = ConsoleCPRequest->CodePage; + ConioUnlockConsole(Console); return STATUS_SUCCESS; } @@ -801,62 +804,45 @@ return STATUS_INVALID_PARAMETER; } -CSR_API(CsrSetConsoleOutputCodePage) // TODO: Merge this function with the other one. -{ - PCSRSS_SET_CONSOLE_OUTPUT_CP SetConsoleOutputCodePage = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetConsoleOutputCodePage; - PCSRSS_CONSOLE Console; - NTSTATUS Status; - - DPRINT("CsrSetConsoleOutputCodePage\n"); - - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } - - if (IsValidCodePage(SetConsoleOutputCodePage->CodePage)) - { - Console->OutputCodePage = SetConsoleOutputCodePage->CodePage; - ConioUnlockConsole(Console); - return STATUS_SUCCESS; - } - - ConioUnlockConsole(Console); - return STATUS_INVALID_PARAMETER; -} - CSR_API(SrvGetConsoleProcessList) { + NTSTATUS Status; PCSRSS_GET_PROCESS_LIST GetProcessListRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetProcessListRequest; PDWORD Buffer; - PCSR_PROCESS ProcessData = CsrGetClientThread()->Process; - PCSRSS_CONSOLE Console; - PCSR_PROCESS current; + // PCSR_PROCESS Process = CsrGetClientThread()->Process; + PCSRSS_CONSOLE Console; + PCONSOLE_PROCESS_DATA current; PLIST_ENTRY current_entry; ULONG nItems = 0; - NTSTATUS Status; DPRINT("SrvGetConsoleProcessList\n"); - Buffer = GetProcessListRequest->ProcessId; + if (!CsrValidateMessageBuffer(ApiMessage, + (PVOID)&GetProcessListRequest->pProcessIds, + GetProcessListRequest->nMaxIds, + sizeof(DWORD))) + { + return STATUS_INVALID_PARAMETER; + } + + Buffer = GetProcessListRequest->pProcessIds; + +/* if (!Win32CsrValidateBuffer(ProcessData, Buffer, GetProcessListRequest->nMaxIds, sizeof(DWORD))) return STATUS_ACCESS_VIOLATION; - - Status = ConioConsoleFromProcessData(ProcessData, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } +*/ + + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); + if (!NT_SUCCESS(Status)) return Status; for (current_entry = Console->ProcessList.Flink; current_entry != &Console->ProcessList; current_entry = current_entry->Flink) { - current = CONTAINING_RECORD(current_entry, CSR_PROCESS, ConsoleLink); + current = CONTAINING_RECORD(current_entry, CONSOLE_PROCESS_DATA, ConsoleLink); if (++nItems <= GetProcessListRequest->nMaxIds) { - *Buffer++ = HandleToUlong(current->ClientId.UniqueProcess); + *Buffer++ = HandleToUlong(current->Process->ClientId.UniqueProcess); } } @@ -868,27 +854,24 @@ CSR_API(SrvGenerateConsoleCtrlEvent) { + NTSTATUS Status; PCSRSS_GENERATE_CTRL_EVENT GenerateCtrlEvent = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GenerateCtrlEvent; PCSRSS_CONSOLE Console; - PCSR_PROCESS current; + PCONSOLE_PROCESS_DATA current; PLIST_ENTRY current_entry; DWORD Group; - NTSTATUS Status; - - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); - if (! NT_SUCCESS(Status)) - { - return Status; - } + + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); + if (!NT_SUCCESS(Status)) return Status; Group = GenerateCtrlEvent->ProcessGroup; Status = STATUS_INVALID_PARAMETER; - for (current_entry = Console->ProcessList.Flink; - current_entry != &Console->ProcessList; - current_entry = current_entry->Flink) - { - current = CONTAINING_RECORD(current_entry, CSR_PROCESS, ConsoleLink); - if (Group == 0 || current->ProcessGroupId == Group) + for (current_entry = Console->ProcessList.Flink; + current_entry != &Console->ProcessList; + current_entry = current_entry->Flink) + { + current = CONTAINING_RECORD(current_entry, CONSOLE_PROCESS_DATA, ConsoleLink); + if (Group == 0 || current->Process->ProcessGroupId == Group) { ConioConsoleCtrlEvent(GenerateCtrlEvent->Event, current); Status = STATUS_SUCCESS; @@ -906,7 +889,7 @@ PCSRSS_GET_CONSOLE_SELECTION_INFO GetConsoleSelectionInfo = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleSelectionInfo; PCSRSS_CONSOLE Console; - Status = ConioConsoleFromProcessData(CsrGetClientThread()->Process, &Console); + Status = ConioConsoleFromProcessData(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console); if (NT_SUCCESS(Status)) { memset(&GetConsoleSelectionInfo->Info, 0, sizeof(CONSOLE_SELECTION_INFO)); @@ -914,6 +897,7 @@ GetConsoleSelectionInfo->Info = Console->Selection; ConioUnlockConsole(Console); } + return Status; }
11 years, 11 months
1
0
0
0
[hbelusca] 57726: [KERNEL32] - Add some NULL checks. - Use new structures and api indices namings.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Nov 17 23:45:14 2012 New Revision: 57726 URL:
http://svn.reactos.org/svn/reactos?rev=57726&view=rev
Log: [KERNEL32] - Add some NULL checks. - Use new structures and api indices namings. Modified: branches/ros-csrss/dll/win32/kernel32/client/console/console.c branches/ros-csrss/include/reactos/subsys/win/conmsg.h Modified: branches/ros-csrss/dll/win32/kernel32/client/console/console.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/kernel32/cl…
============================================================================== --- branches/ros-csrss/dll/win32/kernel32/client/console/console.c [iso-8859-1] (original) +++ branches/ros-csrss/dll/win32/kernel32/client/console/console.c [iso-8859-1] Sat Nov 17 23:45:14 2012 @@ -864,6 +864,12 @@ NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + if (lpConsoleScreenBufferInfo == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + ApiMessage.Data.ScreenBufferInfoRequest.ConsoleHandle = hConsoleOutput; Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, @@ -954,8 +960,8 @@ GetNumberOfConsoleInputEvents(HANDLE hConsoleInput, LPDWORD lpNumberOfEvents) { - CSR_API_MESSAGE Request; - NTSTATUS Status; + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; if (lpNumberOfEvents == NULL) { @@ -963,19 +969,19 @@ return FALSE; } - Request.Data.GetNumInputEventsRequest.ConsoleHandle = hConsoleInput; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GET_NUM_INPUT_EVENTS), - sizeof(CSR_API_MESSAGE)); - if(!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - *lpNumberOfEvents = Request.Data.GetNumInputEventsRequest.NumInputEvents; + ApiMessage.Data.GetNumInputEventsRequest.ConsoleHandle = hConsoleInput; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetNumberOfInputEvents), + sizeof(CSRSS_GET_NUM_INPUT_EVENTS)); + if(!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + *lpNumberOfEvents = ApiMessage.Data.GetNumInputEventsRequest.NumInputEvents; return TRUE; } @@ -1093,16 +1099,16 @@ WINAPI SetConsoleActiveScreenBuffer(HANDLE hConsoleOutput) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.SetScreenBufferRequest.OutputHandle = hConsoleOutput; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SET_SCREEN_BUFFER), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + ApiMessage.Data.SetScreenBufferRequest.OutputHandle = hConsoleOutput; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetActiveScreenBuffer), + sizeof(CSRSS_SET_SCREEN_BUFFER)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; @@ -1121,16 +1127,16 @@ WINAPI FlushConsoleInputBuffer(HANDLE hConsoleInput) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.FlushInputBufferRequest.ConsoleInput = hConsoleInput; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, FLUSH_INPUT_BUFFER), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + ApiMessage.Data.FlushInputBufferRequest.ConsoleInput = hConsoleInput; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFlushInputBuffer), + sizeof(CSRSS_FLUSH_INPUT_BUFFER)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; @@ -1150,17 +1156,17 @@ SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.SetScreenBufferSize.OutputHandle = hConsoleOutput; - Request.Data.SetScreenBufferSize.Size = dwSize; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SET_SCREEN_BUFFER_SIZE), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + ApiMessage.Data.SetScreenBufferSize.OutputHandle = hConsoleOutput; + ApiMessage.Data.SetScreenBufferSize.Size = dwSize; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetScreenBufferSize), + sizeof(CSRSS_SET_SCREEN_BUFFER_SIZE)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; @@ -1209,32 +1215,33 @@ const CHAR_INFO *lpFill, BOOL bUnicode) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.ScrollConsoleScreenBufferRequest.ConsoleHandle = hConsoleOutput; - Request.Data.ScrollConsoleScreenBufferRequest.Unicode = bUnicode; - Request.Data.ScrollConsoleScreenBufferRequest.ScrollRectangle = *lpScrollRectangle; + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + PCSRSS_SCROLL_CONSOLE_SCREEN_BUFFER ScrollConsoleScreenBufferRequest = &ApiMessage.Data.ScrollConsoleScreenBufferRequest; + + ScrollConsoleScreenBufferRequest->ConsoleHandle = hConsoleOutput; + ScrollConsoleScreenBufferRequest->Unicode = bUnicode; + ScrollConsoleScreenBufferRequest->ScrollRectangle = *lpScrollRectangle; if (lpClipRectangle != NULL) { - Request.Data.ScrollConsoleScreenBufferRequest.UseClipRectangle = TRUE; - Request.Data.ScrollConsoleScreenBufferRequest.ClipRectangle = *lpClipRectangle; + ScrollConsoleScreenBufferRequest->UseClipRectangle = TRUE; + ScrollConsoleScreenBufferRequest->ClipRectangle = *lpClipRectangle; } else { - Request.Data.ScrollConsoleScreenBufferRequest.UseClipRectangle = FALSE; - } - - Request.Data.ScrollConsoleScreenBufferRequest.DestinationOrigin = dwDestinationOrigin; - Request.Data.ScrollConsoleScreenBufferRequest.Fill = *lpFill; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SCROLL_CONSOLE_SCREEN_BUFFER), - sizeof(CSR_API_MESSAGE)); - - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + ScrollConsoleScreenBufferRequest->UseClipRectangle = FALSE; + } + + ScrollConsoleScreenBufferRequest->DestinationOrigin = dwDestinationOrigin; + ScrollConsoleScreenBufferRequest->Fill = *lpFill; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepScrollScreenBuffer), + sizeof(CSRSS_SCROLL_CONSOLE_SCREEN_BUFFER)); + + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; @@ -1315,17 +1322,17 @@ SetConsoleTextAttribute(HANDLE hConsoleOutput, WORD wAttributes) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.SetAttribRequest.ConsoleHandle = hConsoleOutput; - Request.Data.SetAttribRequest.Attrib = wAttributes; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SET_ATTRIB), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + ApiMessage.Data.SetAttribRequest.ConsoleHandle = hConsoleOutput; + ApiMessage.Data.SetAttribRequest.Attrib = wAttributes; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetTextAttribute), + sizeof(CSRSS_SET_ATTRIB)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; @@ -1544,8 +1551,6 @@ /*-------------------------------------------------------------- * GetConsoleTitleA * - * 19990306 EA - * * @implemented */ DWORD @@ -1604,8 +1609,6 @@ /*-------------------------------------------------------------- * SetConsoleTitleA - * - * 19990204 EA Added * * @implemented */ @@ -1641,32 +1644,33 @@ DWORD dwFlags, LPVOID lpScreenBufferData) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - if (dwDesiredAccess & ~(GENERIC_READ | GENERIC_WRITE) - || dwShareMode & ~(FILE_SHARE_READ | FILE_SHARE_WRITE) - || dwFlags != CONSOLE_TEXTMODE_BUFFER) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + if ( (dwDesiredAccess & ~(GENERIC_READ | GENERIC_WRITE)) || + (dwShareMode & ~(FILE_SHARE_READ | FILE_SHARE_WRITE)) || + (dwFlags != CONSOLE_TEXTMODE_BUFFER) ) { SetLastError(ERROR_INVALID_PARAMETER); return INVALID_HANDLE_VALUE; } - Request.Data.CreateScreenBufferRequest.Access = dwDesiredAccess; - Request.Data.CreateScreenBufferRequest.ShareMode = dwShareMode; - Request.Data.CreateScreenBufferRequest.Inheritable = - lpSecurityAttributes ? lpSecurityAttributes->bInheritHandle : FALSE; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, CREATE_SCREEN_BUFFER), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + ApiMessage.Data.CreateScreenBufferRequest.Access = dwDesiredAccess; + ApiMessage.Data.CreateScreenBufferRequest.ShareMode = dwShareMode; + ApiMessage.Data.CreateScreenBufferRequest.Inheritable = + (lpSecurityAttributes ? lpSecurityAttributes->bInheritHandle : FALSE); + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepCreateScreenBuffer), + sizeof(CSRSS_CREATE_SCREEN_BUFFER)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return INVALID_HANDLE_VALUE; } - return Request.Data.CreateScreenBufferRequest.OutputHandle; + + return ApiMessage.Data.CreateScreenBufferRequest.OutputHandle; } @@ -1842,18 +1846,26 @@ WINAPI GetConsoleSelectionInfo(PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo) { - CSR_API_MESSAGE Request; - NTSTATUS Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GET_CONSOLE_SELECTION_INFO), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - *lpConsoleSelectionInfo = Request.Data.GetConsoleSelectionInfo.Info; + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + if (lpConsoleSelectionInfo == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetSelectionInfo), + sizeof(CSRSS_GET_CONSOLE_SELECTION_INFO)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + + *lpConsoleSelectionInfo = ApiMessage.Data.GetConsoleSelectionInfo.Info; return TRUE; } @@ -1871,6 +1883,7 @@ return TRUE; } + /*-------------------------------------------------------------- * GetConsoleWindow * @@ -1880,20 +1893,20 @@ WINAPI GetConsoleWindow(VOID) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, GET_CONSOLE_WINDOW), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status ) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetConsoleWindow), + sizeof(CSRSS_GET_CONSOLE_WINDOW)); + if (!NT_SUCCESS(Status ) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return (HWND) NULL; } - return Request.Data.GetConsoleWindowRequest.WindowHandle; + return ApiMessage.Data.GetConsoleWindowRequest.WindowHandle; } @@ -1906,16 +1919,16 @@ WINAPI SetConsoleIcon(HICON hicon) { - CSR_API_MESSAGE Request; - NTSTATUS Status; - - Request.Data.SetConsoleIconRequest.WindowIcon = hicon; - - Status = CsrClientCallServer(&Request, - NULL, - CSR_CREATE_API_NUMBER(CSR_CONSOLE, SET_CONSOLE_ICON), - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + NTSTATUS Status; + CONSOLE_API_MESSAGE ApiMessage; + + ApiMessage.Data.SetConsoleIconRequest.WindowIcon = hicon; + + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetIcon), + sizeof(CSRSS_SET_CONSOLE_ICON)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = ApiMessage.Status)) { BaseSetLastNTError(Status); return FALSE; Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
============================================================================== --- branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original) +++ branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] Sat Nov 17 23:45:14 2012 @@ -413,17 +413,17 @@ typedef struct { HANDLE ConsoleHandle; - DWORD State; + DWORD State; } CSRSS_CONSOLE_HW_STATE, *PCSRSS_CONSOLE_HW_STATE; typedef struct { - HWND WindowHandle; + HWND WindowHandle; } CSRSS_GET_CONSOLE_WINDOW, *PCSRSS_GET_CONSOLE_WINDOW; typedef struct { - HICON WindowIcon; + HICON WindowIcon; } CSRSS_SET_CONSOLE_ICON, *PCSRSS_SET_CONSOLE_ICON;
11 years, 11 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
13
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
Results per page:
10
25
50
100
200