Add wikipedia link to WMI.
[kai/samba-autobuild/.git] / source4 / librpc / idl / wmi.idl
1 /* 
2  * WMI IDL.  
3  * See http://en.wikipedia.org/wiki/Windows_Management_Instrumentation for more information.
4  */
5 #include "idl_types.h"
6
7 import "dcom.idl";
8
9 [
10         uuid("8BC3F05E-D86B-11d0-A075-00C04FB68820")
11 ] coclass WbemLevel1Login
12 {
13     interface IWbemLevel1Login;
14
15 };
16
17 [local, object, uuid("dc12a681-737f-11cf-884d-00aa004b2e24")]
18
19 interface IWbemClassObject : IUnknown
20 {
21
22         typedef struct {
23                 [value(0x72657355)] uint32 flags;
24                 [string, charset(UTF16)] uint16 data[];
25         } BSTR;
26
27     WERROR Delete(
28         [in, string, charset(UTF16)] uint16 *wszName
29         );
30
31 };
32
33 [
34         uuid("9556dc99-828c-11cf-a37e-00aa003240c7"),
35         object,
36         pointer_default(unique)
37 ] interface IWbemServices : IUnknown
38 {
39     typedef [v1_enum] enum
40     {
41         RPC_S_CALL_FAILED               = 1726,
42
43         WBEM_NO_ERROR = 0,
44         WBEM_S_NO_ERROR = 0,
45         WBEM_S_SAME = 0,
46         WBEM_S_FALSE = 1,
47         WBEM_S_ALREADY_EXISTS           = 0x40001,
48         WBEM_S_RESET_TO_DEFAULT         = 0x40002,
49         WBEM_S_DIFFERENT                = 0x40003,
50         WBEM_S_TIMEDOUT                 = 0x40004,
51         WBEM_S_NO_MORE_DATA             = 0x40005,
52         WBEM_S_OPERATION_CANCELLED      = 0x40006,
53         WBEM_S_PENDING                  = 0x40007,
54         WBEM_S_DUPLICATE_OBJECTS        = 0x40008,
55         WBEM_S_ACCESS_DENIED            = 0x40009,
56         WBEM_S_PARTIAL_RESULTS          = 0x40010,
57         WBEM_S_NO_POSTHOOK              = 0x40011,
58         WBEM_S_POSTHOOK_WITH_BOTH       = 0x40012,
59         WBEM_S_POSTHOOK_WITH_NEW        = 0x40013,
60         WBEM_S_POSTHOOK_WITH_STATUS     = 0x40014,
61         WBEM_S_POSTHOOK_WITH_OLD        = 0x40015,
62         WBEM_S_REDO_PREHOOK_WITH_ORIGINAL_OBJECT = 0x40016,
63         WBEM_S_SOURCE_NOT_AVAILABLE     = 0x40017,
64         WBEM_E_FAILED                           = 0x80041001,
65         WBEM_E_NOT_FOUND                        = 0x80041002,
66         WBEM_E_ACCESS_DENIED                    = 0x80041003,
67         WBEM_E_PROVIDER_FAILURE                 = 0x80041004,
68         WBEM_E_TYPE_MISMATCH                    = 0x80041005,
69         WBEM_E_OUT_OF_MEMORY                    = 0x80041006,
70         WBEM_E_INVALID_CONTEXT                  = 0x80041007,
71         WBEM_E_INVALID_PARAMETER                = 0x80041008,
72         WBEM_E_NOT_AVAILABLE                    = 0x80041009,
73         WBEM_E_CRITICAL_ERROR                   = 0x8004100A,
74         WBEM_E_INVALID_STREAM                   = 0x8004100B,
75         WBEM_E_NOT_SUPPORTED                    = 0x8004100C,
76         WBEM_E_INVALID_SUPERCLASS               = 0x8004100D,
77         WBEM_E_INVALID_NAMESPACE                = 0x8004100E,
78         WBEM_E_INVALID_OBJECT                   = 0x8004100F,
79         WBEM_E_INVALID_CLASS                    = 0x80041010,
80         WBEM_E_PROVIDER_NOT_FOUND               = 0x80041011,
81         WBEM_E_INVALID_PROVIDER_REGISTRATION    = 0x80041012,
82         WBEM_E_PROVIDER_LOAD_FAILURE            = 0x80041013,
83         WBEM_E_INITIALIZATION_FAILURE           = 0x80041014,
84         WBEM_E_TRANSPORT_FAILURE                = 0x80041015,
85         WBEM_E_INVALID_OPERATION                = 0x80041016,
86         WBEM_E_INVALID_QUERY                    = 0x80041017,
87         WBEM_E_INVALID_QUERY_TYPE               = 0x80041018,
88         WBEM_E_ALREADY_EXISTS                   = 0x80041019,
89         WBEM_E_OVERRIDE_NOT_ALLOWED             = 0x8004101A,
90         WBEM_E_PROPAGATED_QUALIFIER             = 0x8004101B,
91         WBEM_E_PROPAGATED_PROPERTY              = 0x8004101C,
92         WBEM_E_UNEXPECTED                       = 0x8004101D,
93         WBEM_E_ILLEGAL_OPERATION                = 0x8004101E,
94         WBEM_E_CANNOT_BE_KEY                    = 0x8004101F,
95         WBEM_E_INCOMPLETE_CLASS                 = 0x80041020,
96         WBEM_E_INVALID_SYNTAX                   = 0x80041021,
97         WBEM_E_NONDECORATED_OBJECT              = 0x80041022,
98         WBEM_E_READ_ONLY                        = 0x80041023,
99         WBEM_E_PROVIDER_NOT_CAPABLE             = 0x80041024,
100         WBEM_E_CLASS_HAS_CHILDREN               = 0x80041025,
101         WBEM_E_CLASS_HAS_INSTANCES              = 0x80041026,
102         WBEM_E_QUERY_NOT_IMPLEMENTED            = 0x80041027,
103         WBEM_E_ILLEGAL_NULL                     = 0x80041028,
104         WBEM_E_INVALID_QUALIFIER_TYPE           = 0x80041029,
105         WBEM_E_INVALID_PROPERTY_TYPE            = 0x8004102A,
106         WBEM_E_VALUE_OUT_OF_RANGE               = 0x8004102B,
107         WBEM_E_CANNOT_BE_SINGLETON              = 0x8004102C,
108         WBEM_E_INVALID_CIM_TYPE                 = 0x8004102D,
109         WBEM_E_INVALID_METHOD                   = 0x8004102E,
110         WBEM_E_INVALID_METHOD_PARAMETERS        = 0x8004102F,
111         WBEM_E_SYSTEM_PROPERTY                  = 0x80041030,
112         WBEM_E_INVALID_PROPERTY                 = 0x80041031,
113         WBEM_E_CALL_CANCELLED                   = 0x80041032,
114         WBEM_E_SHUTTING_DOWN                    = 0x80041033,
115         WBEM_E_PROPAGATED_METHOD                = 0x80041034,
116         WBEM_E_UNSUPPORTED_PARAMETER            = 0x80041035,
117         WBEM_E_MISSING_PARAMETER_ID             = 0x80041036,
118         WBEM_E_INVALID_PARAMETER_ID             = 0x80041037,
119         WBEM_E_NONCONSECUTIVE_PARAMETER_IDS     = 0x80041038,
120         WBEM_E_PARAMETER_ID_ON_RETVAL           = 0x80041039,
121         WBEM_E_INVALID_OBJECT_PATH              = 0x8004103A,
122         WBEM_E_OUT_OF_DISK_SPACE                = 0x8004103B,
123         WBEM_E_BUFFER_TOO_SMALL                 = 0x8004103C,
124         WBEM_E_UNSUPPORTED_PUT_EXTENSION        = 0x8004103D,
125         WBEM_E_UNKNOWN_OBJECT_TYPE              = 0x8004103E,
126         WBEM_E_UNKNOWN_PACKET_TYPE              = 0x8004103F,
127         WBEM_E_MARSHAL_VERSION_MISMATCH         = 0x80041040,
128         WBEM_E_MARSHAL_INVALID_SIGNATURE        = 0x80041041,
129         WBEM_E_INVALID_QUALIFIER                = 0x80041042,
130         WBEM_E_INVALID_DUPLICATE_PARAMETER      = 0x80041043,
131         WBEM_E_TOO_MUCH_DATA                    = 0x80041044,
132         WBEM_E_SERVER_TOO_BUSY                  = 0x80041045,
133         WBEM_E_INVALID_FLAVOR                   = 0x80041046,
134         WBEM_E_CIRCULAR_REFERENCE               = 0x80041047,
135         WBEM_E_UNSUPPORTED_CLASS_UPDATE         = 0x80041048,
136         WBEM_E_CANNOT_CHANGE_KEY_INHERITANCE    = 0x80041049,
137         WBEM_E_CANNOT_CHANGE_INDEX_INHERITANCE  = 0x80041050,
138         WBEM_E_TOO_MANY_PROPERTIES              = 0x80041051,
139         WBEM_E_UPDATE_TYPE_MISMATCH             = 0x80041052,
140         WBEM_E_UPDATE_OVERRIDE_NOT_ALLOWED      = 0x80041053,
141         WBEM_E_UPDATE_PROPAGATED_METHOD         = 0x80041054,
142         WBEM_E_METHOD_NOT_IMPLEMENTED           = 0x80041055,
143         WBEM_E_METHOD_DISABLED                  = 0x80041056,
144         WBEM_E_REFRESHER_BUSY                   = 0x80041057,
145         WBEM_E_UNPARSABLE_QUERY                 = 0x80041058,
146         WBEM_E_NOT_EVENT_CLASS                  = 0x80041059,
147         WBEM_E_MISSING_GROUP_WITHIN             = 0x8004105A,
148         WBEM_E_MISSING_AGGREGATION_LIST         = 0x8004105B,
149         WBEM_E_PROPERTY_NOT_AN_OBJECT           = 0x8004105C,
150         WBEM_E_AGGREGATING_BY_OBJECT            = 0x8004105D,
151         WBEM_E_UNINTERPRETABLE_PROVIDER_QUERY   = 0x8004105F,
152         WBEM_E_BACKUP_RESTORE_WINMGMT_RUNNING   = 0x80041060,
153         WBEM_E_QUEUE_OVERFLOW                   = 0x80041061,
154         WBEM_E_PRIVILEGE_NOT_HELD               = 0x80041062,
155         WBEM_E_INVALID_OPERATOR                 = 0x80041063,
156         WBEM_E_LOCAL_CREDENTIALS                = 0x80041064,
157         WBEM_E_CANNOT_BE_ABSTRACT               = 0x80041065,
158         WBEM_E_AMENDED_OBJECT                   = 0x80041066,
159         WBEM_E_CLIENT_TOO_SLOW                  = 0x80041067,
160         WBEM_E_NULL_SECURITY_DESCRIPTOR         = 0x80041068,
161         WBEM_E_TIMED_OUT                        = 0x80041069,
162         WBEM_E_INVALID_ASSOCIATION              = 0x8004106A,
163         WBEM_E_AMBIGUOUS_OPERATION              = 0x8004106B,
164         WBEM_E_QUOTA_VIOLATION                  = 0x8004106C,
165         WBEM_E_RESERVED_001                     = 0x8004106D,
166         WBEM_E_RESERVED_002                     = 0x8004106E,
167         WBEM_E_UNSUPPORTED_LOCALE               = 0x8004106F,
168         WBEM_E_HANDLE_OUT_OF_DATE               = 0x80041070,
169         WBEM_E_CONNECTION_FAILED                = 0x80041071,
170         WBEM_E_INVALID_HANDLE_REQUEST           = 0x80041072,
171         WBEM_E_PROPERTY_NAME_TOO_WIDE           = 0x80041073,
172         WBEM_E_CLASS_NAME_TOO_WIDE              = 0x80041074,
173         WBEM_E_METHOD_NAME_TOO_WIDE             = 0x80041075,
174         WBEM_E_QUALIFIER_NAME_TOO_WIDE          = 0x80041076,
175         WBEM_E_RERUN_COMMAND                    = 0x80041077,
176         WBEM_E_DATABASE_VER_MISMATCH            = 0x80041078,
177         WBEM_E_VETO_DELETE                      = 0x80041079,
178         WBEM_E_VETO_PUT                         = 0x8004107A,
179         WBEM_E_INVALID_LOCALE                   = 0x80041080,
180         WBEM_E_PROVIDER_SUSPENDED               = 0x80041081,
181         WBEM_E_SYNCHRONIZATION_REQUIRED         = 0x80041082,
182         WBEM_E_NO_SCHEMA                        = 0x80041083,
183         WBEM_E_PROVIDER_ALREADY_REGISTERED      = 0x80041084,
184         WBEM_E_PROVIDER_NOT_REGISTERED          = 0x80041085,
185         WBEM_E_FATAL_TRANSPORT_ERROR            = 0x80041086,
186         WBEM_E_ENCRYPTED_CONNECTION_REQUIRED    = 0x80041087,
187         WBEM_E_PROVIDER_TIMED_OUT               = 0x80041088,
188         WBEM_E_NO_KEY                           = 0x80041089,
189         WBEM_E_PROVIDER_DISABLED                = 0x8004108a
190     }   WBEMSTATUS;
191
192     typedef [public,noprint] enum
193     {
194         WBEM_FLAG_RETURN_IMMEDIATELY = 0x10,
195         WBEM_FLAG_RETURN_WBEM_COMPLETE = 0,
196         WBEM_FLAG_BIDIRECTIONAL = 0,
197         WBEM_FLAG_FORWARD_ONLY = 0x20,
198         WBEM_FLAG_NO_ERROR_OBJECT = 0x40,
199         WBEM_FLAG_RETURN_ERROR_OBJECT = 0,
200         WBEM_FLAG_SEND_STATUS = 0x80,
201         WBEM_FLAG_DONT_SEND_STATUS = 0,
202         WBEM_FLAG_ENSURE_LOCATABLE = 0x100,
203         WBEM_FLAG_DIRECT_READ = 0x200,
204         WBEM_FLAG_SEND_ONLY_SELECTED = 0,
205
206         WBEM_RETURN_WHEN_COMPLETE = 0,
207         WBEM_RETURN_IMMEDIATELY = 0x10,
208
209         WBEM_MASK_RESERVED_FLAGS = 0x1F000,
210
211         WBEM_FLAG_USE_AMENDED_QUALIFIERS = 0x20000,
212
213         WBEM_FLAG_STRONG_VALIDATION = 0x100000
214
215     } WBEM_GENERIC_FLAG_TYPE;
216
217     typedef [public,noprint,v1_enum] enum tag_WBEM_TIMEOUT_TYPE
218     {
219         WBEM_NO_WAIT = 0,
220         WBEM_INFINITE = 0xFFFFFFFF
221     } WBEM_TIMEOUT_TYPE;
222
223     typedef [public,v1_enum] enum
224     {
225         CIM_EMPTY = 0,
226
227         CIM_SINT8 = 16,
228         CIM_UINT8 = 17,
229         CIM_SINT16 = 2,
230         CIM_UINT16 = 18,
231         CIM_SINT32 = 3,
232         CIM_UINT32 = 19,
233         CIM_SINT64 = 20,
234         CIM_UINT64 = 21,
235         CIM_REAL32 = 4,
236         CIM_REAL64 = 5,
237         CIM_BOOLEAN = 11,
238         CIM_STRING = 8,
239         CIM_DATETIME = 101,
240         CIM_REFERENCE = 102,
241         CIM_CHAR16 = 103,
242         CIM_OBJECT = 13,
243
244         CIM_FLAG_ARRAY = 0x2000,
245
246         CIM_ARR_SINT8 = CIM_FLAG_ARRAY | CIM_SINT8,
247         CIM_ARR_UINT8 = CIM_FLAG_ARRAY | CIM_UINT8,
248         CIM_ARR_SINT16 = CIM_FLAG_ARRAY | CIM_SINT16,
249         CIM_ARR_UINT16 = CIM_FLAG_ARRAY | CIM_UINT16,
250         CIM_ARR_SINT32 = CIM_FLAG_ARRAY | CIM_SINT32,
251         CIM_ARR_UINT32 = CIM_FLAG_ARRAY | CIM_UINT32,
252         CIM_ARR_SINT64 = CIM_FLAG_ARRAY | CIM_SINT64,
253         CIM_ARR_UINT64 = CIM_FLAG_ARRAY | CIM_UINT64,
254         CIM_ARR_REAL32 = CIM_FLAG_ARRAY | CIM_REAL32,
255         CIM_ARR_REAL64 = CIM_FLAG_ARRAY | CIM_REAL64,
256         CIM_ARR_BOOLEAN = CIM_FLAG_ARRAY | CIM_BOOLEAN,
257         CIM_ARR_STRING = CIM_FLAG_ARRAY | CIM_STRING,
258         CIM_ARR_DATETIME = CIM_FLAG_ARRAY | CIM_DATETIME,
259         CIM_ARR_REFERENCE = CIM_FLAG_ARRAY | CIM_REFERENCE,
260         CIM_ARR_CHAR16 = CIM_FLAG_ARRAY | CIM_CHAR16,
261         CIM_ARR_OBJECT = CIM_FLAG_ARRAY | CIM_OBJECT,
262
263         CIM_ILLEGAL = 0xfff,
264         CIM_TYPEMASK = 0x2FFF
265     } CIMTYPE_ENUMERATION;
266
267     typedef [public] struct {
268         uint32 count;
269         int8 item[count];
270     } arr_int8;
271
272     typedef [public] struct {
273         uint32 count;
274         uint8 item[count];
275     } arr_uint8;
276
277     typedef [public] struct {
278         uint32 count;
279         int16 item[count];
280     } arr_int16;
281
282     typedef [public] struct {
283         uint32 count;
284         uint16 item[count];
285     } arr_uint16;
286
287     typedef [public] struct {
288         uint32 count;
289         int32 item[count];
290     } arr_int32;
291
292     typedef [public] struct {
293         uint32 count;
294         uint32 item[count];
295     } arr_uint32;
296
297     typedef [public] struct {
298         uint32 count;
299         dlong item[count];
300     } arr_dlong;
301
302     typedef [public] struct {
303         uint32 count;
304         udlong item[count];
305     } arr_udlong;
306
307     typedef [public] struct {
308         uint32 count;
309         [relative,charset(UTF16)] uint16 *item[count];
310     } arr_CIMSTRING;
311
312     typedef [public] struct {
313         uint32 count;
314         [relative,subcontext(4)] WbemClassObject *item[count];
315     } arr_WbemClassObject;
316
317 // FIXME:avg implement rest of types
318     typedef [public,nodiscriminant] union
319     {
320         [case(CIM_SINT8)] int8 v_sint8;
321         [case(CIM_UINT8)] uint8 v_uint8;
322         [case(CIM_SINT16)] int16 v_sint16;
323         [case(CIM_UINT16)] uint16 v_uint16;
324         [case(CIM_SINT32)] int32 v_sint32;
325         [case(CIM_UINT32)] uint32 v_uint32;
326         [case(CIM_SINT64)] dlong v_sint64;
327         [case(CIM_UINT64)] udlong v_uint64;
328         [case(CIM_REAL32)] uint32 v_real32;
329         [case(CIM_REAL64)] udlong v_real64;
330         [case(CIM_BOOLEAN)] uint16 v_boolean;
331         [case(CIM_STRING),relative,charset(UTF16)] uint16 *v_string;
332         [case(CIM_DATETIME),relative,charset(UTF16)] uint16 *v_datetime;
333         [case(CIM_REFERENCE),relative,charset(UTF16)] uint16 *v_reference;
334         [case(CIM_OBJECT),subcontext(4),relative] WbemClassObject *v_object;
335
336         [case(CIM_ARR_SINT8),relative] arr_int8 *a_sint8;
337         [case(CIM_ARR_UINT8),relative] arr_uint8 *a_uint8;
338         [case(CIM_ARR_SINT16),relative] arr_int16 *a_sint16;
339         [case(CIM_ARR_UINT16),relative] arr_uint16 *a_uint16;
340         [case(CIM_ARR_SINT32),relative] arr_int32 *a_sint32;
341         [case(CIM_ARR_UINT32),relative] arr_uint32 *a_uint32;
342         [case(CIM_ARR_SINT64),relative] arr_dlong *a_sint64;
343         [case(CIM_ARR_UINT64),relative] arr_udlong *a_uint64;
344         [case(CIM_ARR_REAL32),relative] arr_uint32 *a_real32;
345         [case(CIM_ARR_REAL64),relative] arr_udlong *a_real64;
346         [case(CIM_ARR_BOOLEAN),relative] arr_uint16 *a_boolean;
347         [case(CIM_ARR_STRING),relative] arr_CIMSTRING *a_string;
348         [case(CIM_ARR_DATETIME),relative] arr_CIMSTRING *a_datetime;
349         [case(CIM_ARR_REFERENCE),relative] arr_CIMSTRING *a_reference;
350         [case(CIM_ARR_OBJECT),relative] arr_WbemClassObject *a_object;
351     } CIMVAR;
352
353     typedef [public,bitmap8bit] bitmap
354     {
355         WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE = 0x1,
356         WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS = 0x2,
357 //        WBEM_FLAVOR_MASK_PROPAGATION = 0x0F,
358
359         WBEM_FLAVOR_NOT_OVERRIDABLE = 0x10,
360 //        WBEM_FLAVOR_MASK_PERMISSIONS = 0x10,
361
362         WBEM_FLAVOR_ORIGIN_PROPAGATED = 0x20,
363         WBEM_FLAVOR_ORIGIN_SYSTEM = 0x40,
364 //        WBEM_FLAVOR_MASK_ORIGIN = 0x60,
365
366         WBEM_FLAVOR_AMENDED = 0x80
367 //        WBEM_FLAVOR_MASK_AMENDED = 0x80
368
369     } WBEM_FLAVOR_TYPE;
370
371     typedef [public,bitmap8bit] bitmap
372     {
373         WCF_DECORATIONS = 1,
374         WCF_INSTANCE = 2,
375         WCF_CLASS = 4,
376         WCF_CLASS_PART_INTERNAL = 8
377 //      WCF_CLASS_PART_SHARED = 0x104
378     } WCO_FLAGS;
379
380     typedef [public,nopush,nopull] struct
381     {
382         [relative,charset(UTF16)] uint16 *name;
383         WBEM_FLAVOR_TYPE flavors;
384         CIMTYPE_ENUMERATION cimtype;
385         [switch_is(cimtype)] CIMVAR value;
386     } WbemQualifier;
387
388     typedef [public,nopush,nopull] struct
389     {
390         uint32 count;
391         [ref] WbemQualifier* item[count];
392     } WbemQualifiers;
393
394     typedef [public] struct
395     {
396         uint32 cimtype;
397         uint16 nr;
398         uint32 offset;
399         uint32 depth;
400         WbemQualifiers qualifiers;
401     } WbemPropertyDesc;
402
403     typedef [public] struct
404     {
405         [relative,charset(UTF16)] uint16 *name;
406         [relative] WbemPropertyDesc *desc;
407     } WbemProperty;
408
409     typedef [public,nopull,nopush] struct
410     {
411         uint32 count;
412         [ref,charset(UTF16)] uint16 *item[count];
413     } CIMSTRINGS;
414
415     typedef [public,bitmap8bit] bitmap {
416         DEFAULT_FLAG_EMPTY = 1,
417         DEFAULT_FLAG_INHERITED = 2
418     } DEFAULT_FLAGS;
419
420     typedef [public,nopush,nopull,noprint,flag(NDR_NOALIGN)] struct
421     {
422         uint8 u_0;
423         [relative, null_is_ffffffff,charset(UTF16)] uint16 *__CLASS;
424         uint32 data_size;
425         CIMSTRINGS __DERIVATION;
426         WbemQualifiers qualifiers;
427         uint32 __PROPERTY_COUNT;
428         WbemProperty properties[__PROPERTY_COUNT];
429         uint8 default_flags[__PROPERTY_COUNT];
430         uint32 /*CIMVAR*/ default_values[__PROPERTY_COUNT];
431     } WbemClass;
432
433     typedef [public] struct
434     {
435         [relative,null_is_ffffffff,charset(UTF16)] uint16 *name;
436         uint32 u0;
437         uint32 u1;
438         [relative] WbemQualifiers *qualifiers;
439         [subcontext(4),relative] WbemClassObject *in;
440         [subcontext(4),relative] WbemClassObject *out;
441     } WbemMethod;
442
443     typedef [public,flag(NDR_NOALIGN)] struct
444     {
445         uint16 count;
446         uint16 u0; // It has value 5F5F if there are no methods
447         WbemMethod method[count];
448     } WbemMethods;
449
450     typedef [public,flag(NDR_NOALIGN),nopush,nopull,noprint] struct
451     {
452         uint8 u1_0;
453         [relative,charset(UTF16)] uint16 *__CLASS;
454         uint8 *default_flags;
455         uint32 /*CIMVAR*/ *data;
456         uint32 u2_4;
457         uint8 u3_1;
458     } WbemInstance;
459
460     typedef [public,nopush,nopull,noprint,flag(NDR_NOALIGN)] struct
461     {
462         WCO_FLAGS flags;
463         [ref,charset(UTF16)] uint16 *__SERVER;
464         [ref,charset(UTF16)] uint16 *__NAMESPACE;
465         WbemClass *sup_class;
466         WbemMethods *sup_methods;
467         WbemClass *obj_class;
468         WbemMethods *obj_methods;
469         WbemInstance *instance;
470     } WbemClassObject;
471
472 //    typedef [public] struct {
473 //      [value(0x72657355)] uint32 fFlags;
474 //      uint32 clSize;
475 //      [value(2*clSize)] uint32 _bsize;
476 //      [value(clSize)] uint32 _wsize;
477 //      [flag(NDR_NOALIGN)] uint16 asData[clSize];
478 //    } BSTR1;
479     //typedef [public,nopush,nopull,noprint,string,charset(UTF16)] uint16 *BSTR;
480
481     WERROR OpenNamespace(
482 //        [in] BSTR *strNamespace,
483 //        [in]  int32 lFlags
484 //        [in]  IWbemContext* pCtx,
485 //        [out] IWbemServices** ppWorkingNamespace,
486 //        [out] IWbemCallResult** ppResult
487         );
488
489     WERROR CancelAsyncCall(
490 //        [in] IWbemObjectSink* pSink
491         );
492
493     WERROR QueryObjectSink(
494 //        [in] long lFlags
495 //        [out] IWbemObjectSink** ppResponseHandler
496         );
497
498     // Classes and instances.
499     // ======================
500
501     WERROR GetObject(
502         [in] BSTR strObjectPath,
503         [in]  long lFlags,
504         [in,unique]  IWbemContext* pCtx,
505 //        [in,out,unique] IUnknown** ppObject,
506 //        [in,out,unique] IUnknown** ppCallResult
507         [in,out,unique] IWbemClassObject** ppObject,
508         [in,out,unique] IWbemCallResult** ppCallResult
509         );
510
511     WERROR GetObjectAsync(
512 //        [in] BSTR strObjectPath,
513 //        [in]  long lFlags
514 //        [in]  IWbemContext* pCtx,
515 //        [in]  IWbemObjectSink* pResponseHandler
516         );
517
518     WERROR PutClass(
519 //        [in] IWbemClassObject* pObject,
520 //        [in] long lFlags
521 //        [in]  IWbemContext* pCtx,
522 //        [out, OPTIONAL] IWbemCallResult** ppCallResult
523         );
524
525     WERROR PutClassAsync(
526 //        [in] IWbemClassObject* pObject,
527 //        [in] long lFlags
528 //        [in] IWbemContext* pCtx,
529 //        [in] IWbemObjectSink* pResponseHandler
530         );
531
532     WERROR DeleteClass(
533 //        [in] BSTR strClass,
534 //        [in] long lFlags
535 //        [in]  IWbemContext* pCtx,
536 //        [out, OPTIONAL] IWbemCallResult** ppCallResult
537         );
538
539     WERROR DeleteClassAsync(
540 //        [in] BSTR strClass,
541 //        [in] long lFlags
542 //        [in] IWbemContext* pCtx,
543 //        [in] IWbemObjectSink* pResponseHandler
544         );
545
546     WERROR CreateClassEnum(
547 //        [in] BSTR strSuperclass,
548 //        [in]  long lFlags
549 //        [in]  IWbemContext* pCtx,
550 //        [out] IEnumWbemClassObject** ppEnum
551         );
552
553     WERROR CreateClassEnumAsync(
554 //        [in] BSTR strSuperclass,
555 //        [in]  long lFlags
556 //        [in]  IWbemContext* pCtx,
557 //        [in]  IWbemObjectSink* pResponseHandler
558         );
559
560     WERROR PutInstance(
561 //        [in] IWbemClassObject* pInst,
562 //        [in] long lFlags
563 //        [in]  IWbemContext* pCtx,
564 //        [out, OPTIONAL] IWbemCallResult** ppCallResult
565         );
566
567     WERROR PutInstanceAsync(
568 //        [in] IWbemClassObject* pInst,
569 //        [in] long lFlags
570 //        [in] IWbemContext* pCtx,
571 //        [in] IWbemObjectSink* pResponseHandler
572         );
573
574     WERROR DeleteInstance(
575 //        [in] BSTR strObjectPath,
576 //        [in] long lFlags
577 //        [in]  IWbemContext* pCtx,
578 //        [out, OPTIONAL] IWbemCallResult** ppCallResult
579         );
580
581     WERROR DeleteInstanceAsync(
582 //        [in] BSTR strObjectPath,
583 //        [in] long lFlags
584 //        [in] IWbemContext* pCtx,
585 //        [in] IWbemObjectSink* pResponseHandler
586         );
587
588     WERROR CreateInstanceEnum(
589         [in] BSTR strFilter,          // allow more things than a class name
590         [in] long lFlags,
591         [in,unique]  IWbemContext* pCtx,
592         [out] IEnumWbemClassObject** ppEnum
593         );
594
595     WERROR CreateInstanceEnumAsync(
596 //        [in] BSTR strFilter,          // allow more things than a class name
597 //        [in] long lFlags
598 //        [in] IWbemContext* pCtx,
599 //        [in] IWbemObjectSink* pResponseHandler
600         );
601
602     WERROR ExecQuery(
603         [in] BSTR strQueryLanguage,
604         [in] BSTR strQuery,
605         [in]  long lFlags,
606         [in,unique]  IWbemContext* pCtx,
607         [out] IEnumWbemClassObject** ppEnum
608         );
609
610     WERROR ExecQueryAsync(
611 //        [in] BSTR strQueryLanguage,
612 //        [in] BSTR strQuery,
613 //        [in] long lFlags
614 //        [in] IWbemContext* pCtx,
615 //        [in] IWbemObjectSink* pResponseHandler
616         );
617
618
619     WERROR ExecNotificationQuery(
620         [in] BSTR strQueryLanguage,
621         [in] BSTR strQuery,
622         [in] long lFlags,
623         [in,unique]  IWbemContext* pCtx,
624         [out] IEnumWbemClassObject** ppEnum
625         );
626
627     WERROR ExecNotificationQueryAsync(
628 //        [in] BSTR strQueryLanguage,
629 //        [in] BSTR strQuery,
630 //        [in] long lFlags
631 //        [in] IWbemContext* pCtx,
632 //        [in] IWbemObjectSink* pResponseHandler
633         );
634
635     // Methods
636     // =======
637
638     WERROR ExecMethod(
639         [in] BSTR strObjectPath,
640         [in] BSTR strMethodName,
641         [in] long lFlags,
642         [in,unique] IWbemContext* pCtx,
643         [in,unique] IWbemClassObject* pInParams,
644         [in,out,unique] IWbemClassObject** ppOutParams,
645         [in,out,unique] IWbemCallResult** ppCallResult
646         );
647
648     WERROR ExecMethodAsync(
649 //        [in] BSTR strObjectPath,
650 //        [in] BSTR strMethodName,
651 //        [in] long lFlags
652 //        [in] IWbemContext* pCtx,
653 //        [in] IWbemClassObject* pInParams,
654 //        [in] IWbemObjectSink* pResponseHandler
655         );
656 }
657
658 [
659         object, 
660         uuid(027947e1-d731-11ce-a357-000000000001),
661         pointer_default(unique)
662 ] interface IEnumWbemClassObject : IUnknown
663 {
664     WERROR Reset();
665
666     [call_as(Next)] WERROR IEnumWbemClassObject_Next(
667         [in]  int32 lTimeout,
668         [in]  uint32 uCount,
669         [out, size_is(uCount), length_is(*puReturned)]
670                 IWbemClassObject** apObjects,
671         [out] uint32* puReturned
672         );
673
674     WERROR NextAsync(
675 //        [in]  ULONG uCount
676 //        [in]  IWbemObjectSink* pSink
677         );
678
679     WERROR IEnumWbemClassObject_Clone(
680 //        [out] IEnumWbemClassObject** ppEnum
681         );
682
683     WERROR Skip(
684 //        [in]  long lTimeout,
685 //        [in] ULONG nCount
686         );
687 };
688
689 [
690         object, 
691         local, 
692         uuid("44aca674-e8fc-11d0-a07c-00c04fb68820"),
693         pointer_default(unique)
694 ] interface IWbemContext : IUnknown
695 {
696     WERROR Clone([out] IWbemContext** ppNewCopy);
697
698     WERROR GetNames(
699 //        [in] long lFlags,
700 //        [out] SAFEARRAY (BSTR)* pNames
701         );
702
703     WERROR BeginEnumeration([in] long lFlags);
704
705     WERROR Next(
706 //        [in]  long lFlags,
707 //        [out] BSTR* pstrName,
708 //        [out] VARIANT* pValue
709         );
710
711     WERROR EndEnumeration();
712
713
714     WERROR SetValue(
715 //        [in, string] LPCWSTR wszName,
716 //        [in] long lFlags
717 //        [in] VARIANT* pValue
718         );
719
720     WERROR GetValue(
721 //        [in, string] LPCWSTR wszName,
722 //        [in] long lFlags,
723 //        [out] VARIANT* pValue
724         );
725
726     WERROR DeleteValue(
727 //        [in, string] LPCWSTR wszName,
728 //        [in] long lFlags
729         );
730
731     WERROR DeleteAll();
732 }
733
734 [
735         object,
736         uuid("F309AD18-D86A-11d0-A075-00C04FB68820"),
737         pointer_default(unique)
738 ] interface IWbemLevel1Login :  IUnknown
739 {
740     WERROR EstablishPosition(
741 //        [in, unique, string] LPWSTR wszClientMachineName,
742 //        [in] uint32 dwProcessId,
743 //        [out] uint32* phAuthEventHandle
744         );
745
746     WERROR RequestChallenge(
747 //        [in, unique, string] LPWSTR wszNetworkResource,
748 //        [in, unique, string] LPWSTR wszUser,
749 //        [out] WBEM_128BITS Nonce
750         );
751
752     WERROR WBEMLogin(
753 //        [in, unique, string] LPWSTR wszPreferredLocale,
754 //        [in, unique]  WBEM_128BITS AccessToken,
755 //        [in]   long lFlags
756 //        [in]   IWbemContext* pCtx,
757 //        [out]  IWbemServices** ppNamespace
758         );
759
760     WERROR NTLMLogin(
761           [in,unique,string,charset(UTF16)] uint16 *wszNetworkResource,
762           [in,unique,string,charset(UTF16)] uint16 *wszPreferredLocale,
763           [in]   long lFlags,
764           [in,unique]   IWbemContext* pCtx,
765           [out,ref]  IWbemServices** ppNamespace
766         );
767
768 }
769
770 [
771         object,
772         uuid("423ec01e-2e35-11d2-b604-00104b703efd"),
773         pointer_default(unique)
774 ] interface IWbemWCOSmartEnum : IUnknown
775 {
776     typedef struct {
777         uint32 size;
778         char data[size];
779     } WBEMDATA;
780
781     typedef enum {
782         WTYPE_SCHEMA = 1,
783         WTYPE_CLASS = 2,
784         WTYPE_OBJECT = 3
785     } WTYPES;
786
787     typedef [relative_base] struct {
788 //      [relative] WBEMDATA4 *data; /* 0x9 */
789         uint32 data_size;
790         uint8 wtype;
791     } WBEMDATA4;
792
793     typedef [relative_base] struct {
794         [relative] WBEMDATA4 *data; /* 0x9 */
795         uint32 data_size;
796         uint8 wtype;
797     } WBEMDATA3;
798
799     typedef [relative_base] struct {
800         [relative,size_is(obj_num)] WBEMDATA3 *data; /* 0x8 */
801         uint32 data_size;
802         uint32 obj_num;
803     } WBEMDATA2;
804
805     typedef [relative_base] struct {
806         [relative] WBEMDATA2 *data; /* 0x8 */
807         uint32 data_size;
808     } WBEMDATA1;
809
810     typedef [relative_base] struct {
811         uint32 u1_0; /* 0 */
812         hyper signature; /* 'WBEMDATA' */
813         [relative] WBEMDATA1 *data; /* 0x1A */
814         uint32 data_size;
815         uint32 u2_0; /* 0 */
816         uint8 ver_major; /* 1 */
817         uint8 ver_minor; /* 0 - Win2000, 1 - WinXP/2003 */
818     } WBEMDATA0;
819
820     WERROR IWbemWCOSmartEnum_Next(
821           [in,ref] GUID *gEWCO,
822           [in] uint32 lTimeOut,
823           [in] uint32 uCount,
824 //        [in] uint32 unknown,
825 //        [in,ref] GUID *gWCO,
826           [out,ref] uint32 *puReturned,
827           [out,ref] uint32 *pSize,
828 //        [out,ref] WBEMDATA0 **pData
829           [out,ref,noprint,size_is(,*pSize)] uint8 **pData
830         );
831 }
832
833 [
834         object,
835         uuid("1c1c45ee-4395-11d2-b60b-00104b703efd"),
836         pointer_default(unique)
837 ] interface IWbemFetchSmartEnum : IUnknown
838 {
839     WERROR Fetch(
840           [out] IWbemWCOSmartEnum** ppEnum
841         );
842     WERROR Test(
843           [out] WbemClassObject** ppEnum
844         );
845 }
846
847 [
848         object,
849 //      restricted,
850         uuid(44aca675-e8fc-11d0-a07c-00c04fb68820)
851 ] interface IWbemCallResult : IUnknown
852 {
853     WERROR GetResultObject(
854         [in]  long lTimeout,
855         [out] IUnknown** ppResultObject
856 //        [out] IWbemClassObject** ppResultObject
857         );
858
859     WERROR GetResultString(
860         [in]  long lTimeout
861 //        [out] BSTR* pstrResultString
862         );
863
864     WERROR GetResultServices(
865         [in]  long lTimeout,
866         [out] IWbemServices** ppServices
867         );
868
869     WERROR GetCallStatus(
870         [in]  long lTimeout,
871         [out] long* plStatus
872         );
873 }
874