WNetCloseEnum function

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

Syntax

DWORD WNetCloseEnum(
  HANDLE hEnum
);

Parameters

hEnum

Handle that identifies an enumeration instance. This handle must be returned by the WNetOpenEnum function.

Return Value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is a system error code, such as one of the following values.

Return code Description
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.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winnetwk.h
Library Mpr.lib
DLL Mpr.dll

See Also

WNetEnumResource

WNetOpenEnum

Windows Networking (WNet) Overview

Windows Networking Functions