ReactOS  0.4.14-dev-317-g96040ec
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 2825 of file wnet.c.

2826 {
2827  HANDLE connected;
2828  PWSTR connection;
2829  DWORD ret, size, count;
2830  NETRESOURCEW * resources, * iter;
2831 
2833  if (ret != WN_SUCCESS)
2834  {
2835  if (ret != WN_NO_NETWORK)
2836  {
2837  return ret;
2838  }
2839 
2840  /* Means no provider, then, clearing is OK */
2841  return WN_SUCCESS;
2842  }
2843 
2844  size = 0x1000;
2846  if (!resources)
2847  {
2849  return WN_OUT_OF_MEMORY;
2850  }
2851 
2852  for (;;)
2853  {
2854  size = 0x1000;
2855  count = -1;
2856 
2857  memset(resources, 0, size);
2859  if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
2860  {
2861  for (iter = resources; count; count--, iter++)
2862  {
2863  if (iter->lpLocalName && iter->lpLocalName[0])
2864  connection = iter->lpLocalName;
2865  else
2866  connection = iter->lpRemoteName;
2867 
2868  WNetCancelConnection2W(connection, 0, TRUE);
2869  }
2870  }
2871  else
2872  break;
2873  }
2874 
2877 
2878  return ret;
2879 }
#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:1700
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD WINAPI WNetCloseEnum(HANDLE hEnum)
Definition: wnet.c:1760
LPWSTR lpRemoteName
Definition: winnetwk.h:182
DWORD WINAPI WNetCancelConnection2W(LPCWSTR lpName, DWORD dwFlags, BOOL fForce)
Definition: wnet.c:2418
int connected
Definition: main.c:61
DWORD WINAPI WNetOpenEnumW(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNet, LPHANDLE lphEnum)
Definition: wnet.c:920
#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().