网站首页  词典首页

请输入您要查询的函数:

 

术语 netfileenum
释义 NetFileEnum
语法:
C++
NET_API_STATUS NetFileEnum(
__in LMSTR servername,
__in LMSTR basepath,
__in LMSTR username,
__in DWORD level,
__out LPBYTE *bufptr,
__in DWORD prefmaxlen,
__out LPDWORD entriesread,
__out LPDWORD totalentries,
__inout PDWORD_PTR resume_handle
);
NetFileEnum功能
返回有关部分或服务器上所有打开的文件,根据参数指定。
参数
服务器名 [in]
指针指向一个字符串,它指定的DNS或NetBIOS的远程服务器上的功能是执行的名称。如果该参数为NULL,则使用本地计算机。
这个字符串是Unicode或FORCE_UNICODE如果_WIN32_WINNT定义。
basepath [in]
指针指向一个字符串,它指定一个返回的信息预选赛。如果该参数为NULL,所有打开的资源列举。如果此参数不是NULL,函数枚举已作为前缀basepath参数值的资源。 (前缀是路径组件来一个反斜杠。)
这个字符串是Unicode或FORCE_UNICODE如果_WIN32_WINNT定义。
用户名 [in]
一个字符串指针,指定用户的名称。如果此参数指定的值作为一个枚举预选赛。返回的文件仅限于那些用户名匹配的预选赛。如果该参数为NULL,没有用户名称限定符使用。
这个字符串是Unicode或FORCE_UNICODE如果_WIN32_WINNT定义。
Level [in]
指定的数据信息的Level。此参数可以是下列值之一。
ValueMeaning
2Return文件标识号。在bufptr参数指向一个FILE_INFO_2结构的数组。
3Return有关文件。在bufptr参数指向一个FILE_INFO_3结构的数组。
bufptr [out]
指向的缓冲区,接收信息的地址。这一数据格式取决于Level的参数值。
此缓冲区分配制度,必须使用NetApiBufferFree释放功能。请注意,您必须释放缓冲区,即使函数ERROR_MORE_DATA失败。
prefmaxlen [in]
指定返回数据的首选的最大字节长度。如果您指定MAX_PREFERRED_LENGTH,功能分配用于数据所需的内存量。如果指定这个参数在另一个值,它可以限制的字节数函数返回。如果缓冲区大小不足以容纳所有作品,该函数返回ERROR_MORE_DATA。有关更多信息,请参阅网络管理功能,缓冲器和网络管理功能缓冲区长度。
entriesread [out]
指针的值,它接收元素计数实际列举。
totalentries [out]
指针的值,它接收了本来可以列举参赛总人数从目前的恢复情况。请注意,应用程序应考虑仅作为提示此值。
resume_handle [ in , out ]
指针的值,它包含简历处理,用于继续现有的文件搜索。手柄应在第一次调用零,离开后续调用不变。如果该参数是NULL,没有恢复处理存储。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值可以是下面的错误代码之一。
返回codeDescription
ERROR_ACCESS_DENIEDThe用户没有获得所需的信息。
ERROR_INVALID_LEVELThe价值Level参数指定无效。
ERROR_MORE_DATAMore项可用。指定一个足够大的缓冲区接收的所有条目。
ERROR_NOT_ENOUGH_MEMORYInsufficient内存可用。
NERR_BufTooSmallThe提供的缓冲区太小。
备注
管理员或服务器操作员本地组的成员才可以成功地执行NetFileEnum功能。
您可以调用NetFileGetInfo函数检索有关的一个服务器资源,特别是开放的信息。
如果您是Active Directory的程序,您可以调用某些Active Directory服务接口(ADSI)的方法来达到同样的功能,您可以通过调用NetFileEnum。有关更多信息,请参阅IADsResource和IADsFileServiceOperations。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmshare.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
NetFile功能
FILE_INFO_2
FILE_INFO_3
NetFileGetInfo
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==NetFileEnum Function
Returns information about some or all open files on a server, depending on the parameters specified.
Syntax
C++
NET_API_STATUS NetFileEnum(
__in LMSTR servername,
__in LMSTR basepath,
__in LMSTR username,
__in DWORD level,
__out LPBYTE *bufptr,
__in DWORD prefmaxlen,
__out LPDWORD entriesread,
__out LPDWORD totalentries,
__inout PDWORD_PTR resume_handle
);
Parameters
servername [in]
Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE is defined.
basepath [in]
Pointer to a string that specifies a qualifier for the returned information. If this parameter is NULL, all open resources are enumerated. If this parameter is not NULL, the function enumerates only resources that have the value of the basepath parameter as a prefix. (A prefix is the path component up to a backslash.)
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE is defined.
username [in]
Pointer to a string that specifies the name of the user. If this parameter is specified, its value serves as a qualifier for the enumeration. The files returned are limited to those that have user names matching the qualifier. If this parameter is NULL, no user-name qualifier is used.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE is defined.
level [in]
Specifies the information level of the data. This parameter can be one of the following values.
ValueMeaning
2Return the file identification number. The bufptr parameter points to an array of FILE_INFO_2 structures.
3Return information about the file. The bufptr parameter points to an array of FILE_INFO_3 structures.

bufptr [out]
Pointer to the address of the buffer that receives the information. The format of this data depends on the value of the level parameter.
This buffer is allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer even if the function fails with ERROR_MORE_DATA.
prefmaxlen [in]
Specifies the preferred maximum length of returned data, in bytes. If you specify MAX_PREFERRED_LENGTH, the function allocates the amount of memory required for the data. If you specify another value in this parameter, it can restrict the number of bytes that the function returns. If the buffer size is insufficient to hold all entries, the function returns ERROR_MORE_DATA. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths .
entriesread [out]
Pointer to a value that receives the count of elements actually enumerated.
totalentries [out]
Pointer to a value that receives the total number of entries that could have been enumerated from the current resume position. Note that applications should consider this value only as a hint.
resume_handle [in, out]
Pointer to a value that contains a resume handle which is used to continue an existing file search. The handle should be zero on the first call and left unchanged for subsequent calls. If this parameter is NULL, no resume handle is stored.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value can be one of the following error codes.
Return codeDescription
ERROR_ACCESS_DENIEDThe user does not have access to the requested information.
ERROR_INVALID_LEVELThe value specified for the level parameter is not valid.
ERROR_MORE_DATAMore entries are available. Specify a large enough buffer to receive all entries.
ERROR_NOT_ENOUGH_MEMORYInsufficient memory is available.
NERR_BufTooSmallThe supplied buffer is too small.

Remarks
Only members of the Administrators or Server Operators local group can successfully execute the NetFileEnum function.
You can call the NetFileGetInfo function to retrieve information about a particular opening of a server resource.
If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling NetFileEnum. For more information, see IADsResource and IADsFileServiceOperations .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmshare.h (include Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
Network Management Overview
Network Management Functions
NetFile Functions
FILE_INFO_2
FILE_INFO_3
NetFileGetInfo
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/bb525378(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:23:22