【发布时间】:2011-05-01 04:36:29
【问题描述】:
我希望安全地删除(甚至不是内存中的痕迹)用户在文本框中键入的任何内容。我想知道将其设置为"" 是否足够安全。
SetWindowText 是 Win32 API 中的一个函数,在 user32.dll 中。
在节目中:
SetWindowText(myHandle, "Hello");
SetWindowText(myHandle, "Goodbye");
//Was the buffer containing chars "Hello" overwritten by the
//series of chars "Goodb"?
//Or was another chunk of buffer being allocated to store "Goodbye",
//hence "Hello" still exist somewhere in the memory?
SetWindowText(myHandle, "");
//What does Windows do to the buffer that used to store chars "Goodbye"?
//Does it wipe out and replace the data in the buffer to all 0s here?
//Or does "Goodbye" actually still stays in the memory?
【问题讨论】:
-
你的意思可能是“你好”(双引号)
标签: c++ security winapi memory gdi