I m writing a Ndis miniport driver. I m allocating a buffer pool by calling
NdisAllocateBufferPool. It returns status as NDIS_STATUS_SUCCESS, but the
bufferpool handle is 0. I m able to allocate buffers from this bufferpool.

why NdisAllocateBufferPool is returning bufferpool as 0.

Thanks in advance.
hiremath_vi

Re: NdisAllocateBufferPool by Thomas

Thomas
Wed Apr 12 01:05:37 CDT 2006


"hiremath_vi" <hiremathvi@discussions.microsoft.com> wrote in message
news:C696805C-0F4A-425D-95AE-995506993ACC@microsoft.com...
>I m writing a Ndis miniport driver. I m allocating a buffer pool by calling
> NdisAllocateBufferPool. It returns status as NDIS_STATUS_SUCCESS, but the
> bufferpool handle is 0. I m able to allocate buffers from this
> bufferpool.
>
> why NdisAllocateBufferPool is returning bufferpool as 0.
>
> Thanks in advance.
> hiremath_vi

Do take the time to read the DDK documentation. It includes this comment for
NdisAllocateBufferPool:

"NULL is a valid value for PoolHandle on some Windows versions."

Check the Status return from NdisAllocateBufferPool to know about errors. If
the call is successful, just pass the PoolHandle value (whatever it may be)
to NdisAllocateBuffer.

Good luck,

Thomas F. Divine, Windows DDK MVP
http://www.pcausa.com


Re: NdisAllocateBufferPool by Stephan

Stephan
Thu Apr 13 03:37:30 CDT 2006

As Tom quoted, NULL is a valid buffer pool handle. Simply, because a
pool is not actually allocated on some Windows versions. Instead, any
buffer allocations from a pretended individual pool are actually
satisfied from a global buffer pool.

Keep in mind that it is still required to store and use the actual
handle returned by NdisAllocateBufferPool() as one cannot make any
assumptions on what the handle is or means. For instance, maybe the
next service pack will return a non-null handle.

Stephan
---
Thomas F. Divine [DDK MVP] wrote:
> "hiremath_vi" <hiremathvi@discussions.microsoft.com> wrote in message
> news:C696805C-0F4A-425D-95AE-995506993ACC@microsoft.com...
> >I m writing a Ndis miniport driver. I m allocating a buffer pool by calling
> > NdisAllocateBufferPool. It returns status as NDIS_STATUS_SUCCESS, but the
> > bufferpool handle is 0. I m able to allocate buffers from this
> > bufferpool.
> >
> > why NdisAllocateBufferPool is returning bufferpool as 0.
> >
> > Thanks in advance.
> > hiremath_vi
>
> Do take the time to read the DDK documentation. It includes this comment for
> NdisAllocateBufferPool:
>
> "NULL is a valid value for PoolHandle on some Windows versions."
>
> Check the Status return from NdisAllocateBufferPool to know about errors. If
> the call is successful, just pass the PoolHandle value (whatever it may be)
> to NdisAllocateBuffer.
>
> Good luck,
>
> Thomas F. Divine, Windows DDK MVP
> http://www.pcausa.com


Re: NdisAllocateBufferPool by Maxim

Maxim
Thu Apr 13 04:44:23 CDT 2006

> I m writing a Ndis miniport driver. I m allocating a buffer pool by calling
> NdisAllocateBufferPool. It returns status as NDIS_STATUS_SUCCESS, but the
> bufferpool handle is 0. I m able to allocate buffers from this bufferpool.
>
> why NdisAllocateBufferPool is returning bufferpool as 0.

On NT, NDIS buffer pool is a no-op, and NdisAllocateBuffer is a wrapper around
IoAllocateMdl/MmBuildMdlForNonPagedPool and does not touch any buffer pool at
all.

So, 0 is fine.

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