none
KDMF C++ Deriver, #pragma alloc_text (PAGE RRS feed

  • Question

  • I am about to implement a KDMF C++ driver.

    With "C" #pragma alloc_text (PAGExxx, $(FunctionName)) is used to control code page-ability. 

    With "C++" the #pragma alloc_text (PAGExxx, $(FunctionName))  cannot be used.

    Is there any way to control C++ code page-ability? 
    How should I guarantee the C++ code is not paged out ?
    Will marking a section as 'memory-resident' using: #pragma comment(linker, " /SECTION:.text,!P") suffice ?


    Nadav Rubinstein, See my Blog @ http://www.sophin.com









    • Edited by Nadav Rub Wednesday, October 15, 2014 8:44 AM
    Wednesday, October 15, 2014 8:25 AM

Answers

All replies

  • The default if you do nothing is that all the code is resident.  For C++ just don't have the pragma at all.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com

    • Marked as answer by Nadav Rub Wednesday, October 15, 2014 3:21 PM
    Wednesday, October 15, 2014 11:23 AM
  • __declspec(code_seg("segname")) seems intended for C++.  I haven't used it myself though, and older WDK versions don't support it.

    Wednesday, October 15, 2014 11:23 AM
  • that is exactly why this declspec was created. you can mark methods and entire classes.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, October 15, 2014 4:26 PM