ADVAPI32: Make service_start_process return the pid to the caller
Rolf Kalbermatter
r.kalbermatter at hccnet.nl
Tue Apr 24 00:15:04 CDT 2007
Changelog
dlls/advapi32/service.c
- Make service_start_process return the pid to the caller
License: X11/LGPL
Rolf Kalbermatter
-------------- next part --------------
>From 7fddc0c3fb749e6a7c9691fd59d8033387349ec4 Mon Sep 17 00:00:00 2001
From: Rolf Kalbermatter <r.kalbermatter at hccnet.nl>
Date: Mon, 23 Apr 2007 20:37:11 +0200
Subject: [PATCH] Make service_start_process return the pid to the caller
---
dlls/advapi32/service.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index 5747e2d..a677783 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -1436,7 +1436,7 @@ BOOL WINAPI StartServiceA( SC_HANDLE hSe
/******************************************************************************
* service_start_process [INTERNAL]
*/
-static DWORD service_start_process(struct sc_service *hsvc)
+static DWORD service_start_process(struct sc_service *hsvc, LPDWORD ppid)
{
static const WCHAR _ImagePathW[] = {'I','m','a','g','e','P','a','t','h',0};
PROCESS_INFORMATION pi;
@@ -1470,7 +1470,7 @@ static DWORD service_start_process(struc
r = CreateProcessW(NULL, path, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
if (r)
{
- /* FIXME: Put the pid into the service struct */
+ if (ppid) *ppid = pi.dwProcessId;
handles[1] = pi.hProcess;
ret = WaitForMultipleObjectsEx(2, handles, FALSE, 30000, FALSE);
@@ -1523,6 +1523,7 @@ BOOL WINAPI StartServiceW(SC_HANDLE hSer
{
struct sc_service *hsvc;
BOOL r = FALSE;
+ DWORD pid;
SC_LOCK hLock;
HANDLE handle = INVALID_HANDLE_VALUE;
@@ -1543,7 +1544,7 @@ BOOL WINAPI StartServiceW(SC_HANDLE hSer
if (handle==INVALID_HANDLE_VALUE)
{
/* start the service process */
- if (service_start_process(hsvc))
+ if (service_start_process(hsvc, &pid))
handle = service_open_pipe(hsvc->name);
}
--
1.4.1
More information about the wine-patches
mailing list