I always saw the #pragma LOCKEDCODE in driver.
What is function of it? I found LOCKED CODE is defined to be code_seg(). Means that function flaged with LOCKEDCODE will be put in .text.
Can LOCKEDCODE code be paged out in driver?
thank you very much.
If by “LOCKED CODE is defined to be code_seg()” you mean #define LOCKEDCODE code_seg(),
then code in LOCKEDCODE section will go into the default code section, and, hence, is not going to be pageable. However, if you mean #define LOCKEDCODE code_seg(“PAGE”), then it will go to the PAGE section, and will be pageable. Therefore, this is just the question of definition…
Anton Bassov
From:
>I always saw the #pragma LOCKEDCODE in driver.
> What is function of it? I found LOCKED CODE is defined to be code_seg().
> Means that function flaged with LOCKEDCODE will be put in .text.
#pragma code_seg() reverts to the default section for compiled code, namely
_text. That ends up in non-paged memory. I chose LOCKEDCODE to connote
“locked pages”, which was the description we used in the old 9x days. The
converse is PAGEDCODE, which equates to code_seg(“PAGE”). Any section name
beginning with the letters P-A-G-E is placed into paged memory.
Walter Oney
Consulting and Training
www.oneysoft.com
Dear anton bassov and Walter Oney
thank you very much for your clear explain.
thanks again.