NetAdapterInitAllocate function

Warning

Some information in this topic relates to prereleased product, which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

NetAdapterCx is preview only in Windows 10, version 1903.

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

Syntax

NETADAPTER_INIT * NetAdapterInitAllocate(
  WDFDEVICE Device
);

Parameters

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 method returns NULL.

Important

If a client driver receives a NETADAPTER_INIT structure from a successful call to this method, 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 methods to set further initialization attributes for the NETADAPTER.

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

Requirements

   
Target Platform Universal
Minimum KMDF version 1.27
Header netadapter.h
Library netadaptercxstub.lib
IRQL PASSIVE_LEVEL

See Also

Device initialization

NetAdapterCreate

NetAdapterInitFree