From 19f3b0c6255b86a516b1e9bd0c7e74da1d6ca18e Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 15 Mar 2017 12:23:59 -0500 Subject: [PATCH] Continue move to CMake --- src/siadrive_api/siacommon.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/siadrive_api/siacommon.cpp b/src/siadrive_api/siacommon.cpp index 3a13f32..aedd7dc 100644 --- a/src/siadrive_api/siacommon.cpp +++ b/src/siadrive_api/siacommon.cpp @@ -14,17 +14,17 @@ SString GenerateSha256(const SString& str) SString ret; HCRYPTPROV hCryptProv = 0; HCRYPTHASH hHash = 0; - BOOL ok = CryptAcquireContext(&hCryptProv, nullptr, nullptr, PROV_RSA_AES, 0); - ok = ok && CryptCreateHash(hCryptProv, CALG_SHA_256, 0, 0, &hHash); - ok = ok && CryptHashData(hHash, reinterpret_cast(&str[0]), str.ByteLength(), 0); + BOOL ok = ::CryptAcquireContext(&hCryptProv, nullptr, nullptr, PROV_RSA_AES, 0); + ok = ok && ::CryptCreateHash(hCryptProv, CALG_SHA_256, 0, 0, &hHash); + ok = ok && ::CryptHashData(hHash, reinterpret_cast(&str[0]), str.ByteLength(), 0); if (ok) { DWORD dwHashLen; DWORD dwCount = sizeof(DWORD); - if (CryptGetHashParam(hHash, HP_HASHSIZE, reinterpret_cast(&dwHashLen), &dwCount, 0)) + if (::CryptGetHashParam(hHash, HP_HASHSIZE, reinterpret_cast(&dwHashLen), &dwCount, 0)) { std::vector hash(dwHashLen); - if (CryptGetHashParam(hHash, HP_HASHVAL, reinterpret_cast(&hash[0]), &dwHashLen, 0)) + if (::CryptGetHashParam(hHash, HP_HASHVAL, reinterpret_cast(&hash[0]), &dwHashLen, 0)) { std::ostringstream ss; ss << std::hex << std::uppercase << std::setfill('0'); @@ -37,8 +37,8 @@ SString GenerateSha256(const SString& str) } } - if (hHash) CryptDestroyHash(hHash); - if (hCryptProv) CryptReleaseContext(hCryptProv, 0); + if (hHash) ::CryptDestroyHash(hHash); + if (hCryptProv) ::CryptReleaseContext(hCryptProv, 0); return ret; #else