What is kernel mode equivalent of malloc ?

What is kernel mode equivalent of malloc ?

kmalloc() if you are in Unix land.
ExAllocPool() for NT

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Abhijit
Sent: Thursday, March 25, 2004 9:10 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] What is kernel mode equivalent of malloc ?

What is kernel mode equivalent of malloc ?


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@garlic.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Sorry, make that ExAllocatePoolWithTag, ExAllocatePool is a depreciated
function that is likely to go away. For good practice use a different tag
for each type of item that is allocated multiple times (for instance a queue
of items) and use ExFreePoolWithTag to provide checking that you are freeing
what you intend to.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

“Prokash Sinha” wrote in message news:xxxxx@ntdev…
> kmalloc() if you are in Unix land.
> ExAllocPool() for NT
>
> -pro
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Abhijit
> Sent: Thursday, March 25, 2004 9:10 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] What is kernel mode equivalent of malloc ?
>
>
> What is kernel mode equivalent of malloc ?
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@garlic.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>

I have to manage a linked list in the driver. So would it be proper to use
ExAllocatePoolWithTag while allocating a node of the linked list? If not,
what are the other techniques ?

“Don Burn” wrote in message news:xxxxx@ntdev…
> Sorry, make that ExAllocatePoolWithTag, ExAllocatePool is a depreciated
> function that is likely to go away. For good practice use a different tag
> for each type of item that is allocated multiple times (for instance a
queue
> of items) and use ExFreePoolWithTag to provide checking that you are
freeing
> what you intend to.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
> “Prokash Sinha” wrote in message news:xxxxx@ntdev…
> > kmalloc() if you are in Unix land.
> > ExAllocPool() for NT
> >
> > -pro
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Abhijit
> > Sent: Thursday, March 25, 2004 9:10 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] What is kernel mode equivalent of malloc ?
> >
> >
> > What is kernel mode equivalent of malloc ?
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@garlic.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>

Yes, that will do. Make sure you grab from the right pool. If you need to
accesss it at a dispatch level irql or higher, then use non-paged pool, but
then
non-paged pool is very limited. IDEALLY YOU SHOULD USE PAGED POOL, AND WHEN
AND IF
YOU NEED TO PROCESS AT HIGH IRQL, YOU CAN PUT THE PROCESSING TO WORK QUEUE.

If all these sounds bit confusing, ddk, this site, and books would help

-pro

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Abhijit
Sent: Saturday, March 27, 2004 4:22 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] What is kernel mode equivalent of malloc ?

I have to manage a linked list in the driver. So would it be proper to use
ExAllocatePoolWithTag while allocating a node of the linked list? If not,
what are the other techniques ?

“Don Burn” wrote in message news:xxxxx@ntdev…
> Sorry, make that ExAllocatePoolWithTag, ExAllocatePool is a depreciated
> function that is likely to go away. For good practice use a different tag
> for each type of item that is allocated multiple times (for instance a
queue
> of items) and use ExFreePoolWithTag to provide checking that you are
freeing
> what you intend to.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
> “Prokash Sinha” wrote in message news:xxxxx@ntdev…
> > kmalloc() if you are in Unix land.
> > ExAllocPool() for NT
> >
> > -pro
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Abhijit
> > Sent: Thursday, March 25, 2004 9:10 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] What is kernel mode equivalent of malloc ?
> >
> >
> > What is kernel mode equivalent of malloc ?
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@garlic.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@garlic.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

If you are frequently allocating and deallocating items us a
ExAllocateFromNPagedLookasideList or ExAllocateFromPagedLookasideList these
routines maintain a pool of allocations for you so are very efficient for
things involving a many alloc and deallocs. Otherwise use
ExAllocatePoolWithTag, note the Lookaside lists have a tag argument on their
initialization routines, so you will still be able to monitor usage and find
the items with the debugger.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

“Abhijit” wrote in message news:xxxxx@ntdev…
> I have to manage a linked list in the driver. So would it be proper to use
> ExAllocatePoolWithTag while allocating a node of the linked list? If not,
> what are the other techniques ?
>
>
>
>
>
> “Don Burn” wrote in message news:xxxxx@ntdev…
> > Sorry, make that ExAllocatePoolWithTag, ExAllocatePool is a depreciated
> > function that is likely to go away. For good practice use a different
tag
> > for each type of item that is allocated multiple times (for instance a
> queue
> > of items) and use ExFreePoolWithTag to provide checking that you are
> freeing
> > what you intend to.
> >
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >
> >
> > “Prokash Sinha” wrote in message
news:xxxxx@ntdev…
> > > kmalloc() if you are in Unix land.
> > > ExAllocPool() for NT
> > >
> > > -pro
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com]On Behalf Of Abhijit
> > > Sent: Thursday, March 25, 2004 9:10 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] What is kernel mode equivalent of malloc ?
> > >
> > >
> > > What is kernel mode equivalent of malloc ?
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@garlic.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>

Hi Abhijit,

I wu suggest you that whatever you use, use after analyzing, usage and requirments of your  kernel application. Anyway what is the purpose of this implementation?

good luck,



From: “Abhijit”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] What is kernel mode equivalent of malloc ?
>Date: Sat, 27 Mar 2004 04:21:31 -0800
>
>I have to manage a linked list in the driver. So would it be proper to use
>ExAllocatePoolWithTag while allocating a node of the linked list? If not,
>what are the other techniques ?
>
>
>
>
>
>“Don Burn” wrote in message news:xxxxx@ntdev…
> > Sorry, make that ExAllocatePoolWithTag, ExAllocatePool is a depreciated
> > function that is likely to go away. For good practice use a different tag
> > for each type of item that is allocated multiple times (for instance a
>queue
> > of items) and use ExFreePoolWithTag to provide checking that you are
>freeing
> > what you intend to.
> >
> >
> > –
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >
> >
> > “Prokash Sinha” wrote in message news:xxxxx@ntdev…
> > > kmalloc() if you are in Unix land.
> > > ExAllocPool() for NT
> > >
> > > -pro
> > >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com]On Behalf Of Abhijit
> > > Sent: Thursday, March 25, 2004 9:10 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] What is kernel mode equivalent of malloc ?
> > >
> > >
> > > What is kernel mode equivalent of malloc ?
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@garlic.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Apply to 50,000 jobs now. Post your CV on naukri.com today.

ExAllocatePoolWithTag

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Abhijit”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Friday, March 26, 2004 9:10 AM
Subject: [ntdev] What is kernel mode equivalent of malloc ?

> What is kernel mode equivalent of malloc ?
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com