网站首页  词典首页

请输入您要查询的函数:

 

术语 securezeromemory
释义 SecureZeroMemory
语法:
C++
PVOID SecureZeroMemory(
__in PVOID ptr,
__in SIZE_T cnt
);
SecureZeroMemory功能
填充用零一个内存块。它被设计成一个ZeroMemory更安全的版本。
参数
指针 [in]
是对的内存块的起始地址指针,以填补零。
碳纳米管 [in]
该内存块的大小,以填补零,以字节为单位。
返回值
这个函数返回一个指针指向的内存块。
备注
这个函数被定义为RtlSecureZeroMemory函数(见Winbase.h)。执行的RtlSecureZeroMemory提供内联,可以在任何版本的Windows使用(见WINNT.H中。)
使用此函数,而不是ZeroMemory当您想确保您的数据将被覆盖,及时为一些C + +编译器可以优化删除它完全调用ZeroMemory。
许多编程语言,包括复杂的变量初始化为零语法。可以有与这些行动的结果和SecureZeroMemory功能的差异。使用SecureZeroMemory清除任何编程语言的内存块。
下面的代码片段显示了一个实例,其中有好使用SecureZeroMemory的ZeroMemory代替。
WCHAR szPassword[MAX_PATH];
// Retrieve the password
if (GetPasswordFromUser(szPassword, MAX_PATH))
UsePassword(szPassword);
// Clear the password from memory
SecureZeroMemory(szPassword, sizeof(szPassword));

如果在这件ZeroMemory而不是SecureZeroMemory例如调用时,编译器可以优化调用,因为szPassword缓冲区之前不是超出范围阅读。该密码将保留在应用程序栈它可以将捕获的崩溃转储或由恶意程序进行了探讨。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
参见
CopyMemory
FillMemory
MoveMemory
ZeroMemory
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SecureZeroMemory Function
Fills a block of memory with zeros. It is designed to be a more secure version of ZeroMemory .
Syntax
C++
PVOID SecureZeroMemory(
__in PVOID ptr,
__in SIZE_T cnt
);
Parameters
ptr [in]
A pointer to the starting address of the block of memory to fill with zeros.
cnt [in]
The size of the block of memory to fill with zeros, in bytes.
Return Value
This function returns a pointer to the block of memory.
Remarks
This function is defined as the RtlSecureZeroMemory function (see Winbase.h). The implementation of RtlSecureZeroMemory is provided inline and can be used on any version of Windows (see Winnt.h.)
Use this function instead of ZeroMemory when you want to ensure that your data will be overwritten promptly, as some C++ compilers can optimize a call to ZeroMemory by removing it entirely.
Many programming languages include syntax for initializing complex variables to zero. There can be differences between the results of these operations and the SecureZeroMemory function. Use SecureZeroMemory to clear a block of memory in any programming language.
The following code fragment shows an instance where it is good to use SecureZeroMemory instead of ZeroMemory.

WCHAR szPassword[MAX_PATH];
// Retrieve the password
if (GetPasswordFromUser(szPassword, MAX_PATH))
UsePassword(szPassword);
// Clear the password from memory
SecureZeroMemory(szPassword, sizeof(szPassword));

If ZeroMemory were called in this example instead of SecureZeroMemory, the compiler could optimize the call because the szPassword buffer is not read from before it goes out of scope. The password would remain on the application stack where it could be captured in a crash dump or probed by a malicious application.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
See Also
CopyMemory
FillMemory
MoveMemory
ZeroMemory
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366877(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 11:23:03