0 out of 1 rated this helpful - Rate this topic

WNetCloseEnum function

Applies to: desktop apps only

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

Minimum supported server

Windows 2000 Server

Header

Winnetwk.h

Library

Mpr.lib

DLL

Mpr.dll

See also

Windows Networking (WNet) Overview
Windows Networking Functions
WNetEnumResource
WNetOpenEnum

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ