From d3936f581694cbb799a034c3c8ddcc54c28c9020 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Wed, 22 Apr 2009 15:58:37 +0000 Subject: [PATCH] sync advapi32/cred.c to wine 1.1.19 svn path=/trunk/; revision=40651 --- reactos/dll/win32/advapi32/sec/cred.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/reactos/dll/win32/advapi32/sec/cred.c b/reactos/dll/win32/advapi32/sec/cred.c index f5509b37b3f..d5b4b2efe83 100644 --- a/reactos/dll/win32/advapi32/sec/cred.c +++ b/reactos/dll/win32/advapi32/sec/cred.c @@ -67,7 +67,7 @@ static DWORD read_credential_blob(HKEY hkey, const BYTE key_data[KEY_SIZE], struct ustring data; struct ustring key; - ret = RegQueryValueExW(hkey, wszPasswordValue, 0, &type, (LPVOID)credential_blob, + ret = RegQueryValueExW(hkey, wszPasswordValue, 0, &type, credential_blob, credential_blob_size); if (ret != ERROR_SUCCESS) return ret; @@ -161,10 +161,7 @@ static DWORD registry_read_credential(HKEY hkey, PCREDENTIALW credential, ret = RegQueryValueExW(hkey, wszUserNameValue, 0, &type, (LPVOID)credential->UserName, &count); if (ret == ERROR_FILE_NOT_FOUND) - { credential->UserName = NULL; - ret = ERROR_SUCCESS; - } else if (ret != ERROR_SUCCESS) return ret; else if (type != REG_SZ) @@ -182,10 +179,7 @@ static DWORD registry_read_credential(HKEY hkey, PCREDENTIALW credential, credential->CredentialBlob = (LPBYTE)buffer; ret = read_credential_blob(hkey, key_data, credential->CredentialBlob, &count); if (ret == ERROR_FILE_NOT_FOUND) - { credential->CredentialBlob = NULL; - ret = ERROR_SUCCESS; - } else if (ret != ERROR_SUCCESS) return ret; credential->CredentialBlobSize = count; @@ -459,7 +453,7 @@ static DWORD write_credential_blob(HKEY hkey, LPCWSTR target_name, DWORD type, data.Buffer = encrypted_credential_blob; SystemFunction032(&data, &key); - ret = RegSetValueExW(hkey, wszPasswordValue, 0, REG_BINARY, (LPVOID)encrypted_credential_blob, credential_blob_size); + ret = RegSetValueExW(hkey, wszPasswordValue, 0, REG_BINARY, encrypted_credential_blob, credential_blob_size); HeapFree(GetProcessHeap(), 0, encrypted_credential_blob); return ret; @@ -646,7 +640,7 @@ static DWORD get_cred_mgr_encryption_key(HKEY hkeyMgr, BYTE key_data[KEY_SIZE]) memcpy(key_data, my_key_data, KEY_SIZE); count = KEY_SIZE; - ret = RegQueryValueExW(hkeyMgr, wszEncryptionKeyValue, NULL, &type, (LPVOID)key_data, + ret = RegQueryValueExW(hkeyMgr, wszEncryptionKeyValue, NULL, &type, key_data, &count); if (ret == ERROR_SUCCESS) { @@ -667,14 +661,14 @@ static DWORD get_cred_mgr_encryption_key(HKEY hkeyMgr, BYTE key_data[KEY_SIZE]) *(DWORD *)(key_data + 4) = value; ret = RegSetValueExW(hkeyMgr, wszEncryptionKeyValue, 0, REG_BINARY, - (LPVOID)key_data, KEY_SIZE); + key_data, KEY_SIZE); if (ret == ERROR_ACCESS_DENIED) { ret = open_cred_mgr_key(&hkeyMgr, TRUE); if (ret == ERROR_SUCCESS) { ret = RegSetValueExW(hkeyMgr, wszEncryptionKeyValue, 0, REG_BINARY, - (LPVOID)key_data, KEY_SIZE); + key_data, KEY_SIZE); RegCloseKey(hkeyMgr); } }