Platform SDK: Windows Networking

WNetCloseEnum

The WNetCloseEnum function ends a network resource enumeration started by a call to the WNetOpenEnum function.

DWORD WNetCloseEnum(
  HANDLE hEnum   // handle to enumeration
);

Parameters

hEnum
[in] Specifies a handle that identifies an enumeration instance. This handle must be returned by the WNetOpenEnum function.

Return Values

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value can be one of the following error codes.

Value Meaning
ERROR_NO_NETWORK The network is unavailable. (This condition is tested before the handle specified in the hEnum parameter is tested for validity.)
ERROR_INVALID_HANDLE The hEnum parameter does not specifiy a valid handle.
ERROR_EXTENDED_ERROR A network-specific error occurred. To obtain a description of the error, call the WNetGetLastError function.

Remarks

For a code sample that illustrates an application-defined function that enumerates all the resources on a network, see Enumerating Network Resources.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winnetwk.h.
  Library: Use Mpr.lib.

See Also

Windows Networking (WNet) Overview, Windows Networking Functions, WNetEnumResource, WNetOpenEnum