Re: newbie: ExAllocatePoolWithTag

From: Sam Johnson (SamJohnson_at_discussions.microsoft.com)
Date: 08/14/04


Date: Sat, 14 Aug 2004 11:41:03 -0700

At the moment when I need to allocate the memory, I'm actually in the
ReceivePackets handler of my NDIS Intermediate driver.
If I acquired a spin lock, could I lower the IRQL for a short period, or
would that be illegal, too?

Sam

"Don Burn" wrote:

> Well what is the situation that has you at DISPATCH_LEVEL? Are you holding
> a spinlock, and if so could you use a different synchronization mechanism?
> Are you doing something in a DPC routine and could you do it from a work
> item so you are at passive?
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
> "Sam Johnson" <SamJohnson@discussions.microsoft.com> wrote in message
> news:4236C48E-9ED8-48A6-BA10-89B44258F7E5@microsoft.com...
> > I need to store some amount of data for a short period of time (until a
> user
> > mode application 'collects' it from kernel mode). But as the size of the
> > whole data can is different every time, I thought I'd be better off when I
> > allocate the whole stuff in paged memory, as this won't fail that easily.
> > By the way, is there any way to lower the IRQL? I know there are
> appropriate
> > functions for this, but I've heard that this would be very dangerous
> > solution.....
> >
> >
> > What do you think?
> >
> > Sam Johnson
> >
> >
> >
> >
> >
> > "Don Burn" wrote:
> >
> > > Doron,
> > >
> > > You're right, its been a long week.
> > >
> > > Don
> > >
> > > "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
> > > news:OoMjoGigEHA.2916@TK2MSFTNGP12.phx.gbl...
> > > > i think don meant there is no way to allocate PagedPool at dispatch
> level
> > > > :).
> > > >
> > > > d
> > > >
> > > > --
> > > > Please do not send e-mail directly to this alias. this alias is for
> > > > newsgroup purposes only.
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > >
> > > >
> > > > "Don Burn" <burn@stopspam.acm.org> wrote in message
> > > > news:10hsh0q8t9a9811@corp.supernews.com...
> > > > > No, there is no way to allocate NonPagedPool at DISPATCH_LEVEL. So
> the
> > > > next
> > > > > question is why do you need to allocate at dispatch?
> > > > >
> > > > >
> > > > > --
> > > > > Don Burn (MVP, Windows DDK)
> > > > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > > > Remove StopSpam from the email to reply
> > > > >
> > > > > "Sam Johnson" <Sam Johnson@discussions.microsoft.com> wrote in
> message
> > > > > news:8B1F14A8-69E8-4C87-8494-294C1626EFDC@microsoft.com...
> > > > > > Hello,
> > > > > >
> > > > > > I'm rather new to driver development and I've got a question:
> > > > > > In my driver I use the ExAllocatePoolWithTag function. As I'm
> running
> > > on
> > > > > > DISPATCH_LEVEL, I need to specifiy NonPagedPool as a pool type.
> But as
> > > > I'm
> > > > > > allocating rather a big amount of memory, I'd prefer a paged pool
> > > > > allocation.
> > > > > > Is there any way to do this in DISPATCH_LEVEL?
> > > > > >
> > > > > > Thanks to everyone
> > > > > > Sam
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
>
>
>



Relevant Pages

  • Tru64 issues with Infinite limits
    ... An automated test in my nightly build was failing due to Out of Memory ... Cannot allocate block 146 ...
    (comp.unix.tru64)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (comp.lang.cpp)
  • Re: SBCL performance on OS X
    ... > than C at allocating memory. ... > OpenMCL on the powerbook is an order of magnitude slower than SBCL ... comparison with the lisp implementation of your experiment terribly ... allocate an extra two-word structure to store it in, ...
    (comp.lang.lisp)
  • Re: Sharing memory between kernelspace and userspace
    ... deallocate, on a totally dynamic basis, userspace ... Let userspace allocate shared memory visible to multiple ... and pass that into the kernel for it to write to. ...
    (Linux-Kernel)