Filling in an NDIS_GUID Structure

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, you can run the Uuidgen.exe application. For more information about this application, see Generating Interface UUIDs.

The Oid or Status member is a ULONG that is an OID code. NDIS 6.0 does not map custom status indications to WMI GUIDs.

If the NDIS_GUID structure maps an OID that returns an array of data items, the Size member specifies the size, in bytes, of each data item in the array. If the data is not an array, the Size member specifies the size of the data. If the size of the data items is variable, or if the OID does not return data, the Size member must be -1.

A bitwise OR of the following values for the Flags member indicates the type of data that is associated with the GUID:

fNDIS_GUID_TO_OID
When this flag is set, the NDIS_GUID structure maps a GUID to an OID.

fNDIS_GUID_TO_STATUS
Reserved for NDIS. Miniport drivers should not use this flag.

fNDIS_GUID_ANSI_STRING
When this flag is set, a null-terminated ANSI string is supplied for the GUID.

fNDIS_GUID_UNICODE_STRING
When this flag is set, a Unicode string is supplied for the GUID.

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

fNDIS_GUID_ALLOW_READ
When this flag is set, all users are allowed to use this GUID to obtain information.

fNDIS_GUID_ALLOW_WRITE
When this flag is set, all users are allowed to use this GUID to set information.

Note  By default, custom WMI GUIDs that a miniport driver supplies are accessible only 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. You can set the fNDIS_GUID_ALLOW_READ and fNDIS_GUID_ALLOW_WRITE flags to allow all users to access a custom GUID.

Note that for all custom GUIDs that a driver registers, the driver must set fNDIS_GUID_TO_OID. Miniport drivers should never set fNDIS_GUID_TO_STATUS. All of the other flags can be combined by using a bitwise OR operation.