Hi,
(Gap in title since it prevents me from posting otherwise)
I am having trouble with a NET_BUFFER allocated with NdisAllocateNetBufferMdlAndData
and then attempting to get the data buffer via NdisGetDataBuffer but it just returns NULL. I allocate my NBL and NB from pools setup as the following:
NET_BUFFER_POOL_PARAMETERS params = {
.Header.Revision = NET_BUFFER_POOL_PARAMETERS_REVISION_1,
.Header.Type = NDIS_OBJECT_TYPE_DEFAULT,
.Header.Size = NDIS_SIZEOF_NET_BUFFER_POOL_PARAMETERS_REVISION_1,
.PoolTag = WDI_USB_POOLTAG,
.DataSize = 1024};
...
NET_BUFFER_LIST_POOL_PARAMETERS params = {
.Header.Revision = NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1,
.Header.Size = NDIS_SIZEOF_NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1,
.Header.Type = NDIS_OBJECT_TYPE_DEFAULT,
.ProtocolId = NDIS_PROTOCOL_ID_DEFAULT,
.fAllocateNetBuffer = FALSE,
.ContextSize = 0,
.PoolTag = WDI_USB_POOLTAG,
.DataSize = 0};
and then allocate with nb = NdisAllocateNetBufferMdlAndData(NblQueue->nb_pool);
. I have debugged the MDL and it is valid and I am able to attain the buffer via manually walking the MDL chain, but for some reason the function fails when called? Id rather not have to manually do this and would prefer to use the abstractions in place but I am truly puzzled as to why I am not able to attain the buffer when the MDL is valid and has been allocated correctly from the NET_BUFFER pool.
Thanks in advance!