Bug 1607990 - Link to WSCGetProviderInfo at compile time. r=aklotz

Differential Revision: https://phabricator.services.mozilla.com/D59262

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Henrie 2020-01-29 21:18:18 +00:00
parent 51c21554f5
commit dc4c3ca267

View File

@ -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<decltype(WSCGetProviderInfo)*>(
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(" : ");