locking program code from paging

Started by
0 comments, last by AbandonedAccount 17 years, 7 months ago
how do i find the virtual memory range taken up by my code? the idea is to invoke VirtualLock() on that memory range, such that windows does not move it to the page file, in other words, i want to lock the code (instructions) of my app in RAM
Cartman's definition of sexual harrasement:"When you are trying to have intercourse with a lady friend, and some other guy comes up and tickles your balls from behind"(watch South Park, it rocks)
Advertisement
Assuming C/C++ you can make a couple of labels, then use inline ASM to store them. For example:
point1://some codepoint2:unsigned int cp1,cp2;unsigned int oEdx;_asm mov oEdx, edx;_asm mov edx, point1;_asm mov cp1, edx;_asm mov edx, point2;_asm mov cp2, edx;_asm mov edx, oEdx;


Please make sure you know what you're doing. There are very few reasons you should be messing with this stuff.

This topic is closed to new replies.

Advertisement