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