// UserpConsoleHandleOperation, // Added in Win7
// UserpGetSetShutdownBlockReason, // Added in Vista
+ /// HACK: ReactOS-specific
+ UserpRosSetLogonNotifyWindow,
+
UserpMaxApiNumber
} USERSRV_API_NUMBER, *PUSERSRV_API_NUMBER;
BOOL Register;
} CSRSS_REGISTER_LOGON_PROCESS, *PCSRSS_REGISTER_LOGON_PROCESS;
+/// HACK: ReactOS-specific
typedef struct
{
HWND LogonNotifyWindow;
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;
#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();
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 */
}
}
- /* Convert some flags. FIXME: More need conversion */
+ /* Flags conversion. FIXME: More need conversion */
if (CreateProcessRequest->CreationFlags & CREATE_NEW_PROCESS_GROUP)
{
DebugFlags |= CsrProcessCreateNewGroup;
/* 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;
}
/* Call CSRSRV to tell it about the new thread */
Status = CsrCreateThread(CsrProcess,
ThreadHandle,
- &CreateThreadRequest->ClientId);
+ &CreateThreadRequest->ClientId,
+ TRUE);
}
/* Unlock the process and return */
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,
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;
}
/*
// SrvCancelShutdown, // Added in Vista
// SrvConsoleHandleOperation, // Added in Win7
// SrvGetSetShutdownBlockReason, // Added in Vista
+
+ /// HACK: ReactOS-specific
+ RosSetLogonNotifyWindow
};
BOOLEAN UserServerApiServerValidTable[UserpMaxApiNumber] =
// FALSE, // SrvConsoleHandleOperation
// FALSE, // SrvGetSetShutdownBlockReason
+ /// HACK: ReactOS-specific
+ FALSE, // RosSetLogonNotifyWindow
+
// FALSE
};
// "SrvConsoleHandleOperation",
// "SrvGetSetShutdownBlockReason",
+ /// HACK: ReactOS-specific
+ "RosSetLogonNotifyWindow",
+
// NULL
};