ADVAPI32: Make SERVICE_STATUS_PROCESS match the declaration in MSDN and PSDK

Rolf Kalbermatter r.kalbermatter at hccnet.nl
Sun Apr 22 15:26:47 CDT 2007


Changelog
  dlls/advapi32/service.c
   - Make SERVICE_STATUS_PROCESS match the declaration in MSDN and PSDK

License: X11/LGPL

Rolf Kalbermatter
-------------- next part --------------
>From b8f061044aa08ac7fbe58d06e021b13602f8537a Mon Sep 17 00:00:00 2001
From: Rolf Kalbermatter <r.kalbermatter at hccnet.nl>
Date: Sun, 22 Apr 2007 21:10:23 +0200
Subject: [PATCH] Make SERVICE_STATUS_PROCESS match the declaration in MSDN and PSDK
---
 dlls/advapi32/service.c |   28 ++++++++++++++--------------
 include/winsvc.h        |    8 +++++++-
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index 34cb96a..3be5275 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -1580,7 +1580,7 @@ BOOL WINAPI QueryServiceStatus(SC_HANDLE
 
     ret = QueryServiceStatusEx(hService, SC_STATUS_PROCESS_INFO, (LPBYTE)&SvcStatusData,
                                 sizeof(SERVICE_STATUS_PROCESS), NULL);
-    if (ret) *lpservicestatus = SvcStatusData.status;
+    if (ret) memcpy(lpservicestatus, &SvcStatusData, sizeof(SERVICE_STATUS)) ;
     return ret;
 }
 
@@ -1642,20 +1642,20 @@ BOOL WINAPI QueryServiceStatusEx(SC_HAND
         return FALSE;
     }
 
-    /* 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;
-
     pipe = service_open_pipe(hsvc->name);
     if (pipe != INVALID_HANDLE_VALUE)
     {
-        r = service_get_status(pipe, &pSvcStatusData->status);
+        r = service_get_status(pipe, (LPSERVICE_STATUS)&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 */
@@ -1664,13 +1664,13 @@ BOOL WINAPI QueryServiceStatusEx(SC_HAND
     if (r != ERROR_SUCCESS || type != REG_DWORD)
         val = 0;
 
-    pSvcStatusData->status.dwServiceType = val;
-    pSvcStatusData->status.dwCurrentState            = SERVICE_STOPPED;  /* stopped */
-    pSvcStatusData->status.dwControlsAccepted        = 0;
-    pSvcStatusData->status.dwWin32ExitCode           = ERROR_SERVICE_NEVER_STARTED;
-    pSvcStatusData->status.dwServiceSpecificExitCode = 0;
-    pSvcStatusData->status.dwCheckPoint              = 0;
-    pSvcStatusData->status.dwWaitHint                = 0;
+    pSvcStatusData->dwServiceType = val;
+    pSvcStatusData->dwCurrentState            = SERVICE_STOPPED;  /* stopped */
+    pSvcStatusData->dwControlsAccepted        = 0;
+    pSvcStatusData->dwWin32ExitCode           = ERROR_SERVICE_NEVER_STARTED;
+    pSvcStatusData->dwServiceSpecificExitCode = 0;
+    pSvcStatusData->dwCheckPoint              = 0;
+    pSvcStatusData->dwWaitHint                = 0;
 
     return TRUE;
 }
diff --git a/include/winsvc.h b/include/winsvc.h
index eeb9539..617b9f4 100644
--- a/include/winsvc.h
+++ b/include/winsvc.h
@@ -135,7 +135,13 @@ typedef struct _SERVICE_STATUS {
 
 typedef struct _SERVICE_STATUS_PROCESS
 {
-  SERVICE_STATUS status;
+  DWORD dwServiceType;
+  DWORD dwCurrentState;
+  DWORD dwControlsAccepted;
+  DWORD dwWin32ExitCode;
+  DWORD dwServiceSpecificExitCode;
+  DWORD dwCheckPoint;
+  DWORD dwWaitHint;
   DWORD dwProcessId;
   DWORD dwServiceFlags;
 } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;
-- 
1.4.1



More information about the wine-patches mailing list