NetAdapterCreate function (netadapter.h)

Creates a NETADAPTER object.

Syntax

NTSTATUS NetAdapterCreate(
  [_In_]     NETADAPTER_INIT       *AdapterInit,
  [_In_opt_] WDF_OBJECT_ATTRIBUTES *AdapterAttributes,
  [_Out_]    NETADAPTER            *Adapter
);

Parameters

[_In_] AdapterInit

A pointer to a NETADAPTER_INIT structure that the client driver previously received from a call to NetAdapterInitAllocate.

[_In_opt_] AdapterAttributes

A pointer to a caller-allocated WDF_OBJECT_ATTRIBUTES structure. The structure’s ParentObject must be NULL. The parameter is optional and can be WDF_NO_OBJECT_ATTRIBUTES.

[_Out_] Adapter

A pointer to a location that receives a handle to the new NETADAPTER object.

Return value

The function returns STATUS_SUCCESS if the operation succeeds. Otherwise, this function may return an appropriate NTSTATUS error code.

Remarks

After it has called WdfDeviceCreate, the client typically calls NetAdapterCreate from within its EvtDriverDeviceAdd routine.

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

The NETADAPTER object is a standard WDF object. The framework manages its deletion, which occurs when the parent WDFDEVICE is deleted.

Requirements

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