Bewerken

Delen via


NetAdapterInitAllocate function (netadapter.h)

The NetAdapterInitAllocate function allocates a NETADAPTER_INIT structure that a client driver uses when creating a new NETADAPTER object.

Syntax

NETADAPTER_INIT * NetAdapterInitAllocate(
  [_In_] WDFDEVICE Device
);

Parameters

[_In_] Device

A handle to a framework device object.

Return value

Returns a pointer to a framework-allocated NETADAPTER_INIT structure if the operation succeeds. Otherwise, this function returns NULL.

Important

If a client driver receives a NETADAPTER_INIT structure from a successful call to this function, the driver must always call NetAdapterInitFree to deallocate it regardless of the result of NetAdapterCreate.

Remarks

A client driver calls NetAdapterInitAllocate to obtain a NETADAPTER_INIT structure that it can pass to NetAdapterCreate.

After NetAdapterInitAllocate succeeds, client drivers can optionally call NetAdapterInitSetXxx functions to set further initialization attributes for the NETADAPTER.

For a code example of creating a NETADAPTER, see Device initialization.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.27
Minimum UMDF version 2.33
Header netadapter.h (include netadaptercx.h)
Library netadaptercxstub.lib
IRQL PASSIVE_LEVEL

See also

Device initialization

NetAdapterCreate

NetAdapterInitFree