From: Pierre Schweitzer Date: Tue, 2 Aug 2016 09:53:54 +0000 (+0000) Subject: [MPR] X-Git-Tag: backups/sndblst@72664~519 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=e0484e917c456ae6c6aed73baaa087d6ac1b56a7;ds=sidebyside [MPR] Implement WNetCancelConnection2W() Already sent upstream. Patch 3/6 CORE-11757 ROSAPPS-303 svn path=/trunk/; revision=72084 --- diff --git a/reactos/dll/win32/mpr/wnet.c b/reactos/dll/win32/mpr/wnet.c index 64468624a05..3e117e6f0c7 100644 --- a/reactos/dll/win32/mpr/wnet.c +++ b/reactos/dll/win32/mpr/wnet.c @@ -48,6 +48,7 @@ typedef struct _WNetProvider PF_NPGetResourceInformation getResourceInformation; PF_NPAddConnection addConnection; PF_NPAddConnection3 addConnection3; + PF_NPCancelConnection cancelConnection; #ifdef __REACTOS__ PF_NPGetConnection getConnection; #endif @@ -199,11 +200,13 @@ static void _tryLoadProvider(PCWSTR provider) } provider->addConnection = MPR_GETPROC(NPAddConnection); provider->addConnection3 = MPR_GETPROC(NPAddConnection3); + provider->cancelConnection = MPR_GETPROC(NPCancelConnection); #ifdef __REACTOS__ provider->getConnection = MPR_GETPROC(NPGetConnection); #endif TRACE("NPAddConnection %p\n", provider->addConnection); TRACE("NPAddConnection3 %p\n", provider->addConnection3); + TRACE("NPCancelConnection %p\n", provider->cancelConnection); providerTable->numProviders++; } else @@ -1913,9 +1916,26 @@ DWORD WINAPI WNetCancelConnection2A( LPCSTR lpName, DWORD dwFlags, BOOL fForce ) */ DWORD WINAPI WNetCancelConnection2W( LPCWSTR lpName, DWORD dwFlags, BOOL fForce ) { - FIXME( "(%s, %08X, %d), stub\n", debugstr_w(lpName), dwFlags, fForce ); + DWORD ret = WN_NO_NETWORK; + DWORD index; - return WN_SUCCESS; + if (providerTable != NULL) + { + for (index = 0; index < providerTable->numProviders; index++) + { + if(providerTable->table[index].getCaps(WNNC_CONNECTION) & + WNNC_CON_GETCONNECTIONS) + { + if (providerTable->table[index].cancelConnection) + ret = providerTable->table[index].cancelConnection((LPWSTR)lpName, fForce); + else + ret = WN_NO_NETWORK; + if (ret == WN_SUCCESS || ret == WN_OPEN_FILES) + break; + } + } + } + return ret; } /*****************************************************************