Bug 1315213 - Add "CurrentPatchLevel" to the list of possible values where the microcode version is stored. r=milan
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Thu, 01 Dec 2016 09:31:46 +0100
changeset 324979 46f6ea9600f0aa6dbf7433f4e2295b3bad241e45
parent 324978 bb0dcd3dc89305e32a5f3e80c4149f862a7ed282
child 324980 ad9064b5fe9a0da54cc820482a61759a730a1c0b
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmilan
bugs1315213
milestone53.0a1
Bug 1315213 - Add "CurrentPatchLevel" to the list of possible values where the microcode version is stored. r=milan
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3438,19 +3438,20 @@ XREMain::XRE_mainInit(bool* aExitFlag)
       L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0";
 
     if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName , 0, KEY_QUERY_VALUE, &key) == ERROR_SUCCESS) {
 
       DWORD updateRevision[2];
       DWORD len = sizeof(updateRevision);
       DWORD vtype;
 
-      // Windows 7 uses Update Signature, 8 uses "Update Revision".
+      // Windows 7 uses "Update Signature", 8 uses "Update Revision".
+      // For AMD CPUs, "CurrentPatchLevel" is sometimes used.
       // Take the first one we find.
-      LPCWSTR choices[] = {L"Update Signature", L"Update Revision"};
+      LPCWSTR choices[] = {L"Update Signature", L"Update Revision", L"CurrentPatchLevel"};
       for (size_t oneChoice=0; oneChoice<ArrayLength(choices); oneChoice++) {
         if (RegQueryValueExW(key, choices[oneChoice],
                              0, &vtype,
                              reinterpret_cast<LPBYTE>(updateRevision),
                              &len) == ERROR_SUCCESS) {
           if (vtype == REG_BINARY && len == sizeof(updateRevision)) {
             // The first word is unused
             cpuUpdateRevision = static_cast<int>(updateRevision[1]);