다음을 통해 공유


NdisAllocateGenericObject (Compact 2013)

3/26/2014

Components that do not have an NDIS handle use this function to allocate a generic NDIS object.

Syntax

PNDIS_GENERIC_OBJECT
  NdisAllocateGenericObject(
    IN PDRIVER_OBJECT  DriverObject OPTIONAL,
    IN ULONG  Tag,
    IN USHORT  Size
    );

Parameters

  • DriverObject
    A driver object to associate with the generic object. This parameter can be NULL.
  • Tag
    The kernel memory tag that NDIS should use to allocate memory for the generic object.
  • Size
    The 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.

Return Value

NdisAllocateGenericObject returns a pointer to the NDIS_GENERIC_OBJECT that it allocated. If NDIS failed to create the object, the return value is NULL.

Remarks

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 a NDIS handle.

NDIS drivers must call the NdisFreeGenericObject function to free a generic object that was created by using NdisAllocateGenericObject.

Requirements

Header

ndis.h

See Also

Reference

NDIS Object Interface
NDIS_GENERIC_OBJECT
NdisFreeGenericObject