PRB: VirtualProtect Limitations on Windows 95

Last reviewed: January 15, 1998
Article ID: Q170426
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows 95

SYMPTOMS

VirtualProtect() and VirtualProtectEx() functions fail with ERROR_INVALID_PARAMETER when you are setting access protection for a region of pages committed to a memory-mapped file.

CAUSE

VirtualProtect and VirtualProtectEx are not supported for memory that is mapped to the shared memory region (addresses between 2 GB and 3 GB), and the system memory regions (addresses between 3 GB and 4 GB). Since all memory-mapped files in Windows 95 are mapped to this region, the VirtualProtect functions are not supported for them.

STATUS

This behavior is by design.

MORE INFORMATION

NOTE: The VirtualProtect and VirtualProtectEx() functions may succeed under certain circumstances when attempting to set access protection to PAGE_READONLY or PAGE_NOACCESS for pages in the shared memory regions. This behavior should not be relied upon, and can cause other undesirable behavior.


Additional query words: 95 VirtualProtect VirtualProtectEx Win95
Keywords : BseMm
Version : WINDOWS:95
Platform : Win95
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.