When I use ExAllocatePool( ) to allocate nonpaged pool, sometime will fail.
And I use XPDDK's DriverVerify(on XP) to check the nonpaged pool peak bytes,
it's only 64 bytes.
Could anyone tell me why ExAllocatePool( ) return NULL and how to avoid it
happen ?

Thanks.

Re: Why ExAllocatePool fail ? by David

David
Fri Sep 09 11:25:30 CDT 2005

Because it can. You can't avoid it. Write your code correctly to handle
it.

"SL Chang" <slchang@sq.com.tw> wrote in message
news:eSo3HkStFHA.2212@TK2MSFTNGP15.phx.gbl...
> When I use ExAllocatePool( ) to allocate nonpaged pool, sometime will
> fail.
> And I use XPDDK's DriverVerify(on XP) to check the nonpaged pool peak
> bytes,
> it's only 64 bytes.
> Could anyone tell me why ExAllocatePool( ) return NULL and how to avoid it
> happen ?
>
> Thanks.
>
>



Re: Why ExAllocatePool fail ? by heinz

heinz
Fri Sep 09 23:36:00 CDT 2005

> When I use ExAllocatePool( ) to allocate nonpaged pool, sometime will fail.
> And I use XPDDK's DriverVerify(on XP) to check the nonpaged pool peak bytes,
> it's only 64 bytes.
> Could anyone tell me why ExAllocatePool( ) return NULL and how to avoid it
> happen ?

Turn of "Low resource simulation" in driver verifier.


Re: Why ExAllocatePool fail ? by David

David
Sat Sep 10 00:27:57 CDT 2005

Not a good idea. You should not run with low resource simulation all the
time, but you must run with it to ensure you can handle a failure to obtain
memory. There is always a chance that you will find yourself running on a
system with no available memory. It may be temporary, but you sure don't
want your driver being the one in the stack when the system bug checks,
especially if yours was not the driver that is using all the memory.

"heinz" <heinz_baer@my-deja.com> wrote in message
news:1126326960.053972.212090@z14g2000cwz.googlegroups.com...
>> When I use ExAllocatePool( ) to allocate nonpaged pool, sometime will
>> fail.
>> And I use XPDDK's DriverVerify(on XP) to check the nonpaged pool peak
>> bytes,
>> it's only 64 bytes.
>> Could anyone tell me why ExAllocatePool( ) return NULL and how to avoid
>> it
>> happen ?
>
> Turn of "Low resource simulation" in driver verifier.
>



Re: Why ExAllocatePool fail ? by Calvin

Calvin
Sat Sep 10 01:09:06 CDT 2005

"David J. Craig" <SeniorDriversWriter@shogunyoshimuni.com.net> wrote in
message

> but you sure don't want your driver being the one in the stack when the
> system bug checks,

Still, much better than "system is crashing but my driver is not in the
stack":)

--
Calvin Guan (Windows DDK MVP)
NetXtreme Longhorn Miniport Prime
Broadcom Corp. www.broadcom.com




Re: Why ExAllocatePool fail ? by heinz

heinz
Sat Sep 10 01:33:45 CDT 2005

I was simply letting the OP know why his allocation was failing and how
to avoid it. But I totally agree with you. I think anyone who releases
a driver that can't handle verifier turned on to the max should be
shot.


Re: Why ExAllocatePool fail ? by Calvin

Calvin
Sat Sep 10 02:48:59 CDT 2005

> I think anyone who releases
> a driver that can't handle verifier turned on to the max should be
> shot.

Symantec AV.

Just enable DV and have fun, not necessary to the max and no need to pick up
their driver to verify.

--
Calvin Guan (Windows DDK MVP)
NetXtreme Longhorn Miniport Prime
Broadcom Corp. www.broadcom.com



Re: Why ExAllocatePool fail ? by SL

SL
Sun Sep 11 21:12:53 CDT 2005

I am stupid !
The problem is cause by "size" variable be changed somewhere.

Thanks all :)