mpr: Enumerate connections capability before looking for functions entry points.

Signed-off-by: Pierre Schweitzer <pierre@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Pierre Schweitzer 2016-12-30 21:17:27 +01:00 committed by Alexandre Julliard
parent d961f5ac7e
commit 96a93ee608
1 changed files with 8 additions and 3 deletions

View File

@ -178,6 +178,7 @@ static void _tryLoadProvider(PCWSTR provider)
TRACE("loaded lib %p\n", hLib); TRACE("loaded lib %p\n", hLib);
if (getCaps) if (getCaps)
{ {
DWORD connectCap;
PWNetProvider provider = PWNetProvider provider =
&providerTable->table[providerTable->numProviders]; &providerTable->table[providerTable->numProviders];
@ -211,9 +212,13 @@ static void _tryLoadProvider(PCWSTR provider)
WARN("Couldn't load enumeration functions\n"); WARN("Couldn't load enumeration functions\n");
} }
} }
provider->addConnection = MPR_GETPROC(NPAddConnection); connectCap = getCaps(WNNC_CONNECTION);
provider->addConnection3 = MPR_GETPROC(NPAddConnection3); if (connectCap & WNNC_CON_ADDCONNECTION)
provider->cancelConnection = MPR_GETPROC(NPCancelConnection); provider->addConnection = MPR_GETPROC(NPAddConnection);
if (connectCap & WNNC_CON_ADDCONNECTION3)
provider->addConnection3 = MPR_GETPROC(NPAddConnection3);
if (connectCap & WNNC_CON_CANCELCONNECTION)
provider->cancelConnection = MPR_GETPROC(NPCancelConnection);
TRACE("NPAddConnection %p\n", provider->addConnection); TRACE("NPAddConnection %p\n", provider->addConnection);
TRACE("NPAddConnection3 %p\n", provider->addConnection3); TRACE("NPAddConnection3 %p\n", provider->addConnection3);
TRACE("NPCancelConnection %p\n", provider->cancelConnection); TRACE("NPCancelConnection %p\n", provider->cancelConnection);