How do the Windows DDK samples deal with being paged out? I don't see much code dealing with it in the samples

StackOverflow https://stackoverflow.com/questions/7541577

Question

How come the Windows DDK samples do not deal with being paged out? Are they non-pageable?

Was it helpful?

Solution

Pageable code is marked with #pragma code_seg("PAGE"). That's why the drivers are not dealing with paging. They are by default all non-pagable.

OTHER TIPS

Not speaking specifically of Windows drivers, but only for device drivers in general:

Don't have large drivers.

Don't do that much work in kernel mode and certainly don't do that much work at high interrupt priority levels. Do only what's needed at these levels, then delegate the rest of the work to code that runs at the lowest level (0).

Paged code is wrapped by #pragma code_seg("PAGExxx"), paged data by #pragma data_seg("PAGExxx"). It's also possible to specify paged functions (only c-linkage) with #pragma alloc_text. Classes can also be paged by using declspec(allocate()) starting with WDK 8. There is also an API to lock and unlock pages in memory, allowing runtime control. See more here: http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/ba75e766-6a8f-4fe8-9d03-b69be85655d9

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top