ADVAPI32: Make struct service_data_t have the new SERVICE_STATUS_PROCESS struct

Rolf Kalbermatter r.kalbermatter at hccnet.nl
Tue Apr 24 00:14:38 CDT 2007


Changelog
  dlls/advapi32/service.c
   - Make struct service_data_t have the new SERVICE_STATUS_PROCESS struct

License: X11/LGPL

Rolf Kalbermatter
-------------- next part --------------
>From d73028533ea7571b4a73a74c806cd6e24e2740c9 Mon Sep 17 00:00:00 2001
From: Rolf Kalbermatter <r.kalbermatter at hccnet.nl>
Date: Mon, 23 Apr 2007 20:18:53 +0200
Subject: [PATCH] Make struct service_data_t have the new SERVICE_STATUS_PROCESS struct
---
 dlls/advapi32/service.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index 641c89d..5747e2d 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -62,7 +62,7 @@ typedef struct service_data_t
         LPHANDLER_FUNCTION_EX handler_ex;
     } handler;
     LPVOID context;
-    SERVICE_STATUS status;
+    SERVICE_STATUS_PROCESS status;
     HANDLE thread;
     BOOL unicode : 1;
     BOOL extended : 1; /* uses handler_ex instead of handler? */
@@ -499,7 +499,7 @@ static BOOL service_handle_get_status(HA
 /******************************************************************************
  * service_get_status
  */
-static BOOL service_get_status(HANDLE pipe, LPSERVICE_STATUS status)
+static BOOL service_get_status(HANDLE pipe, LPSERVICE_STATUS_PROCESS status)
 {
     DWORD cmd[2], count = 0;
     BOOL r;
@@ -1470,6 +1470,8 @@ 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 */
+
         handles[1] = pi.hProcess;
         ret = WaitForMultipleObjectsEx(2, handles, FALSE, 30000, FALSE);
         if(ret != WAIT_OBJECT_0)
@@ -1645,17 +1647,12 @@ BOOL WINAPI QueryServiceStatusEx(SC_HAND
     pipe = service_open_pipe(hsvc->name);
     if (pipe != INVALID_HANDLE_VALUE)
     {
-        r = service_get_status(pipe, (LPSERVICE_STATUS)&pSvcStatusData);
+        r = service_get_status(pipe, pSvcStatusData);
         CloseHandle(pipe);
         if (r)
             return TRUE;
     }
 
-    /* FIXME: this would be the pid from service_start_process() */
-    pSvcStatusData->dwProcessId = 0;
-    /* service is running in a process that is not a system process */
-    pSvcStatusData->dwServiceFlags = 0;
-
     TRACE("Failed to read service status\n");
 
     /* read the service type from the registry */
-- 
1.4.1



More information about the wine-patches mailing list