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