I was reading an article posted in code project website. The author has
noticed that his XP explorer was taking about 5 seconds to display an
error message when he tried deleted a locked file or directory. He
found that shell32.dll was looping around sleep for 5 times with 1
second expiration. So he decided to patch the shell32.dll using a
driver so that it will loop for 0 times thus avoiding the delay.
He writes "Now that we know which addresses to patch, we need to map
those addresses into the kernel-mode area of the memory. This will
allow us to lock the pages in memory, thus preventing them from being
swapped out to disk. In this case the memory we're modifying is
"backed" by shell32.dll. If it were to be swapped out, the memory
manager would attempt to write the changes back to shell32.dll. ...."
He also writes (in the Some Final Thoughts section) "I'm not sure why
the memory manager doesn't try to write the modified pages back to
shell32.dll. I suspect that it's because the entries in the Page Frame
Number Database representing the physical pages we've modified always
have a "reference count" of at least 1 (because they're locked). If my
understanding is correct, this means they will not be moved to the
"Modified List" and thus will not be written to disk by the Modified
Page Writer. If anyone can expand on this, please leave a comment. "
My question is:
1. Is it true that the memory manager will write pages back to the
executable upon modification? Under what circumstance does the memory
manager does this?
2. Where can I find more information about this topic?
The original article may be found at
http://www.codeproject.com/system/NoDeleteDelay.asp
Tom