Loading accessible/windows/msaa/Platform.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -197,14 +197,15 @@ a11y::IsHandlerRegistered() return false; } nsAutoString clsid; GUIDToString(CLSID_AccessibleHandler, clsid); nsAutoString subKey; subKey.AppendLiteral("CLSID\\"); nsAutoString iid; GUIDToString(CLSID_AccessibleHandler, iid); subKey.Append(iid); subKey.AppendLiteral("\\InprocHandler32"); subKey.AppendLiteral(u"SOFTWARE\\Classes\\CLSID\\"); subKey.Append(clsid); subKey.AppendLiteral(u"\\InprocHandler32"); rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT, subKey, rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE, subKey, nsIWindowsRegKey::ACCESS_READ); if (NS_FAILED(rv)) { return false; Loading ipc/mscom/RegistrationAnnotator.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ static const char16_t kFlags[] = u"FLAGS"; static const char16_t kProxyStubClsid32[] = u"\\ProxyStubClsid32"; static const char16_t kClsid[] = u"\\CLSID\\"; static const char16_t kInprocServer32[] = u"\\InprocServer32"; static const char16_t kInprocHandler32[] = u"\\InprocHandler32"; static const char16_t kTypeLib[] = u"\\TypeLib"; static const char16_t kVersion[] = u"Version"; static const char16_t kWin32[] = u"Win32"; Loading Loading @@ -170,6 +171,24 @@ AnnotateClsidRegistrationForHive(JSONWriter& aJson, HKEY aHive, if (GetStringValue(aHive, inprocServerSubkey, kThreadingModel, apartment)) { aJson.StringProperty("ThreadingModel", NS_ConvertUTF16toUTF8(apartment).get()); } nsAutoString inprocHandlerSubkey(clsidSubkey); inprocHandlerSubkey.AppendLiteral(kInprocHandler32); nsAutoString pathToHandlerDll; if (GetStringValue(aHive, inprocHandlerSubkey, kDefaultValue, pathToHandlerDll)) { aJson.StringProperty("HandlerPath", NS_ConvertUTF16toUTF8(pathToHandlerDll).get()); if (GetLoadedPath(pathToHandlerDll)) { aJson.StringProperty("LoadedHandlerPath", NS_ConvertUTF16toUTF8(pathToHandlerDll).get()); } } nsAutoString handlerApartment; if (GetStringValue(aHive, inprocHandlerSubkey, kThreadingModel, handlerApartment)) { aJson.StringProperty("HandlerThreadingModel", NS_ConvertUTF16toUTF8(handlerApartment).get()); } } static void Loading ipc/mscom/oop/Handler.cpp +12 −9 Original line number Diff line number Diff line Loading @@ -263,17 +263,20 @@ template <size_t N> static HRESULT BuildClsidPath(wchar_t (&aPath)[N], REFCLSID aClsid) { const wchar_t kClsid[] = {L'C', L'L', L'S', L'I', L'D', L'\\'}; const wchar_t kSubkey[] = L"SOFTWARE\\Classes\\CLSID\\"; // We exclude kSubkey's null terminator in the length because we include // the stringified GUID's null terminator. constexpr uint32_t kSubkeyLen = mozilla::ArrayLength(kSubkey) - 1; const size_t kReqdGuidLen = 39; static_assert(N >= kReqdGuidLen + mozilla::ArrayLength(kClsid), "aPath array is too short"); if (wcsncpy_s(aPath, kClsid, mozilla::ArrayLength(kClsid))) { static_assert(N >= kReqdGuidLen + kSubkeyLen, "aPath array is too short"); if (wcsncpy_s(aPath, kSubkey, kSubkeyLen)) { return E_INVALIDARG; } int guidConversionResult = StringFromGUID2(aClsid, &aPath[mozilla::ArrayLength(kClsid)], N - mozilla::ArrayLength(kClsid)); StringFromGUID2(aClsid, &aPath[kSubkeyLen], N - kSubkeyLen); if (!guidConversionResult) { return E_INVALIDARG; } Loading @@ -290,7 +293,7 @@ Handler::Unregister(REFCLSID aClsid) return hr; } hr = HRESULT_FROM_WIN32(SHDeleteKey(HKEY_CLASSES_ROOT, path)); hr = HRESULT_FROM_WIN32(SHDeleteKey(HKEY_LOCAL_MACHINE, path)); if (FAILED(hr)) { return hr; } Loading @@ -309,7 +312,7 @@ Handler::Register(REFCLSID aClsid) HKEY rawClsidKey; DWORD disposition; LONG result = RegCreateKeyEx(HKEY_CLASSES_ROOT, path, 0, nullptr, LONG result = RegCreateKeyEx(HKEY_LOCAL_MACHINE, path, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &rawClsidKey, &disposition); if (result != ERROR_SUCCESS) { Loading @@ -322,7 +325,7 @@ Handler::Register(REFCLSID aClsid) } HKEY rawInprocHandlerKey; result = RegCreateKeyEx(HKEY_CLASSES_ROOT, path, 0, nullptr, result = RegCreateKeyEx(HKEY_LOCAL_MACHINE, path, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &rawInprocHandlerKey, &disposition); if (result != ERROR_SUCCESS) { Loading Loading
accessible/windows/msaa/Platform.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -197,14 +197,15 @@ a11y::IsHandlerRegistered() return false; } nsAutoString clsid; GUIDToString(CLSID_AccessibleHandler, clsid); nsAutoString subKey; subKey.AppendLiteral("CLSID\\"); nsAutoString iid; GUIDToString(CLSID_AccessibleHandler, iid); subKey.Append(iid); subKey.AppendLiteral("\\InprocHandler32"); subKey.AppendLiteral(u"SOFTWARE\\Classes\\CLSID\\"); subKey.Append(clsid); subKey.AppendLiteral(u"\\InprocHandler32"); rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT, subKey, rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE, subKey, nsIWindowsRegKey::ACCESS_READ); if (NS_FAILED(rv)) { return false; Loading
ipc/mscom/RegistrationAnnotator.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ static const char16_t kFlags[] = u"FLAGS"; static const char16_t kProxyStubClsid32[] = u"\\ProxyStubClsid32"; static const char16_t kClsid[] = u"\\CLSID\\"; static const char16_t kInprocServer32[] = u"\\InprocServer32"; static const char16_t kInprocHandler32[] = u"\\InprocHandler32"; static const char16_t kTypeLib[] = u"\\TypeLib"; static const char16_t kVersion[] = u"Version"; static const char16_t kWin32[] = u"Win32"; Loading Loading @@ -170,6 +171,24 @@ AnnotateClsidRegistrationForHive(JSONWriter& aJson, HKEY aHive, if (GetStringValue(aHive, inprocServerSubkey, kThreadingModel, apartment)) { aJson.StringProperty("ThreadingModel", NS_ConvertUTF16toUTF8(apartment).get()); } nsAutoString inprocHandlerSubkey(clsidSubkey); inprocHandlerSubkey.AppendLiteral(kInprocHandler32); nsAutoString pathToHandlerDll; if (GetStringValue(aHive, inprocHandlerSubkey, kDefaultValue, pathToHandlerDll)) { aJson.StringProperty("HandlerPath", NS_ConvertUTF16toUTF8(pathToHandlerDll).get()); if (GetLoadedPath(pathToHandlerDll)) { aJson.StringProperty("LoadedHandlerPath", NS_ConvertUTF16toUTF8(pathToHandlerDll).get()); } } nsAutoString handlerApartment; if (GetStringValue(aHive, inprocHandlerSubkey, kThreadingModel, handlerApartment)) { aJson.StringProperty("HandlerThreadingModel", NS_ConvertUTF16toUTF8(handlerApartment).get()); } } static void Loading
ipc/mscom/oop/Handler.cpp +12 −9 Original line number Diff line number Diff line Loading @@ -263,17 +263,20 @@ template <size_t N> static HRESULT BuildClsidPath(wchar_t (&aPath)[N], REFCLSID aClsid) { const wchar_t kClsid[] = {L'C', L'L', L'S', L'I', L'D', L'\\'}; const wchar_t kSubkey[] = L"SOFTWARE\\Classes\\CLSID\\"; // We exclude kSubkey's null terminator in the length because we include // the stringified GUID's null terminator. constexpr uint32_t kSubkeyLen = mozilla::ArrayLength(kSubkey) - 1; const size_t kReqdGuidLen = 39; static_assert(N >= kReqdGuidLen + mozilla::ArrayLength(kClsid), "aPath array is too short"); if (wcsncpy_s(aPath, kClsid, mozilla::ArrayLength(kClsid))) { static_assert(N >= kReqdGuidLen + kSubkeyLen, "aPath array is too short"); if (wcsncpy_s(aPath, kSubkey, kSubkeyLen)) { return E_INVALIDARG; } int guidConversionResult = StringFromGUID2(aClsid, &aPath[mozilla::ArrayLength(kClsid)], N - mozilla::ArrayLength(kClsid)); StringFromGUID2(aClsid, &aPath[kSubkeyLen], N - kSubkeyLen); if (!guidConversionResult) { return E_INVALIDARG; } Loading @@ -290,7 +293,7 @@ Handler::Unregister(REFCLSID aClsid) return hr; } hr = HRESULT_FROM_WIN32(SHDeleteKey(HKEY_CLASSES_ROOT, path)); hr = HRESULT_FROM_WIN32(SHDeleteKey(HKEY_LOCAL_MACHINE, path)); if (FAILED(hr)) { return hr; } Loading @@ -309,7 +312,7 @@ Handler::Register(REFCLSID aClsid) HKEY rawClsidKey; DWORD disposition; LONG result = RegCreateKeyEx(HKEY_CLASSES_ROOT, path, 0, nullptr, LONG result = RegCreateKeyEx(HKEY_LOCAL_MACHINE, path, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &rawClsidKey, &disposition); if (result != ERROR_SUCCESS) { Loading @@ -322,7 +325,7 @@ Handler::Register(REFCLSID aClsid) } HKEY rawInprocHandlerKey; result = RegCreateKeyEx(HKEY_CLASSES_ROOT, path, 0, nullptr, result = RegCreateKeyEx(HKEY_LOCAL_MACHINE, path, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &rawInprocHandlerKey, &disposition); if (result != ERROR_SUCCESS) { Loading