Fixed problem with DependOnService key, which can be of type string and multistring. This fixes a problem with some service entries, which do not use the multistring type for this key as most do.

Peter Dons Tychsen (none) donpedro at dhcppc2.
Tue Sep 2 18:35:53 CDT 2008


---
 programs/services/services.c |    4 ++--
 programs/services/services.h |    2 +-
 programs/services/utils.c    |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/programs/services/services.c b/programs/services/services.c
index 36ed117..cd71a1f 100644
--- a/programs/services/services.c
+++ b/programs/services/services.c
@@ -106,9 +106,9 @@ static DWORD load_service_config(HKEY hKey, struct service_entry *entry)
         return err;
     if ((err = load_reg_string(hKey, SZ_DESCRIPTION,  0,    &entry->description)) != 0)
         return err;
-    if ((err = load_reg_multisz(hKey, SZ_DEPEND_ON_SERVICE, &entry->dependOnServices)) != 0)
+    if ((err = load_reg_multisz(hKey, SZ_DEPEND_ON_SERVICE, TRUE, &entry->dependOnServices)) != 0)
         return err;
-    if ((err = load_reg_multisz(hKey, SZ_DEPEND_ON_GROUP,   &entry->dependOnGroups)) != 0)
+    if ((err = load_reg_multisz(hKey, SZ_DEPEND_ON_GROUP, FALSE, &entry->dependOnGroups)) != 0)
         return err;
 
     if ((err = load_reg_dword(hKey, SZ_TYPE,  &entry->config.dwServiceType)) != 0)
diff --git a/programs/services/services.h b/programs/services/services.h
index fd99bf9..cd7de02 100644
--- a/programs/services/services.h
+++ b/programs/services/services.h
@@ -87,7 +87,7 @@ LPWSTR strdupW(LPCWSTR str);
 BOOL check_multisz(LPCWSTR lpMultiSz, DWORD cbSize);
 
 DWORD load_reg_string(HKEY hKey, LPCWSTR szValue, BOOL bExpand, LPWSTR *output);
-DWORD load_reg_multisz(HKEY hKey, LPCWSTR szValue, LPWSTR *output);
+DWORD load_reg_multisz(HKEY hKey, LPCWSTR szValue, BOOL bAllowSingle, LPWSTR *output);
 DWORD load_reg_dword(HKEY hKey, LPCWSTR szValue, DWORD *output);
 
 static inline LPCWSTR get_display_name(struct service_entry *service)
diff --git a/programs/services/utils.c b/programs/services/utils.c
index 89eb500..191cc5f 100644
--- a/programs/services/utils.c
+++ b/programs/services/utils.c
@@ -102,7 +102,7 @@ failed:
     return err;
 }
 
-DWORD load_reg_multisz(HKEY hKey, LPCWSTR szValue, LPWSTR *output)
+DWORD load_reg_multisz(HKEY hKey, LPCWSTR szValue, BOOL bAllowSingle, LPWSTR *output)
 {
     DWORD size, type;
     LPWSTR buf = NULL;
@@ -118,7 +118,7 @@ DWORD load_reg_multisz(HKEY hKey, LPCWSTR szValue, LPWSTR *output)
         }
         goto failed;
     }
-    if (type != REG_MULTI_SZ)
+    if (!((type == REG_MULTI_SZ) || ((type == REG_SZ) && bAllowSingle)))
     {
         err = ERROR_INVALID_DATATYPE;
         goto failed;
-- 
1.5.4.1


--=-yy8jNzXQ4HhSvtj3EVZZ
Content-Disposition: attachment; filename*0=0002-Fixed-problem-with-driver-entries-in-the-registry-wh.pat; filename*1=ch
Content-Type: application/mbox; name=0002-Fixed-problem-with-driver-entries-in-the-registry-wh.patch
Content-Transfer-Encoding: 7bit



More information about the wine-devel mailing list