[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

svn path=/trunk/; revision=65712
This commit is contained in:
Hermès Bélusca-Maïto 2014-12-17 23:03:36 +00:00
parent ae2e894b80
commit effa3a4d24
5 changed files with 31 additions and 11 deletions

View file

@ -15,11 +15,13 @@ typedef
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
{

View file

@ -14,6 +14,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 *********************************************************/
CSR_API(BaseSrvDebugProcess)
@ -167,7 +172,14 @@ CSR_API(BaseSrvCreateProcess)
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 @@ CSR_API(BaseSrvSetProcessShutdownParam)
/* 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 */

View file

@ -709,9 +709,9 @@ BOOL
NTAPI
NtUserNotifyProcessCreate(
HANDLE NewProcessId,
HANDLE SourceThreadId,
DWORD dwUnknown,
ULONG CreateFlags)
HANDLE ParentThreadId,
ULONG dwUnknown,
ULONG CreateFlags)
{
STUB;
return FALSE;

View file

@ -261,6 +261,9 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization)
return Status;
}
/* Set the process creation notify routine for BASE */
BaseSetProcessCreateNotify(NtUserNotifyProcessCreate);
/* Initialize the kernel mode subsystem */
Status = NtUserInitialize(USER_VERSION,
ghPowerRequestEvent,

View file

@ -21,6 +21,9 @@
// #define NTOS_MODE_USER
/* BASE Header */
#include <win/base.h>
/* USER Headers */
#include <win/winmsg.h>