Author: hbelusca
Date: Tue Dec 23 16:42:59 2014
New Revision: 65811
URL:
http://svn.reactos.org/svn/reactos?rev=65811&view=rev
Log:
[USER32]
Reenable some disabled tests, while disabling some other calls, namely:
- code in ClientThreadStartup (that was moved in ClientThreadSetupHelper that is hackilly
now called in Init() from DllMain),
- code in User32CallClientThreadSetupFromKernel,
- add two flag manual resets in Init() and the forced call to ClientThreadSetupHelper,
- and moreover the whole CSR call in DllMain, that seems to sometimes cause some user32
internal global pointers to remain NULL where they should not (more specifically some
"pdi" thing).
Obviously all these problems need to be understood (why some things do not become
initialized when they should, etc...). See r65799, revert r65810, and CORE-8949.
Modified:
trunk/reactos/win32ss/user/user32/misc/dllmain.c
Modified: trunk/reactos/win32ss/user/user32/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/dllmain.c [iso-8859-1] Tue Dec 23 16:42:59
2014
@@ -240,7 +240,7 @@
* Also this needs to be done only for the first thread (since the connection
* is per-process).
*/
- // if (gfServerProcess && IsFirstThread) // Disabling this test is a HACK!!
+ if (gfServerProcess && IsFirstThread)
{
NTSTATUS Status;
USERCONNECT UserCon;
@@ -269,7 +269,7 @@
TRACE("Checkpoint (register PFN)\n");
if (!RegisterClientPFN())
{
- TRACE("RegisterClientPFN failed\n");
+ ERR("RegisterClientPFN failed\n");
return FALSE;
}
@@ -277,7 +277,7 @@
ClientInfo->CI_flags |= CI_INITTHREAD;
/* Initialization that should be done once per process */
- // if (IsFirstThread) // Disabling this test is a HACK!!
+ if (IsFirstThread)
{
TRACE("Checkpoint (Allocating TLS)\n");
@@ -352,7 +352,9 @@
// continue as normal.
//
- // return ClientThreadSetupHelper(FALSE); // Disabling this call is a HACK!!
+ // FIXME: Disabling this call is a HACK!! See also
User32CallClientThreadSetupFromKernel...
+ // return ClientThreadSetupHelper(FALSE);
+ UNIMPLEMENTED;
return TRUE;
}
@@ -368,18 +370,26 @@
/* Initialize callback table in PEB data */
NtCurrentPeb()->KernelCallbackTable = apfnDispatch;
NtCurrentPeb()->PostProcessInitRoutine = NULL;
+
+ // This is a HACK!! //
+ gfServerProcess = FALSE;
+ gfFirstThread = TRUE;
+ //// End of HACK!! ///
/*
* Retrieve data from the connect info structure if the initializing
* process is not CSRSS. In case it is, this will be done from inside
* ClientThreadSetup.
*/
- // if (!gfServerProcess) // Disabling this test is a HACK!!
+ if (!gfServerProcess)
{
// FIXME: HACK!! We should fixup for the NtUserProcessConnect fixups
// because it was made in the context of CSRSS process and not ours!!
// So... as long as we don't fix that, we need to redo again a call
// to NtUserProcessConnect... How perverse is that?!
+ //
+ // HACK(2): This call is necessary since we disabled
+ // the CSR call in DllMain...
{
RtlZeroMemory(UserCon, sizeof(*UserCon));
@@ -395,7 +405,7 @@
}
//
- // We continue as we should do...
+ // We continue as we should do normally...
//
/* Retrieve data */
@@ -406,6 +416,15 @@
gHandleEntries = SharedPtrToUser(gHandleTable->handles);
}
+ // FIXME: Yet another hack... This call should normally not be done here, but
+ // instead in ClientThreadSetup, and in User32CallClientThreadSetupFromKernel as
well.
+ ERR("HACK: Using Init-ClientThreadSetupHelper hack!!\n");
+ if (!ClientThreadSetupHelper(FALSE))
+ {
+ ERR("Init-ClientThreadSetupHelper hack failed!\n");
+ return FALSE;
+ }
+
TRACE("<-- user32::Init()\n");
return NT_SUCCESS(Status);
@@ -436,8 +455,11 @@
#define WIN_OBJ_DIR L"\\Windows"
#define SESSION_DIR L"\\Sessions"
+ USERSRV_API_CONNECTINFO ConnectInfo; // USERCONNECT
+
+#if 0 // Disabling this code is a BIG HACK!!
+
NTSTATUS Status;
- USERSRV_API_CONNECTINFO ConnectInfo; // USERCONNECT
ULONG ConnectInfoSize = sizeof(ConnectInfo);
WCHAR SessionDir[256];
@@ -487,6 +509,8 @@
TRACE("Checkpoint (CSR called)\n");
+#endif
+
User32Instance = hInstanceDll;
/* Finish initialization */
@@ -516,7 +540,8 @@
User32CallClientThreadSetupFromKernel(PVOID Arguments, ULONG ArgumentLength)
{
TRACE("User32CallClientThreadSetupFromKernel -->\n");
- ClientThreadSetupHelper(TRUE);
+ // FIXME: Disabling this call is a HACK!! See also ClientThreadSetup...
+ // ClientThreadSetupHelper(TRUE);
TRACE("<-- User32CallClientThreadSetupFromKernel\n");
return ZwCallbackReturn(NULL, 0, STATUS_SUCCESS);
}