services: Fixed problem with services where DependOnServices key is REG_SZ and not REG_MULTI_SZ.

This commit is contained in:
Peter Dons Tychsen 2008-09-17 00:35:01 +02:00 committed by Alexandre Julliard
parent 62823d272d
commit 741dd708c4
3 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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;