ReactOS  0.4.13-dev-961-g238ea69
undocmpr.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

DWORD WINAPI WNetClearConnections (HANDLE owner)
 

Function Documentation

◆ WNetClearConnections()

DWORD WINAPI WNetClearConnections ( HANDLE  owner)

Definition at line 2686 of file wnet.c.

2687 {
2688  HANDLE connected;
2689  PWSTR connection;
2690  DWORD ret, size, count;
2691  NETRESOURCEW * resources, * iter;
2692 
2694  if (ret != WN_SUCCESS)
2695  {
2696  if (ret != WN_NO_NETWORK)
2697  {
2698  return ret;
2699  }
2700 
2701  /* Means no provider, then, clearing is OK */
2702  return WN_SUCCESS;
2703  }
2704 
2705  size = 0x1000;
2707  if (!resources)
2708  {
2710  return WN_OUT_OF_MEMORY;
2711  }
2712 
2713  for (;;)
2714  {
2715  size = 0x1000;
2716  count = -1;
2717 
2718  memset(resources, 0, size);
2720  if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
2721  {
2722  for (iter = resources; count; count--, iter++)
2723  {
2724  if (iter->lpLocalName && iter->lpLocalName[0])
2725  connection = iter->lpLocalName;
2726  else
2727  connection = iter->lpRemoteName;
2728 
2729  WNetCancelConnection2W(connection, 0, TRUE);
2730  }
2731  }
2732  else
2733  break;
2734  }
2735 
2738 
2739  return ret;
2740 }
#define TRUE
Definition: types.h:120
#define WN_SUCCESS
Definition: winnetwk.h:111
uint16_t * PWSTR
Definition: typedefs.h:54
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define RESOURCE_CONNECTED
Definition: winnetwk.h:58
static struct resource resources[16]
smooth NULL
Definition: ftsmooth.c:416
LPWSTR lpLocalName
Definition: winnetwk.h:181
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WN_NO_NETWORK
Definition: winnetwk.h:126
DWORD WINAPI WNetEnumResourceW(HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
Definition: wnet.c:1561
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD WINAPI WNetCloseEnum(HANDLE hEnum)
Definition: wnet.c:1621
LPWSTR lpRemoteName
Definition: winnetwk.h:182
DWORD WINAPI WNetCancelConnection2W(LPCWSTR lpName, DWORD dwFlags, BOOL fForce)
Definition: wnet.c:2279
int connected
Definition: main.c:61
DWORD WINAPI WNetOpenEnumW(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNet, LPHANDLE lphEnum)
Definition: wnet.c:781
#define WN_OUT_OF_MEMORY
Definition: winnetwk.h:125
#define WN_MORE_DATA
Definition: winnetwk.h:117
#define RESOURCETYPE_ANY
Definition: winnetwk.h:63
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by LogoffShutdownThread().