From 4ccf6c6b751bcd4ea8314f0221cb0c18e6457bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 22 Dec 2014 19:50:00 +0000 Subject: [PATCH] [USERSRV] - Reenable UserClientConnect callback, it's not the problematic code that made bots to fail at 3rd stage and caused r65716 to be committed. - Put the system threads hack *after* having called NtUserInitialize (that really initializes user-kernel interface with win32k), and not before. svn path=/trunk/; revision=65798 --- reactos/win32ss/user/winsrv/usersrv/init.c | 55 ++++++++++------------ 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/reactos/win32ss/user/winsrv/usersrv/init.c b/reactos/win32ss/user/winsrv/usersrv/init.c index eddf6760aa5..2a1e8bd92ba 100644 --- a/reactos/win32ss/user/winsrv/usersrv/init.c +++ b/reactos/win32ss/user/winsrv/usersrv/init.c @@ -191,12 +191,7 @@ UserClientConnect(IN PCSR_PROCESS CsrProcess, CSR_SERVER_DLL_INIT(UserServerDllInitialization) { -/*** From win32csr... ***/ - HANDLE ServerThread; - CLIENT_ID ClientId; NTSTATUS Status; - UINT i; -/*** END - From win32csr... ***/ /* Initialize the memory */ UserServerHeap = RtlGetProcessHeap(); @@ -210,37 +205,13 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization) LoadedServerDll->NameTable = UserServerApiNameTable; #endif LoadedServerDll->SizeOfProcessData = 0; -#if 0 LoadedServerDll->ConnectCallback = UserClientConnect; -#else - LoadedServerDll->ConnectCallback = NULL; -#endif LoadedServerDll->DisconnectCallback = NULL; LoadedServerDll->HardErrorCallback = UserServerHardError; LoadedServerDll->ShutdownProcessCallback = UserClientShutdown; UserServerDllInstance = LoadedServerDll->ServerHandle; -/*** From win32csr... See r54125 ***/ - /* Start the Raw Input Thread and the Desktop Thread */ - for (i = 0; i < 2; ++i) - { - Status = RtlCreateUserThread(NtCurrentProcess(), - NULL, TRUE, 0, 0, 0, - CreateSystemThreads, - (PVOID)i, &ServerThread, &ClientId); - if (NT_SUCCESS(Status)) - { - NtResumeThread(ServerThread, NULL); - NtClose(ServerThread); - } - else - { - DPRINT1("Cannot start Raw Input Thread!\n"); - } - } -/*** END - From win32csr... ***/ - /* Create the power request event */ Status = NtCreateEvent(&ghPowerRequestEvent, EVENT_ALL_ACCESS, @@ -278,6 +249,32 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization) return Status; } +/*** From win32csr... See r54125 ***/ + { + HANDLE ServerThread; + CLIENT_ID ClientId; + UINT i; + + /* Start the Raw Input Thread and the Desktop Thread */ + for (i = 0; i < 2; ++i) + { + Status = RtlCreateUserThread(NtCurrentProcess(), + NULL, TRUE, 0, 0, 0, + CreateSystemThreads, + (PVOID)i, &ServerThread, &ClientId); + if (NT_SUCCESS(Status)) + { + NtResumeThread(ServerThread, NULL); + NtClose(ServerThread); + } + else + { + DPRINT1("Cannot start Raw Input Thread!\n"); + } + } + } +/*** END - From win32csr... ***/ + /* All done */ return STATUS_SUCCESS; }