Module: wine Branch: master Commit: ff62d6cf42e8504f5d8fa27d0c848723cca4af7d URL: http://source.winehq.org/git/wine.git/?a=commit;h=ff62d6cf42e8504f5d8fa27d0c...
Author: Paul Vriens paul.vriens.wine@gmail.com Date: Thu Jun 28 07:59:55 2007 +0200
advapi32/service: Don't rely blindly on type.
---
dlls/advapi32/service.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index c7bb0c7..731d668 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1915,22 +1915,22 @@ QueryServiceConfigW( SC_HANDLE hService,
sz = sizeof val; r = RegQueryValueExW( hKey, szType, 0, &type, (LPBYTE)&val, &sz ); - if( ( r == ERROR_SUCCESS ) || ( type == REG_DWORD ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_DWORD ) ) lpServiceConfig->dwServiceType = val;
sz = sizeof val; r = RegQueryValueExW( hKey, szStart, 0, &type, (LPBYTE)&val, &sz ); - if( ( r == ERROR_SUCCESS ) || ( type == REG_DWORD ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_DWORD ) ) lpServiceConfig->dwStartType = val;
sz = sizeof val; r = RegQueryValueExW( hKey, szError, 0, &type, (LPBYTE)&val, &sz ); - if( ( r == ERROR_SUCCESS ) || ( type == REG_DWORD ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_DWORD ) ) lpServiceConfig->dwErrorControl = val;
sz = sizeof val; r = RegQueryValueExW( hKey, szTag, 0, &type, (LPBYTE)&val, &sz ); - if( ( r == ERROR_SUCCESS ) || ( type == REG_DWORD ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_DWORD ) ) lpServiceConfig->dwTagId = val;
/* now do the strings */ @@ -1958,7 +1958,7 @@ QueryServiceConfigW( SC_HANDLE hService, sz = n; r = RegQueryValueExW( hKey, szGroup, 0, &type, p, &sz ); lpServiceConfig->lpLoadOrderGroup = (LPWSTR) p; - if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) ) { p += sz; n -= sz; @@ -1973,7 +1973,7 @@ QueryServiceConfigW( SC_HANDLE hService, sz = n; r = RegQueryValueExW( hKey, szDependencies, 0, &type, p, &sz ); lpServiceConfig->lpDependencies = (LPWSTR) p; - if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) ) { p += sz; n -= sz; @@ -1988,7 +1988,7 @@ QueryServiceConfigW( SC_HANDLE hService, sz = n; r = RegQueryValueExW( hKey, szObjectName, 0, &type, p, &sz ); lpServiceConfig->lpServiceStartName = (LPWSTR) p; - if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) ) { p += sz; n -= sz; @@ -2003,7 +2003,7 @@ QueryServiceConfigW( SC_HANDLE hService, sz = n; r = RegQueryValueExW( hKey, szDisplayName, 0, &type, p, &sz ); lpServiceConfig->lpDisplayName = (LPWSTR) p; - if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) + if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) ) { p += sz; n -= sz;