Enumerate connections capability before looking for functions entry points.
This is a major fix, because it allows VBoxSF to work without a hack, and without necessarily make a connection from the NP to the VBoxSF driver.

Already sent upstream.

ROSAPPS-303
CORE-11757

svn path=/trunk/; revision=73489
This commit is contained in:
Pierre Schweitzer 2016-12-30 20:30:28 +00:00
parent 3fb8dc2d64
commit 68bcda65e2
2 changed files with 11 additions and 4 deletions

View file

@ -64,7 +64,8 @@ Index: wnet.c
provider->addConnection3 = MPR_GETPROC(NPAddConnection3);
provider->cancelConnection = MPR_GETPROC(NPCancelConnection);
+#ifdef __REACTOS__
+ provider->getConnection = MPR_GETPROC(NPGetConnection);
+ if (connectCap & WNNC_CON_GETCONNECTIONS)
+ provider->getConnection = MPR_GETPROC(NPGetConnection);
+#endif
TRACE("NPAddConnection %p\n", provider->addConnection);
TRACE("NPAddConnection3 %p\n", provider->addConnection3);

View file

@ -171,6 +171,7 @@ static void _tryLoadProvider(PCWSTR provider)
TRACE("loaded lib %p\n", hLib);
if (getCaps)
{
DWORD connectCap;
PWNetProvider provider =
&providerTable->table[providerTable->numProviders];
@ -204,11 +205,16 @@ static void _tryLoadProvider(PCWSTR provider)
WARN("Couldn't load enumeration functions\n");
}
}
provider->addConnection = MPR_GETPROC(NPAddConnection);
connectCap = getCaps(WNNC_CONNECTION);
if (connectCap & WNNC_CON_ADDCONNECTION)
provider->addConnection = MPR_GETPROC(NPAddConnection);
if (connectCap & WNNC_CON_ADDCONNECTION3)
provider->addConnection3 = MPR_GETPROC(NPAddConnection3);
provider->cancelConnection = MPR_GETPROC(NPCancelConnection);
if (connectCap & WNNC_CON_CANCELCONNECTION)
provider->cancelConnection = MPR_GETPROC(NPCancelConnection);
#ifdef __REACTOS__
provider->getConnection = MPR_GETPROC(NPGetConnection);
if (connectCap & WNNC_CON_GETCONNECTIONS)
provider->getConnection = MPR_GETPROC(NPGetConnection);
#endif
TRACE("NPAddConnection %p\n", provider->addConnection);
TRACE("NPAddConnection3 %p\n", provider->addConnection3);