Skip to content

Commit

Permalink
Bug 1844908 - Remove pre-Win10-specific codepath from uriloader/extha…
Browse files Browse the repository at this point in the history
…ndler/. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D184306
  • Loading branch information
vyv03354 committed Jul 25, 2023
1 parent fe7eca4 commit f85d187
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions uriloader/exthandler/win/nsOSHelperAppService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f85d187

Please sign in to comment.