ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
24 participants
517 discussions
Start a n
N
ew thread
[ion] 52863: [CSRSRV]: Initialize CSR_CONNECTION_INFO in CsrpHandleConnectionRequest. Should fix the fact CsrProcessId was bogus before, as were the CSR PEB fields.
by ion@svn.reactos.org
Author: ion Date: Mon Jul 25 18:39:56 2011 New Revision: 52863 URL:
http://svn.reactos.org/svn/reactos?rev=52863&view=rev
Log: [CSRSRV]: Initialize CSR_CONNECTION_INFO in CsrpHandleConnectionRequest. Should fix the fact CsrProcessId was bogus before, as were the CSR PEB fields. Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] Mon Jul 25 18:39:56 2011 @@ -127,11 +127,19 @@ PCSRSS_PROCESS_DATA ProcessData = NULL; REMOTE_PORT_VIEW LpcRead; CLIENT_ID ClientId; + PCSR_CONNECTION_INFO ConnectInfo; LpcRead.Length = sizeof(LpcRead); ServerPort = NULL; DPRINT("CSR: %s: Handling: %p\n", __FUNCTION__, Request); + ConnectInfo = (PCSR_CONNECTION_INFO)(Request + 1); + DPRINT1("CSR Connect Info: %p\n", ConnectInfo); + + /* Save the process ID */ + RtlZeroMemory(ConnectInfo, sizeof(CSR_CONNECTION_INFO)); + ConnectInfo->ProcessId = NtCurrentTeb()->ClientId.UniqueProcess; + Status = NtAcceptConnectPort(&ServerPort, NULL, Request,
13 years, 5 months
1
0
0
0
[akhaldi] 52862: [CMAKE] * De-duplicate IDL flags.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 25 18:39:25 2011 New Revision: 52862 URL:
http://svn.reactos.org/svn/reactos?rev=52862&view=rev
Log: [CMAKE] * De-duplicate IDL flags. Modified: trunk/reactos/cmake/gcc.cmake Modified: trunk/reactos/cmake/gcc.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=52862&…
============================================================================== --- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Mon Jul 25 18:39:25 2011 @@ -199,14 +199,6 @@ set(IDL_FLAGS -m64 --win64) endif() -set(IDL_HEADER_ARG -h -o) #.h -set(IDL_TYPELIB_ARG -t -o) #.tlb -set(IDL_SERVER_ARG -s -S) #.c for server library -set(IDL_CLIENT_ARG -c -C) #.c for stub client library -set(IDL_PROXY_ARG -p -P) -set(IDL_INTERFACE_ARG -u -o) -set(IDL_DLLDATA_ARG --dlldata-only -o) - macro(add_delay_importlibs MODULE) foreach(LIB ${ARGN}) target_link_libraries(${MODULE} ${CMAKE_BINARY_DIR}/importlibs/lib${LIB}_delayed.a)
13 years, 5 months
1
0
0
0
[ion] 52861: [KERNEL32]: Fix querying the CSDNumber and RCNumber, as this seems to be a bug (no valid data was found on Windows).
by ion@svn.reactos.org
Author: ion Date: Mon Jul 25 14:40:59 2011 New Revision: 52861 URL:
http://svn.reactos.org/svn/reactos?rev=52861&view=rev
Log: [KERNEL32]: Fix querying the CSDNumber and RCNumber, as this seems to be a bug (no valid data was found on Windows). Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Mon Jul 25 14:40:59 2011 @@ -264,7 +264,6 @@ UNICODE_STRING SystemRootString; UNICODE_STRING UnexpandedSystemRootString = RTL_CONSTANT_STRING(L"%SystemRoot%"); UNICODE_STRING BaseSrvCSDString; - ULONG BaseSrvCSDNumber; RTL_QUERY_REGISTRY_TABLE BaseServerRegistryConfigurationTable[] = { { @@ -272,16 +271,6 @@ RTL_QUERY_REGISTRY_DIRECT, L"CSDVersion", &BaseSrvCSDString - }, - {0} - }; - RTL_QUERY_REGISTRY_TABLE BaseServerRegistryConfigurationTable1[] = - { - { - NULL, - RTL_QUERY_REGISTRY_DIRECT, - L"CSDVersion", - &BaseSrvCSDNumber }, {0} }; @@ -298,6 +287,7 @@ &UnexpandedSystemRootString, &SystemRootString, NULL); + DPRINT1("Status: %lx. Root: %wZ\n", Status, &SystemRootString); ASSERT(NT_SUCCESS(Status)); Buffer[SystemRootString.Length / sizeof(WCHAR)] = UNICODE_NULL; @@ -322,23 +312,16 @@ ASSERT(FALSE); } - RtlInitEmptyUnicodeString(&BaseSrvCSDString, Buffer, sizeof(BaseStaticServerData->CSDVersion)); - - Status = RtlQueryRegistryValues(RTL_REGISTRY_WINDOWS_NT, - L"", - BaseServerRegistryConfigurationTable1, - NULL, - NULL); - if (NT_SUCCESS(Status)) - { - BaseStaticServerData->CSDNumber = (USHORT)(BaseSrvCSDNumber & 0xFFFF); - BaseStaticServerData->RCNumber = (USHORT)(BaseSrvCSDNumber >> 16); - } - else - { - BaseStaticServerData->CSDNumber = 0; - BaseStaticServerData->RCNumber = 0; - } + /* + * Confirmed that in Windows, CSDNumber and RCNumber are actually Length + * and MaximumLength of the CSD String, since the same UNICODE_STRING is + * being queried twice, the first time as a ULONG! + * + * Somehow, in Windows this doesn't cause a buffer overflow, but it might + * in ReactOS, so this code is disabled until someone figures out WTF. + */ + BaseStaticServerData->CSDNumber = 0; + BaseStaticServerData->RCNumber = 0; Status = RtlQueryRegistryValues(RTL_REGISTRY_WINDOWS_NT, L"", @@ -347,6 +330,7 @@ NULL); if (NT_SUCCESS(Status)) { + DPRINT1("CSD String: %wZ\n", BaseSrvCSDString); wcsncpy(BaseStaticServerData->CSDVersion, BaseSrvCSDString.Buffer, BaseSrvCSDString.Length / sizeof(WCHAR)); @@ -446,6 +430,7 @@ } /* Get the server data */ + DPRINT1("Server data: %p\n", Peb->ReadOnlyStaticServerData); if (!Peb->ReadOnlyStaticServerData) { /* Build fake one for ReactOS */ @@ -462,6 +447,7 @@ /* Get the server data */ BaseStaticServerData = Peb->ReadOnlyStaticServerData[CSR_CONSOLE]; + DPRINT1("Static data: %p\n", BaseStaticServerData); ASSERT(BaseStaticServerData); /* Check if we are running a CSR Server */
13 years, 5 months
1
0
0
0
[ion] 52860: [KERNEL32]: Fix potential buffer overflow.
by ion@svn.reactos.org
Author: ion Date: Mon Jul 25 06:23:50 2011 New Revision: 52860 URL:
http://svn.reactos.org/svn/reactos?rev=52860&view=rev
Log: [KERNEL32]: Fix potential buffer overflow. Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Mon Jul 25 06:23:50 2011 @@ -322,7 +322,7 @@ ASSERT(FALSE); } - RtlInitEmptyUnicodeString(&BaseSrvCSDString, Buffer, sizeof(Buffer)); + RtlInitEmptyUnicodeString(&BaseSrvCSDString, Buffer, sizeof(BaseStaticServerData->CSDVersion)); Status = RtlQueryRegistryValues(RTL_REGISTRY_WINDOWS_NT, L"",
13 years, 5 months
1
0
0
0
[dgorbachev] 52859: [CSRSRV|NTOSKRNL|KERNEL32|NTDLL] Fix multiple definition of variables.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Mon Jul 25 05:54:37 2011 New Revision: 52859 URL:
http://svn.reactos.org/svn/reactos?rev=52859&view=rev
Log: [CSRSRV|NTOSKRNL|KERNEL32|NTDLL] Fix multiple definition of variables. Modified: trunk/reactos/dll/ntdll/ldr/ldrpe.c trunk/reactos/dll/win32/kernel32/client/proc.c trunk/reactos/ntoskrnl/cache/section/data.c trunk/reactos/ntoskrnl/mm/freelist.c trunk/reactos/ntoskrnl/mm/section.c trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c trunk/reactos/subsystems/win32/csrss/csrsrv/api/user.c trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c trunk/reactos/subsystems/win32/csrss/csrsrv/init.c trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c trunk/reactos/subsystems/win32/csrss/csrsrv/thredsup.c Modified: trunk/reactos/dll/ntdll/ldr/ldrpe.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrpe.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrpe.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrpe.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -14,7 +14,6 @@ /* GLOBALS *******************************************************************/ -ULONG LdrpFatalHardErrorCount; PVOID LdrpManifestProberRoutine; ULONG LdrpNormalSnap; Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -34,7 +34,6 @@ RegisterWaitForInputIdle(WaitForInputIdleType lpfnRegisterWaitForInputIdle); UNICODE_STRING BasePathVariableName = RTL_CONSTANT_STRING(L"PATH"); -UNICODE_STRING BaseDefaultPath; PLDR_DATA_TABLE_ENTRY BasepExeLdrEntry; #define CMD_STRING L"cmd /c " Modified: trunk/reactos/ntoskrnl/cache/section/data.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/dat…
============================================================================== --- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -58,7 +58,6 @@ /* GLOBALS *******************************************************************/ ULONG_PTR MmSubsectionBase; -BOOLEAN MmAllocationFragment; NTSTATUS NTAPI Modified: trunk/reactos/ntoskrnl/mm/freelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -33,7 +33,6 @@ PFN_NUMBER MmResidentAvailablePages; PFN_NUMBER MmResidentAvailableAtInit; -SIZE_T MmTotalCommitLimit; SIZE_T MmTotalCommittedPages; SIZE_T MmSharedCommit; SIZE_T MmDriverCommit; Modified: trunk/reactos/ntoskrnl/mm/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -123,8 +123,6 @@ /* GLOBALS *******************************************************************/ POBJECT_TYPE MmSectionObjectType = NULL; - -SIZE_T MmAllocationFragment; ULONG_PTR MmSubsectionBase; Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/process.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -1,5 +1,5 @@ /* - * reactos/subsys/csrss/api/process.c + * subsystems/win32/csrss/csrsrv/api/process.c * * "\windows\ApiPort" port process management functions * Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/user.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/user.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/user.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -1,6 +1,6 @@ /* $Id$ * - * reactos/subsys/csrss/api/user.c + * subsystems/win32/csrss/csrsrv/api/user.c * * User functions * Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -1,6 +1,6 @@ /* $Id$ * - * reactos/subsys/csrss/api/wapi.c + * subsystems/win32/csrss/csrsrv/api/wapi.c * * CSRSS port message processing * Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/init.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS CSR Sub System - * FILE: subsys/csr/csrsrv/init.c + * FILE: subsystems/win32/csrss/csrsrv/init.c * PURPOSE: CSR Server DLL Initialization * PROGRAMMERS: ReactOS Portable Systems Group */ Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/procsup.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS CSR Sub System - * FILE: subsys/csr/csrsrv/procsup.c + * FILE: subsystems/win32/csrss/csrsrv/procsup.c * PURPOSE: CSR Process Management * PROGRAMMERS: ReactOS Portable Systems Group * Alex Ionescu @@ -26,7 +26,6 @@ extern RTL_CRITICAL_SECTION ProcessDataLock; extern PCSRSS_PROCESS_DATA ProcessData[256]; PCSRSS_PROCESS_DATA CsrRootProcess; -LIST_ENTRY CsrThreadHashTable[256]; SECURITY_QUALITY_OF_SERVICE CsrSecurityQos = { sizeof(SECURITY_QUALITY_OF_SERVICE), Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/thredsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/thredsup.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/thredsup.c [iso-8859-1] Mon Jul 25 05:54:37 2011 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS CSR Sub System - * FILE: subsys/csr/csrsrv/procsup.c + * FILE: subsystems/win32/csrss/csrsrv/thredsup.c * PURPOSE: CSR Process Management * PROGRAMMERS: ReactOS Portable Systems Group * Alex Ionescu
13 years, 5 months
1
0
0
0
[ion] 52858: [KERNEL32]: Define the BASE_STATIC_SERVER_DATA structure that BASESRV shares with KERNEL32 on Windows. In Windows, each CSR client/server pair can share such data through the PEB's Rea...
by ion@svn.reactos.org
Author: ion Date: Mon Jul 25 03:28:33 2011 New Revision: 52858 URL:
http://svn.reactos.org/svn/reactos?rev=52858&view=rev
Log: [KERNEL32]: Define the BASE_STATIC_SERVER_DATA structure that BASESRV shares with KERNEL32 on Windows. In Windows, each CSR client/server pair can share such data through the PEB's ReadOnlyStaticServerData array. In ReactOS, this is not (yet) implemented, so if we don't have this data, kernel32 builds a "fake" copy instead. This "fake" copy will still be useful though as it'll let kernel32 cache some data (per-process). With proper CSRSS support, we could cache it per-system, but at least this is a start. Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c trunk/reactos/dll/win32/kernel32/include/kernel32.h Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Mon Jul 25 03:28:33 2011 @@ -21,6 +21,9 @@ extern UNICODE_STRING SystemDirectory; extern UNICODE_STRING WindowsDirectory; + + +PBASE_STATIC_SERVER_DATA BaseStaticServerData; BOOLEAN BaseRunningInServerProcess; @@ -252,6 +255,135 @@ return TRUE; } +VOID +WINAPI +BasepFakeStaticServerData(VOID) +{ + NTSTATUS Status; + WCHAR Buffer[MAX_PATH]; + UNICODE_STRING SystemRootString; + UNICODE_STRING UnexpandedSystemRootString = RTL_CONSTANT_STRING(L"%SystemRoot%"); + UNICODE_STRING BaseSrvCSDString; + ULONG BaseSrvCSDNumber; + RTL_QUERY_REGISTRY_TABLE BaseServerRegistryConfigurationTable[] = + { + { + NULL, + RTL_QUERY_REGISTRY_DIRECT, + L"CSDVersion", + &BaseSrvCSDString + }, + {0} + }; + RTL_QUERY_REGISTRY_TABLE BaseServerRegistryConfigurationTable1[] = + { + { + NULL, + RTL_QUERY_REGISTRY_DIRECT, + L"CSDVersion", + &BaseSrvCSDNumber + }, + {0} + }; + + /* Allocate the fake data */ + BaseStaticServerData = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(BASE_STATIC_SERVER_DATA)); + ASSERT(BaseStaticServerData != NULL); + + /* Get the Windows directory */ + RtlInitEmptyUnicodeString(&SystemRootString, Buffer, sizeof(Buffer)); + Status = RtlExpandEnvironmentStrings_U(NULL, + &UnexpandedSystemRootString, + &SystemRootString, + NULL); + ASSERT(NT_SUCCESS(Status)); + + Buffer[SystemRootString.Length / sizeof(WCHAR)] = UNICODE_NULL; + Status = RtlCreateUnicodeString(&BaseStaticServerData->WindowsDirectory, + SystemRootString.Buffer); + ASSERT(NT_SUCCESS(Status)); + + wcscat(SystemRootString.Buffer, L"\\system32"); + Status = RtlCreateUnicodeString(&BaseStaticServerData->WindowsSystemDirectory, + SystemRootString.Buffer); + ASSERT(NT_SUCCESS(Status)); + + if (!SessionId) + { + Status = RtlCreateUnicodeString(&BaseStaticServerData->NamedObjectDirectory, + L"\\BaseNamedObjects"); + ASSERT(NT_SUCCESS(Status)); + } + else + { + /* Hopefully we'll fix CSRSS Before we add multiple sessions... */ + ASSERT(FALSE); + } + + RtlInitEmptyUnicodeString(&BaseSrvCSDString, Buffer, sizeof(Buffer)); + + Status = RtlQueryRegistryValues(RTL_REGISTRY_WINDOWS_NT, + L"", + BaseServerRegistryConfigurationTable1, + NULL, + NULL); + if (NT_SUCCESS(Status)) + { + BaseStaticServerData->CSDNumber = (USHORT)(BaseSrvCSDNumber & 0xFFFF); + BaseStaticServerData->RCNumber = (USHORT)(BaseSrvCSDNumber >> 16); + } + else + { + BaseStaticServerData->CSDNumber = 0; + BaseStaticServerData->RCNumber = 0; + } + + Status = RtlQueryRegistryValues(RTL_REGISTRY_WINDOWS_NT, + L"", + BaseServerRegistryConfigurationTable, + NULL, + NULL); + if (NT_SUCCESS(Status)) + { + wcsncpy(BaseStaticServerData->CSDVersion, + BaseSrvCSDString.Buffer, + BaseSrvCSDString.Length / sizeof(WCHAR)); + } + else + { + BaseStaticServerData->CSDVersion[0] = UNICODE_NULL; + } + + Status = NtQuerySystemInformation(SystemBasicInformation, + &BaseStaticServerData->SysInfo, + sizeof(BaseStaticServerData->SysInfo), + NULL); + ASSERT(NT_SUCCESS(Status)); + + BaseStaticServerData->DefaultSeparateVDM = FALSE; + BaseStaticServerData->IsWowTaskReady = FALSE; + BaseStaticServerData->LUIDDeviceMapsEnabled = FALSE; + BaseStaticServerData->TermsrvClientTimeZoneId = TIME_ZONE_ID_INVALID; + BaseStaticServerData->TermsrvClientTimeZoneChangeNum = 0; + + Status = NtQuerySystemInformation(SystemTimeOfDayInformation, + &BaseStaticServerData->TimeOfDay, + sizeof(BaseStaticServerData->TimeOfDay), + NULL); + ASSERT(NT_SUCCESS(Status)); + + DPRINT1("ReactOS Base API Connected: %wZ %wZ %wZ %S (%lx.%lx) %d KB\n", + BaseStaticServerData->WindowsDirectory, + BaseStaticServerData->WindowsSystemDirectory, + BaseStaticServerData->NamedObjectDirectory, + BaseStaticServerData->CSDVersion, + BaseStaticServerData->CSDNumber, + BaseStaticServerData->RCNumber, + BaseStaticServerData->SysInfo.PageSize * + BaseStaticServerData->SysInfo.NumberOfPhysicalPages / 1024); +} BOOL WINAPI @@ -312,6 +444,25 @@ ZwTerminateProcess(NtCurrentProcess(), Status); return FALSE; } + + /* Get the server data */ + if (!Peb->ReadOnlyStaticServerData) + { + /* Build fake one for ReactOS */ + BasepFakeStaticServerData(); + + /* Allocate the array */ + Peb->ReadOnlyStaticServerData = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + 4 * sizeof(PVOID)); + + /* Set the data for the BASESRV DLL Index */ + Peb->ReadOnlyStaticServerData[CSR_CONSOLE] = BaseStaticServerData; + } + + /* Get the server data */ + BaseStaticServerData = Peb->ReadOnlyStaticServerData[CSR_CONSOLE]; + ASSERT(BaseStaticServerData); /* Check if we are running a CSR Server */ if (!BaseRunningInServerProcess) Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Mon Jul 25 03:28:33 2011 @@ -80,6 +80,75 @@ CPTABLEINFO CodePageTable; } CODEPAGE_ENTRY, *PCODEPAGE_ENTRY; +typedef struct _NLS_USER_INFO +{ + WCHAR iCountry[80]; + WCHAR sCountry[80]; + WCHAR sList[80]; + WCHAR iMeasure[80]; + WCHAR iPaperSize[80]; + WCHAR sDecimal[80]; + WCHAR sThousand[80]; + WCHAR sGrouping[80]; + WCHAR iDigits[80]; + WCHAR iLZero[80]; + WCHAR iNegNumber[80]; + WCHAR sNativeDigits[80]; + WCHAR iDigitSubstitution[80]; + WCHAR sCurrency[80]; + WCHAR sMonDecSep[80]; + WCHAR sMonThouSep[80]; + WCHAR sMonGrouping[80]; + WCHAR iCurrDigits[80]; + WCHAR iCurrency[80]; + WCHAR iNegCurr[80]; + WCHAR sPosSign[80]; + WCHAR sNegSign[80]; + WCHAR sTimeFormat[80]; + WCHAR s1159[80]; + WCHAR s2359[80]; + WCHAR sShortDate[80]; + WCHAR sYearMonth[80]; + WCHAR sLongDate[80]; + WCHAR iCalType[80]; + WCHAR iFirstDay[80]; + WCHAR iFirstWeek[80]; + WCHAR sLocale[80]; + WCHAR sLocaleName[85]; + LCID UserLocaleId; + LUID InteractiveUserLuid; + CHAR InteractiveUserSid[SECURITY_MAX_SID_SIZE]; + ULONG ulCacheUpdateCount; +} NLS_USER_INFO, *PNLS_USER_INFO; + +typedef struct _BASE_STATIC_SERVER_DATA +{ + UNICODE_STRING WindowsDirectory; + UNICODE_STRING WindowsSystemDirectory; + UNICODE_STRING NamedObjectDirectory; + USHORT WindowsMajorVersion; + USHORT WindowsMinorVersion; + USHORT BuildNumber; + USHORT CSDNumber; + USHORT RCNumber; + WCHAR CSDVersion[128]; + SYSTEM_BASIC_INFORMATION SysInfo; + SYSTEM_TIMEOFDAY_INFORMATION TimeOfDay; + PVOID IniFileMapping; + NLS_USER_INFO NlsUserInfo; + BOOLEAN DefaultSeparateVDM; + BOOLEAN IsWowTaskReady; + UNICODE_STRING WindowsSys32x86Directory; + BOOLEAN fTermsrvAppInstallMode; + TIME_ZONE_INFORMATION tziTermsrvClientTimeZone; + KSYSTEM_TIME ktTermsrvClientBias; + ULONG TermsrvClientTimeZoneId; + BOOLEAN LUIDDeviceMapsEnabled; + ULONG TermsrvClientTimeZoneChangeNum; +} BASE_STATIC_SERVER_DATA, *PBASE_STATIC_SERVER_DATA; + +extern PBASE_STATIC_SERVER_DATA BaseStaticServerData; + typedef DWORD (*WaitForInputIdleType)(
13 years, 5 months
1
0
0
0
[tkreuzer] 52857: [NTOSKRNL] - Use NtTib.ExceptionList instead of Used_ExceptionList - use ALIGN_DOWN_BY macro
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jul 25 00:50:53 2011 New Revision: 52857 URL:
http://svn.reactos.org/svn/reactos?rev=52857&view=rev
Log: [NTOSKRNL] - Use NtTib.ExceptionList instead of Used_ExceptionList - use ALIGN_DOWN_BY macro Modified: trunk/reactos/ntoskrnl/ke/i386/usercall.c Modified: trunk/reactos/ntoskrnl/ke/i386/usercall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/usercall.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/usercall.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/usercall.c [iso-8859-1] Mon Jul 25 00:50:53 2011 @@ -4,6 +4,7 @@ * FILE: ntoskrnl/ke/i386/usercall.c * PURPOSE: User-mode Callout Mechanisms (APC and Win32K Callbacks) * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) + * Timo Kreuzer (timo.kreuzer(a)reactos.org) */ /* INCLUDES ******************************************************************/ @@ -208,8 +209,9 @@ return CallbackStatus; } -/* Stack layout: - * + +/* + * Stack layout for KiUserModeCallout: * ---------------------------------- * KCALLOUT_FRAME.ResultLength <= 2nd Parameter to KiCallUserMode * KCALLOUT_FRAME.Result <= 1st Parameter to KiCallUserMode @@ -271,8 +273,8 @@ } #endif - /* Align stack on 16-byte boundary */ - InitialStack = (ULONG_PTR)CalloutFrame & ~15; + /* Align stack on a 16-byte boundary */ + InitialStack = ALIGN_DOWN_BY(CalloutFrame, 16); /* Check if we have enough space on the stack */ if ((InitialStack - KERNEL_STACK_SIZE) < CurrentThread->StackLimit) @@ -322,20 +324,20 @@ Pcr = KeGetPcr(); /* Update the exception list */ - CallbackTrapFrame->ExceptionList = Pcr->Used_ExceptionList; + CallbackTrapFrame->ExceptionList = Pcr->NtTib.ExceptionList; /* Get TSS */ Tss = Pcr->TSS; - /* Bias the stack for V86 mode */ + /* Check for V86 mode */ if (CallbackTrapFrame->EFlags & EFLAGS_V86_MASK) { - /* Set new stack address in TSS */ + /* Set new stack address in TSS (full trap frame) */ Tss->Esp0 = (ULONG_PTR)(CallbackTrapFrame + 1); } else { - /* Set new stack address in TSS */ + /* Set new stack address in TSS (non-V86 trap frame) */ Tss->Esp0 = (ULONG_PTR)&CallbackTrapFrame->V86Es; }
13 years, 5 months
1
0
0
0
[tkreuzer] 52856: [NTOSKRNL] Fix typos in comments
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jul 25 00:07:07 2011 New Revision: 52856 URL:
http://svn.reactos.org/svn/reactos?rev=52856&view=rev
Log: [NTOSKRNL] Fix typos in comments Modified: trunk/reactos/ntoskrnl/ke/i386/usercall.c trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S Modified: trunk/reactos/ntoskrnl/ke/i386/usercall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/usercall.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/usercall.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/usercall.c [iso-8859-1] Mon Jul 25 00:07:07 2011 @@ -215,7 +215,7 @@ * KCALLOUT_FRAME.Result <= 1st Parameter to KiCallUserMode * KCALLOUT_FRAME.ReturnAddress <= Return address of KiCallUserMode * KCALLOUT_FRAME.Ebp \ - * KCALLOUT_FRAME.Ebx | = volatile registers, pushed + * KCALLOUT_FRAME.Ebx | = non-volatile registers, pushed * KCALLOUT_FRAME.Esi | by KiCallUserMode * KCALLOUT_FRAME.Edi / * KCALLOUT_FRAME.CallbackStack Modified: trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/usercall_…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] Mon Jul 25 00:07:07 2011 @@ -49,7 +49,7 @@ PUBLIC _KiCallUserMode@8 _KiCallUserMode@8: - /* Push volatile registers on the stack. + /* Push non-volatile registers on the stack. This is part of the KCALLOUT_FRAME */ push ebp push ebx
13 years, 5 months
1
0
0
0
[tkreuzer] 52855: [NTOSKRNL] - Convert KiCallUserMode from asm to C (with a small asm wrapper) - Convert KiGetUserModeStackAddress into a C inline function
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jul 25 00:01:29 2011 New Revision: 52855 URL:
http://svn.reactos.org/svn/reactos?rev=52855&view=rev
Log: [NTOSKRNL] - Convert KiCallUserMode from asm to C (with a small asm wrapper) - Convert KiGetUserModeStackAddress into a C inline function Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/ke/i386/usercall.c trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] Mon Jul 25 00:01:29 2011 @@ -846,4 +846,11 @@ KeGetContextSwitches(KeGetCurrentPrcb())); } +FORCEINLINE +PULONG +KiGetUserModeStackAddress(void) +{ + return &(KeGetCurrentThread()->TrapFrame->HardwareEsp); +} + #endif Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Mon Jul 25 00:01:29 2011 @@ -164,7 +164,7 @@ #define TIMER_WAIT_BLOCK 0x3L #ifdef _M_ARM // FIXME: remove this once our headers are cleaned up -// +// // A system call ID is formatted as such: // .________________________________________________________________. // | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | @@ -187,7 +187,7 @@ // // NB. From assembly code, the table number must be computed as an offset into // the service descriptor table. -// +// // Each entry into the table is 16 bytes long on 32-bit architectures, and // 32 bytes long on 64-bit architectures. // @@ -864,7 +864,7 @@ ULONG_PTR BugCheckParameter4, PKTRAP_FRAME Tf ); - + BOOLEAN NTAPI KiHandleNmi(VOID); @@ -1020,12 +1020,6 @@ IN PULONG OutputLength ); -PULONG -NTAPI -KiGetUserModeStackAddress( - VOID -); - VOID NTAPI KiInitMachineDependent(VOID); Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Mon Jul 25 00:01:29 2011 @@ -6,6 +6,7 @@ struct _EPROCESS; +extern PMMSUPPORT MmKernelAddressSpace; extern PFN_NUMBER MiFreeSwapPages; extern PFN_NUMBER MiUsedSwapPages; extern SIZE_T MmTotalPagedPoolQuota; @@ -1134,7 +1135,7 @@ /* Make sure the PFN number is valid */ if (Pfn > MmHighestPhysicalPage) return NULL; - + /* Make sure this page actually has a PFN entry */ if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, (ULONG)Pfn))) return NULL; @@ -1338,7 +1339,7 @@ VOID NTAPI MmGetPageFileMapping( - struct _EPROCESS *Process, + struct _EPROCESS *Process, PVOID Address, SWAPENTRY* SwapEntry); @@ -1735,7 +1736,15 @@ IN PLIST_ENTRY ListHead ); -extern PMMSUPPORT MmKernelAddressSpace; + +/* procsup.c *****************************************************************/ + +NTSTATUS +NTAPI +MmGrowKernelStack( + IN PVOID StackPointer +); + FORCEINLINE VOID Modified: trunk/reactos/ntoskrnl/ke/i386/usercall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/usercall.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/usercall.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/usercall.c [iso-8859-1] Mon Jul 25 00:01:29 2011 @@ -208,4 +208,146 @@ return CallbackStatus; } +/* Stack layout: + * + * ---------------------------------- + * KCALLOUT_FRAME.ResultLength <= 2nd Parameter to KiCallUserMode + * KCALLOUT_FRAME.Result <= 1st Parameter to KiCallUserMode + * KCALLOUT_FRAME.ReturnAddress <= Return address of KiCallUserMode + * KCALLOUT_FRAME.Ebp \ + * KCALLOUT_FRAME.Ebx | = volatile registers, pushed + * KCALLOUT_FRAME.Esi | by KiCallUserMode + * KCALLOUT_FRAME.Edi / + * KCALLOUT_FRAME.CallbackStack + * KCALLOUT_FRAME.TrapFrame + * KCALLOUT_FRAME.InitialStack <= CalloutFrame points here + * ---------------------------------- + * ~~ optional alignment ~~ + * ---------------------------------- + * FX_SAVE_AREA + * ---------------------------------- + * KTRAP_FRAME + * ---------------------------------- + * ~~ begin of stack frame for KiUserModeCallout ~~ + * + */ + +NTSTATUS +FASTCALL +KiUserModeCallout(PKCALLOUT_FRAME CalloutFrame) +{ + PKTHREAD CurrentThread; + PKTRAP_FRAME TrapFrame, CallbackTrapFrame; + PFX_SAVE_AREA FxSaveArea, OldFxSaveArea; + PKPCR Pcr; + PKTSS Tss; + ULONG_PTR InitialStack; + NTSTATUS Status; + + /* Get the current thread */ + CurrentThread = KeGetCurrentThread(); + +#if DBG + /* Check if we are at pasive level */ + if (KeGetCurrentIrql() != PASSIVE_LEVEL) + { + /* We're not, bugcheck */ + KeBugCheckEx(IRQL_GT_ZERO_AT_SYSTEM_SERVICE, + 0, + KeGetCurrentIrql(), + 0, + 0); + } + + /* Check if we are attached or APCs are disabled */ + if ((CurrentThread->ApcStateIndex != OriginalApcEnvironment) || + (CurrentThread->CombinedApcDisable > 0)) + { + KeBugCheckEx(APC_INDEX_MISMATCH, + 0, + CurrentThread->ApcStateIndex, + CurrentThread->CombinedApcDisable, + 0); + } +#endif + + /* Align stack on 16-byte boundary */ + InitialStack = (ULONG_PTR)CalloutFrame & ~15; + + /* Check if we have enough space on the stack */ + if ((InitialStack - KERNEL_STACK_SIZE) < CurrentThread->StackLimit) + { + /* We don't, we'll have to grow our stack */ + Status = MmGrowKernelStack((PVOID)InitialStack); + + /* Quit if we failed */ + if (!NT_SUCCESS(Status)) return Status; + } + + /* Save the current callback stack and initial stack */ + CalloutFrame->CallbackStack = (ULONG_PTR)CurrentThread->CallbackStack; + CalloutFrame->InitialStack = (ULONG_PTR)CurrentThread->InitialStack; + + /* Get and save the trap frame */ + TrapFrame = CurrentThread->TrapFrame; + CalloutFrame->TrapFrame = (ULONG_PTR)TrapFrame; + + /* Set the new callback stack */ + CurrentThread->CallbackStack = CalloutFrame; + + /* Set destination and origin NPX Areas */ + OldFxSaveArea = (PVOID)(CalloutFrame->InitialStack - sizeof(FX_SAVE_AREA)); + FxSaveArea = (PVOID)(InitialStack - sizeof(FX_SAVE_AREA)); + + /* Disable interrupts so we can fill the NPX State */ + _disable(); + + /* Now copy the NPX State */ + FxSaveArea->U.FnArea.ControlWord = OldFxSaveArea->U.FnArea.ControlWord; + FxSaveArea->U.FnArea.StatusWord = OldFxSaveArea->U.FnArea.StatusWord; + FxSaveArea->U.FnArea.TagWord = OldFxSaveArea->U.FnArea.TagWord; + FxSaveArea->U.FnArea.DataSelector = OldFxSaveArea->U.FnArea.DataSelector; + FxSaveArea->Cr0NpxState = OldFxSaveArea->Cr0NpxState; + + /* Set the stack address */ + CurrentThread->InitialStack = (PVOID)InitialStack; + + /* Locate the trap frame on the callback stack */ + CallbackTrapFrame = (PVOID)((ULONG_PTR)FxSaveArea - sizeof(KTRAP_FRAME)); + + /* Copy the trap frame to the new location */ + *CallbackTrapFrame = *TrapFrame; + + /* Get PCR */ + Pcr = KeGetPcr(); + + /* Update the exception list */ + CallbackTrapFrame->ExceptionList = Pcr->Used_ExceptionList; + + /* Get TSS */ + Tss = Pcr->TSS; + + /* Bias the stack for V86 mode */ + if (CallbackTrapFrame->EFlags & EFLAGS_V86_MASK) + { + /* Set new stack address in TSS */ + Tss->Esp0 = (ULONG_PTR)(CallbackTrapFrame + 1); + } + else + { + /* Set new stack address in TSS */ + Tss->Esp0 = (ULONG_PTR)&CallbackTrapFrame->V86Es; + } + + /* Set user-mode dispatcher address as EIP */ + CallbackTrapFrame->Eip = (ULONG_PTR)KeUserCallbackDispatcher; + + /* Bring interrupts back */ + _enable(); + + /* Exit to user-mode */ + KiServiceExit(CallbackTrapFrame, 0); +} + + /* EOF */ Modified: trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/usercall_…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] Mon Jul 25 00:01:29 2011 @@ -17,19 +17,10 @@ EXTERN @KiServiceExit@8:PROC EXTERN _KeGetCurrentIrql@0:PROC EXTERN _KeBugCheckEx@20:PROC +EXTERN @KiUserModeCallout@4:PROC /* FUNCTIONS ****************************************************************/ .code - -PUBLIC _KiGetUserModeStackAddress@0 -_KiGetUserModeStackAddress@0: - - /* Get the current thread's trapframe and return the esp */ - mov eax, fs:[KPCR_CURRENT_THREAD] - mov eax, [eax+KTHREAD_TRAP_FRAME] - lea eax, [eax+KTRAP_FRAME_ESP] - ret - /*++ * @name KiCallUserMode @@ -58,166 +49,23 @@ PUBLIC _KiCallUserMode@8 _KiCallUserMode@8: - /* Save volatile registers */ + /* Push volatile registers on the stack. + This is part of the KCALLOUT_FRAME */ push ebp push ebx push esi push edi - /* Get the current thread */ - mov ebx, fs:[KPCR_CURRENT_THREAD] - - /* Make sure we're at passive */ -#if DBG - call _KeGetCurrentIrql@0 - or al, al - jz AtPassive - - /* We're not, bugcheck! */ - push 0 - push 0 - push eax - push 0 - push IRQL_GT_ZERO_AT_SYSTEM_SERVICE - call _KeBugCheckEx@20 - -AtPassive: - - /* Make sure that we are not attached and that APCs are not disabled */ - movzx eax, byte ptr [ebx+KTHREAD_APC_STATE_INDEX] - mov edx, [ebx+KTHREAD_COMBINED_APC_DISABLE] - or eax, eax - jnz InvalidIndex - or edx, edx - jz ApcsEnabled - -InvalidIndex: - - push 0 - push edx - push eax - push 0 - push APC_INDEX_MISMATCH - call _KeBugCheckEx@20 -ApcsEnabled: -#endif - - /* Get the lowest stack limit and check if we can handle it */ - lea eax, [esp-HEX(3000)] - cmp eax, [ebx+KTHREAD_STACK_LIMIT] - jnb StackOk - - /* We can't, we'll have to grow our stack */ - push esp - call _MmGrowKernelStack@4 - - /* Quit if we failed */ - or eax, eax - jnz GrowFailed - - /* Save the current callback stack */ -StackOk: - push [ebx+KTHREAD_CALLBACK_STACK] - - /* Get and save the trap frame */ - mov edx, [ebx+KTHREAD_TRAP_FRAME] - push edx - - /* Get and save the initial stack */ - mov esi, [ebx+KTHREAD_INITIAL_STACK] - push esi - - /* Set the new callback stack */ - mov [ebx+KTHREAD_CALLBACK_STACK], esp - - /* Align stack on 16-byte boundary */ - and esp, NOT 15 - mov edi, esp - - /* Set destination and origin NPX Areas */ - sub esp, NPX_FRAME_LENGTH - sub esi, NPX_FRAME_LENGTH - - /* Disable interrupts so we can fill the NPX State */ - cli - - /* Now copy the NPX State */ - mov ecx, [esi+FP_CONTROL_WORD] - mov [esp+FP_CONTROL_WORD], ecx - mov ecx, [esi+FP_STATUS_WORD] - mov [esp+FP_STATUS_WORD], ecx - mov ecx, [esi+FP_TAG_WORD] - mov [esp+FP_TAG_WORD], ecx - mov ecx, [esi+FP_DATA_SELECTOR] - mov [esp+FP_DATA_SELECTOR], ecx - mov ecx, [esi+FN_CR0_NPX_STATE] - mov [esp+FN_CR0_NPX_STATE], ecx - - /* Get TSS */ - mov esi, fs:[KPCR_TSS] - - /* Set the stack address */ - mov [ebx+KTHREAD_INITIAL_STACK], edi - - /* Bias the stack for V86 mode */ - mov ecx, esp - sub esp, 16 - test dword ptr [edx+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK - jnz DontBias - mov ecx, esp - -DontBias: - /* Set new stack address in TSS */ - mov [esi+KTSS_ESP0], ecx - - /* Allocate the trap frame and set it */ - sub esp, KTRAP_FRAME_V86_ES - mov ebp, esp - - /* Set copy iterator and dest/origin parameters and do the copy */ - mov ecx, (KTRAP_FRAME_V86_ES - KTRAP_FRAME_FS) / 4 - lea edi, [esp+KTRAP_FRAME_FS] - lea esi, [edx+KTRAP_FRAME_FS] - rep movsd - - /* Copy DR7 */ - mov edi, [edx+KTRAP_FRAME_DR7] - test edi, NOT DR7_RESERVED_MASK - mov [esp+KTRAP_FRAME_DR7], edi - - /* Check if we need to save debug registers */ - jnz SaveDebug - - /* Get user-mode dispatcher address and set it as EIP */ -SetEip: - mov eax, dword ptr [_KeUserCallbackDispatcher] - mov [esp+KTRAP_FRAME_EIP], eax - - /* Set the exception list */ - mov eax, fs:[KPCR_EXCEPTION_LIST] - mov [esp+KTRAP_FRAME_EXCEPTION_LIST], eax - - /* Set the previous mode */ - mov eax, [edx+KTRAP_FRAME_PREVIOUS_MODE] - mov [esp+KTRAP_FRAME_PREVIOUS_MODE], eax - - /* Bring interrupts back */ - sti - - /* Exit to user-mode */ - mov ecx, esp - jmp @KiServiceExit@8 - -SaveDebug: - - /* Copy all 5 DRs */ - mov ecx, 5 - lea edi, [esp+KTRAP_FRAME_DR0] - lea esi, [edx+KTRAP_FRAME_DR0] - rep movsd - jmp SetEip - -GrowFailed: + /* load the address of the callout frame into ecx */ + lea ecx, [esp - 12] + + /* Allocate space for the inital stack */ + sub esp, 12 + NPX_FRAME_LENGTH + KTRAP_FRAME_LENGTH + 16 + + call @KiUserModeCallout@4 + + add esp, 12 + NPX_FRAME_LENGTH + KTRAP_FRAME_LENGTH + 16 + /* Restore registers */ pop edi pop esi
13 years, 5 months
1
0
0
0
[ion] 52854: [KERNEL32]: Fix the spec/pspec files to match 100% the exports on NT 5.2's Kernel32.dll [KERNEL32]: Remove, add, fix, stub functions where necessary to handle these new/modified exports.
by ion@svn.reactos.org
Author: ion Date: Sun Jul 24 23:42:09 2011 New Revision: 52854 URL:
http://svn.reactos.org/svn/reactos?rev=52854&view=rev
Log: [KERNEL32]: Fix the spec/pspec files to match 100% the exports on NT 5.2's Kernel32.dll [KERNEL32]: Remove, add, fix, stub functions where necessary to handle these new/modified exports. Modified: trunk/reactos/dll/win32/kernel32/client/appcache.c trunk/reactos/dll/win32/kernel32/client/environ.c trunk/reactos/dll/win32/kernel32/client/time.c trunk/reactos/dll/win32/kernel32/client/vdm.c trunk/reactos/dll/win32/kernel32/kernel32.pspec trunk/reactos/dll/win32/kernel32/kernel32.spec trunk/reactos/dll/win32/kernel32/wine/lzexpand.c trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/kernel32/client/appcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
Modified: trunk/reactos/dll/win32/kernel32/client/environ.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
Modified: trunk/reactos/dll/win32/kernel32/client/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
Modified: trunk/reactos/dll/win32/kernel32/kernel32.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
Modified: trunk/reactos/dll/win32/kernel32/kernel32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
Modified: trunk/reactos/dll/win32/kernel32/wine/lzexpand.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/wine/lz…
Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
13 years, 5 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
52
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Results per page:
10
25
50
100
200