Driver Memory Allocation

An important aspect of programming concerns the need to allocate storage. Unfortunately, drivers don't have the luxury of making simple calls to malloc and free, or new and delete. Instead, care must be taken to ensure that memory of the right type is allocated. Drivers must also be sure to release any memory they allocate, since there is no automatic cleanup mechanism for kernel-mode code. This section describes techniques a driver can use to work with temporary storage.

Memory Available to Drivers

There are three options for allocating temporary storage in a driver. The criteria used to select the right storage type depends on factors such as duration, size, and from what IRQL level the code which accesses it will ...

Get Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.