Bug 1844908 - Remove pre-Win10-specific codepath from uriloader/exthandler/. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D184306
This commit is contained in:
Masatoshi Kimura 2023-07-25 14:41:05 +00:00
Родитель fe7eca4ab3
Коммит f85d1878c5
1 изменённых файлов: 10 добавлений и 13 удалений

Просмотреть файл

@ -17,7 +17,6 @@
#include "nsIWindowsRegKey.h"
#include "nsXULAppAPI.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/WindowsVersion.h"
// shellapi.h is needed to build with WIN32_LEAN_AND_MEAN
#include <shellapi.h>
@ -119,23 +118,21 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(
NS_ConvertASCIItoUTF16 buf(aScheme);
if (mozilla::IsWin8OrLater()) {
wchar_t result[1024];
DWORD resultSize = 1024;
HRESULT hr = AssocQueryString(0x1000 /* ASSOCF_IS_PROTOCOL */,
ASSOCSTR_FRIENDLYAPPNAME, buf.get(), NULL,
result, &resultSize);
if (SUCCEEDED(hr)) {
_retval = result;
return NS_OK;
}
wchar_t result[1024];
DWORD resultSize = 1024;
HRESULT hr = AssocQueryString(0x1000 /* ASSOCF_IS_PROTOCOL */,
ASSOCSTR_FRIENDLYAPPNAME, buf.get(), NULL,
result, &resultSize);
if (SUCCEEDED(hr)) {
_retval = result;
return NS_OK;
}
NS_ENSURE_TRUE(mAppAssoc, NS_ERROR_NOT_AVAILABLE);
wchar_t* pResult = nullptr;
// We are responsible for freeing returned strings.
HRESULT hr = mAppAssoc->QueryCurrentDefault(buf.get(), AT_URLPROTOCOL,
AL_EFFECTIVE, &pResult);
hr = mAppAssoc->QueryCurrentDefault(buf.get(), AT_URLPROTOCOL, AL_EFFECTIVE,
&pResult);
if (SUCCEEDED(hr)) {
nsCOMPtr<nsIFile> app;
nsAutoString appInfo(pResult);