Share via


Filling in an NDIS_GUID Structure (NDIS 5.1)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

An NDIS_GUID structure is defined as follows:

typedef struct _NDIS_GUID
{
    GUID             Guid;
    union
    {
        NDIS_OID     Oid;
        NDIS_STATUS  Status;
    };
    ULONG            Size;
    ULONG            Flags;
} NDIS_GUID, *PNDIS_GUID;

To obtain a GUID for the Guid member of the structure, the driver writer must run the uuidgen.exe program. For more information about this utility, see the Microsoft Windows SDK.

The Oidor Statusmember is a ULONG that is an OID code or status code. In both cases, the most significant byte of the code is 0xFF and the rest is vendor-defined. The code must be unique within the scope of the miniport driver.

If the NDIS_GUID structure maps a OID that returns data, the Sizemember specifies the size in bytes of each data item in the returned array. If the size of the returned data items is variable, if the OID does not return data, or if the NDIS_GUID structure maps a status indication, the Sizemember must be -1.

The following Flagscan be ORed together to indicate whether the GUID maps to an OID or to an NDIS_STATUS string and to indicate the type of data supplied for the GUID:

  • fNDIS_GUID_TO_OID
    When set, indicates that the NDIS_GUID structure maps a GUID to an OID.

  • fNDIS_GUID_TO_STATUS
    When set, indicates that the NDIS_GUID structure maps a GUID to an NDIS_STATUS string.

  • fNDIS_GUID_ANSI_STRING
    When set, indicates that a null-terminated ANSI string is supplied for the GUID.

  • fNDIS_GUID_UNICODE_STRING
    When set, indicates that a Unicode string is supplied for the GUID.

  • fNDIS_GUID_ARRAY
    When set, indicates that an array of data items is supplied for the GUID. The specified Size indicates the length of each data item in the array.

  • fNDIS_GUID_ALLOW_READ
    When set, indicates that all users are allowed to use this GUID to obtain information.

  • fNDIS_GUID_ALLOW_WRITE
    When set, indicates that all users are allowed to use this GUID to set information.

Note   By default, custom WMI GUIDs supplied by a miniport driver are only accessible to users with administrator privileges. A user with administrator privileges can always read or write to a custom GUID if the miniport driver supports the read or write operation for that GUID. Set the fNDIS_GUID_ALLOW_READ and fNDIS_GUID_ALLOW_WRITE flags to allow all users to access a custom GUID.

 

Note that all custom GUIDs registered by a miniport driver must set either fNDIS_GUID_TO_OID or fNDIS_GUID_TO_STATUS (never set both). All other flags may be combined by using the OR operator as applicable.

 

 

Send comments about this topic to Microsoft