Michael Stefaniuc : svchost: Inline a simple string.

Alexandre Julliard julliard at winehq.org
Wed Nov 4 15:20:31 CST 2020


Module: wine
Branch: master
Commit: f629166425b6d91aaaa5da58a20b8bc78479f984
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f629166425b6d91aaaa5da58a20b8bc78479f984

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue Nov  3 23:34:39 2020 +0100

svchost: Inline a simple string.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/svchost/svchost.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/programs/svchost/svchost.c b/programs/svchost/svchost.c
index 0daaa6ebf47..603deef1abd 100644
--- a/programs/svchost/svchost.c
+++ b/programs/svchost/svchost.c
@@ -37,8 +37,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(svchost);
 static const WCHAR service_reg_path[] = L"System\\CurrentControlSet\\Services";
 static const WCHAR svchost_path[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Svchost";
 
-static const CHAR service_main[] = "ServiceMain";
-
 /* Allocate and initialize a WSTR containing the queried value */
 static LPWSTR GetRegValue(HKEY service_key, const WCHAR *value_name)
 {
@@ -162,14 +160,14 @@ static BOOL AddServiceElem(LPWSTR service_name,
     }
 
     /* Look for alternate to default ServiceMain entry point */
-    ret = RegQueryValueExA(service_hkey, service_main, NULL, NULL, NULL, &reg_size);
+    ret = RegQueryValueExA(service_hkey, "ServiceMain", NULL, NULL, NULL, &reg_size);
     if (ret == ERROR_SUCCESS)
     {
         /* Add space for potentially missing NULL terminator, allocate, and
          * fill with the registry value */
         size = reg_size + 1;
         dll_service_main = HeapAlloc(GetProcessHeap(), 0, size);
-        ret = RegQueryValueExA(service_hkey, service_main, NULL, NULL,
+        ret = RegQueryValueExA(service_hkey, "ServiceMain", NULL, NULL,
                 (LPBYTE)dll_service_main, &reg_size);
         if (ret != ERROR_SUCCESS)
         {
@@ -196,7 +194,7 @@ static BOOL AddServiceElem(LPWSTR service_name,
     else
     {
         service_main_func =
-            (LPSERVICE_MAIN_FUNCTIONW) GetProcAddress(library, service_main);
+            (LPSERVICE_MAIN_FUNCTIONW) GetProcAddress(library, "ServiceMain");
     }
     if (!service_main_func)
     {




More information about the wine-cvs mailing list