mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 09:50:52 +00:00
advapi32/service: Don't rely blindly on type.
This commit is contained in:
parent
9c6a5dfa85
commit
ff62d6cf42
1 changed files with 8 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue