Freigeben über


Updating the NDIS 6.0 Protocol Driver characteristics Structure

Many entry points that are found in the NDIS 5.x NDIS_PROTOCOL_CHARACTERISTICS structure are removed from the NDIS 6.0 version of the structure. The NDIS 6.0 version of the structure is named NDIS_PROTOCOL_DRIVER_CHARACTERISTICS.

Most NDIS 6.0 data structures contain structure version information in the object header member, which is the first member of the structure. The version information is specified in the NDIS_OBJECT_HEADER structure.

The object header has three members: Type, Size, and Revision . If the header information is incorrect, calls to NDIS 6.0 functions will fail. The following example illustrates the header initialization:

ProtocolChar.Header.Type = NDIS_OBJECT_TYPE_PROTOCOL_DRIVER_CHARACTERISTICS,
ProtocolChar.Header.Size = sizeof(NDIS_PROTOCOL_DRIVER_CHARACTERISTICS);
ProtocolChar.Header.Revision = NDIS_PROTOCOL_DRIVER_CHARACTERISTICS_REVISION_1;

In the following examples, ProtocolChar is a structure of type NDIS_PROTOCOL_DRIVER_CHARACTERISTICS. Strikeouts indicate the changed NDIS 5.x driver equivalent.

Set the NDIS 6.0 protocol drivers' major and minor version numbers to 6 and 0, respectively.

 ProtocolChar.MajorNdisVersion             = 5;
    ProtocolChar.MajorNdisVersion             = 6;
 ProtocolChar.MinorNdisVersion             = 1;
    ProtocolChar.MinorNdisVersion             = 0;

NDIS 6.0 protocol drivers must specify a driver version. The driver version is independent of the NDIS major and minor version.

    ProtocolChar.MajorDriverVersion = PROTOCOL_MAJOR_DRIVER_VERSION;
    ProtocolChar.MinorDriverVersion = PROTOCOL_MINOR_DRIVER_VERSION;

Replace the ProtocolBindAdapter function with the ProtocolBindAdapterEx function.

 ProtocolChar.BindAdapterHandler           = ProtocolBindAdapter;
    ProtocolChar.BindAdapterHandlerEx         = ProtocolBindAdapterEx;

Replace the ProtocolUnbindAdapter function with the ProtocolUnbindAdapterEx function.

 ProtocolChar.UnbindAdapterHandler                  = ProtocolUnbindAdapter;
    ProtocolChar.UnbindAdapterHandlerEx                = ProtocolUnbindAdapterEx;

Replace the ProtocolOpenAdapterComplete function with the ProtocolOpenAdapterCompleteEx function.

 ProtocolChar.OpenAdapterCompleteHandler           = ProtocolOpenAdapterComplete;
    ProtocolChar.OpenAdapterCompleteHandlerEx         = ProtocolOpenAdapterCompleteEx;

Replace the ProtocolCloseAdapterComplete function with the ProtocolCloseAdapterCompleteEx function.

 ProtocolChar.CloseAdapterCompleteHandler                  = ProtocolCloseAdapterComplete;
    ProtocolChar.CloseAdapterCompleteHandlerEx                = ProtocolCloseAdapterCompleteEx;

Replace the ProtocolPnPEvent function with the ProtocolNetPnPEvent function.

 ProtocolChar.PnPEventHandler        = ProtocolPnPEvent;
    ProtocolChar.NetPnPEventHandler      = ProtocolNetPnPEvent;

Replace the ProtocolRequestComplete function with the ProtocolOidRequestComplete function:

    ProtocolChar.RequestCompleteHandler        = ProtocolRequestComplete;
    ProtocolChar.OidRequestCompleteHandler        = ProtocolOidRequestComplete;

To register optional services, provide an entry point for the ProtocolSetOptions function.

ProtocolChar.SetOptionsHandler = ProtocolSetOptions;

Send and receive functions that use the NET_BUFFER and NET_BUFFER_LIST structures replace functions that use NDIS_PACKET structures:

    ProtocolChar.ReceivePacketHandler          = ProtocolReceivePacket;
    ProtocolChar.SendPacketsCompleteHandler           = ProtocolSendPacketsComplete;
    ProtocolChar.ReceiveNetBufferListsHandler    = ProtocolReceiveNetBufferLists;
    ProtocolChar.SendNetBufferListsCompleteHandler  = ProtocolSendNetBufferListsComplete;

For more information about the NET_BUFFER and NET_BUFFER_LIST structures, see NET_BUFFER Architecture.

To support system uninstall of a driver, replace the ProtocolUnload function, if any, with the ProtocolUninstall function.

    ProtocolChar.UnloadHandler                = ProtocolUnload;
    ProtocolChar.UninstallHandler                = ProtocolUninstall;