Pierre Schweitzer : mpr: Implement WNetCancelConnection2W().
Alexandre Julliard
julliard at winehq.org
Fri Aug 12 10:00:59 CDT 2016
Module: wine
Branch: master
Commit: 0b34924bd8cb82ba2a96e7704c1c685a07c43e30
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0b34924bd8cb82ba2a96e7704c1c685a07c43e30
Author: Pierre Schweitzer <pierre at reactos.org>
Date: Tue Aug 2 13:21:22 2016 +0200
mpr: Implement WNetCancelConnection2W().
Signed-off-by: Pierre Schweitzer <pierre at reactos.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mpr/wnet.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c
index c44fec2..6e865f0 100644
--- a/dlls/mpr/wnet.c
+++ b/dlls/mpr/wnet.c
@@ -58,6 +58,7 @@ typedef struct _WNetProvider
PF_NPGetResourceInformation getResourceInformation;
PF_NPAddConnection addConnection;
PF_NPAddConnection3 addConnection3;
+ PF_NPCancelConnection cancelConnection;
} WNetProvider, *PWNetProvider;
typedef struct _WNetProviderTable
@@ -206,8 +207,10 @@ static void _tryLoadProvider(PCWSTR provider)
}
provider->addConnection = MPR_GETPROC(NPAddConnection);
provider->addConnection3 = MPR_GETPROC(NPAddConnection3);
+ provider->cancelConnection = MPR_GETPROC(NPCancelConnection);
TRACE("NPAddConnection %p\n", provider->addConnection);
TRACE("NPAddConnection3 %p\n", provider->addConnection3);
+ TRACE("NPCancelConnection %p\n", provider->cancelConnection);
providerTable->numProviders++;
}
else
@@ -1865,9 +1868,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_CANCELCONNECTION)
+ {
+ 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;
}
/*****************************************************************
More information about the wine-cvs
mailing list