网站首页  词典首页

请输入您要查询的函数:

 

术语 localrealloc
释义 LocalReAlloc
语法:
C++
HLOCAL WINAPI LocalReAlloc(
__in HLOCAL hMem,
__in SIZE_T uBytes,
__in UINT uFlags
);
LocalReAlloc功能
改变大小或指定的本地内存对象的属性。大小可以增加或减少。
注意当地的职能,并提供更大的开销比其他内存管理功能较少的功能。新的应用程序应该使用堆文档指出,除非当地的职能应常用的功能。有关更多信息,请参阅全局和局部的功能。
参数
hMem [in]
阿处理本地内存对象被重新分配。这是处理不论是由LocalAlloc或LocalReAlloc函数返回。
uBytes [in]
该内存块的新的大小,以字节为单位。如果uFlags指定LMEM_MODIFY,此参数被忽略。
uFlags [in]
重新分配方案。如果LMEM_MODIFY指定的函数修改内存的唯一对象的属性(即uBytes参数被忽略。)否则,函数重新分配的内存对象。
您可以选择结合起来,下面的值LMEM_MODIFY。
ValueMeaning
LMEM_MOVEABLE
0x0002Allocates固定或可移动的内存。
如果内存是一个锁定LMEM_MOVEABLE内存块或LMEM_FIXED内存块,这个标志是没有指定,内存只能在地方重新分配。
如果此参数不指定LMEM_MODIFY,您可以使用下面的值。
ValueMeaning
LMEM_ZEROINIT
0x0040Causes额外的内存内容的初始化为零,如果内存对象是越来越大。
返回值
如果函数成功,返回值是一个句柄分配内存对象。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
如果LocalReAlloc失败,原来的内存不释放,和原处理和指针仍然有效。
如果LocalReAlloc重新分配一个固定的对象,在处理返回的值是内存块的第一个字节的地址。要访问内存,这个过程可以简单地将返回值转换为一个指针。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
全局和局部功能
LocalAlloc
LocalFree
LocalLock
内存管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==LocalReAlloc Function
Changes the size or the attributes of a specified local memory object. The size can increase or decrease.
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 LocalReAlloc(
__in HLOCAL hMem,
__in SIZE_T uBytes,
__in UINT uFlags
);
Parameters
hMem [in]
A handle to the local memory object to be reallocated. This handle is returned by either the LocalAlloc or LocalReAlloc function.
uBytes [in]
The new size of the memory block, in bytes. If uFlags specifies LMEM_MODIFY, this parameter is ignored.
uFlags [in]
The reallocation options. If LMEM_MODIFY is specified, the function modifies the attributes of the memory object only (the uBytes parameter is ignored.) Otherwise, the function reallocates the memory object.
You can optionally combine LMEM_MODIFY with the following value.
ValueMeaning
LMEM_MOVEABLE
0x0002Allocates fixed or movable memory.
If the memory is a locked LMEM_MOVEABLE memory block or a LMEM_FIXED memory block and this flag is not specified, the memory can only be reallocated in place.

If this parameter does not specify LMEM_MODIFY, you can use the following value.
ValueMeaning
LMEM_ZEROINIT
0x0040Causes the additional memory contents to be initialized to zero if the memory object is growing in size.

Return Value
If the function succeeds, the return value is a handle to the reallocated memory object.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
If LocalReAlloc fails, the original memory is not freed, and the original handle and pointer are still valid.
If LocalReAlloc reallocates a fixed object, the value of the handle returned is the address of the first byte of the memory block. To access the memory, a process can simply cast the return value to a pointer.
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
LocalFree
LocalLock
Memory Management Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366742(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:47