网站首页  词典首页

请输入您要查询的函数:

 

术语 globalunlock
释义 GlobalUnlock
语法:
C++
BOOL WINAPI GlobalUnlock(
__in HGLOBAL hMem
);
GlobalUnlock函数
递减计数的锁的内存对象,与GMEM_MOVEABLE分配有关。这个函数没有与GMEM_FIXED分配的内存对象的影响。
注意:全局函数有更大的开销,并提供比其它内存管理功能较少的功能。新的应用程序应该使用堆,除非文档指出全局函数应该使用功能。有关更多信息,请参阅全局和局部的功能。
参数
hMem [in]
句柄全球内存对象。这是处理无论是GlobalAlloc或GlobalReAlloc函数返回。
返回值
如果内存对象仍然锁定后递减计数锁定,则返回值为非零值。如果内存对象锁定锁定后递减计数,该函数返回0,GetLastError返回NO_ERROR。
如果函数失败,返回值为零,GetLastError返回值比NO_ERROR等。
备注
每个内存对象内部数据结构包括一个锁计数最初为零。对于可移动内存对象,GlobalLock函数递增计数之一,GlobalUnlock递减计数一。 For each call that a process makes to GlobalLock for an object, it must eventually call GlobalUnlock.锁定的内存将无法移动或丢弃,除非内存对象是使用GlobalReAlloc职能重新分配。在锁定内存对象的内存块保持锁定状态,直到其锁计数递减为零,到时可以移动或丢弃。
分配了内存中的对象GMEM_FIXED始终为零锁计数。如果指定的内存块是固定的记忆,这个函数返回TRUE。
如果内存对象已经锁定,GlobalUnlock返回FALSE,而且GetLastError报告ERROR_NOT_LOCKED。
阿进程不应该依靠返回值来确定的次数必须随后呼吁内存对象GlobalUnlock。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
全局和局部功能
GlobalAlloc
GlobalLock
GlobalReAlloc
内存管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GlobalUnlock Function
Decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE. This function has no effect on memory objects allocated with GMEM_FIXED.
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++
BOOL WINAPI GlobalUnlock(
__in HGLOBAL hMem
);
Parameters
hMem [in]
A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.
Return Value
If the memory object is still locked after decrementing the lock count, the return value is a nonzero value. If the memory object is unlocked after decrementing the lock count, the function returns zero and GetLastError returns NO_ERROR.
If the function fails, the return value is zero and GetLastError returns a value other than NO_ERROR.
Remarks
The internal data structures for each memory object include a lock count that is initially zero. For movable memory objects, the GlobalLock function increments the count by one, and GlobalUnlock decrements the count by one. For each call that a process makes to GlobalLock for an object, it must eventually call GlobalUnlock. Locked memory will not be moved or discarded, unless the memory object is reallocated by using the GlobalReAlloc function. The memory block of a locked memory object remains locked until its lock count is decremented to zero, at which time it can be moved or discarded.
Memory objects allocated with GMEM_FIXED always have a lock count of zero. If the specified memory block is fixed memory, this function returns TRUE.
If the memory object is already unlocked, GlobalUnlock returns FALSE and GetLastError reports ERROR_NOT_LOCKED.
A process should not rely on the return value to determine the number of times it must subsequently call GlobalUnlock for a memory object.
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
GlobalLock
GlobalReAlloc
Memory Management Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366595(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:24:56