I need a utility (or if this doesn't exist, a Windows function) to query the state of pages in a running application. Utilities like VMMap already give quite some information, but what I am missing is the following: knowing whether a memory page is currently in RAM, swapped out, or is not loaded.
The problem is that my executable is loaded from the network, and although I used the /SWAPRUN:NET linker flag in the past, I don't use it anymore since it leads to horrible performance problems in Windows Explorer since Windows Vista (if this flag is set Windows Explorer also loads the complete executable over the network just to show the icon).
I have some trick to force the application in memory myself, but I have the impression that it doesn't always work, and it also doesn't seem to work if Windows gets low on memory (I think it simply removes the executable pages instead of swapping them out to the page file).
With such a utility I would be able to check what Windows is really doing, and I can try some alternative ideas to force the application code in memory.