Bug 1494709 - Check for native messaging host registrations in both the 32-bit and 64-bit registry views. r=aswan
authorMatt Howell <mhowell@mozilla.com>
Thu, 04 Oct 2018 20:36:04 +0000
changeset 495450 3be82e46d044dc1082fc28cded2deb15bb92acc2
parent 495449 a2ecbcdcec39d0d478213034aa0fd4cd20e32552
child 495451 7b49a74b30e60b6e030bb3e23b444f8eac0ca715
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1494709
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1494709 - Check for native messaging host registrations in both the 32-bit and 64-bit registry views. r=aswan This brings us into line with Chrome's behavior. Like Chrome, we check the 32-bit view first and check HKEY_CURRENT_USER before HKEY_LOCAL_MACHINE. This patch only adds code affecting HKEY_LOCAL_MACHINE because the registry does not use a 32-bit view in the HKEY_CURRENT_USER\Software key. Differential Revision: https://phabricator.services.mozilla.com/D7779
toolkit/components/extensions/NativeManifests.jsm
--- a/toolkit/components/extensions/NativeManifests.jsm
+++ b/toolkit/components/extensions/NativeManifests.jsm
@@ -54,17 +54,21 @@ var NativeManifests = {
   },
 
   _winLookup(type, name, context) {
     const REGISTRY = Ci.nsIWindowsRegKey;
     let regPath = `${REGPATH}\\${TYPES[type]}\\${name}`;
     let path = WindowsRegistry.readRegKey(REGISTRY.ROOT_KEY_CURRENT_USER,
                                           regPath, "", REGISTRY.WOW64_64);
     if (!path) {
-      path = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
+      path = WindowsRegistry.readRegKey(REGISTRY.ROOT_KEY_LOCAL_MACHINE,
+                                        regPath, "", REGISTRY.WOW64_32);
+    }
+    if (!path) {
+      path = WindowsRegistry.readRegKey(REGISTRY.ROOT_KEY_LOCAL_MACHINE,
                                         regPath, "", REGISTRY.WOW64_64);
     }
     if (!path) {
       return null;
     }
     return this._tryPath(type, path, name, context)
       .then(manifest => manifest ? {path, manifest} : null);
   },