网站首页  词典首页

请输入您要查询的函数:

 

术语 globalfree
释义 GlobalFree
语法:
C++
HGLOBAL WINAPI GlobalFree(
__in HGLOBAL hMem
);
GlobalFree函数
释放指定的全局内存对象和作废处理。
注意:全局函数有更大的开销,并提供比其它内存管理功能较少的功能。新的应用程序应该使用堆,除非文档指出全局函数应该使用功能。有关更多信息,请参阅全局和局部的功能。
参数
hMem [in]
句柄全球内存对象。这是处理无论是GlobalAlloc或GlobalReAlloc函数返回。这是不安全的自由与LocalAlloc分配的内存。
返回值
如果函数成功,返回值为NULL。
如果函数失败,返回值就相当于一个处理全球内存对象。为了获得更多错误信息,调用GetLastError。
备注
如果进程检查或修改后,已释放的内存,堆损坏可能会出现或访问冲突异常(EXCEPTION_ACCESS_VIOLATION)可能会生成。
该GlobalFree函数将释放锁定的内存对象。锁定的内存对象有大于零的锁计数。该GlobalLock函数锁定一个全局内存对象和增量锁计数。 GlobalUnlock函数的一个解锁,并递减的锁计数。要获得一个全局内存对象锁计数,使用GlobalFlags功能。
如果应用程序是根据系统的运行调试版本,GlobalFree将发出一个信息,告诉您一个锁定的对象是被释放。如果您是调试应用程序,GlobalFree将进入前释放锁定对象的断点。这使您可以验证预期的行为,然后继续执行。
实例
有关示例,请参见GlobalAlloc。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
全局和局部功能
GlobalAlloc
GlobalFlags
GlobalLock
GlobalReAlloc
GlobalUnlock
内存管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GlobalFree Function
Frees the specified global memory object and invalidates its handle.
Note The global 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 global function should be used. For more information, see Global and Local Functions .
Syntax
C++
HGLOBAL WINAPI GlobalFree(
__in HGLOBAL hMem
);
Parameters
hMem [in]
A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function. It is not safe to free memory allocated with LocalAlloc .
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 global memory object. To get extended error information, call GetLastError .
Remarks
If the process examines or modifies the memory after it has been freed, heap corruption may occur or an access violation exception (EXCEPTION_ACCESS_VIOLATION) may be generated.
The GlobalFree function will free a locked memory object. A locked memory object has a lock count greater than zero. The GlobalLock function locks a global memory object and increments the lock count by one. The GlobalUnlock function unlocks it and decrements the lock count by one. To get the lock count of a global memory object, use the GlobalFlags function.
If an application is running under a debug version of the system, GlobalFree will issue a message that tells you that a locked object is being freed. If you are debugging the application, GlobalFree 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 GlobalAlloc .
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
GlobalAlloc
GlobalFlags
GlobalLock
GlobalReAlloc
GlobalUnlock
Memory Management Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366579(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:23:21