https://git.reactos.org/?p=reactos.git;a=commitdiff;h=50a1479c53e8e22f187a512c185c19d07d6cf029

commit 50a1479c53e8e22f187a512c185c19d07d6cf029
Author:     Eric Kohl <[email protected]>
AuthorDate: Sat Feb 26 19:08:15 2022 +0100
Commit:     Eric Kohl <[email protected]>
CommitDate: Sat Feb 26 19:08:15 2022 +0100

    [SECLOGON] Create the remote process
---
 base/services/seclogon/rpcserver.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/base/services/seclogon/rpcserver.c 
b/base/services/seclogon/rpcserver.c
index b927ca7e868..410b50fc6b9 100644
--- a/base/services/seclogon/rpcserver.c
+++ b/base/services/seclogon/rpcserver.c
@@ -59,6 +59,9 @@ SeclCreateProcessWithLogonW(
     _In_ SECL_REQUEST *pRequest,
     _Out_ SECL_RESPONSE *pResponse)
 {
+    STARTUPINFOW StartupInfo;
+    PROCESS_INFORMATION ProcessInfo;
+
     PROFILEINFOW ProfileInfo;
     HANDLE hToken = NULL;
 
@@ -111,9 +114,41 @@ SeclCreateProcessWithLogonW(
         }
     }
 
-    /* FIXME: Create Process */
+    ZeroMemory(&StartupInfo, sizeof(StartupInfo));
+    StartupInfo.cb = sizeof(StartupInfo);
+
+    /* FIXME: Get startup info from the caller */
+
+    ZeroMemory(&ProcessInfo, sizeof(ProcessInfo));
+
+    /* Create Process */
+    rc = CreateProcessAsUserW(hToken,
+                              pRequest->ApplicationName,
+                              pRequest->CommandLine,
+                              NULL,  // lpProcessAttributes,
+                              NULL,  // lpThreadAttributes,
+                              FALSE, // bInheritHandles,
+                              pRequest->dwCreationFlags,
+                              NULL,  // lpEnvironment,
+                              pRequest->CurrentDirectory,
+                              &StartupInfo,
+                              &ProcessInfo);
+    if (rc == FALSE)
+    {
+        dwError = GetLastError();
+        WARN("CreateProcessAsUser() failed with Error %lu\n", dwError);
+        goto done;
+    }
+
+    /* FIXME: Pass process info to the caller */
 
 done:
+    if (ProcessInfo.hThread)
+        CloseHandle(ProcessInfo.hThread);
+
+    if (ProcessInfo.hProcess)
+        CloseHandle(ProcessInfo.hProcess);
+
     if (ProfileInfo.hProfile != NULL)
         UnloadUserProfile(hToken, ProfileInfo.hProfile);
 

Reply via email to