Condividi tramite


NdisMRegisterMiniport (Windows CE 5.0)

Send Feedback

This function registers an NIC or intermediate driver's Miniport_* entry points and name with the NDIS library when the driver initializes.

NDIS_STATUS NdisMRegisterMiniport(NDIS_HANDLE NdisWrapperHandle,PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics,UINT CharacteristicsLength);

Parameters

  • NdisWrapperHandle
    [in] Handle returned by the NdisMInitializeWrapper function.

  • MiniportCharacteristics
    [in] Pointer to an NDIS_MINIPORT_CHARACTERISTICS structure set up by the caller.

    The driver should initialize this structure with 0s before setting up any its members.

  • CharacteristicsLength
    [in] Specifies the length, in bytes, of the caller-supplied characteristics buffer. Depending on the value of the MajorNdisVersion member of NDIS_MINIPORT_CHARACTERISTICS, this parameter must be either sizeof(NDIS51_MINIPORT_CHARACTERISTICS), sizeof(NDIS50_MINIPORT_CHARACTERISTICS), or sizeof(NDIS40_MINIPORT_CHARACTERISTICS).

    The driver includes the build instruction NDIS51_MINIPORT, NDIS50_MINIPORT, or NDIS51_MINIPORT, as appropriate, in its sources; if the driver writer uses the -DNDIS51_MINIPORT, DNDIS50_MINIPORT, or DNDIS30_MINIPORT compiler switch, this parameter is set when the driver is built.

Return Values

The following table shows the return values for this function.

Value Description
NDIS_STATUS_SUCCESS Ndis successfully registered the miniport entry points.
NDIS_STATUS_BAD_CHARACTERISTICS The CharacteristicsLength is too small for the MajorNdisVersion specified in the buffer at MiniportCharacteristics.
NDIS_STATUS_BAD_VERSION The MajorNdisVersion or MinorNdisVersion specified in the characteristics structure is invalid.
NDIS_STATUS_RESOURCES A shortage of resources, possibly memory, prevented the NDIS library from registering the caller.
NDIS_STATUS_FAILURE This is a default error status, returned when none of the preceding errors caused the registration to fail. For example, if the NDIS library cannot load the driver's image and lock it into system memory, it returns this error.

Remarks

A NIC driver calls this function from its DriverEntry routine after first calling the NdisMInitializeWrapper function.

Every NIC driver that exports only MiniportXXX functions must set up a characteristics structure and call this function. This structure is copied in the request to the NDIS library's internal storage. Thus, once it has registered, a miniport driver cannot change its handler functions.

The NDIS library currently does not call MiniportReconfigure functions, so such a function in an existing miniport driver does nothing unless the miniport makes internal calls to its MiniportReconfigure function from MiniportInitialize.

Frequently, after the driver has called this function, it will be called back at the MiniportInitialize entry point specified in the characteristics structure.

NDIS intermediate drivers, which export both MiniportXXX and ProtocolXXX functions, usually call the NdisIMRegisterLayeredMiniport function, instead of this function. Intermediate drivers that export only a set of MiniportXXX functions usually call this function.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
Link Library: Ndis.dll.

See Also

Initialization of NDIS Protocol Drivers | MiniportInitialize | MiniportReconfigure | NDIS_MINIPORT_CHARACTERISTICS | NdisIMRegisterLayeredMiniport | NdisMInitializeWrapper | NdisZeroMemory

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.