Re: How to allocate memory for a linked list of pointers in a kernel process
- From: "Volodymyr M. Shcherbyna" <v_scherbina@xxxxxxxxxxxxxxx>
- Date: Tue, 12 Feb 2008 08:41:20 +0100
In addition to Tim's questions: are you sure you access memory at proper
IRQL? You can use paged pool only at passive level.
--
V
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Tim Roberts" <timr@xxxxxxxxx> wrote in message
news:v9h2r3dsbf74mqiduami1euutagu280717@xxxxxxxxxx
joemango <joseandremorales@xxxxxxxxx> wrote:
Hi everyone, i am building a short program that builds several linked
lists using pointers of course. Its my first time doing this in the
kernel, i need to know the best way to allocate memory when i create a
new pointer that will for multiple pointers to be created without
causing a system crash, I had started with pointer delclaration
getting memory allocation with the ExAllocatePoolXxx function. but
quickly found that would not work i was declaring too many pointers
and used up all of the small amount of pool memory causing a BSOD !
For gosh sakes, how many pointers are you allocating? If you run with
Driver Verifier, ExAllocatePool ends up allocating a page per allocation,
which could eat up space, but otherwise I'm confused.
so now i need to know what i can use to access memory for my linked
lists that wont cause teh BSOD and the right way to do to be efficient
with memory usage.
Linked lists of what? Usually, the linked list pointers will be part of
another, larger structure. When the kernel routines need to allocate a
bunch of items of the same size, they use a lookaside list
(ExInitializePagedLookasideList, ExAllocateFromPagedLookasideList, etc).
Are you aware that the kernel contains routines to do doubly linked lists
(InitializeListHead, InsertTailList, InsertHeadList, etc)?
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- Prev by Date: Re: How to allocate memory for a linked list of pointers in a kernel process
- Next by Date: Re: Critical section leak in advapi32.dll
- Previous by thread: Re: How to allocate memory for a linked list of pointers in a kernel process
- Index(es):
Relevant Pages
|