Author: hbelusca
Date: Fri Nov 9 23:39:45 2012
New Revision: 57694
URL:
http://svn.reactos.org/svn/reactos?rev=57694&view=rev
Log:
[BASESRV]
- Remove the unneeded CallProcessCreated function since the same functionality is
programmed and executed in CSRSRV when CsrInsertProcess is called via a call of
CsrCreateProcess.
- Remove some hacks in process creation.
- In BaseSrvExitProcess, use the 'Reply = 2' value instead of the old hack
'ApiMessage->ApiNumber = 0xBABE'.
[USER32/WINSRV]
- Make SetLogonNotifyWindow call our 'RosSetLogonNotifyWindow' hack and
explicitely mark it as a hack.
- CsrSetLogonNotifyWindow --> RosSetLogonNotifyWindow to emphasize that it is a
ReactOS-specific hack.
Modified:
branches/ros-csrss/include/reactos/subsys/win/winmsg.h
branches/ros-csrss/subsystems/win/basesrv/server.c
branches/ros-csrss/win32ss/user/user32/misc/misc.c
branches/ros-csrss/win32ss/user/winsrv/init.c
branches/ros-csrss/win32ss/user/winsrv/shutdown.c
branches/ros-csrss/win32ss/user/winsrv/winsrv.h
Modified: branches/ros-csrss/include/reactos/subsys/win/winmsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/win/winmsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/win/winmsg.h [iso-8859-1] Fri Nov 9
23:39:45 2012
@@ -33,6 +33,9 @@
// UserpConsoleHandleOperation, // Added in Win7
// UserpGetSetShutdownBlockReason, // Added in Vista
+ /// HACK: ReactOS-specific
+ UserpRosSetLogonNotifyWindow,
+
UserpMaxApiNumber
} USERSRV_API_NUMBER, *PUSERSRV_API_NUMBER;
@@ -54,6 +57,7 @@
BOOL Register;
} CSRSS_REGISTER_LOGON_PROCESS, *PCSRSS_REGISTER_LOGON_PROCESS;
+/// HACK: ReactOS-specific
typedef struct
{
HWND LogonNotifyWindow;
@@ -73,6 +77,8 @@
CSRSS_EXIT_REACTOS ExitReactosRequest;
CSRSS_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
CSRSS_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
+
+ /// HACK: ReactOS-specific
CSRSS_SET_LOGON_NOTIFY_WINDOW SetLogonNotifyWindowRequest;
} Data;
} USER_API_MESSAGE, *PUSER_API_MESSAGE;
Modified: branches/ros-csrss/subsystems/win/basesrv/server.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/subsystems/win/basesr…
==============================================================================
--- branches/ros-csrss/subsystems/win/basesrv/server.c [iso-8859-1] (original)
+++ branches/ros-csrss/subsystems/win/basesrv/server.c [iso-8859-1] Fri Nov 9 23:39:45
2012
@@ -11,45 +11,14 @@
#define NDEBUG
#include <debug.h>
-
-// extern NTSTATUS CallProcessCreated(PCSR_PROCESS, PCSR_PROCESS); // TODO: Import it
from csrsrv/init.c
-// Remove it and correct csrsrv instead...
-#if 0
-NTSTATUS
-CallProcessCreated(IN PCSR_PROCESS SourceProcessData,
- IN PCSR_PROCESS TargetProcessData)
-{
- NTSTATUS Status = STATUS_SUCCESS;
- ULONG i;
- PCSR_SERVER_DLL ServerDll;
-
- DPRINT("CSR: %s called\n", __FUNCTION__);
-
- /* Notify the Server DLLs */
- for (i = 0; i < CSR_SERVER_DLL_MAX; i++)
- {
- /* Get the current Server DLL */
- ServerDll = CsrLoadedServerDll[i];
-
- /* Make sure it's valid and that it has callback */
- if ((ServerDll) && (ServerDll->NewProcessCallback))
- {
- Status = ServerDll->NewProcessCallback(SourceProcessData,
TargetProcessData);
- }
- }
-
- return Status;
-}
-#endif
-
CSR_API(BaseSrvCreateProcess)
{
NTSTATUS Status;
PBASE_CREATE_PROCESS CreateProcessRequest =
&((PBASE_API_MESSAGE)ApiMessage)->Data.CreateProcessRequest;
HANDLE ProcessHandle, ThreadHandle;
PCSR_THREAD CsrThread;
- PCSR_PROCESS Process; // , NewProcess;
- ULONG /* Flags, */ VdmPower = 0, DebugFlags = 0;
+ PCSR_PROCESS Process;
+ ULONG Flags = 0, VdmPower = 0, DebugFlags = 0;
/* Get the current client thread */
CsrThread = CsrGetClientThread();
@@ -58,7 +27,7 @@
Process = CsrThread->Process;
/* Extract the flags out of the process handle */
- // Flags = (ULONG_PTR)CreateProcessRequest->ProcessHandle & 3;
+ Flags = (ULONG_PTR)CreateProcessRequest->ProcessHandle & 3;
CreateProcessRequest->ProcessHandle =
(HANDLE)((ULONG_PTR)CreateProcessRequest->ProcessHandle & ~3);
/* Duplicate the process handle */
@@ -107,7 +76,7 @@
}
}
- /* Convert some flags. FIXME: More need conversion */
+ /* Flags conversion. FIXME: More need conversion */
if (CreateProcessRequest->CreationFlags & CREATE_NEW_PROCESS_GROUP)
{
DebugFlags |= CsrProcessCreateNewGroup;
@@ -139,20 +108,6 @@
/* FIXME: VDM vodoo */
- /* ReactOS Compatibility */
-#if 0
- Status = CsrLockProcessByClientId(CreateProcessRequest->ClientId.UniqueProcess,
&NewProcess);
- ASSERT(Status == STATUS_SUCCESS);
- if (!(CreateProcessRequest->CreationFlags & (CREATE_NEW_CONSOLE |
DETACHED_PROCESS)))
- {
- NewProcess->ParentConsole = Process->Console;
- NewProcess->bInheritHandles = CreateProcessRequest->bInheritHandles;
- }
- RtlInitializeCriticalSection(&NewProcess->HandleTableLock);
- CallProcessCreated(Process, NewProcess);
- CsrUnlockProcess(NewProcess);
-#endif
-
/* Return the result of this operation */
return Status;
}
@@ -206,7 +161,8 @@
/* Call CSRSRV to tell it about the new thread */
Status = CsrCreateThread(CsrProcess,
ThreadHandle,
- &CreateThreadRequest->ClientId);
+ &CreateThreadRequest->ClientId,
+ TRUE);
}
/* Unlock the process and return */
@@ -232,8 +188,8 @@
PCSR_THREAD CsrThread = CsrGetClientThread();
ASSERT(CsrThread != NULL);
- /* Set magic flag so we don't reply this message back */
- ApiMessage->ApiNumber = 0xBABE;
+ /* Set the special reply value so we don't reply this message back */
+ *Reply = 2;
/* Remove the CSR_THREADs and CSR_PROCESS */
return CsrDestroyProcess(&CsrThread->ClientId,
Modified: branches/ros-csrss/win32ss/user/user32/misc/misc.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/user32/m…
==============================================================================
--- branches/ros-csrss/win32ss/user/user32/misc/misc.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/user32/misc/misc.c [iso-8859-1] Fri Nov 9 23:39:45
2012
@@ -74,26 +74,25 @@
WINAPI
SetLogonNotifyWindow(HWND Wnd, HWINSTA WinSta)
{
-#if 0
+/// HACK: Windows does not do this !! ReactOS-specific
/* Maybe we should call NtUserSetLogonNotifyWindow and let that one inform CSRSS???
*/
- CSR_API_MESSAGE Request;
+ USER_API_MESSAGE Request;
NTSTATUS Status;
Request.Data.SetLogonNotifyWindowRequest.LogonNotifyWindow = Wnd;
- Status = CsrClientCallServer(&Request,
+ Status = CsrClientCallServer((PCSR_API_MESSAGE)&Request,
NULL,
- CSR_CREATE_API_NUMBER(CSR_GUI,
SET_LOGON_NOTIFY_WINDOW),
- sizeof(CSR_API_MESSAGE));
+ CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX,
UserpRosSetLogonNotifyWindow),
+ sizeof(CSRSS_SET_LOGON_NOTIFY_WINDOW));
if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+/// END HACK
return NtUserSetLogonNotifyWindow(Wnd);
-#endif
- return TRUE;
}
/*
Modified: branches/ros-csrss/win32ss/user/winsrv/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/i…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/init.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/init.c [iso-8859-1] Fri Nov 9 23:39:45 2012
@@ -40,6 +40,9 @@
// SrvCancelShutdown, // Added in Vista
// SrvConsoleHandleOperation, // Added in Win7
// SrvGetSetShutdownBlockReason, // Added in Vista
+
+ /// HACK: ReactOS-specific
+ RosSetLogonNotifyWindow
};
BOOLEAN UserServerApiServerValidTable[UserpMaxApiNumber] =
@@ -58,6 +61,9 @@
// FALSE, // SrvConsoleHandleOperation
// FALSE, // SrvGetSetShutdownBlockReason
+ /// HACK: ReactOS-specific
+ FALSE, // RosSetLogonNotifyWindow
+
// FALSE
};
@@ -76,6 +82,9 @@
// "SrvCancelShutdown",
// "SrvConsoleHandleOperation",
// "SrvGetSetShutdownBlockReason",
+
+ /// HACK: ReactOS-specific
+ "RosSetLogonNotifyWindow",
// NULL
};
Modified: branches/ros-csrss/win32ss/user/winsrv/shutdown.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/s…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/shutdown.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/shutdown.c [iso-8859-1] Fri Nov 9 23:39:45
2012
@@ -56,7 +56,8 @@
return STATUS_SUCCESS;
}
-CSR_API(CsrSetLogonNotifyWindow)
+/// HACK: ReactOS-specific
+CSR_API(RosSetLogonNotifyWindow)
{
PCSRSS_SET_LOGON_NOTIFY_WINDOW SetLogonNotifyWindowRequest =
&((PUSER_API_MESSAGE)ApiMessage)->Data.SetLogonNotifyWindowRequest;
DWORD WindowCreator;
Modified: branches/ros-csrss/win32ss/user/winsrv/winsrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/winsrv/w…
==============================================================================
--- branches/ros-csrss/win32ss/user/winsrv/winsrv.h [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/winsrv/winsrv.h [iso-8859-1] Fri Nov 9 23:39:45 2012
@@ -53,11 +53,12 @@
/* shutdown.c */
CSR_API(SrvExitWindowsEx);
-CSR_API(CsrSetLogonNotifyWindow);
+// CSR_API(CsrRegisterSystemClasses);
+CSR_API(SrvRegisterServicesProcess);
CSR_API(SrvRegisterLogonProcess);
-// CSR_API(CsrRegisterSystemClasses);
-CSR_API(SrvRegisterServicesProcess);
+/// HACK: ReactOS-specific
+CSR_API(RosSetLogonNotifyWindow);
/*****************************