// ndis.h
PNDIS_GENERIC_OBJECT NdisAllocateGenericObject(
[optional] PDRIVER_OBJECT DriverObject,
ULONG Tag,
USHORT Size
);
View the official Windows Driver Kit DDI referenceNo description available.
Components that do not have an NDIS handle use the NdisAllocateGenericObject function to allocate a generic NDIS object.
DriverObject [optional]A driver object to associate with the generic object. This parameter can be NULL.
TagThe kernel memory tag that NDIS should use to allocate memory for the generic object.
SizeThe amount of memory, in bytes, to reserve for the caller. This does not include the size of the NDIS_GENERIC_OBJECT structure. Use the additional memory space for your own purposes. To access the additional memory, use sizeof(NDIS_GENERIC_OBJECT) to skip over the generic object structure.
NdisAllocateGenericObject returns a pointer to the NDIS_GENERIC_OBJECT that it allocated. If NDIS failed to create the object, the return value is NULL.
NDIS uses a generic object to manage resources that are allocated by a component that does not otherwise have an NDIS handle. Such a component uses the returned generic object pointer as an NDIS handle in some NDIS resource allocation APIs that require an NDIS handle.
NDIS drivers must call the NdisFreeGenericObject function to free a generic object that was created with NdisAllocateGenericObject.