The Old New Thing

The curious interaction between PAE and NX

Carmen Crincoli covered the interaction between PAE and NX on his own blog, so I'll merely incorporate his remarks by reference. (And notice again the concession to backwards compatibility. Without the backwards compatibility work, XP SP2 would have shipped with NX support and an asterisk, "* and those of you who have device drivers ...

Writing your own menu-like window

Hereby incorporating by reference the "FakeMenu" sample in the Platform SDK. It's in the winui\shell\fakemenu directory. For those who don't have the Platform SDK, what are you doing writing Win32 programs without the Platform SDK? Download it if it didn't come with your development tools. If for some reason you don't want the Platform SDK...

Myth: In order to use AWE, you must enable PAE

Address Windowing Extensions (AWE) does not require PAE. I don't know why some people claim that it does, since it is so easy to demonstrate otherwise. Take a program that uses AWE. If you don't have one handy, you can use the one that comes in MSDN as a sample program that demonstrates how to use AWE. Grant yourself "Lock Pages in Memory" ...

Myth: PAE increases the virtual address space beyond 4GB

This is another non sequitur. PAE increases the amount of physical memory that can be addressed by the processor, but that is unrelated to virtual address space. (Remember that PAE stands for Physical Address Extensions.) PAE increases the physical address space (the address space that the CPU can use to access the memory chips on your ...

Why all these articles about PAE and /3GB?

Apparently there is some unrest in comment-land with people who are sick of this whole /3GB series. Why have I been spending over two weeks exploring the consequences of the /3GB switch and exploding various common myths about it? Because too many people don't understand what /3GB means but talk as if they do. As you saw yesterday, there ...

Why is the virtual address space 4GB anyway?

The size of the address space is capped by the number of unique pointer values. For a 32-bit processor, a 32-bit value can represent 232 distinct values. If you allow each such value to address a different byte of memory, you get 232 bytes, which equals four gigabytes. If you were willing to forego the flat memory model and deal with ...

Myth: The /3GB switch lets me map one giant 3GB block of memory

Just because the virtual address space is 3GB doesn't mean that you can map one giant 3GB block of memory. The standard holes in the virtual address space are still there: 64K at the bottom, and 64K near the 2GB boundary. Moreover, the system DLLs continue to load at their preferred virtual addresses which lie just below the 2GB boundary. ...

Why does Exchange recommend /3GB if you have more than 1GB of physical memory?

If you look through the Knowledge Base, you'll see an article that say that Exchange 2000 requires the /3GB switch with more than 1 gigabyte of physical RAM. Yet I've been writing all this time that /3GB has nothing to do with physical RAM. What's the deal? The title of the article could be a bit clearer. It really should be something more ...

Myth: The /3GB switch expands the user-mode address space of all programs

Only programs marked as /LARGEADDRESSAWARE are affected. For compatibility reasons, only programs that explicitly indicate that they are prepared to handle a virtual address space larger than 2GB will get the larger virtual address space. Unmarked programs get the normal 2GB virtual address space, and the address space between 2GB and 3GB ...

Myth: You need /3GB if you have more than 2GB of physical memory

Physical memory is not virtual address space. In my opinion, this is another non sequitur. I'm not sure what logical process led to this myth. It can't be a misapprehension of a 1-1 mapping between physical memory and virtual memory, because that mapping is blatantly not one-to-one. You typically have far more virtual memory than physical ...