From dc4c3ca267b811613cc66761a91a8d05b5430d7d Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Wed, 29 Jan 2020 21:18:18 +0000 Subject: [PATCH] Bug 1607990 - Link to WSCGetProviderInfo at compile time. r=aklotz Differential Revision: https://phabricator.services.mozilla.com/D59262 --HG-- extra : moz-landing-system : lando --- widget/windows/LSPAnnotator.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/widget/windows/LSPAnnotator.cpp b/widget/windows/LSPAnnotator.cpp index f034732db0fc..d3c2fd5807e8 100644 --- a/widget/windows/LSPAnnotator.cpp +++ b/widget/windows/LSPAnnotator.cpp @@ -99,23 +99,14 @@ LSPAnnotationGatherer::Run() { } str.AppendLiteral(" : "); - // If WSCGetProviderInfo is available, we should call it to obtain the - // category flags for this provider. When present, these flags inform - // Windows as to which order to chain the providers. - nsModuleHandle ws2_32(LoadLibraryW(L"ws2_32.dll")); - if (ws2_32) { - decltype(WSCGetProviderInfo)* pWSCGetProviderInfo = - reinterpret_cast( - GetProcAddress(ws2_32, "WSCGetProviderInfo")); - if (pWSCGetProviderInfo) { - DWORD categoryInfo; - size_t categoryInfoSize = sizeof(categoryInfo); - if (!pWSCGetProviderInfo( - &providers[i].ProviderId, ProviderInfoLspCategories, - (PBYTE)&categoryInfo, &categoryInfoSize, 0, &err)) { - str.AppendPrintf("0x%x", categoryInfo); - } - } + // Call WSCGetProviderInfo to obtain the category flags for this provider. + // When present, these flags inform Windows as to which order to chain the + // providers. + DWORD categoryInfo; + size_t categoryInfoSize = sizeof(categoryInfo); + if (!WSCGetProviderInfo(&providers[i].ProviderId, ProviderInfoLspCategories, + (PBYTE)&categoryInfo, &categoryInfoSize, 0, &err)) { + str.AppendPrintf("0x%lx", categoryInfo); } str.AppendLiteral(" : ");