网站首页  词典首页

请输入您要查询的函数:

 

术语 netapibufferfree
释义 NetApiBufferFree
语法:
C++
NET_API_STATUS NetApiBufferFree(
__in LPVOID Buffer
);
NetApiBufferFree功能
该NetApiBufferFree函数释放内存的NetApiBufferAllocate函数分配。应用还应呼吁NetApiBufferFree释放内存,其他的网络管理功能内部使用的返回信息。
参数
缓冲区 [in]
一个缓冲区指针返回以前由其他网络管理功能,或调用NetApiBufferAllocate函数分配的内存。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值是一个系统错误代码。对于一个错误代码的列表,请参见系统错误代码。
备注
该NetApiBufferFree函数是用来释放内存使用的网络管理功能。这个函数是用来在两种情况下:
要释放的内存分配一个明确的NetApiBufferAllocate函数调用申请内存时不再需要。
要释放的内存分配调用内部在对远程的网络管理功能的应用程序,信息返回给调用者。 RPC运行时库内部分配的缓冲区包含返回信息。
许多网络管理功能检索信息并返回一个缓冲区,其中可能包含一个复杂的结构,一个结构的数组,或者嵌套结构的数组信息。这些函数使用RPC运行时库的内部分配缓冲区包含返回的信息,是否调用的是本地计算机或远程服务器。例如,检索功能的NetServerEnum作为结构的数组的服务器列表,并返回此信息指出的bufptr参数。当函数成功,内存分配函数的的NetServerEnum内部存储在bufptr参数结构的应用程序返回的数组。当这种结构的数组不再需要时,应NetApiBufferFree功能所要求的设置参数通过的NetServerEnum bufptr返回自由这一内部使用的内存缓冲区参数应用。在这种情况下,NetApiBufferFree函数释放为包括嵌套结构的内存缓冲区分配内存的,为字符串指针,和其他数据。
没有特殊组成员必须成功地执行NetApiBufferFree职能或其他ApiBuffer任何职能。
有关代码示例,演示如何使用NetApiBufferFree函数来释放内存明确由一个应用程序分配,见NetApiBufferAllocate功能。
有关代码示例,演示如何使用NetApiBufferFree函数来释放记忆体内部通过网络管理功能分配给返回的信息,请参阅的NetServerEnum功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmapibuf.h(包括Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理功能,缓冲器
网络管理功能缓冲区长度
网络管理概述
网络管理功能
阿比缓冲功能
NetApiBufferAllocate
NetApiBufferReallocate
NetApiBufferSize
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月13日
==英文原文==NetApiBufferFree Function
The NetApiBufferFree function frees the memory that the NetApiBufferAllocate function allocates. Applications should also call NetApiBufferFree to free the memory that other network management functions use internally to return information.
Syntax
C++
NET_API_STATUS NetApiBufferFree(
__in LPVOID Buffer
);
Parameters
Buffer [in]
A pointer to a buffer returned previously by another network management function or memory allocated by calling the NetApiBufferAllocate function.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes .
Remarks
The NetApiBufferFree function is used to free memory used by network management functions. This function is used in two cases:
To free memory explicitly allocated by calls in an application to the NetApiBufferAllocate function when the memory is no longer needed.
To free memory allocated internally by calls in an application to remotable network management functions that return information to the caller. The RPC run-time library internally allocates the buffer containing the return information.
Many network management functions retrieve information and return this information as a buffer that may contain a complex structure, an array of structures, or an array of nested structures. These functions use the RPC run-time library to internally allocate the buffer containing the return information, whether the call is to a local computer or a remote server. For example, the NetServerEnum function retrieves a lists of servers and returns this information as an array of structures pointed to by the bufptr parameter. When the function is successful, memory is allocated internally by the NetServerEnum function to store the array of structures returned in the bufptr parameter to the application. When this array of structures is no longer needed, the NetApiBufferFree function should be called by the application with the Buffer parameter set to the bufptr parameter returned by NetServerEnum to free this internal memory used. In these cases, the NetApiBufferFree function frees all of the internal memory allocated for the buffer including memory for nested structures, pointers to strings, and other data.
No special group membership is required to successfully execute the NetApiBufferFree function or any of the other ApiBuffer functions .
For a code sample that demonstrates how to use of the NetApiBufferFree function to free memory explicitly allocated by an application, see the NetApiBufferAllocate function.
For a code sample that demonstrates how to use of the NetApiBufferFree function to free memory internally allocated by a network management function to return information, see the NetServerEnum function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmapibuf.h (include Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
Network Management Function Buffers
Network Management Function Buffer Lengths
Network Management Overview
Network Management Functions
Api Buffer Functions
NetApiBufferAllocate
NetApiBufferReallocate
NetApiBufferSize
Send comments about this topic to Microsoft
Build date: 8/13/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa370304(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:32:32