Export (0) Print
Expand All

WNetCloseEnum function

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

Syntax


DWORD WNetCloseEnum(
  _In_  HANDLE hEnum
);

Parameters

hEnum [in]

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 codeDescription
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.

 

Examples

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

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winnetwk.h

Library

Mpr.lib

DLL

Mpr.dll

See also

Windows Networking (WNet) Overview
Windows Networking Functions
WNetEnumResource
WNetOpenEnum

 

 

Community Additions

ADD
Show:
© 2014 Microsoft