Microsoft KB Archive/92764

From BetaArchive Wiki

Non-Addressable Range in Address Space

ID: Q92764

3.10 3.50 WINDOWS NT kbprg


The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), included with:
    • Microsoft Windows NT, versions 3.1, 3.5




SUMMARY

In Windows NT, each process has its own private address space. The process can use up to 2 gigabytes of virtual memory. This 2Gb is not necessarily contiguous. The system uses the other 2Gb.

The user-mode addresses extend from 0x00010000 to 0x7FFF0000. The following ranges are reserved as non-address space to ensure that the process does not walk on system-owned memory

   0x00000000 to 0x0000FFFF    (first 64K of virtual space)

   0x7FFF0000 to 0x7FFFFFFF    (last 64K of user virtual space) 

These are effectively PAGE_NOACCESS ranges.

Additionally, Win32 DLLs will reserve other specific address ranges. For more information, see the file COFFBASE.TXT that comes with the DDK.

MORE INFORMATION

This range is not guaranteed to serve this purpose in the future. There could be good reasons in a future implementation to use these addresses. Code that is going to depend on this non-address range should verify its validity at run time with something like

   BOOL IsFirst64kInvalid(void)
   {
      BOOL bFirst64kInvalid = FALSE;

      try {
         *(char *)0x0000FFFF;
      }
      except (EXCEPTION_EXECUTE_HANDLER) {
         if (EXCEPTION_ACCESS_VIOLATION == GetExceptionCode())
            bFirst64kInvalid = TRUE;
      }

      return bFirst64kInvalid;
   } 

Additional query words: 3.10 3.50

Keywords          : 
Version           : winnt:3.1,3.5
Platform          : winnt 
Issue type        : 

Last Reviewed: October 14, 1999
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.