Share via


NdisIMGetDeviceContext (Windows Embedded CE 6.0)

1/6/2010

This function allows an NDIS intermediate driver's MiniportInitialize function to access the device context area allocated by its ProtocolBindAdapter function.

Syntax

NDIS_HANDLE NdisIMGetDeviceContext(
  NDIS_HANDLE MiniportAdapterHandle
);

Parameters

  • MiniportAdapterHandle
    [in] Specifies the handle input to MiniportInitialize.

Return Value

The following table shows the return values for this function.

Value Description

NDISIMGETDEVICECONTEXT

Returns access to the device context area for the virtual NIC identified by MiniportAdapterHandle.

NULL

If the driver's ProtocolBindAdapter function did not allocate such a device context area.

Remarks

An NDIS intermediate driver's MiniportInitialize function calls NdisIMGetDeviceContext to access the device context area for the virtual NIC it is initializing. Usually, the memory for such an area is provided by the intermediate driver's ProtocolBindAdapter function, which calls NdisIMInitializeDeviceInstanceEx with a pointer to this area, thereby causing the driver's MiniportInitialize function to be called. However, an intermediate driver is not required to have such a context area.

On return from NdisIMGetDeviceContext, MiniportInitialize sets up the driver-defined state for the virtual NIC with whatever information the intermediate driver writer intends to be useful to still higher-level protocols that bind themselves subsequently to its virtual NIC.

Still higher level NDIS protocols bound to the same virtual NIC subsequently can access this device context area by calling NdisIMGetBindingContext from their ProtocolBindAdapter functions.

Requirements

Header ndis.h
Library ndis.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Library Functions
MiniportInitialize
NdisIMGetBindingContext
NdisIMInitializeDeviceInstanceEx
ProtocolBindAdapter