网站首页  词典首页

请输入您要查询的函数:

 

术语 wnetenumresource
释义 WNetEnumResource
语法:
C++
DWORD WNetEnumResource(
__in HANDLE hEnum,
__inout LPDWORD lpcCount,
__out LPVOID lpBuffer,
__inout LPDWORD lpBufferSize
);
WNetEnumResource函数
在WNetEnumResource函数继续对网络资源的枚举是向WNetOpenEnum函数调用开始。
参数
hEnum [in]
处理标识枚举实例。这种处理必须由WNetOpenEnum函数返回。
lpcCount [ in , out ]
指针变量指定的条目数的要求。如果请求的数量为-1,尽可能多的参赛作品中函数返回。
如果函数成功,在返回的变量指向该参数包含的条目数实际读取。
lpBuffer [out]
缓冲区指针接收枚举结果。返回的结果将作为NETRESOURCE结构的数组。请注意,您分配的缓冲区必须足够大举行的结构,加上字符串是其成员点。有关详细信息,请参阅下面的备注部分。
缓冲区有效期至下一次调用使用的处理由hEnum参数指定。在NETRESOURCE结构数组顺序是无法预测。
lpBufferSize [ in , out ]
指针变量指定lpBuffer参数大小,以字节。如果缓冲区太小,也能得到一个条目,这个参数接收缓冲区的所需大小。
返回值
如果函数成功,返回值是下列值之一。
返回codeDescription
NO_ERRORThe枚举成功,缓冲区包含请求的数据。调用应用程序可以继续呼吁WNetEnumResource完成枚举。
ERROR_NO_MORE_ITEMSThere are no more entries.缓冲区的内容是不确定的。
如果函数失败,返回值是一个系统错误代码,如下列值之一。
返回codeDescription
ERROR_MORE_DATAMore项可提供后续调用。有关详细信息,请参阅下面的备注部分。
ERROR_INVALID_HANDLEThe处理由hEnum参数指定无效。
ERROR_NO_NETWORKThe网络不可用。 (这种情况是测试,然后hEnum是测试的有效性。)
ERROR_EXTENDED_ERRORA网络特定的错误。要获取该错误的描述,调用WNetGetLastError功能。
备注
该WNetEnumResource函数不枚举连接到一个共享的用户,您可以调用NetConnectionEnum函数来完成这项任务。枚举隐藏共享,调用NetShareEnum功能。
应用程序不能lpBuffer参数设置为NULL和检索lpBufferSize参数所需的缓冲区大小。相反,应用程序应分配的合理大小的缓冲区,是典型的16千字节和用于错误检测过程中lpBufferSize价值。
实例
有关代码示例,演示应用程序定义的函数枚举所有网络上的资源,请列举网络资源。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnetwk.h
LibraryMpr.lib
DLLMpr.dll
Unicode和ANSI namesWNetEnumResourceW(Unicode)和WNetEnumResourceA(ANSI)的
参见
Windows网络(WNet)概述
Windows网络函数
NETRESOURCE
WNetCloseEnum
WNetOpenEnum
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月6日
==英文原文==WNetEnumResource Function
The WNetEnumResource function continues an enumeration of network resources that was started by a call to the WNetOpenEnum function.
Syntax
C++
DWORD WNetEnumResource(
__in HANDLE hEnum,
__inout LPDWORD lpcCount,
__out LPVOID lpBuffer,
__inout LPDWORD lpBufferSize
);
Parameters
hEnum [in]
Handle that identifies an enumeration instance. This handle must be returned by the WNetOpenEnum function.
lpcCount [in, out]
Pointer to a variable specifying the number of entries requested. If the number requested is –1, the function returns as many entries as possible.
If the function succeeds, on return the variable pointed to by this parameter contains the number of entries actually read.
lpBuffer [out]
Pointer to the buffer that receives the enumeration results. The results are returned as an array of NETRESOURCE structures. Note that the buffer you allocate must be large enough to hold the structures, plus the strings to which their members point. For more information, see the following Remarks section.
The buffer is valid until the next call using the handle specified by the hEnum parameter. The order of NETRESOURCE structures in the array is not predictable.
lpBufferSize [in, out]
Pointer to a variable that specifies the size of the lpBuffer parameter, in bytes. If the buffer is too small to receive even one entry, this parameter receives the required size of the buffer.
Return Value
If the function succeeds, the return value is one of the following values.
Return codeDescription
NO_ERRORThe enumeration succeeded, and the buffer contains the requested data. The calling application can continue to call WNetEnumResource to complete the enumeration.
ERROR_NO_MORE_ITEMSThere are no more entries. The buffer contents are undefined.

If the function fails, the return value is a system error code , such as one of the following values.
Return codeDescription
ERROR_MORE_DATAMore entries are available with subsequent calls. For more information, see the following Remarks section.
ERROR_INVALID_HANDLEThe handle specified by the hEnum parameter is not valid.
ERROR_NO_NETWORKThe network is unavailable. (This condition is tested before hEnum is tested for validity.)
ERROR_EXTENDED_ERRORA network-specific error occurred. To obtain a description of the error, call the WNetGetLastError function.

Remarks
The WNetEnumResource function does not enumerate users connected to a share; you can call the NetConnectionEnum function to accomplish this task. To enumerate hidden shares, call the NetShareEnum function.
An application cannot set the lpBuffer parameter to NULL and retrieve the required buffer size from the lpBufferSize parameter. Instead, the application should allocate a buffer of a reasonable size—16 kilobytes is typical—and use the value of lpBufferSize for error detection.
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 clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnetwk.h
LibraryMpr.lib
DLLMpr.dll
Unicode and ANSI namesWNetEnumResourceW (Unicode) and WNetEnumResourceA (ANSI)
See Also
Windows Networking (WNet) Overview
Windows Networking Functions
NETRESOURCE
WNetCloseEnum
WNetOpenEnum
Send comments about this topic to Microsoft
Build date: 8/6/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa385449(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:31:10