mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 10:37:30 +00:00
[ADVAPI32]
- Roel Messiant: Fix short-circuit evaluation. See issue #5677 for more details. svn path=/trunk/; revision=49216
This commit is contained in:
parent
824ec6597d
commit
12cded29f1
1 changed files with 34 additions and 19 deletions
|
@ -103,16 +103,22 @@ static DWORD registry_read_credential(HKEY hkey, PCREDENTIALW credential,
|
|||
credential->TargetName = (LPWSTR)buffer;
|
||||
ret = RegQueryValueExW(hkey, NULL, 0, &type, (LPVOID)credential->TargetName,
|
||||
&count);
|
||||
if (ret != ERROR_SUCCESS || type != REG_SZ) return ret;
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
else if (type != REG_SZ)
|
||||
return ERROR_REGISTRY_CORRUPT;
|
||||
buffer += count;
|
||||
}
|
||||
|
||||
ret = RegQueryValueExW(hkey, wszCommentValue, 0, &type, NULL, &count);
|
||||
if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
else if (type != REG_SZ)
|
||||
return ERROR_REGISTRY_CORRUPT;
|
||||
*len += count;
|
||||
if (ret != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
else if (type != REG_SZ)
|
||||
return ERROR_REGISTRY_CORRUPT;
|
||||
*len += count;
|
||||
}
|
||||
if (credential)
|
||||
{
|
||||
credential->Comment = (LPWSTR)buffer;
|
||||
|
@ -129,11 +135,14 @@ static DWORD registry_read_credential(HKEY hkey, PCREDENTIALW credential,
|
|||
}
|
||||
|
||||
ret = RegQueryValueExW(hkey, wszTargetAliasValue, 0, &type, NULL, &count);
|
||||
if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
else if (type != REG_SZ)
|
||||
return ERROR_REGISTRY_CORRUPT;
|
||||
*len += count;
|
||||
if (ret != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
else if (type != REG_SZ)
|
||||
return ERROR_REGISTRY_CORRUPT;
|
||||
*len += count;
|
||||
}
|
||||
if (credential)
|
||||
{
|
||||
credential->TargetAlias = (LPWSTR)buffer;
|
||||
|
@ -150,11 +159,14 @@ static DWORD registry_read_credential(HKEY hkey, PCREDENTIALW credential,
|
|||
}
|
||||
|
||||
ret = RegQueryValueExW(hkey, wszUserNameValue, 0, &type, NULL, &count);
|
||||
if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
else if (type != REG_SZ)
|
||||
return ERROR_REGISTRY_CORRUPT;
|
||||
*len += count;
|
||||
if (ret != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
else if (type != REG_SZ)
|
||||
return ERROR_REGISTRY_CORRUPT;
|
||||
*len += count;
|
||||
}
|
||||
if (credential)
|
||||
{
|
||||
credential->UserName = (LPWSTR)buffer;
|
||||
|
@ -171,9 +183,12 @@ static DWORD registry_read_credential(HKEY hkey, PCREDENTIALW credential,
|
|||
}
|
||||
|
||||
ret = read_credential_blob(hkey, key_data, NULL, &count);
|
||||
if (ret != ERROR_FILE_NOT_FOUND && ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
*len += count;
|
||||
if (ret != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
if (ret != ERROR_SUCCESS)
|
||||
return ret;
|
||||
*len += count;
|
||||
}
|
||||
if (credential)
|
||||
{
|
||||
credential->CredentialBlob = (LPBYTE)buffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue