Author: hbelusca
Date: Wed Dec 17 23:03:36 2014
New Revision: 65712
URL:
http://svn.reactos.org/svn/reactos?rev=65712&view=rev
Log:
[USERSRV]
- Set the process creation notify routine for BASE that needs to be called when a process
is created.
Patch by Timo, see CORE-7505.
[BASESRV]
- Implement BaseSetProcessCreateNotify that just saves internally the notification
function to be called when a process is created.
- Call the notification function where it should be.
CORE-7505
Modified:
trunk/reactos/include/reactos/subsys/win/base.h
trunk/reactos/subsystems/win/basesrv/proc.c
trunk/reactos/win32ss/user/ntuser/ntstubs.c
trunk/reactos/win32ss/user/winsrv/usersrv/init.c
trunk/reactos/win32ss/user/winsrv/usersrv/usersrv.h
Modified: trunk/reactos/include/reactos/subsys/win/base.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/win…
==============================================================================
--- trunk/reactos/include/reactos/subsys/win/base.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/win/base.h [iso-8859-1] Wed Dec 17 23:03:36 2014
@@ -15,11 +15,13 @@
BOOL
(CALLBACK *BASE_PROCESS_CREATE_NOTIFY_ROUTINE)(
HANDLE NewProcessId,
- HANDLE SourceThreadId,
- DWORD dwUnknown,
- ULONG CreateFlags);
+ HANDLE ParentThreadId,
+ ULONG dwUnknown,
+ ULONG CreateFlags);
-NTSTATUS WINAPI BaseSetProcessCreateNotify(BASE_PROCESS_CREATE_NOTIFY_ROUTINE);
+VOID
+NTAPI
+BaseSetProcessCreateNotify(IN BASE_PROCESS_CREATE_NOTIFY_ROUTINE
ProcessCreateNotifyProc);
typedef struct _NLS_USER_INFO
{
Modified: trunk/reactos/subsystems/win/basesrv/proc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/pro…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/proc.c [iso-8859-1] Wed Dec 17 23:03:36 2014
@@ -13,6 +13,11 @@
#define NDEBUG
#include <debug.h>
+
+/* GLOBALS ********************************************************************/
+
+/* User notification procedure to be called when a process is created */
+static BASE_PROCESS_CREATE_NOTIFY_ROUTINE UserNotifyProcessCreate = NULL;
/* PUBLIC SERVER APIS *********************************************************/
@@ -167,7 +172,14 @@
return Status;
}
- /* FIXME: Should notify user32 */
+ /* Call the user notification procedure */
+ if (UserNotifyProcessCreate)
+ {
+ UserNotifyProcessCreate(CreateProcessRequest->ClientId.UniqueProcess,
+ Process->ClientId.UniqueThread,
+ 0,
+ Flags);
+ }
/* Check if this is a VDM process */
if (CreateProcessRequest->VdmBinaryType)
@@ -295,12 +307,12 @@
/* PUBLIC API *****************************************************************/
-NTSTATUS
+VOID
NTAPI
BaseSetProcessCreateNotify(IN BASE_PROCESS_CREATE_NOTIFY_ROUTINE
ProcessCreateNotifyProc)
{
- DPRINT("BASESRV: %s(%08lx) called\n", __FUNCTION__,
ProcessCreateNotifyProc);
- return STATUS_NOT_IMPLEMENTED;
+ /* Set the user notification procedure to be called when a process is created */
+ UserNotifyProcessCreate = ProcessCreateNotifyProc;
}
/* EOF */
Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntstub…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] Wed Dec 17 23:03:36 2014
@@ -709,9 +709,9 @@
NTAPI
NtUserNotifyProcessCreate(
HANDLE NewProcessId,
- HANDLE SourceThreadId,
- DWORD dwUnknown,
- ULONG CreateFlags)
+ HANDLE ParentThreadId,
+ ULONG dwUnknown,
+ ULONG CreateFlags)
{
STUB;
return FALSE;
Modified: trunk/reactos/win32ss/user/winsrv/usersrv/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/usersr…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/usersrv/init.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/usersrv/init.c [iso-8859-1] Wed Dec 17 23:03:36
2014
@@ -261,6 +261,9 @@
return Status;
}
+ /* Set the process creation notify routine for BASE */
+ BaseSetProcessCreateNotify(NtUserNotifyProcessCreate);
+
/* Initialize the kernel mode subsystem */
Status = NtUserInitialize(USER_VERSION,
ghPowerRequestEvent,
Modified: trunk/reactos/win32ss/user/winsrv/usersrv/usersrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/usersr…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/usersrv/usersrv.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/usersrv/usersrv.h [iso-8859-1] Wed Dec 17 23:03:36
2014
@@ -21,6 +21,9 @@
// #define NTOS_MODE_USER
+/* BASE Header */
+#include <win/base.h>
+
/* USER Headers */
#include <win/winmsg.h>