Share via


Initialize the Miniport Driver Characteristics Structure (Compact 7)

3/12/2014

You use the miniport driver characteristics structure to register information about your driver with NDIS. This structure contains versioning information about your driver and a list of the driver entry point functions that NDIS calls after your driver is loaded. In NDIS 5.x, this structure is called NDIS_MINIPORT_CHARACTERISTICS. Some members of this structure have been removed in the NDIS 6.0 version of this structure, which is renamed NDIS_MINIPORT_DRIVER_CHARACTERISTICS. The remainder of this guide explains these differences and shows you how to modify your driver code to work with this new structure. In the following examples, MyMDC is a structure of type NDIS_MINIPORT_DRIVER_CHARACTERISTICS.

The following table lists the NDIS 5.x miniport driver characteristics structure and its equivalent structure in NDIS 6.0:

NDIS 5.x NDIS 6.0

NDIS_MINIPORT_CHARACTERISTICS

NDIS_MINIPORT_DRIVER_CHARACTERISTICS

To initialize the miniport driver characteristics structure for NDIS 6.0

  1. Initialize the object header portion of the NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure.

    The first member of the NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure is an NDIS_OBJECT_HEADER structure (also called the object header), which contains version information that NDIS uses to interpret the remainder of the miniport driver characteristics structure. The object header has three members: Type, Size, and Revision. Calls to NDIS 6.0 functions succeed only if this header information is correct.

    The following example illustrates correct object header initialization:

    MyMDC.Header.Type     = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS,
    MyMDC.Header.Size     = sizeof(NDIS_MINIPORT_DRIVER_CHARACTERISTICS);
    MyMDC.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
    

    The NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure and the NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1 constant are defined in the following header file:

    %_WINCEROOT%\Public\Common\Ddk\Inc\Ndis.h

    The NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS constant is defined in the following header file:

    %_WINCEROOT%\Public\Common\Sdk\Inc\Ntddndis.h

  2. Declare the NDIS version of your miniport driver in the miniport driver characteristics structure.

    For example, to configure MyMDC for NDIS 6.0, set the major and minor version members as shown in the following example:

    MyMDC.MajorNdisVersion = 6;
    MyMDC.MinorNdisVersion = 0;
    

    Remember that, in a production environment, you typically define header file constants for these major and minor version values rather than specify them directly.

  3. Optionally specify a miniport driver version.

    The driver version is independent of the NDIS major and minor version shown above. The following example sets the driver version to 3.1:

    MyMDC.MajorDriverVersion = 3;
    MyMDC.MinorDriverVersion = 1;
    

See Also

Concepts

Convert Miniport Driver Initialization for NDIS 6.0