locking program code from paging
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
Assuming C/C++ you can make a couple of labels, then use inline ASM to store them. For example:
Please make sure you know what you're doing. There are very few reasons you should be messing with this stuff.
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
Popular Topics
Advertisement