网站首页  词典首页

请输入您要查询的函数:

 

术语 localfree
释义 LocalFree
语法:
C++
HLOCAL WINAPI LocalFree(
__in HLOCAL hMem
);
LocalFree函数
释放指定的本地内存对象和作废处理。
注意当地的职能,并提供更大的开销比其他内存管理功能较少的功能。新的应用程序应该使用堆文档指出,除非当地的职能应常用的功能。有关更多信息,请参阅全局和局部的功能。
参数
hMem [in]
句柄到本地内存对象。这是处理不论是由LocalAlloc或LocalReAlloc函数返回。这是不安全的自由与GlobalAlloc分配的内存。
返回值
如果函数成功,返回值为NULL。
如果函数失败,返回值等于1处理本地内存对象。为了获得更多错误信息,调用GetLastError。
备注
如果进程试图检查或修改后的内存已经被释放堆损坏可能会出现或访问冲突异常(EXCEPTION_ACCESS_VIOLATION)可能会生成。
如果hMem参数为NULL,LocalFree忽略的参数和返回NULL。
该LocalFree函数将免费锁定内存对象。锁定的内存对象有大于零的锁计数。该LocalLock函数锁定一个本地内存对象和增量锁计数。该LocalUnlock一个解锁功能,并递减的锁计数。要获得一个本地内存对象锁计数,使用LocalFlags功能。
如果应用程序是根据系统的运行调试版本,LocalFree将发出一个信息,告诉您一个锁定的对象是被释放。如果您是调试应用程序,LocalFree将进入前释放锁定对象的断点。这使您可以验证预期的行为,然后继续执行。
实例
有关示例,请参见LocalAlloc。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
全局和局部功能
GlobalFree
LocalAlloc
LocalFlags
LocalLock
LocalReAlloc
LocalUnlock
内存管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==LocalFree Function
Frees the specified local memory object and invalidates its handle.
Note The local functions have greater overhead and provide fewer features than other memory management functions. New applications should use the heap functions unless documentation states that a local function should be used. For more information, see Global and Local Functions .
Syntax
C++
HLOCAL WINAPI LocalFree(
__in HLOCAL hMem
);
Parameters
hMem [in]
A handle to the local memory object. This handle is returned by either the LocalAlloc or LocalReAlloc function. It is not safe to free memory allocated with GlobalAlloc .
Return Value
If the function succeeds, the return value is NULL.
If the function fails, the return value is equal to a handle to the local memory object. To get extended error information, call GetLastError .
Remarks
If the process tries to examine or modify the memory after it has been freed, heap corruption may occur or an access violation exception (EXCEPTION_ACCESS_VIOLATION) may be generated.
If the hMem parameter is NULL, LocalFree ignores the parameter and returns NULL.
The LocalFree function will free a locked memory object. A locked memory object has a lock count greater than zero. The LocalLock function locks a local memory object and increments the lock count by one. The LocalUnlock function unlocks it and decrements the lock count by one. To get the lock count of a local memory object, use the LocalFlags function.
If an application is running under a debug version of the system, LocalFree will issue a message that tells you that a locked object is being freed. If you are debugging the application, LocalFree will enter a breakpoint just before freeing a locked object. This allows you to verify the intended behavior, then continue execution.
Examples
For an example, see LocalAlloc .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Global and Local Functions
GlobalFree
LocalAlloc
LocalFlags
LocalLock
LocalReAlloc
LocalUnlock
Memory Management Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366730(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 13:20:12