[1166] | 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_VERSIONED_PROPERTIES 0x00800000
|
---|
| 52 | #define WNODE_FLAG_SEVERITY_MASK 0xff000000
|
---|
| 53 |
|
---|
| 54 | typedef struct {
|
---|
| 55 | ULONG OffsetInstanceData;
|
---|
| 56 | ULONG LengthInstanceData;
|
---|
| 57 | } OFFSETINSTANCEDATAANDLENGTH,*POFFSETINSTANCEDATAANDLENGTH;
|
---|
| 58 |
|
---|
| 59 | typedef struct tagWNODE_ALL_DATA {
|
---|
| 60 | struct _WNODE_HEADER WnodeHeader;
|
---|
| 61 | ULONG DataBlockOffset;
|
---|
| 62 | ULONG InstanceCount;
|
---|
| 63 | ULONG OffsetInstanceNameOffsets;
|
---|
| 64 | __C89_NAMELESS union {
|
---|
| 65 | ULONG FixedInstanceSize;
|
---|
| 66 | OFFSETINSTANCEDATAANDLENGTH OffsetInstanceDataAndLength[1];
|
---|
| 67 | };
|
---|
| 68 | } WNODE_ALL_DATA,*PWNODE_ALL_DATA;
|
---|
| 69 |
|
---|
| 70 | typedef struct tagWNODE_SINGLE_INSTANCE {
|
---|
| 71 | struct _WNODE_HEADER WnodeHeader;
|
---|
| 72 | ULONG OffsetInstanceName;
|
---|
| 73 | ULONG InstanceIndex;
|
---|
| 74 | ULONG DataBlockOffset;
|
---|
| 75 | ULONG SizeDataBlock;
|
---|
| 76 | UCHAR VariableData[];
|
---|
| 77 | } WNODE_SINGLE_INSTANCE,*PWNODE_SINGLE_INSTANCE;
|
---|
| 78 |
|
---|
| 79 | typedef struct tagWNODE_SINGLE_ITEM {
|
---|
| 80 | struct _WNODE_HEADER WnodeHeader;
|
---|
| 81 | ULONG OffsetInstanceName;
|
---|
| 82 | ULONG InstanceIndex;
|
---|
| 83 | ULONG ItemId;
|
---|
| 84 | ULONG DataBlockOffset;
|
---|
| 85 | ULONG SizeDataItem;
|
---|
| 86 | UCHAR VariableData[];
|
---|
| 87 | } WNODE_SINGLE_ITEM,*PWNODE_SINGLE_ITEM;
|
---|
| 88 |
|
---|
| 89 | typedef struct tagWNODE_METHOD_ITEM {
|
---|
| 90 | struct _WNODE_HEADER WnodeHeader;
|
---|
| 91 | ULONG OffsetInstanceName;
|
---|
| 92 | ULONG InstanceIndex;
|
---|
| 93 | ULONG MethodId;
|
---|
| 94 | ULONG DataBlockOffset;
|
---|
| 95 | ULONG SizeDataBlock;
|
---|
| 96 | UCHAR VariableData[];
|
---|
| 97 | } WNODE_METHOD_ITEM,*PWNODE_METHOD_ITEM;
|
---|
| 98 |
|
---|
| 99 | typedef struct tagWNODE_EVENT_ITEM {
|
---|
| 100 | struct _WNODE_HEADER WnodeHeader;
|
---|
| 101 | } WNODE_EVENT_ITEM,*PWNODE_EVENT_ITEM;
|
---|
| 102 |
|
---|
| 103 | typedef struct tagWNODE_EVENT_REFERENCE {
|
---|
| 104 | struct _WNODE_HEADER WnodeHeader;
|
---|
| 105 | GUID TargetGuid;
|
---|
| 106 | ULONG TargetDataBlockSize;
|
---|
| 107 | __C89_NAMELESS union {
|
---|
| 108 | ULONG TargetInstanceIndex;
|
---|
| 109 | WCHAR TargetInstanceName[1];
|
---|
| 110 | };
|
---|
| 111 | } WNODE_EVENT_REFERENCE,*PWNODE_EVENT_REFERENCE;
|
---|
| 112 |
|
---|
| 113 | typedef struct tagWNODE_TOO_SMALL {
|
---|
| 114 | struct _WNODE_HEADER WnodeHeader;
|
---|
| 115 | ULONG SizeNeeded;
|
---|
| 116 | } WNODE_TOO_SMALL,*PWNODE_TOO_SMALL;
|
---|
| 117 |
|
---|
| 118 | typedef struct {
|
---|
| 119 | GUID Guid;
|
---|
| 120 | ULONG Flags;
|
---|
| 121 | ULONG InstanceCount;
|
---|
| 122 | __C89_NAMELESS union {
|
---|
| 123 | ULONG InstanceNameList;
|
---|
| 124 | ULONG BaseNameOffset;
|
---|
| 125 | ULONG_PTR Pdo;
|
---|
| 126 | ULONG_PTR InstanceInfo;
|
---|
| 127 | };
|
---|
| 128 | } WMIREGGUIDW,*PWMIREGGUIDW;
|
---|
| 129 |
|
---|
| 130 | typedef WMIREGGUIDW WMIREGGUID;
|
---|
| 131 | typedef PWMIREGGUIDW PWMIREGGUID;
|
---|
| 132 |
|
---|
| 133 | #define WMIREG_FLAG_EXPENSIVE 0x00000001
|
---|
| 134 | #define WMIREG_FLAG_INSTANCE_LIST 0x00000004
|
---|
| 135 | #define WMIREG_FLAG_INSTANCE_BASENAME 0x00000008
|
---|
| 136 | #define WMIREG_FLAG_INSTANCE_PDO 0x00000020
|
---|
| 137 | #define WMIREG_FLAG_REMOVE_GUID 0x00010000
|
---|
| 138 | #define WMIREG_FLAG_RESERVED1 0x00020000
|
---|
| 139 | #define WMIREG_FLAG_RESERVED2 0x00040000
|
---|
| 140 | #define WMIREG_FLAG_TRACED_GUID 0x00080000
|
---|
| 141 | #define WMIREG_FLAG_TRACE_CONTROL_GUID 0x00001000
|
---|
| 142 | #define WMIREG_FLAG_EVENT_ONLY_GUID 0x00000040
|
---|
| 143 |
|
---|
| 144 | typedef struct {
|
---|
| 145 | ULONG BufferSize;
|
---|
| 146 | ULONG NextWmiRegInfo;
|
---|
| 147 | ULONG RegistryPath;
|
---|
| 148 | ULONG MofResourceName;
|
---|
| 149 | ULONG GuidCount;
|
---|
| 150 | WMIREGGUIDW WmiRegGuid[];
|
---|
| 151 | } WMIREGINFOW,*PWMIREGINFOW;
|
---|
| 152 |
|
---|
| 153 | typedef WMIREGINFOW WMIREGINFO;
|
---|
| 154 | typedef PWMIREGINFOW PWMIREGINFO;
|
---|
| 155 |
|
---|
| 156 | typedef enum {
|
---|
| 157 | 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,
|
---|
| 158 | WMI_ENABLE_COLLECTION = 6,WMI_DISABLE_COLLECTION = 7,WMI_REGINFO = 8,WMI_EXECUTE_METHOD = 9,
|
---|
| 159 | WMI_CAPTURE_STATE = 10
|
---|
| 160 | } WMIDPREQUESTCODE;
|
---|
| 161 |
|
---|
| 162 | #if defined(_WINNT_) || defined(WINNT)
|
---|
| 163 |
|
---|
| 164 | #define WMI_GUIDTYPE_TRACECONTROL 0
|
---|
| 165 | #define WMI_GUIDTYPE_TRACE 1
|
---|
| 166 | #define WMI_GUIDTYPE_DATA 2
|
---|
| 167 | #define WMI_GUIDTYPE_EVENT 3
|
---|
| 168 |
|
---|
| 169 | #define WMIGUID_QUERY 0x0001
|
---|
| 170 | #define WMIGUID_SET 0x0002
|
---|
| 171 | #define WMIGUID_NOTIFICATION 0x0004
|
---|
| 172 | #define WMIGUID_READ_DESCRIPTION 0x0008
|
---|
| 173 | #define WMIGUID_EXECUTE 0x0010
|
---|
| 174 | #define TRACELOG_CREATE_REALTIME 0x0020
|
---|
| 175 | #define TRACELOG_CREATE_ONDISK 0x0040
|
---|
| 176 | #define TRACELOG_GUID_ENABLE 0x0080
|
---|
| 177 | #define TRACELOG_ACCESS_KERNEL_LOGGER 0x0100
|
---|
| 178 | #define TRACELOG_CREATE_INPROC 0x0200
|
---|
| 179 | #define TRACELOG_LOG_EVENT 0x0200
|
---|
| 180 | #define TRACELOG_ACCESS_REALTIME 0x0400
|
---|
| 181 | #define TRACELOG_REGISTER_GUIDS 0x0800
|
---|
| 182 | #define TRACELOG_JOIN_GROUP 0x1000
|
---|
| 183 |
|
---|
| 184 | #define WMIGUID_ALL_ACCESS_WIN2K (STANDARD_RIGHTS_READ | 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)
|
---|
| 185 | #define WMIGUID_ALL_ACCESS_WINXP (WMIGUID_ALL_ACCESS_WIN2K | SYNCHRONIZE | TRACELOG_REGISTER_GUIDS)
|
---|
| 186 | #define WMIGUID_ALL_ACCESS_RS1 (WMIGUID_ALL_ACCESS_WINXP | TRACELOG_JOIN_GROUP)
|
---|
| 187 |
|
---|
| 188 | #if (NTDDI_VERSION >= 0x0A000002)
|
---|
| 189 | #define WMIGUID_ALL_ACCESS WMIGUID_ALL_ACCESS_RS1
|
---|
| 190 | #elif (NTDDI_VERSION >= 0x05010000)
|
---|
| 191 | #define WMIGUID_ALL_ACCESS WMIGUID_ALL_ACCESS_WINXP
|
---|
| 192 | #else
|
---|
| 193 | #define WMIGUID_ALL_ACCESS WMIGUID_ALL_ACCESS_WIN2K
|
---|
| 194 | #endif
|
---|
| 195 |
|
---|
| 196 | #define WMI_GLOBAL_LOGGER_ID 0x0001
|
---|
| 197 | #endif
|
---|
| 198 | #endif
|
---|