INFO: The Use of PAGE_WRITECOPY |
Q105532
The documentation to CreateFileMapping(), VirtualAlloc(), and
VirtualProtect() indicates that the PAGE_WRITECOPY protection gives
copy-on-write access to the committed region of pages. As it is,
PAGE_WRITECOPY makes sense only in the context of file mapping, where
you want to map something from the disk into your view and then modify
the view without causing the data to go on the disk.
The only case where VirtualAlloc() should succeed with PAGE_WRITECOPY
is the case where CreateFileMapping() is called with INVALID_HANDLE_VALUE and allocates memory with the SEC_RESERVE flag and later on, VirtualAlloc() is used
to change this into MEM_COMMIT with a PAGE_WRITECOPY protection.
There is a bug in Windows NT 3.1 such that the following call to
VirtualAlloc() will succeed:
lpCommit = VirtualAlloc(lpvAddr, cbSize, MEM_COMMIT, PAGE_WRITECOPY);
This call will fail under any other versions of Windows NT.
Additional query words: 3.10 3.50
Keywords : kbAPI kbKernBase kbMemory kbOSWin2000 kbDSupport kbGrpDSKernBase
Issue type : kbinfo
Technology : kbAudDeveloper kbWin32sSearch kbWin32API
|
Last Reviewed: October 27, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |