Secure text editor?

Alessandro Vesely vesely at tana.it
Wed May 16 08:47:47 CEST 2007


Ryan Malayter wrote:
> On 5/15/07, Alessandro Vesely <vesely at tana.it> wrote:
>> On Windows there is
>> just one way to share memory. Memory locking must be understood in that
>> context. It is meant for synchronization purposes, not for security.
> 
> LocalLock() and GlobalLock() do indeed seem to be for synchronization,
> but VirtualLock() seems a different beast entirely.

Each XyzAlloc has its corresponding XyzLock. I don't count LocalAlloc,
GlobalAlloc, HeapAlloc as memory sharing functions.  VirtualAlloc can
be used after MapViewOfFile, more or less where one would possibly use
madvise() on Linux, except that it's mandatory.

About VirtualLock, MSDN says:

  Locks the specified region of the process's virtual address space
  into physical memory, ensuring that subsequent access to the region
  will not incur a page fault.

It doesn't ensure the corresponding region on the swap file is swept.




More information about the Gnupg-users mailing list