ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2012
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
22 participants
577 discussions
Start a n
N
ew thread
[ion] 55647: [NTDLL/INCLUDE]: Rename the CSRSRV API Numbers not to conflict with the actual functions. [CSRSRV]: Import server.c from CSRSRV2, and move the existing CsrSrv functions we had from wap...
by ion@svn.reactos.org
Author: ion Date: Thu Feb 16 19:53:47 2012 New Revision: 55647 URL:
http://svn.reactos.org/svn/reactos?rev=55647&view=rev
Log: [NTDLL/INCLUDE]: Rename the CSRSRV API Numbers not to conflict with the actual functions. [CSRSRV]: Import server.c from CSRSRV2, and move the existing CsrSrv functions we had from wapi.c to server.c (with the reactOS-specific hacks we had). The other CsrSrv* functions are not yet used. Added: trunk/reactos/subsystems/win32/csrss/csrsrv/server.c - copied, changed from r55585, trunk/reactos/subsystems/csr/csrsrv/server.c Modified: trunk/reactos/dll/ntdll/csr/api.c trunk/reactos/dll/ntdll/csr/connect.c trunk/reactos/include/reactos/subsys/csrss/csrss.h trunk/reactos/subsystems/win32/csrss/csrsrv/CMakeLists.txt trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c trunk/reactos/subsystems/win32/csrss/csrsrv/csrsrv.rbuild trunk/reactos/subsystems/win32/csrss/csrsrv/init.c trunk/reactos/subsystems/win32/csrss/include/api.h Modified: trunk/reactos/dll/ntdll/csr/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/csr/api.c?rev=55…
============================================================================== --- trunk/reactos/dll/ntdll/csr/api.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/csr/api.c [iso-8859-1] Thu Feb 16 19:53:47 2012 @@ -48,7 +48,7 @@ /* Call it */ Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, - CSR_MAKE_OPCODE(CsrSrvSetPriorityClass, + CSR_MAKE_OPCODE(CsrpSetPriorityClass, CSR_SRV_SERVER), sizeof(CSR_SET_PRIORITY_CLASS)); @@ -78,7 +78,7 @@ /* Call it */ Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, - CSR_MAKE_OPCODE(CsrSrvIdentifyAlertableThread, + CSR_MAKE_OPCODE(CsrpIdentifyAlertable, CSR_SRV_SERVER), sizeof(CSR_SET_PRIORITY_CLASS)); Modified: trunk/reactos/dll/ntdll/csr/connect.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/csr/connect.c?re…
============================================================================== --- trunk/reactos/dll/ntdll/csr/connect.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/csr/connect.c [iso-8859-1] Thu Feb 16 19:53:47 2012 @@ -438,7 +438,7 @@ #if 0 Status = CsrClientCallServer(&ApiMessage, CaptureBuffer, - CSR_MAKE_OPCODE(CsrSrvClientConnect, + CSR_MAKE_OPCODE(CsrpClientConnect, CSR_SRV_DLL), sizeof(CSR_CLIENT_CONNECT)); #endif Modified: trunk/reactos/include/reactos/subsys/csrss/csrss.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
============================================================================== --- trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/subsys/csrss/csrss.h [iso-8859-1] Thu Feb 16 19:53:47 2012 @@ -864,9 +864,15 @@ /* Types used in the new CSR. Temporarly here for proper compile of NTDLL */ #define CSR_SRV_SERVER 0 -#define CsrSrvClientConnect 0 -#define CsrSrvIdentifyAlertableThread 3 -#define CsrSrvSetPriorityClass 4 +typedef enum _CSR_SRV_API_NUMBER +{ + CsrpClientConnect, + CsrpThreadConnect, + CsrpProfileControl, + CsrpIdentifyAlertable, + CsrpSetPriorityClass, + CsrpMaxApiNumber +} CSR_SRV_API_NUMBER, *PCSR_SRV_API_NUMBER; #define CSR_MAKE_OPCODE(s,m) ((s) << 16) | (m) Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/CMakeLists.txt [iso-8859-1] Thu Feb 16 19:53:47 2012 @@ -13,6 +13,7 @@ init.c wait.c session.c + server.c ${CMAKE_CURRENT_BINARY_DIR}/csrsrv.def) add_library(csrsrv SHARED ${SOURCE}) 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] Thu Feb 16 19:53:47 2012 @@ -111,197 +111,6 @@ /* Call the hard error handler in win32csr */ (VOID)CallHardError(ProcessData, Message); -} - -PVOID CsrSrvSharedSectionHeap; -PVOID CsrSrvSharedSectionBase; -PVOID *CsrSrvSharedStaticServerData; -ULONG CsrSrvSharedSectionSize; -HANDLE CsrSrvSharedSection; - -/*++ - * @name CsrSrvCreateSharedSection - * - * The CsrSrvCreateSharedSection creates the Shared Section that all CSR Server - * DLLs and Clients can use to share data. - * - * @param ParameterValue - * Specially formatted string from our registry command-line which - * specifies various arguments for the shared section. - * - * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL - * othwerwise. - * - * @remarks None. - * - *--*/ -NTSTATUS -NTAPI -CsrSrvCreateSharedSection(IN PCHAR ParameterValue) -{ - PCHAR SizeValue = ParameterValue; - ULONG Size; - NTSTATUS Status; - LARGE_INTEGER SectionSize; - ULONG ViewSize = 0; - SYSTEM_BASIC_INFORMATION CsrNtSysInfo; - PPEB Peb = NtCurrentPeb(); - - /* ReactOS Hackssss */ - Status = NtQuerySystemInformation(SystemBasicInformation, - &CsrNtSysInfo, - sizeof(SYSTEM_BASIC_INFORMATION), - NULL); - ASSERT(NT_SUCCESS(Status)); - - /* Find the first comma, and null terminate */ - while (*SizeValue) - { - if (*SizeValue == ',') - { - *SizeValue++ = '\0'; - break; - } - else - { - SizeValue++; - } - } - - /* Make sure it's valid */ - if (!*SizeValue) return STATUS_INVALID_PARAMETER; - - /* Convert it to an integer */ - Status = RtlCharToInteger(SizeValue, 0, &Size); - if (!NT_SUCCESS(Status)) return Status; - - /* Multiply by 1024 entries and round to page size */ - CsrSrvSharedSectionSize = ROUND_UP(Size * 1024, CsrNtSysInfo.PageSize); - - /* Create the Secion */ - SectionSize.LowPart = CsrSrvSharedSectionSize; - SectionSize.HighPart = 0; - Status = NtCreateSection(&CsrSrvSharedSection, - SECTION_ALL_ACCESS, - NULL, - &SectionSize, - PAGE_EXECUTE_READWRITE, - SEC_BASED | SEC_RESERVE, - NULL); - if (!NT_SUCCESS(Status)) return Status; - - /* Map the section */ - Status = NtMapViewOfSection(CsrSrvSharedSection, - NtCurrentProcess(), - &CsrSrvSharedSectionBase, - 0, - 0, - NULL, - &ViewSize, - ViewUnmap, - MEM_TOP_DOWN, - PAGE_EXECUTE_READWRITE); - if(!NT_SUCCESS(Status)) - { - /* Fail */ - NtClose(CsrSrvSharedSection); - return(Status); - } - - /* FIXME: Write the value to registry */ - - /* The Heap is the same place as the Base */ - CsrSrvSharedSectionHeap = CsrSrvSharedSectionBase; - - /* Create the heap */ - if (!(RtlCreateHeap(HEAP_ZERO_MEMORY, - CsrSrvSharedSectionHeap, - CsrSrvSharedSectionSize, - PAGE_SIZE, - 0, - 0))) - { - /* Failure, unmap section and return */ - NtUnmapViewOfSection(NtCurrentProcess(), - CsrSrvSharedSectionBase); - NtClose(CsrSrvSharedSection); - return STATUS_NO_MEMORY; - } - - /* Now allocate space from the heap for the Shared Data */ - CsrSrvSharedStaticServerData = RtlAllocateHeap(CsrSrvSharedSectionHeap, - 0, - 4 * // HAX CSR_SERVER_DLL_MAX * - sizeof(PVOID)); - - /* Write the values to the PEB */ - Peb->ReadOnlySharedMemoryBase = CsrSrvSharedSectionBase; - Peb->ReadOnlySharedMemoryHeap = CsrSrvSharedSectionHeap; - Peb->ReadOnlyStaticServerData = CsrSrvSharedStaticServerData; - - /* Return */ - return STATUS_SUCCESS; -} - -/*++ - * @name CsrSrvAttachSharedSection - * - * The CsrSrvAttachSharedSection maps the CSR Shared Section into a new - * CSR Process' address space, and returns the pointers to the section - * through the Connection Info structure. - * - * @param CsrProcess - * Pointer to the CSR Process that is attempting a connection. - * - * @param ConnectInfo - * Pointer to the CSR Connection Info structure for the incoming - * connection. - * - * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL - * othwerwise. - * - * @remarks None. - * - *--*/ -NTSTATUS -NTAPI -CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL, - OUT PCSR_CONNECTION_INFO ConnectInfo) -{ - NTSTATUS Status; - ULONG ViewSize = 0; - - /* Check if we have a process */ - if (CsrProcess) - { - /* Map the section into this process */ - DPRINT("CSR Process Handle: %p. CSR Process: %p\n", CsrProcess->ProcessHandle, CsrProcess); - Status = NtMapViewOfSection(CsrSrvSharedSection, - CsrProcess->ProcessHandle, - &CsrSrvSharedSectionBase, - 0, - 0, - NULL, - &ViewSize, - ViewUnmap, - SEC_NO_CHANGE, - PAGE_EXECUTE_READ); - if (Status == STATUS_CONFLICTING_ADDRESSES) - { - /* I Think our csrss tries to connect to itself... */ - DPRINT1("Multiple mapping hack\n"); - Status = STATUS_SUCCESS; - } - if (!NT_SUCCESS(Status)) return Status; - } - - /* Write the values in the Connection Info structure */ - ConnectInfo->SharedSectionBase = CsrSrvSharedSectionBase; - ConnectInfo->SharedSectionHeap = CsrSrvSharedSectionHeap; - ConnectInfo->SharedSectionData = CsrSrvSharedStaticServerData; - - /* Return success */ - return STATUS_SUCCESS; } /*++ Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/csrsrv.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/csrsrv/csrsrv.rbuild [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/csrsrv.rbuild [iso-8859-1] Thu Feb 16 19:53:47 2012 @@ -20,5 +20,6 @@ <file>init.c</file> <file>wait.c</file> <file>session.c</file> + <file>server.c</file> <pch>srv.h</pch> </module> 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] Thu Feb 16 19:53:47 2012 @@ -181,10 +181,6 @@ VOID WINAPI BasepFakeStaticServerData(VOID); - -NTSTATUS -NTAPI -CsrSrvCreateSharedSection(IN PCHAR ParameterValue); /*++ * @name CsrSetProcessSecurity Copied: trunk/reactos/subsystems/win32/csrss/csrsrv/server.c (from r55585, trunk/reactos/subsystems/csr/csrsrv/server.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/csr…
============================================================================== --- trunk/reactos/subsystems/csr/csrsrv/server.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/csrsrv/server.c [iso-8859-1] Thu Feb 16 19:53:47 2012 @@ -49,6 +49,39 @@ HANDLE CsrSrvSharedSection; /* PRIVATE FUNCTIONS**********************************************************/ + +/*++ + * @name CsrServerDllInitialization + * @implemented NT4 + * + * The CsrServerDllInitialization is the initialization routine for + * the this Server DLL. + * + * @param LoadedServerDll + * Pointer to the CSR Server DLL structure representing this Server DLL. + * + * @return STATUS_SUCCESS. + * + * @remarks None. + * + *--*/ +NTSTATUS +NTAPI +CsrServerDllInitialization(IN PCSR_SERVER_DLL LoadedServerDll) +{ + /* Setup the DLL Object */ + LoadedServerDll->ApiBase = 0; + LoadedServerDll->HighestApiSupported = 5; + LoadedServerDll->DispatchTable = CsrServerApiDispatchTable; + LoadedServerDll->ValidTable = CsrServerApiServerValidTable; + LoadedServerDll->NameTable = CsrServerApiNameTable; + LoadedServerDll->SizeOfProcessData = 0; + LoadedServerDll->ConnectCallback = NULL; + LoadedServerDll->DisconnectCallback = NULL; + + /* All done */ + return STATUS_SUCCESS; +} /*++ * @name CsrLoadServerDll @@ -173,7 +206,7 @@ if (NT_SUCCESS(Status)) { /* Get the result from the Server DLL */ - Status = (*ServerDllInitProcedure)(ServerDll); + Status = ServerDllInitProcedure(ServerDll); /* Check for Success */ if (NT_SUCCESS(Status)) @@ -215,39 +248,6 @@ } /*++ - * @name CsrServerDllInitialization - * @implemented NT4 - * - * The CsrServerDllInitialization is the initialization routine for - * the this Server DLL. - * - * @param LoadedServerDll - * Pointer to the CSR Server DLL structure representing this Server DLL. - * - * @return STATUS_SUCCESS. - * - * @remarks None. - * - *--*/ -NTSTATUS -NTAPI -CsrServerDllInitialization(IN PCSR_SERVER_DLL LoadedServerDll) -{ - /* Setup the DLL Object */ - LoadedServerDll->ApiBase = 0; - LoadedServerDll->HighestApiSupported = 5; - LoadedServerDll->DispatchTable = CsrServerApiDispatchTable; - LoadedServerDll->ValidTable = CsrServerApiServerValidTable; - LoadedServerDll->NameTable = CsrServerApiNameTable; - LoadedServerDll->SizeOfProcessData = 0; - LoadedServerDll->ConnectCallback = NULL; - LoadedServerDll->DisconnectCallback = NULL; - - /* All done */ - return STATUS_SUCCESS; -} - -/*++ * @name CsrSrvClientConnect * * The CsrSrvClientConnect CSR API handles a new connection to a server DLL. @@ -269,6 +269,9 @@ CsrSrvClientConnect(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PULONG Reply OPTIONAL) { + /* Hack */ + return STATUS_SUCCESS; +#if 0 NTSTATUS Status; PCSR_CLIENT_CONNECT ClientConnect; PCSR_SERVER_DLL ServerDll; @@ -283,7 +286,7 @@ { return STATUS_TOO_MANY_NAMES; } - else if (!(CsrLoadedServerDll[ClientConnect->ServerId])) + else if (!CsrLoadedServerDll[ClientConnect->ServerId]) { return STATUS_INVALID_PARAMETER; } @@ -305,9 +308,9 @@ if (ServerDll->ConnectCallback) { /* Call the callback */ - Status = (ServerDll->ConnectCallback)(CurrentProcess, - ClientConnect->ConnectionInfo, - &ClientConnect->ConnectionInfoSize); + Status = ServerDll->ConnectCallback(CurrentProcess, + ClientConnect->ConnectionInfo, + &ClientConnect->ConnectionInfoSize); } else { @@ -317,6 +320,7 @@ /* Return status */ return Status; +#endif } /*++ @@ -347,7 +351,7 @@ PPEB Peb = NtCurrentPeb(); /* If there's no parameter, fail */ - if (ParameterValue) return STATUS_INVALID_PARAMETER; + if (!ParameterValue) return STATUS_INVALID_PARAMETER; /* Find the first comma, and null terminate */ while (*SizeValue) @@ -400,7 +404,7 @@ { /* Fail */ NtClose(CsrSrvSharedSection); - return(Status); + return Status; } /* FIXME: Write the value to registry */ @@ -469,7 +473,8 @@ /* Check if we have a process */ if (CsrProcess) { - /* Map the sectio into this process */ + /* Map the section into this process */ + DPRINT("CSR Process Handle: %p. CSR Process: %p\n", CsrProcess->ProcessHandle, CsrProcess); Status = NtMapViewOfSection(CsrSrvSharedSection, CsrProcess->ProcessHandle, &CsrSrvSharedSectionBase, @@ -480,6 +485,12 @@ ViewUnmap, SEC_NO_CHANGE, PAGE_EXECUTE_READ); + if (Status == STATUS_CONFLICTING_ADDRESSES) + { + /* I Think our csrss tries to connect to itself... */ + DPRINT1("Multiple mapping hack\n"); + Status = STATUS_SUCCESS; + } if (!NT_SUCCESS(Status)) return Status; } Modified: trunk/reactos/subsystems/win32/csrss/include/api.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/inc…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/include/api.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/include/api.h [iso-8859-1] Thu Feb 16 19:53:47 2012 @@ -14,6 +14,7 @@ #include <csrss/csrss.h> +#define CSR_SRV_SERVER 0 #define CSR_SERVER_DLL_MAX 4 #define LOCK RtlEnterCriticalSection(&ProcessDataLock) #define UNLOCK RtlLeaveCriticalSection(&ProcessDataLock) @@ -151,6 +152,75 @@ CSR_API_MESSAGE WaitApiMessage; } CSR_WAIT_BLOCK, *PCSR_WAIT_BLOCK; +typedef +NTSTATUS +(NTAPI *PCSR_CONNECT_CALLBACK)( + IN PCSR_PROCESS CsrProcess, + IN OUT PVOID ConnectionInfo, + IN OUT PULONG ConnectionInfoLength +); + +typedef +VOID +(NTAPI *PCSR_DISCONNECT_CALLBACK)(IN PCSR_PROCESS CsrProcess); + +typedef +NTSTATUS +(NTAPI *PCSR_NEWPROCESS_CALLBACK)( + IN PCSR_PROCESS Parent, + IN PCSR_PROCESS CsrProcess +); + +typedef +VOID +(NTAPI *PCSR_HARDERROR_CALLBACK)( + IN PCSR_THREAD CsrThread, + IN PHARDERROR_MSG HardErrorMessage +); + +typedef +ULONG +(NTAPI *PCSR_SHUTDOWNPROCESS_CALLBACK)( + IN PCSR_PROCESS CsrProcess, + IN ULONG Flags, + IN BOOLEAN FirstPhase +); + +typedef +NTSTATUS +(NTAPI *PCSR_API_ROUTINE)( + IN OUT PCSR_API_MESSAGE ApiMessage, + IN OUT PULONG Reply +); + +typedef struct _CSR_SERVER_DLL +{ + ULONG Length; + HANDLE Event; + ANSI_STRING Name; + HANDLE ServerHandle; + ULONG ServerId; + ULONG Unknown; + ULONG ApiBase; + ULONG HighestApiSupported; + PCSR_API_ROUTINE *DispatchTable; + PBOOLEAN ValidTable; + PCHAR *NameTable; + ULONG SizeOfProcessData; + PCSR_CONNECT_CALLBACK ConnectCallback; + PCSR_DISCONNECT_CALLBACK DisconnectCallback; + PCSR_HARDERROR_CALLBACK HardErrorCallback; + PVOID SharedSection; + PCSR_NEWPROCESS_CALLBACK NewProcessCallback; + PCSR_SHUTDOWNPROCESS_CALLBACK ShutdownProcessCallback; + ULONG Unknown2[3]; +} CSR_SERVER_DLL, *PCSR_SERVER_DLL; + +typedef +NTSTATUS +(NTAPI *PCSR_SERVER_DLL_INIT_CALLBACK)(IN PCSR_SERVER_DLL ServerDll); + + typedef NTSTATUS (WINAPI *CSRSS_API_PROC)(PCSR_PROCESS ProcessData, PCSR_API_MESSAGE Request); @@ -237,6 +307,11 @@ extern RTL_CRITICAL_SECTION ProcessDataLock, CsrWaitListsLock; extern UNICODE_STRING CsrDirectoryName; extern ULONG CsrDebug; +extern ULONG CsrTotalPerProcessDataLength; +extern SYSTEM_BASIC_INFORMATION CsrNtSysInfo; +extern PVOID CsrSrvSharedSectionHeap; +extern PVOID *CsrSrvSharedStaticServerData; +extern HANDLE CsrInitializationEvent; NTSTATUS NTAPI @@ -273,6 +348,43 @@ NTAPI CsrInitializeNtSessionList(VOID); +NTSTATUS +NTAPI +CsrSrvAttachSharedSection(IN PCSR_PROCESS CsrProcess OPTIONAL, +OUT PCSR_CONNECTION_INFO ConnectInfo); + +NTSTATUS +NTAPI +CsrSrvCreateSharedSection(IN PCHAR ParameterValue); + +NTSTATUS +NTAPI +CsrSrvClientConnect( + IN OUT PCSR_API_MESSAGE ApiMessage, + IN OUT PULONG Reply +); + +NTSTATUS +NTAPI +CsrSrvUnusedFunction( + IN OUT PCSR_API_MESSAGE ApiMessage, + IN OUT PULONG Reply +); + +NTSTATUS +NTAPI +CsrSrvIdentifyAlertableThread( + IN OUT PCSR_API_MESSAGE ApiMessage, + IN OUT PULONG Reply +); + +NTSTATUS +NTAPI +CsrSrvSetPriorityClass( + IN OUT PCSR_API_MESSAGE ApiMessage, + IN OUT PULONG Reply +); + /* api/user.c */ CSR_API(CsrRegisterServicesProcess);
12 years, 10 months
1
0
0
0
[ion] 55646: [CSRSRV2]: Bug fixes.
by ion@svn.reactos.org
Author: ion Date: Thu Feb 16 19:15:00 2012 New Revision: 55646 URL:
http://svn.reactos.org/svn/reactos?rev=55646&view=rev
Log: [CSRSRV2]: Bug fixes. Modified: trunk/reactos/subsystems/csr/csrsrv/server.c Modified: trunk/reactos/subsystems/csr/csrsrv/server.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/csr/csrsrv/serv…
============================================================================== --- trunk/reactos/subsystems/csr/csrsrv/server.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/csr/csrsrv/server.c [iso-8859-1] Thu Feb 16 19:15:00 2012 @@ -173,7 +173,7 @@ if (NT_SUCCESS(Status)) { /* Get the result from the Server DLL */ - Status = (*ServerDllInitProcedure)(ServerDll); + Status = ServerDllInitProcedure(ServerDll); /* Check for Success */ if (NT_SUCCESS(Status)) @@ -283,7 +283,7 @@ { return STATUS_TOO_MANY_NAMES; } - else if (!(CsrLoadedServerDll[ClientConnect->ServerId])) + else if (!CsrLoadedServerDll[ClientConnect->ServerId]) { return STATUS_INVALID_PARAMETER; } @@ -305,9 +305,9 @@ if (ServerDll->ConnectCallback) { /* Call the callback */ - Status = (ServerDll->ConnectCallback)(CurrentProcess, - ClientConnect->ConnectionInfo, - &ClientConnect->ConnectionInfoSize); + Status = ServerDll->ConnectCallback(CurrentProcess, + ClientConnect->ConnectionInfo, + &ClientConnect->ConnectionInfoSize); } else { @@ -347,7 +347,7 @@ PPEB Peb = NtCurrentPeb(); /* If there's no parameter, fail */ - if (ParameterValue) return STATUS_INVALID_PARAMETER; + if (!ParameterValue) return STATUS_INVALID_PARAMETER; /* Find the first comma, and null terminate */ while (*SizeValue) @@ -400,7 +400,7 @@ { /* Fail */ NtClose(CsrSrvSharedSection); - return(Status); + return Status; } /* FIXME: Write the value to registry */
12 years, 10 months
1
0
0
0
[jgardou] 55645: [NTOSKRNL/MM] - First drop of a new implementation of NtAllocateVirtualMemory. Very incomplete, don't hesitate to drop in and complete it. For now, only MEM_RESERVE is kind of supp...
by jgardou@svn.reactos.org
Author: jgardou Date: Thu Feb 16 17:24:15 2012 New Revision: 55645 URL:
http://svn.reactos.org/svn/reactos?rev=55645&view=rev
Log: [NTOSKRNL/MM] - First drop of a new implementation of NtAllocateVirtualMemory. Very incomplete, don't hesitate to drop in and complete it. For now, only MEM_RESERVE is kind of supported, as well as MEM_RESERVE|MEM_COMMIT Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c trunk/reactos/ntoskrnl/mm/anonmem.c Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Thu Feb 16 17:24:15 2012 @@ -2773,4 +2773,359 @@ return Status; } +#ifdef __USE_ARM3__ +/* +* @implemented +*/ +NTSTATUS +NTAPI +NtAllocateVirtualMemory(IN HANDLE ProcessHandle, + IN OUT PVOID* UBaseAddress, + IN ULONG_PTR ZeroBits, + IN OUT PSIZE_T URegionSize, + IN ULONG AllocationType, + IN ULONG Protect) +{ + PEPROCESS Process; + ULONG Type; + NTSTATUS Status = STATUS_SUCCESS; + PVOID BaseAddress; + ULONG RegionSize; + PMMVAD Vad; + PMMADDRESS_NODE ParentNode; + ULONG_PTR StartVpn, EndVpn; + PHYSICAL_ADDRESS BoundaryAddressMultiple; + PEPROCESS CurrentProcess = PsGetCurrentProcess(); + KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); + KAPC_STATE ApcState; + ULONG ProtectionMask; + BOOLEAN Attached = FALSE; + BoundaryAddressMultiple.QuadPart = 0; + TABLE_SEARCH_RESULT Result; + + PAGED_CODE(); + + /* Check for valid Zero bits */ + if (ZeroBits > 21) + { + DPRINT1("Too many zero bits\n"); + return STATUS_INVALID_PARAMETER_3; + } + + /* Check for valid Allocation Types */ + if ((AllocationType & ~(MEM_COMMIT | MEM_RESERVE | MEM_RESET | MEM_PHYSICAL | + MEM_TOP_DOWN | MEM_WRITE_WATCH))) + { + DPRINT1("Invalid Allocation Type\n"); + return STATUS_INVALID_PARAMETER_5; + } + + /* Check for at least one of these Allocation Types to be set */ + if (!(AllocationType & (MEM_COMMIT | MEM_RESERVE | MEM_RESET))) + { + DPRINT1("No memory allocation base type\n"); + return STATUS_INVALID_PARAMETER_5; + } + + /* MEM_RESET is an exclusive flag, make sure that is valid too */ + if ((AllocationType & MEM_RESET) && (AllocationType != MEM_RESET)) + { + DPRINT1("Invalid use of MEM_RESET\n"); + return STATUS_INVALID_PARAMETER_5; + } + + /* Check if large pages are being used */ + if (AllocationType & MEM_LARGE_PAGES) + { + /* Large page allocations MUST be committed */ + if (!(AllocationType & MEM_COMMIT)) + { + DPRINT1("Must supply MEM_COMMIT with MEM_LARGE_PAGES\n"); + return STATUS_INVALID_PARAMETER_5; + } + + /* These flags are not allowed with large page allocations */ + if (AllocationType & (MEM_PHYSICAL | MEM_RESET | MEM_WRITE_WATCH)) + { + DPRINT1("Using illegal flags with MEM_LARGE_PAGES\n"); + return STATUS_INVALID_PARAMETER_5; + } + } + + /* MEM_WRITE_WATCH can only be used if MEM_RESERVE is also used */ + if ((AllocationType & MEM_WRITE_WATCH) && !(AllocationType & MEM_RESERVE)) + { + DPRINT1("MEM_WRITE_WATCH used without MEM_RESERVE\n"); + return STATUS_INVALID_PARAMETER_5; + } + + /* MEM_PHYSICAL can only be used if MEM_RESERVE is also used */ + if ((AllocationType & MEM_PHYSICAL) && !(AllocationType & MEM_RESERVE)) + { + DPRINT1("MEM_WRITE_WATCH used without MEM_RESERVE\n"); + return STATUS_INVALID_PARAMETER_5; + } + + /* Check for valid MEM_PHYSICAL usage */ + if (AllocationType & MEM_PHYSICAL) + { + /* Only these flags are allowed with MEM_PHYSIAL */ + if (AllocationType & ~(MEM_RESERVE | MEM_TOP_DOWN | MEM_PHYSICAL)) + { + DPRINT1("Using illegal flags with MEM_PHYSICAL\n"); + return STATUS_INVALID_PARAMETER_5; + } + + /* Then make sure PAGE_READWRITE is used */ + if (Protect != PAGE_READWRITE) + { + DPRINT1("MEM_PHYSICAL used without PAGE_READWRITE\n"); + return STATUS_INVALID_PARAMETER_6; + } + } + + /* Calculate the protection mask and make sure it's valid */ + ProtectionMask = MiMakeProtectionMask(Protect); + if (ProtectionMask == MM_INVALID_PROTECTION) + { + DPRINT1("Invalid protection mask\n"); + return STATUS_INVALID_PAGE_PROTECTION; + } + + /* Enter SEH */ + _SEH2_TRY + { + /* Check for user-mode parameters */ + if (PreviousMode != KernelMode) + { + /* Make sure they are writable */ + ProbeForWritePointer(UBaseAddress); + ProbeForWriteUlong(URegionSize); + } + + /* Capture their values */ + BaseAddress = *UBaseAddress; + RegionSize = *URegionSize; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Return the exception code */ + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + + /* Make sure there's a size specified */ + if (!RegionSize) + { + DPRINT1("Region size is invalid (zero)\n"); + return STATUS_INVALID_PARAMETER_4; + } + + RegionSize = PAGE_ROUND_UP((ULONG_PTR)BaseAddress + RegionSize) - + PAGE_ROUND_DOWN(BaseAddress); + BaseAddress = (PVOID)PAGE_ROUND_DOWN(BaseAddress); + StartVpn = (ULONG_PTR)BaseAddress >> PAGE_SHIFT; + EndVpn = ((ULONG_PTR)BaseAddress + RegionSize - 1) >> PAGE_SHIFT; + + /* Make sure the allocation isn't past the VAD area */ + if (BaseAddress >= MM_HIGHEST_VAD_ADDRESS) + { + DPRINT1("Virtual allocation base above User Space\n"); + return STATUS_INVALID_PARAMETER_2; + } + + /* Make sure the allocation wouldn't overflow past the VAD area */ + if ((((ULONG_PTR)MM_HIGHEST_VAD_ADDRESS + 1) - (ULONG_PTR)BaseAddress) < RegionSize) + { + DPRINT1("Region size would overflow into kernel-memory\n"); + return STATUS_INVALID_PARAMETER_4; + } + + /* Check if this is for the current process */ + if (ProcessHandle == NtCurrentProcess()) + { + /* We already have the current process, no need to go through Ob */ + Process = CurrentProcess; + } + else + { + /* Reference the handle for correct permissions */ + Status = ObReferenceObjectByHandle(ProcessHandle, + PROCESS_VM_OPERATION, + PsProcessType, + PreviousMode, + (PVOID*)&Process, + NULL); + if (!NT_SUCCESS(Status)) return Status; + + /* Check if not running in the current process */ + if (CurrentProcess != Process) + { + /* Attach to it */ + KeStackAttachProcess(&Process->Pcb, &ApcState); + Attached = TRUE; + } + } + + /* Check for large page allocations */ + if (AllocationType & MEM_LARGE_PAGES) + { + /* The lock memory privilege is required */ + if (!SeSinglePrivilegeCheck(SeLockMemoryPrivilege, PreviousMode)) + { + /* Fail without it */ + DPRINT1("Privilege not held for MEM_LARGE_PAGES\n"); + if (Attached) KeUnstackDetachProcess(&ApcState); + if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process); + return STATUS_PRIVILEGE_NOT_HELD; + } + } + + + /* + * Copy on Write is reserved for system use. This case is a certain failure + * but there may be other cases...needs more testing + */ + if ((!BaseAddress || (AllocationType & MEM_RESERVE)) && + (Protect & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY))) + { + DPRINT1("Copy on write is not supported by VirtualAlloc\n"); + if (Attached) KeUnstackDetachProcess(&ApcState); + if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process); + return STATUS_INVALID_PAGE_PROTECTION; + } + + Type = (AllocationType & MEM_COMMIT) ? MEM_COMMIT : MEM_RESERVE; + DPRINT("Type %x\n", Type); + + /* Lock the process address space */ + KeAcquireGuardedMutex(&Process->AddressCreationLock); + + if(BaseAddress != 0) + { + /* + * An address was provided. Let's see if we've already + * something there + */ + if(MiCheckForConflictingNode(StartVpn, EndVpn, &Process->VadRoot) != NULL) + { + /* Can't reserve twice the same range */ + if(AllocationType & MEM_RESERVE) + { + Status = STATUS_CONFLICTING_ADDRESSES; + DPRINT1("Trying to reserve twice the same range.\n"); + goto cleanup; + } + /* Great there's already something there. What shall we do ? */ + if(AllocationType == MEM_RESET) + { + UNIMPLEMENTED; + /* Reset the dirty bits for each PTEs */ + goto cleanup; + } + else + { + ASSERT(AllocationType & MEM_COMMIT); + UNIMPLEMENTED; + /* Mark the VAD as committed */ + goto cleanup; + } + } + + /* There's nothing */ + if(!(AllocationType & MEM_RESERVE)) + { + Status = STATUS_ACCESS_DENIED; + goto cleanup; + } + + /* Now we can reserve our chunk of memory */ + goto buildVad; + } + + /* No base address was given. */ + if(!(AllocationType & MEM_RESERVE)) + { + DPRINT1("Providing NULL base address witout MEM_RESERVE.\n"); + ASSERT(FALSE); + Status = STATUS_INVALID_PARAMETER_5; + goto cleanup; + } + + /* Find an empty range in Address Space */ + if(AllocationType & MEM_TOP_DOWN) + { + /* Top down allocation */ + Result = MiFindEmptyAddressRangeDownTree(RegionSize, + (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS, + (ZeroBits > PAGE_SHIFT) ? 1 << ZeroBits : PAGE_SIZE, + &Process->VadRoot, + (PULONG_PTR)&BaseAddress, + &ParentNode); + + if(Result == TableFoundNode) + { + /* This means failure */ + Status = STATUS_NO_MEMORY; + goto cleanup; + } + } + else + { + /* Good old bottom up allocation */ + Status = MiFindEmptyAddressRangeInTree(RegionSize, + (ZeroBits > PAGE_SHIFT) ? 1 << ZeroBits : PAGE_SIZE, + &Process->VadRoot, + &ParentNode, + (PULONG_PTR)&BaseAddress); + if(!NT_SUCCESS(Status)) + { + /* Failed... */ + goto cleanup; + } + } + StartVpn = (ULONG_PTR)BaseAddress >> PAGE_SHIFT; + EndVpn = ((ULONG_PTR)BaseAddress + RegionSize - 1) >> PAGE_SHIFT; + + /* Build the Vad */ +buildVad: + Vad = ExAllocatePoolWithTag(NonPagedPool, sizeof(MMVAD), TAG_MVAD); + if(!Vad) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + RtlZeroMemory(Vad, sizeof(MMVAD)); + + /* Set min/max */ + Vad->StartingVpn = StartVpn; + Vad->EndingVpn = EndVpn; + /* Set protection */ + Vad->u.VadFlags.Protection = ProtectionMask; + /* Should it be already marked as committed ? */ + if(AllocationType & MEM_COMMIT) + Vad->u.VadFlags.MemCommit = 1; + if(AllocationType & MEM_PHYSICAL) + { + UNIMPLEMENTED; + Vad->u.VadFlags.VadType = VadAwe; + } + /* Add it */ + MiLockProcessWorkingSet(Process, PsGetCurrentThread()); + MiInsertVad(Vad, Process); + MiUnlockProcessWorkingSet(Process, PsGetCurrentThread()); + + /* we're done */ +cleanup: + KeReleaseGuardedMutex(&Process->AddressCreationLock); + if (Attached) KeUnstackDetachProcess(&ApcState); + if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process); + + *UBaseAddress = BaseAddress; + *URegionSize = RegionSize; + DPRINT("*UBaseAddress %x *URegionSize %x\n", BaseAddress, RegionSize); + + return Status; +} +#endif /* EOF */ Modified: trunk/reactos/ntoskrnl/mm/anonmem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Thu Feb 16 17:24:15 2012 @@ -528,6 +528,7 @@ return Status; } +#ifndef __USE_ARM3__ /* * @implemented */ @@ -900,6 +901,7 @@ return(STATUS_SUCCESS); } +#endif // __USE_ARM3__ static VOID MmFreeVirtualMemoryPage(PVOID Context,
12 years, 10 months
1
0
0
0
[jgardou] 55644: [NTOSKRNL] - One can't only use MEM_COMMIT for reserving memory
by jgardou@svn.reactos.org
Author: jgardou Date: Thu Feb 16 17:24:01 2012 New Revision: 55644 URL:
http://svn.reactos.org/svn/reactos?rev=55644&view=rev
Log: [NTOSKRNL] - One can't only use MEM_COMMIT for reserving memory Modified: trunk/reactos/ntoskrnl/ex/init.c Modified: trunk/reactos/ntoskrnl/ex/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=556…
============================================================================== --- trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] Thu Feb 16 17:24:01 2012 @@ -400,7 +400,7 @@ (PVOID*)&ProcessParams, 0, &Size, - MEM_COMMIT, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); if (!NT_SUCCESS(Status)) { @@ -429,7 +429,7 @@ &EnvironmentPtr, 0, &Size, - MEM_COMMIT, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); if (!NT_SUCCESS(Status)) {
12 years, 10 months
1
0
0
0
[jgardou] 55643: [NTOSKRNL/MM] - fix returned value in case of failure in MiFindEmptyAddressRangeDownTree
by jgardou@svn.reactos.org
Author: jgardou Date: Thu Feb 16 17:22:54 2012 New Revision: 55643 URL:
http://svn.reactos.org/svn/reactos?rev=55643&view=rev
Log: [NTOSKRNL/MM] - fix returned value in case of failure in MiFindEmptyAddressRangeDownTree Modified: trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c Modified: trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] Thu Feb 16 17:22:54 2012 @@ -380,7 +380,7 @@ /* Compute page length, make sure the boundary address is valid */ Length = ROUND_TO_PAGES(Length); PageCount = Length >> PAGE_SHIFT; - if ((BoundaryAddress + 1) < Length) return STATUS_NO_MEMORY; + if ((BoundaryAddress + 1) < Length) return TableFoundNode; /* Check if the table is empty */ if (Table->NumberGenericTableElements == 0)
12 years, 10 months
1
0
0
0
[pschweitzer] 55642: [CABMAN] Get rid of MAX_PATH
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Feb 16 17:21:10 2012 New Revision: 55642 URL:
http://svn.reactos.org/svn/reactos?rev=55642&view=rev
Log: [CABMAN] Get rid of MAX_PATH Modified: trunk/reactos/tools/cabman/cabinet.cxx trunk/reactos/tools/cabman/cabinet.h trunk/reactos/tools/cabman/cabman.h trunk/reactos/tools/cabman/dfp.cxx Modified: trunk/reactos/tools/cabman/cabinet.cxx URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabinet.cxx?r…
============================================================================== --- trunk/reactos/tools/cabman/cabinet.cxx [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/cabinet.cxx [iso-8859-1] Thu Feb 16 17:21:10 2012 @@ -512,7 +512,7 @@ strcpy(DestPath, DestinationPath); ConvertPath(DestPath, false); if (strlen(DestPath) > 0) - NormalizePath(DestPath, MAX_PATH); + NormalizePath(DestPath, PATH_MAX); } ULONG CCabinet::AddSearchCriteria(char* SearchCriteria) @@ -1030,8 +1030,8 @@ #if defined(_WIN32) FILETIME FileTime; #endif - CHAR DestName[MAX_PATH]; - CHAR TempName[MAX_PATH]; + CHAR DestName[PATH_MAX]; + CHAR TempName[PATH_MAX]; Status = LocateFile(FileName, &File); if (Status != CAB_STATUS_SUCCESS) @@ -2086,8 +2086,8 @@ { bool bRet = false; char* pszFile; - char szFilePath[MAX_PATH]; - char szFile[MAX_PATH]; + char szFilePath[PATH_MAX]; + char szFile[PATH_MAX]; PSEARCH_CRITERIA Criteria; ULONG Status; @@ -2554,7 +2554,7 @@ return CAB_STATUS_INVALID_CAB; } - File->FileName = (char*)AllocateMemory(MAX_PATH); + File->FileName = (char*)AllocateMemory(PATH_MAX); if (!File->FileName) { DPRINT(MIN_TRACE, ("Insufficient memory.\n")); @@ -2562,7 +2562,7 @@ } /* Read file name */ - Status = ReadString(File->FileName, MAX_PATH); + Status = ReadString(File->FileName, PATH_MAX); if (Status != CAB_STATUS_SUCCESS) return Status; @@ -3654,7 +3654,7 @@ &File->File.FileTime); #else struct stat stbuf; - char buf[MAX_PATH]; + char buf[PATH_MAX]; // Check for an absolute path if (IsSeparator(File->FileName[0])) @@ -3698,7 +3698,7 @@ File->File.Attributes = (USHORT)(Attributes & 0x37); #else struct stat stbuf; - char buf[MAX_PATH]; + char buf[PATH_MAX]; // Check for an absolute path if (IsSeparator(File->FileName[0])) Modified: trunk/reactos/tools/cabman/cabinet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabinet.h?rev…
============================================================================== --- trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] Thu Feb 16 17:21:10 2012 @@ -16,9 +16,6 @@ #include <time.h> #include <typedefs.h> #include <unistd.h> -#ifndef MAX_PATH -#define MAX_PATH 260 -#endif #endif #include <stdlib.h> @@ -303,7 +300,7 @@ ULONG ReadBlock(PCFDATA Data, void* Buffer, PULONG BytesRead); ULONG WriteBlock(PCFDATA Data, void* Buffer, PULONG BytesWritten); private: - char FullName[MAX_PATH]; + char FullName[PATH_MAX]; bool FileCreated; FILEHANDLE FileHandle; }; @@ -449,8 +446,8 @@ ULONG FolderUncompSize; // Uncompressed size of folder ULONG BytesLeftInBlock; // Number of bytes left in current block bool ReuseBlock; - char DestPath[MAX_PATH]; - char CabinetReservedFile[MAX_PATH]; + char DestPath[PATH_MAX]; + char CabinetReservedFile[PATH_MAX]; void* CabinetReservedFileBuffer; ULONG CabinetReservedFileSize; FILEHANDLE FileHandle; Modified: trunk/reactos/tools/cabman/cabman.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabman.h?rev=…
============================================================================== --- trunk/reactos/tools/cabman/cabman.h [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/cabman.h [iso-8859-1] Thu Feb 16 17:21:10 2012 @@ -38,7 +38,7 @@ bool ProcessAll; ULONG Mode; bool PromptOnOverwrite; - char FileName[MAX_PATH]; + char FileName[PATH_MAX]; }; /* EOF */ Modified: trunk/reactos/tools/cabman/dfp.cxx URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/dfp.cxx?rev=5…
============================================================================== --- trunk/reactos/tools/cabman/dfp.cxx [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/dfp.cxx [iso-8859-1] Thu Feb 16 17:21:10 2012 @@ -123,7 +123,7 @@ void CDFParser::WriteInfLine(char* InfLine) { - char buf[MAX_PATH]; + char buf[PATH_MAX]; char eolbuf[2]; char* destpath; #if defined(_WIN32) @@ -432,7 +432,7 @@ strcpy(FileRelativePath, Path); ConvertPath(FileRelativePath, false); if (strlen(FileRelativePath) > 0) - NormalizePath(FileRelativePath, MAX_PATH); + NormalizePath(FileRelativePath, PATH_MAX); } @@ -498,7 +498,7 @@ * true if a cabinet name was returned, false if not */ { - char Buffer[MAX_PATH]; + char Buffer[PATH_MAX]; ULONG i; int j; char ch; @@ -1107,11 +1107,11 @@ ULONG Status; ULONG i, j; char ch; - char SrcName[MAX_PATH]; - char DstName[MAX_PATH]; - char InfLine[MAX_PATH]; + char SrcName[PATH_MAX]; + char DstName[PATH_MAX]; + char InfLine[PATH_MAX]; char Options[128]; - char BaseFilename[MAX_PATH]; + char BaseFilename[PATH_MAX]; *SrcName = '\0'; *DstName = '\0';
12 years, 10 months
1
0
0
0
[pschweitzer] 55641: [CABMAN] Attempt to fix 2. MAX_PATH shouldn't be defined/used any longer
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Feb 16 17:13:38 2012 New Revision: 55641 URL:
http://svn.reactos.org/svn/reactos?rev=55641&view=rev
Log: [CABMAN] Attempt to fix 2. MAX_PATH shouldn't be defined/used any longer Modified: trunk/reactos/tools/cabman/cabinet.h Modified: trunk/reactos/tools/cabman/cabinet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabinet.h?rev…
============================================================================== --- trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] Thu Feb 16 17:13:38 2012 @@ -16,15 +16,15 @@ #include <time.h> #include <typedefs.h> #include <unistd.h> -#endif - #ifndef MAX_PATH #define MAX_PATH 260 #endif +#endif #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <limits.h> #if defined(_WIN32) #define DIR_SEPARATOR_CHAR '\\'
12 years, 10 months
1
0
0
0
[pschweitzer] 55640: [CABMAN] Fix Windows build
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Feb 16 17:02:28 2012 New Revision: 55640 URL:
http://svn.reactos.org/svn/reactos?rev=55640&view=rev
Log: [CABMAN] Fix Windows build Modified: trunk/reactos/tools/cabman/cabinet.h Modified: trunk/reactos/tools/cabman/cabinet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabinet.h?rev…
============================================================================== --- trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/cabinet.h [iso-8859-1] Thu Feb 16 17:02:28 2012 @@ -16,9 +16,10 @@ #include <time.h> #include <typedefs.h> #include <unistd.h> +#endif + #ifndef MAX_PATH #define MAX_PATH 260 -#endif #endif #include <stdlib.h>
12 years, 10 months
1
0
0
0
[pschweitzer] 55639: [CABMAN] Ensure line reading buffer is big enough to hold complete paths. Remove a magic value usage accordingly.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Feb 16 16:50:16 2012 New Revision: 55639 URL:
http://svn.reactos.org/svn/reactos?rev=55639&view=rev
Log: [CABMAN] Ensure line reading buffer is big enough to hold complete paths. Remove a magic value usage accordingly. Modified: trunk/reactos/tools/cabman/dfp.cxx trunk/reactos/tools/cabman/dfp.h Modified: trunk/reactos/tools/cabman/dfp.cxx URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/dfp.cxx?rev=5…
============================================================================== --- trunk/reactos/tools/cabman/dfp.cxx [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/dfp.cxx [iso-8859-1] Thu Feb 16 16:50:16 2012 @@ -1281,7 +1281,7 @@ return false; i = 0; - while (((j = CurrentOffset + i) < FileBufferSize) && (i < 127) && + while (((j = CurrentOffset + i) < FileBufferSize) && (i < sizeof(Line) - 1) && ((ch = FileBuffer[j]) != 0x0D && (ch = FileBuffer[j]) != 0x0A)) { Line[i] = ch; Modified: trunk/reactos/tools/cabman/dfp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/dfp.h?rev=556…
============================================================================== --- trunk/reactos/tools/cabman/dfp.h [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/dfp.h [iso-8859-1] Thu Feb 16 16:50:16 2012 @@ -97,7 +97,7 @@ char* FileBuffer; ULONG FileBufferSize; ULONG CurrentOffset; - char Line[128]; + char Line[PATH_MAX + 6]; /* "PATH" xEOL */ ULONG LineLength; ULONG CurrentLine; ULONG CurrentChar;
12 years, 10 months
1
0
0
0
[ion] 55638: [CSRSRV]: Improve ClientConnectionThread a bit to make it look a bit more like CSRSRV2 and add some extra functionality. [CSRSRV]: Port from CSRSRV2 and use CsrApiPortInitialize instea...
by ion@svn.reactos.org
Author: ion Date: Thu Feb 16 16:40:15 2012 New Revision: 55638 URL:
http://svn.reactos.org/svn/reactos?rev=55638&view=rev
Log: [CSRSRV]: Improve ClientConnectionThread a bit to make it look a bit more like CSRSRV2 and add some extra functionality. [CSRSRV]: Port from CSRSRV2 and use CsrApiPortInitialize instead of CsrpCreateListenPort. This will set appropriate SDs and also wait for all threads to be ready. Modified: trunk/reactos/subsystems/win32/csrss/csrsrv/api/wapi.c trunk/reactos/subsystems/win32/csrss/csrsrv/init.c trunk/reactos/subsystems/win32/csrss/include/api.h 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] Thu Feb 16 16:40:15 2012 @@ -19,6 +19,7 @@ static unsigned ApiDefinitionsCount = 0; static PCSRSS_API_DEFINITION ApiDefinitions = NULL; +UNICODE_STRING CsrApiPortName; /* FUNCTIONS *****************************************************************/ @@ -301,6 +302,129 @@ /* Return success */ return STATUS_SUCCESS; +} + +/*++ + * @name CsrApiPortInitialize + * + * The CsrApiPortInitialize routine initializes the LPC Port used for + * communications with the Client/Server Runtime (CSR) and initializes the + * static thread that will handle connection requests and APIs. + * + * @param None + * + * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL + * othwerwise. + * + * @remarks None. + * + *--*/ +NTSTATUS +NTAPI +CsrApiPortInitialize(VOID) +{ + ULONG Size; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + HANDLE hRequestEvent, hThread; + CLIENT_ID ClientId; + PLIST_ENTRY ListHead, NextEntry; + PCSR_THREAD ServerThread; + + /* Calculate how much space we'll need for the Port Name */ + Size = CsrDirectoryName.Length + sizeof(CSR_PORT_NAME) + sizeof(WCHAR); + + /* Create the buffer for it */ + CsrApiPortName.Buffer = RtlAllocateHeap(CsrHeap, 0, Size); + if (!CsrApiPortName.Buffer) return STATUS_NO_MEMORY; + + /* Setup the rest of the empty string */ + CsrApiPortName.Length = 0; + CsrApiPortName.MaximumLength = (USHORT)Size; + RtlAppendUnicodeStringToString(&CsrApiPortName, &CsrDirectoryName); + RtlAppendUnicodeToString(&CsrApiPortName, UNICODE_PATH_SEP); + RtlAppendUnicodeToString(&CsrApiPortName, CSR_PORT_NAME); + if (CsrDebug & 1) + { + DPRINT1("CSRSS: Creating %wZ port and associated threads\n", &CsrApiPortName); + DPRINT1("CSRSS: sizeof( CONNECTINFO ) == %ld sizeof( API_MSG ) == %ld\n", + sizeof(CSR_CONNECTION_INFO), sizeof(CSR_API_MESSAGE)); + } + + /* FIXME: Create a Security Descriptor */ + + /* Initialize the Attributes */ + InitializeObjectAttributes(&ObjectAttributes, + &CsrApiPortName, + 0, + NULL, + NULL /* FIXME*/); + + /* Create the Port Object */ + Status = NtCreatePort(&hApiPort, //&CsrApiPort, + &ObjectAttributes, + sizeof(CSR_CONNECTION_INFO), + sizeof(CSR_API_MESSAGE), + 16 * PAGE_SIZE); + if (NT_SUCCESS(Status)) + { + /* Create the event the Port Thread will use */ + Status = NtCreateEvent(&hRequestEvent, + EVENT_ALL_ACCESS, + NULL, + SynchronizationEvent, + FALSE); + if (NT_SUCCESS(Status)) + { + /* Create the Request Thread */ + Status = RtlCreateUserThread(NtCurrentProcess(), + NULL, + TRUE, + 0, + 0, + 0, + (PVOID)ClientConnectionThread,//CsrApiRequestThread, + (PVOID)hRequestEvent, + &hThread, + &ClientId); + if (NT_SUCCESS(Status)) + { + /* Add this as a static thread to CSRSRV */ + CsrAddStaticServerThread(hThread, &ClientId, CsrThreadIsServerThread); + + /* Get the Thread List Pointers */ + ListHead = &CsrRootProcess->ThreadList; + NextEntry = ListHead->Flink; + + /* Start looping the list */ + while (NextEntry != ListHead) + { + /* Get the Thread */ + ServerThread = CONTAINING_RECORD(NextEntry, CSR_THREAD, Link); + + /* Start it up */ + Status = NtResumeThread(ServerThread->ThreadHandle, NULL); + + /* Is this a Server Thread? */ + if (ServerThread->Flags & CsrThreadIsServerThread) + { + /* If so, then wait for it to initialize */ + Status = NtWaitForSingleObject(hRequestEvent, FALSE, NULL); + ASSERT(NT_SUCCESS(Status)); + } + + /* Next thread */ + NextEntry = NextEntry->Flink; + } + + /* We don't need this anymore */ + NtClose(hRequestEvent); + } + } + } + + /* Return */ + return Status; } PBASE_STATIC_SERVER_DATA BaseStaticServerData; @@ -685,8 +809,7 @@ } NTSTATUS WINAPI -CsrpHandleConnectionRequest (PPORT_MESSAGE Request, - IN HANDLE hApiListenPort) +CsrpHandleConnectionRequest (PPORT_MESSAGE Request) { NTSTATUS Status; HANDLE ServerPort = NULL, ServerThread = NULL; @@ -780,7 +903,7 @@ 0, 0, (PTHREAD_START_ROUTINE)ClientConnectionThread, - ServerPort, + NULL, & ServerThread, &ClientId); if (!NT_SUCCESS(Status)) @@ -849,74 +972,130 @@ VOID WINAPI -ClientConnectionThread(HANDLE ServerPort) +ClientConnectionThread(IN PVOID Parameter) { + PTEB Teb = NtCurrentTeb(); + LARGE_INTEGER TimeOut; NTSTATUS Status; BYTE RawRequest[LPC_MAX_DATA_LENGTH]; PCSR_API_MESSAGE Request = (PCSR_API_MESSAGE)RawRequest; PCSR_API_MESSAGE Reply; PCSR_PROCESS ProcessData; PCSR_THREAD ServerThread; + ULONG MessageType; DPRINT("CSR: %s called\n", __FUNCTION__); + + /* Setup LPC loop port and message */ + Reply = NULL; +// ReplyPort = CsrApiPort; /* Connect to user32 */ while (!CsrConnectToUser()) { + /* Set up the timeout for the connect (30 seconds) */ + TimeOut.QuadPart = -30 * 1000 * 1000 * 10; + /* Keep trying until we get a response */ - NtCurrentTeb()->Win32ClientInfo[0] = 0; - //NtDelayExecution(FALSE, &TimeOut); - } - - /* Reply must be NULL at the first call to NtReplyWaitReceivePort */ - ServerThread = NtCurrentTeb()->CsrClientThread; - Reply = NULL; - - /* Loop and reply/wait for a new message */ - for (;;) - { + Teb->Win32ClientInfo[0] = 0; + NtDelayExecution(FALSE, &TimeOut); + } + + /* Get our thread */ + ServerThread = Teb->CsrClientThread; + + /* If we got an event... */ + if (Parameter) + { + /* Set it, to let stuff waiting on us load */ + Status = NtSetEvent((HANDLE)Parameter, NULL); + ASSERT(NT_SUCCESS(Status)); + + /* Increase the Thread Counts */ + //_InterlockedIncrement(&CsrpStaticThreadCount); + //_InterlockedIncrement(&CsrpDynamicThreadTotal); + } + + /* Now start the loop */ + while (TRUE) + { + /* Make sure the real CID is set */ + Teb->RealClientId = Teb->ClientId; + + /* Debug check */ + if (Teb->CountOfOwnedCriticalSections) + { + DPRINT1("CSRSRV: FATAL ERROR. CsrThread is Idle while holding %lu critical sections\n", + Teb->CountOfOwnedCriticalSections); + DPRINT1("CSRSRV: Last Receive Message %lx ReplyMessage %lx\n", + &Request, Reply); + DbgBreakPoint(); + } + /* Send the reply and wait for a new request */ Status = NtReplyWaitReceivePort(hApiPort, 0, &Reply->Header, &Request->Header); - /* Client died, continue */ - if (Status == STATUS_INVALID_CID) - { - Reply = NULL; - continue; - } - - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtReplyWaitReceivePort failed: %lx\n", Status); - break; - } + /* Check if we didn't get success */ + if (Status != STATUS_SUCCESS) + { + /* Was it a failure or another success code? */ + if (!NT_SUCCESS(Status)) + { + /* Check for specific status cases */ + if ((Status != STATUS_INVALID_CID) && + (Status != STATUS_UNSUCCESSFUL))// && +// ((Status == STATUS_INVALID_HANDLE) || (ReplyPort == CsrApiPort))) + { + /* Notify the debugger */ + DPRINT1("CSRSS: ReceivePort failed - Status == %X\n", Status); + //DPRINT1("CSRSS: ReplyPortHandle %lx CsrApiPort %lx\n", ReplyPort, CsrApiPort); + } + + /* We failed big time, so start out fresh */ + Reply = NULL; + //ReplyPort = CsrApiPort; + continue; + } + else + { + /* A bizare "success" code, just try again */ + DPRINT1("NtReplyWaitReceivePort returned \"success\" status 0x%x\n", Status); + continue; + } + } + + /* Use whatever Client ID we got */ + Teb->RealClientId = Request->Header.ClientId; + + /* Get the Message Type */ + MessageType = Request->Header.u2.s2.Type; /* If the connection was closed, handle that */ - if (Request->Header.u2.s2.Type == LPC_PORT_CLOSED) + if (MessageType == LPC_PORT_CLOSED) { DPRINT("Port died, oh well\n"); CsrFreeProcessData( Request->Header.ClientId.UniqueProcess ); break; } - if (Request->Header.u2.s2.Type == LPC_CONNECTION_REQUEST) - { - CsrpHandleConnectionRequest((PPORT_MESSAGE)Request, ServerPort); + if (MessageType == LPC_CONNECTION_REQUEST) + { + CsrpHandleConnectionRequest((PPORT_MESSAGE)Request); Reply = NULL; continue; } - if (Request->Header.u2.s2.Type == LPC_CLIENT_DIED) + if (MessageType == LPC_CLIENT_DIED) { DPRINT("Client died, oh well\n"); Reply = NULL; continue; } - if ((Request->Header.u2.s2.Type != LPC_ERROR_EVENT) && - (Request->Header.u2.s2.Type != LPC_REQUEST)) + if ((MessageType != LPC_ERROR_EVENT) && + (MessageType != LPC_REQUEST)) { DPRINT1("CSR: received message %d\n", Request->Header.u2.s2.Type); Reply = NULL; @@ -932,7 +1111,7 @@ if (ProcessData == NULL) { DPRINT1("Message %d: Unable to find data for process 0x%x\n", - Request->Header.u2.s2.Type, + MessageType, Request->Header.ClientId.UniqueProcess); break; } @@ -944,7 +1123,7 @@ } /* Check if we got a hard error */ - if (Request->Header.u2.s2.Type == LPC_ERROR_EVENT) + if (MessageType == LPC_ERROR_EVENT) { /* Call the Handler */ CsrHandleHardError(ProcessData, (PHARDERROR_MSG)Request); @@ -972,7 +1151,9 @@ // NtClose(ServerPort); DPRINT("CSR: %s done\n", __FUNCTION__); - RtlExitUserThread(STATUS_SUCCESS); + /* We're out of the loop for some reason, terminate! */ + NtTerminateThread(NtCurrentThread(), Status); + //return Status; } /*++ 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] Thu Feb 16 16:40:15 2012 @@ -175,57 +175,6 @@ CSRSS_DEFINE_API(SET_SHUTDOWN_PARAMETERS, CsrSetShutdownParameters), { 0, 0, NULL } }; - -static NTSTATUS WINAPI -CsrpCreateListenPort (IN LPWSTR Name, - IN OUT PHANDLE Port, - IN PTHREAD_START_ROUTINE ListenThread) -{ - NTSTATUS Status = STATUS_SUCCESS; - OBJECT_ATTRIBUTES PortAttributes; - UNICODE_STRING PortName; - HANDLE ServerThread; - CLIENT_ID ClientId; - - DPRINT("CSR: %s called\n", __FUNCTION__); - - RtlInitUnicodeString (& PortName, Name); - InitializeObjectAttributes (& PortAttributes, - & PortName, - 0, - NULL, - NULL); - Status = NtCreatePort ( Port, - & PortAttributes, - sizeof(SB_CONNECTION_INFO), - sizeof(SB_API_MSG), - 32 * sizeof(SB_API_MSG)); - if(!NT_SUCCESS(Status)) - { - DPRINT1("CSR: %s: NtCreatePort failed (Status=%08lx)\n", - __FUNCTION__, Status); - return Status; - } - Status = RtlCreateUserThread(NtCurrentProcess(), - NULL, - TRUE, - 0, - 0, - 0, - (PTHREAD_START_ROUTINE) ListenThread, - *Port, - &ServerThread, - &ClientId); - - if (ListenThread == (PVOID)ClientConnectionThread) - { - CsrAddStaticServerThread(ServerThread, &ClientId, 0); - } - - NtResumeThread(ServerThread, NULL); - NtClose(ServerThread); - return Status; -} /* === INIT ROUTINES === */ @@ -1150,10 +1099,13 @@ DPRINT1("CSRSRV failed in %s with status %lx\n", "CsrApiRegisterDefinitions", Status); } - Status = CsrpCreateListenPort(L"\\Windows\\ApiPort", &hApiPort, (PTHREAD_START_ROUTINE)ClientConnectionThread); - if (!NT_SUCCESS(Status)) - { - DPRINT1("CSRSRV failed in %s with status %lx\n", "CsrpCreateApiPort", Status); + /* Now initialize our API Port */ + Status = CsrApiPortInitialize(); + if (!NT_SUCCESS(Status)) + { + DPRINT1("CSRSRV:%s: CsrApiPortInitialize failed (Status=%08lx)\n", + __FUNCTION__, Status); + return Status; } Status = CsrpInitWin32Csr(); Modified: trunk/reactos/subsystems/win32/csrss/include/api.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/inc…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/include/api.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/include/api.h [iso-8859-1] Thu Feb 16 16:40:15 2012 @@ -235,6 +235,12 @@ extern LIST_ENTRY CsrThreadHashTable[256]; extern PCSR_PROCESS CsrRootProcess; extern RTL_CRITICAL_SECTION ProcessDataLock, CsrWaitListsLock; +extern UNICODE_STRING CsrDirectoryName; +extern ULONG CsrDebug; + +NTSTATUS +NTAPI +CsrApiPortInitialize(VOID); BOOLEAN NTAPI
12 years, 10 months
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
58
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Results per page:
10
25
50
100
200