Bug 1404147 Resolve inconsistency between GetLastError (DWORD - unsigned) and HRESULT (signed) r?smaug
MozReview-Commit-ID: AzyiFjAG5Wt
--- a/toolkit/mozapps/update/common/pathhash.cpp
+++ b/toolkit/mozapps/update/common/pathhash.cpp
@@ -39,17 +39,17 @@ static BOOL
CalculateMD5(const char *data, DWORD dataSize,
BYTE **hash, DWORD &hashSize)
{
HCRYPTPROV hProv = 0;
HCRYPTHASH hHash = 0;
if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
- if (NTE_BAD_KEYSET != GetLastError()) {
+ if ((DWORD)NTE_BAD_KEYSET != GetLastError()) {
return FALSE;
}
// Maybe it doesn't exist, try to create it.
if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET)) {
return FALSE;
}