]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Resolve the stdcall/cdecl ambiguity that caused Win2K to crash with the
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 27 Mar 2001 19:18:14 +0000 (19:18 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 27 Mar 2001 19:18:14 +0000 (19:18 +0000)
  set service description patch.  Also lighten the load (don't allocate
  a handle) to get at the advapi32.dll we already statically link to.

PR: 7471
Submitted by: Roman Neuhauser <cynic@mail.cz>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@88595 13f79535-47bb-0310-9956-ffa450edef68

src/os/win32/service.c

index 33cdac10be8a053a7465806e77e8f66be891615b..f2a734eef4f51cf99e4335da49c71b3014bad764 100644 (file)
@@ -698,7 +698,7 @@ static void set_service_description_string(const char *description)
 
 /* ChangeServiceConfig2() prototype:
  */
-typedef WINADVAPI BOOL (*CSD_T)(SC_HANDLE, DWORD, LPCVOID);
+typedef WINADVAPI BOOL (WINAPI *CSD_T)(SC_HANDLE, DWORD, LPCVOID);
 
 
 /* Windows 2000 alone supports ChangeServiceConfig2 in order to
@@ -727,7 +727,7 @@ void service_set_status(int status)
     /* Time to fix up the description, upon each successful restart
      */
     full_description = ap_get_server_version();
-    hwin2000scm = LoadLibrary("ADVAPI32.DLL");
+    hwin2000scm = GetModuleHandle("ADVAPI32.DLL");
     if (!hwin2000scm) {
         set_service_description_string(full_description);
         return;
@@ -735,7 +735,6 @@ void service_set_status(int status)
     ChangeServiceDescription = (CSD_T) GetProcAddress(hwin2000scm, 
                                                       "ChangeServiceConfig2A");
     if (!ChangeServiceDescription) {
-        FreeLibrary(hwin2000scm);
         set_service_description_string(full_description);
         return;
     }
@@ -753,7 +752,6 @@ void service_set_status(int status)
     }
     if (!ret)
         set_service_description_string(full_description);
-    FreeLibrary(hwin2000scm);
 }