* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "precomp.h"
-
-#include <winioctl.h>
-#include <npapi.h>
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "winioctl.h"
+#include "winnetwk.h"
+#include "npapi.h"
+#include "winreg.h"
+#include "winuser.h"
#define WINE_MOUNTMGR_EXTENSIONS
-#include <ddk/mountmgr.h>
-#include <wine/unicode.h>
+#include "ddk/mountmgr.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "mprres.h"
+#include "wnetpriv.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mpr);
/* Data structures representing network service providers. Assumes only one
* thread creates them, and that they are constant for the life of the process
return err;
}
+#ifdef __REACTOS__
+/*****************************************************************
+ * WNetClearConnections [MPR.@]
+ */
+DWORD WINAPI WNetClearConnections ( DWORD unknown )
+{
+ HANDLE connected;
+ DWORD ret, size, count;
+ NETRESOURCEW * resources, * iter;
+
+ ret = WNetOpenEnumW(RESOURCE_CONNECTED, RESOURCETYPE_ANY, 0, NULL, &connected);
+ if (ret != WN_SUCCESS)
+ {
+ if (ret != WN_NO_NETWORK)
+ {
+ return ret;
+ }
+
+ /* Means no provider, then, clearing is OK */
+ return WN_SUCCESS;
+ }
+
+ size = 0x1000;
+ resources = HeapAlloc(GetProcessHeap(), 0, size);
+ if (!resources)
+ {
+ WNetCloseEnum(connected);
+ return WN_OUT_OF_MEMORY;
+ }
+
+ do
+ {
+ size = 0x1000;
+ count = -1;
+
+ memset(resources, 0, size);
+ ret = WNetEnumResourceW(connected, &count, resources, &size);
+ if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
+ {
+ iter = resources;
+ for (; count; count--)
+ {
+ WNetCancelConnection2W(iter->lpLocalName, 0, TRUE);
+
+ iter++;
+ }
+ }
+ else
+ break;
+ } while (ret != WN_NO_MORE_ENTRIES);
+
+ HeapFree(GetProcessHeap(), 0, resources);
+ WNetCloseEnum(connected);
+
+ return ret;
+}
+#endif
+
/*