Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _WMISTR_
      7 #define _WMISTR_
      8 
      9 typedef struct _WNODE_HEADER {
     10   ULONG BufferSize;
     11   ULONG ProviderId;
     12   __C89_NAMELESS union {
     13     ULONG64 HistoricalContext;
     14     __C89_NAMELESS struct {
     15       ULONG Version;
     16       ULONG Linkage;
     17     };
     18   };
     19   __C89_NAMELESS union {
     20     ULONG CountLost;
     21     HANDLE KernelHandle;
     22     LARGE_INTEGER TimeStamp;
     23   };
     24   GUID Guid;
     25   ULONG ClientContext;
     26   ULONG Flags;
     27 } WNODE_HEADER,*PWNODE_HEADER;
     28 
     29 #define WNODE_FLAG_ALL_DATA 0x00000001
     30 #define WNODE_FLAG_SINGLE_INSTANCE 0x00000002
     31 #define WNODE_FLAG_SINGLE_ITEM 0x00000004
     32 #define WNODE_FLAG_EVENT_ITEM 0x00000008
     33 #define WNODE_FLAG_FIXED_INSTANCE_SIZE 0x00000010
     34 #define WNODE_FLAG_TOO_SMALL 0x00000020
     35 #define WNODE_FLAG_INSTANCES_SAME 0x00000040
     36 #define WNODE_FLAG_STATIC_INSTANCE_NAMES 0x00000080
     37 #define WNODE_FLAG_INTERNAL 0x00000100
     38 #define WNODE_FLAG_USE_TIMESTAMP 0x00000200
     39 #define WNODE_FLAG_PERSIST_EVENT 0x00000400
     40 #define WNODE_FLAG_EVENT_REFERENCE 0x00002000
     41 #define WNODE_FLAG_ANSI_INSTANCENAMES 0x00004000
     42 #define WNODE_FLAG_METHOD_ITEM 0x00008000
     43 #define WNODE_FLAG_PDO_INSTANCE_NAMES 0x00010000
     44 #define WNODE_FLAG_TRACED_GUID 0x00020000
     45 #define WNODE_FLAG_LOG_WNODE 0x00040000
     46 #define WNODE_FLAG_USE_GUID_PTR 0x00080000
     47 #define WNODE_FLAG_USE_MOF_PTR 0x00100000
     48 #define WNODE_FLAG_NO_HEADER 0x00200000
     49 #define WNODE_FLAG_SEVERITY_MASK 0xff000000
     50 
     51 typedef struct {
     52   ULONG OffsetInstanceData;
     53   ULONG LengthInstanceData;
     54 } OFFSETINSTANCEDATAANDLENGTH,*POFFSETINSTANCEDATAANDLENGTH;
     55 
     56 typedef struct tagWNODE_ALL_DATA {
     57   struct _WNODE_HEADER WnodeHeader;
     58   ULONG DataBlockOffset;
     59   ULONG InstanceCount;
     60   ULONG OffsetInstanceNameOffsets;
     61   __C89_NAMELESS union {
     62     ULONG FixedInstanceSize;
     63     OFFSETINSTANCEDATAANDLENGTH OffsetInstanceDataAndLength[1];
     64   };
     65 } WNODE_ALL_DATA,*PWNODE_ALL_DATA;
     66 
     67 typedef struct tagWNODE_SINGLE_INSTANCE {
     68   struct _WNODE_HEADER WnodeHeader;
     69   ULONG OffsetInstanceName;
     70   ULONG InstanceIndex;
     71   ULONG DataBlockOffset;
     72   ULONG SizeDataBlock;
     73   UCHAR VariableData[];
     74 } WNODE_SINGLE_INSTANCE,*PWNODE_SINGLE_INSTANCE;
     75 
     76 typedef struct tagWNODE_SINGLE_ITEM {
     77   struct _WNODE_HEADER WnodeHeader;
     78   ULONG OffsetInstanceName;
     79   ULONG InstanceIndex;
     80   ULONG ItemId;
     81   ULONG DataBlockOffset;
     82   ULONG SizeDataItem;
     83   UCHAR VariableData[];
     84 } WNODE_SINGLE_ITEM,*PWNODE_SINGLE_ITEM;
     85 
     86 typedef struct tagWNODE_METHOD_ITEM {
     87   struct _WNODE_HEADER WnodeHeader;
     88   ULONG OffsetInstanceName;
     89   ULONG InstanceIndex;
     90   ULONG MethodId;
     91   ULONG DataBlockOffset;
     92   ULONG SizeDataBlock;
     93   UCHAR VariableData[];
     94 } WNODE_METHOD_ITEM,*PWNODE_METHOD_ITEM;
     95 
     96 typedef struct tagWNODE_EVENT_ITEM {
     97   struct _WNODE_HEADER WnodeHeader;
     98 } WNODE_EVENT_ITEM,*PWNODE_EVENT_ITEM;
     99 
    100 typedef struct tagWNODE_EVENT_REFERENCE {
    101   struct _WNODE_HEADER WnodeHeader;
    102   GUID TargetGuid;
    103   ULONG TargetDataBlockSize;
    104   __C89_NAMELESS union {
    105     ULONG TargetInstanceIndex;
    106     WCHAR TargetInstanceName[1];
    107   };
    108 } WNODE_EVENT_REFERENCE,*PWNODE_EVENT_REFERENCE;
    109 
    110 typedef struct tagWNODE_TOO_SMALL {
    111   struct _WNODE_HEADER WnodeHeader;
    112   ULONG SizeNeeded;
    113 } WNODE_TOO_SMALL,*PWNODE_TOO_SMALL;
    114 
    115 typedef struct {
    116   GUID Guid;
    117   ULONG Flags;
    118   ULONG InstanceCount;
    119   __C89_NAMELESS union {
    120     ULONG InstanceNameList;
    121     ULONG BaseNameOffset;
    122     ULONG_PTR Pdo;
    123     ULONG_PTR InstanceInfo;
    124   };
    125 } WMIREGGUIDW,*PWMIREGGUIDW;
    126 
    127 typedef WMIREGGUIDW WMIREGGUID;
    128 typedef PWMIREGGUIDW PWMIREGGUID;
    129 
    130 #define WMIREG_FLAG_EXPENSIVE 0x00000001
    131 #define WMIREG_FLAG_INSTANCE_LIST 0x00000004
    132 #define WMIREG_FLAG_INSTANCE_BASENAME 0x00000008
    133 #define WMIREG_FLAG_INSTANCE_PDO 0x00000020
    134 #define WMIREG_FLAG_REMOVE_GUID 0x00010000
    135 #define WMIREG_FLAG_RESERVED1 0x00020000
    136 #define WMIREG_FLAG_RESERVED2 0x00040000
    137 #define WMIREG_FLAG_TRACED_GUID 0x00080000
    138 #define WMIREG_FLAG_TRACE_CONTROL_GUID 0x00001000
    139 #define WMIREG_FLAG_EVENT_ONLY_GUID 0x00000040
    140 
    141 typedef struct {
    142   ULONG BufferSize;
    143   ULONG NextWmiRegInfo;
    144   ULONG RegistryPath;
    145   ULONG MofResourceName;
    146   ULONG GuidCount;
    147   WMIREGGUIDW WmiRegGuid[];
    148 } WMIREGINFOW,*PWMIREGINFOW;
    149 
    150 typedef WMIREGINFOW WMIREGINFO;
    151 typedef PWMIREGINFOW PWMIREGINFO;
    152 
    153 typedef enum {
    154   WMI_GET_ALL_DATA = 0,WMI_GET_SINGLE_INSTANCE = 1,WMI_SET_SINGLE_INSTANCE = 2,WMI_SET_SINGLE_ITEM = 3,WMI_ENABLE_EVENTS = 4,WMI_DISABLE_EVENTS = 5,
    155   WMI_ENABLE_COLLECTION = 6,WMI_DISABLE_COLLECTION = 7,WMI_REGINFO = 8,WMI_EXECUTE_METHOD = 9
    156 } WMIDPREQUESTCODE;
    157 
    158 #if defined(_WINNT_) || defined(WINNT)
    159 
    160 #define WMI_GUIDTYPE_TRACECONTROL 0
    161 #define WMI_GUIDTYPE_TRACE 1
    162 #define WMI_GUIDTYPE_DATA 2
    163 #define WMI_GUIDTYPE_EVENT 3
    164 
    165 #define WMIGUID_QUERY 0x0001
    166 #define WMIGUID_SET 0x0002
    167 #define WMIGUID_NOTIFICATION 0x0004
    168 #define WMIGUID_READ_DESCRIPTION 0x0008
    169 #define WMIGUID_EXECUTE 0x0010
    170 #define TRACELOG_CREATE_REALTIME 0x0020
    171 #define TRACELOG_CREATE_ONDISK 0x0040
    172 #define TRACELOG_GUID_ENABLE 0x0080
    173 #define TRACELOG_ACCESS_KERNEL_LOGGER 0x0100
    174 #define TRACELOG_CREATE_INPROC 0x0200
    175 #define TRACELOG_ACCESS_REALTIME 0x0400
    176 #define TRACELOG_REGISTER_GUIDS 0x0800
    177 
    178 #define WMIGUID_ALL_ACCESS (STANDARD_RIGHTS_READ | SYNCHRONIZE | WMIGUID_QUERY | WMIGUID_SET | WMIGUID_NOTIFICATION | WMIGUID_READ_DESCRIPTION | WMIGUID_EXECUTE | TRACELOG_CREATE_REALTIME | TRACELOG_CREATE_ONDISK | TRACELOG_GUID_ENABLE | TRACELOG_ACCESS_KERNEL_LOGGER | TRACELOG_CREATE_INPROC | TRACELOG_ACCESS_REALTIME | TRACELOG_REGISTER_GUIDS)
    179 
    180 #define WMI_GLOBAL_LOGGER_ID 0x0001
    181 #endif
    182 #endif
    183