Hi all,

I'm calling the function 'GenericRegisterInterface' into generic.lib (Walter
Oney's framework)

This function tries allocate a small (36 bytes) NonPagedPool and fails.

But, just after the call to 'GenericRegisterInterface' others allocations
work fine.

What's the problem with ExAllocatePool in functions imported from a lib?

Thanks Very Much
Edgard Lima
edgard.lima@cin.ufpe.br

GenericRegisterInterface(pdx->pgx, &GUID_DEVINTERFACE_WAYTSUSB);
void *p;
if ( p = ExAllocatePool(NonPagedPool, 36) ) {
KdPrint((DRIVERNAME " - Allocated 36\n"));
ExFreePool(p);
if ( p = ExAllocatePool(NonPagedPool, 128) ) {
KdPrint((DRIVERNAME " - Allocated 128\n"));
ExFreePool(p);
if ( p = ExAllocatePool(NonPagedPool, 1024) ) {
KdPrint((DRIVERNAME " - Allocated 1024\n"));
ExFreePool(p);
if ( p = ExAllocatePool(NonPagedPool, 2048) ) {
KdPrint((DRIVERNAME " - Allocated 2048\n"));
ExFreePool(p);
}
}
}
}

Re: ExAllocatePool error into .lib by Tim

Tim
Thu Oct 14 01:11:25 CDT 2004

"Edgard Lima" <enagl@cin.ufpe.br> wrote:
>
>I'm calling the function 'GenericRegisterInterface' into generic.lib (Walter
>Oney's framework)
>
>This function tries allocate a small (36 bytes) NonPagedPool and fails.
>
>But, just after the call to 'GenericRegisterInterface' others allocations
>work fine.
>
>What's the problem with ExAllocatePool in functions imported from a lib?

Nothing. I'll wager you are running driver verifier with memory pool
testing turned on. That causes ExAllocatePool to fail once in a while.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: ExAllocatePool error into .lib by Edgard

Edgard
Thu Oct 14 09:34:32 CDT 2004


Thanks for the hint Tim,

It wasn't exactly the problem, but It help me to find a very idiot thing I
was doing. ;-)
I launched the driver verifier and saw the allocation was sucessfully ;-)

please excuse me to do a bad question,
[]s
Edgard Lima
edgard.lima@cin.ufpe.br



"Tim Roberts" <timr@probo.com> wrote in message
news:926sm0l85aud4898hjtll1sklvfm4aluca@4ax.com...
> "Edgard Lima" <enagl@cin.ufpe.br> wrote:
>>
>>I'm calling the function 'GenericRegisterInterface' into generic.lib
>>(Walter
>>Oney's framework)
>>
>>This function tries allocate a small (36 bytes) NonPagedPool and fails.
>>
>>But, just after the call to 'GenericRegisterInterface' others allocations
>>work fine.
>>
>>What's the problem with ExAllocatePool in functions imported from a lib?
>
> Nothing. I'll wager you are running driver verifier with memory pool
> testing turned on. That causes ExAllocatePool to fail once in a while.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc