网站首页  词典首页

请输入您要查询的函数:

 

术语 locallock
释义 LocalLock
语法:
C++
LPVOID WINAPI LocalLock(
__in HLOCAL hMem
);
LocalLock功能
锁定本地内存对象并返回一个指向对象的内存块的第一个字节。
注意当地的职能,并提供更大的开销比其他内存管理功能较少的功能。新的应用程序应该使用堆文档指出,除非当地的职能应常用的功能。有关更多信息,请参阅全局和局部的功能。
参数
hMem [in]
句柄到本地内存对象。这是处理不论是由LocalAlloc或LocalReAlloc函数返回。
返回值
如果函数成功,返回值是对内存块的第一个字节的指针。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
每个内存对象内部数据结构包括一个锁计数最初为零。可移动内存对象,LocalLock递增计数之一,LocalUnlock函数递减计数一。每一个成功的呼叫,一个过程使以LocalLock一个必须由相应的调用LocalUnlock匹配的对象。 Locked memory will not be moved or discarded unless the memory object is reallocated by using the LocalReAlloc function.在锁定内存对象的内存块保留在内存中锁定,直至其锁计数递减为零,到时可以移动或丢弃。
分配了内存中的对象LMEM_FIXED始终为零锁计数。对于这些对象时,返回指针值等于指定的句柄值。
如果指定的内存块已被取消或者如果内存块有一个零字节大小,这个函数返回NULL。
抛弃的物体始终为零锁计数。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
全局和局部功能
LocalAlloc
LocalFlags
LocalReAlloc
LocalUnlock
内存管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==LocalLock Function
Locks a local memory object and returns a pointer to the first byte of the object's memory block.
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++
LPVOID WINAPI LocalLock(
__in HLOCAL hMem
);
Parameters
hMem [in]
A handle to the local memory object. This handle is returned by either the LocalAlloc or LocalReAlloc function.
Return Value
If the function succeeds, the return value is a pointer to the first byte of the memory block.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
The internal data structures for each memory object include a lock count that is initially zero. For movable memory objects, LocalLock increments the count by one, and the LocalUnlock function decrements the count by one. Each successful call that a process makes to LocalLock for an object must be matched by a corresponding call to LocalUnlock. Locked memory will not be moved or discarded unless the memory object is reallocated by using the LocalReAlloc function. The memory block of a locked memory object remains locked in memory until its lock count is decremented to zero, at which time it can be moved or discarded.
Memory objects allocated with LMEM_FIXED always have a lock count of zero. For these objects, the value of the returned pointer is equal to the value of the specified handle.
If the specified memory block has been discarded or if the memory block has a zero-byte size, this function returns NULL.
Discarded objects always have a lock count of zero.
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
LocalAlloc
LocalFlags
LocalReAlloc
LocalUnlock
Memory Management Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366737(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:21:24