Bug 1404147 Resolve inconsistency between GetLastError (DWORD - unsigned) and HRESULT (signed) r?smaug draft
authorTom Ritter <tom@mozilla.com>
Thu, 28 Sep 2017 17:50:52 -0500
changeset 674380 a57367f1e2b2326ae0cb9288377c9aeffefb3421
parent 674379 0d3087b7b28ac0dd92d6b4b6da46fd4a43345a4d
child 674381 135c068cf7b7f1076bf2ca5350ab32e3024fed2b
push id82814
push userbmo:tom@mozilla.com
push dateTue, 03 Oct 2017 17:51:18 +0000
reviewerssmaug
bugs1404147
milestone58.0a1
Bug 1404147 Resolve inconsistency between GetLastError (DWORD - unsigned) and HRESULT (signed) r?smaug MozReview-Commit-ID: AzyiFjAG5Wt
toolkit/mozapps/update/common/pathhash.cpp
--- 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;
     }