网站首页  词典首页

请输入您要查询的函数:

 

术语 movememory
释义 MoveMemory
语法:
C++
void MoveMemory(
__in PVOID Destination,
__in const VOID *Source,
__in SIZE_T Length
);
MoveMemory功能
Moves a block of memory from one location to another.
参数
Destination [in]
是对移动目标的起始地址的指针。
来源 [in]
是对的内存块的起始地址指针移动。
Length [in]
该内存块大小的移动,以字节为单位。
返回值
这个函数没有返回值。
备注
这个函数被定义为RtlMoveMemory函数。在实施过程中提供的内联。有关更多信息,请参阅Winbase.h和WINNT.H中。
源和目标块可能会重叠。
安全备注
第一个参数,目标,必须大到足以容纳源长度字节,否则,可能会出现缓冲区溢出。这可能导致对服务的应用程序如果发生访问冲突或攻击予以否认,但最坏的情况下,允许攻击者注入到可执行代码的过程。尤其如此,如果目的地是一个基于堆栈的缓冲区。请注意,最后一个参数,长度,是字节数复制到目的地,而不是大小的目标。
实例
下面的代码示例显示了一个更安全的方式使用MoveMemory。或者,您可以使用memmove_s或wmemmove_s功能。
无效MyMoveMemory(字符*缓冲带,烧焦* pbData,无符号整型cbData)
(
MoveMemory(缓冲带,pbData,__min(cbData,strlen(缓冲带)));
)
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
参见
CopyMemory
FillMemory
内存管理功能
SecureZeroMemory
ZeroMemory
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==MoveMemory Function
Moves a block of memory from one location to another.
Syntax
C++
void MoveMemory(
__in PVOID Destination,
__in const VOID *Source,
__in SIZE_T Length
);
Parameters
Destination [in]
A pointer to the starting address of the move destination.
Source [in]
A pointer to the starting address of the block of memory to be moved.
Length [in]
The size of the block of memory to move, in bytes.
Return Value
This function has no return value.
Remarks
This function is defined as the RtlMoveMemory function. Its implementation is provided inline. For more information, see Winbase.h and Winnt.h.
The source and destination blocks may overlap.
Security Remarks
The first parameter, Destination, must be large enough to hold Length bytes of Source; otherwise, a buffer overrun may occur. This may lead to a denial of service attack against the application if an access violation occurs or, in the worst case, allow an attacker to inject executable code into your process. This is especially true if Destination is a stack-based buffer. Be aware that the last parameter, Length, is the number of bytes to copy into Destination, not the size of the Destination.
Examples
The following code example shows a safer way to use MoveMemory. Alternatively, you could use the memmove_s or wmemmove_s function.

void MyMoveMemory(char *buf, char *pbData, unsigned int cbData)
{
MoveMemory(buf, pbData, __min(cbData,strlen(buf)));
}
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
See Also
CopyMemory
FillMemory
Memory Management Functions
SecureZeroMemory
ZeroMemory
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366788(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 9:21:36