1# Copyright (c) 2003-2016 CORE Security Technologies
2#
3# This software is provided under under a slightly modified version
4# of the Apache Software License. See the accompanying LICENSE file
5# for more information.
6#
7# Author: Alberto Solino (@agsolino)
8#
9# Description:
10#   [MS-COMEV]: Component Object Model Plus (COM+) Event System Protocol.
11#               This was used as a way to test the DCOM runtime. Further
12#               testing is needed to verify it is working as expected
13#
14#   Best way to learn how to use these calls is to grab the protocol standard
15#   so you understand what the call does, and then read the test case located
16#   at https://github.com/CoreSecurity/impacket/tree/master/impacket/testcases/SMB_RPC
17#
18#   Since DCOM is like an OO RPC, instead of helper functions you will see the
19#   classes described in the standards developed.
20#   There are test cases for them too.
21#
22from impacket.dcerpc.v5.ndr import NDRSTRUCT, NDRENUM, NDRUniConformantVaryingArray
23from impacket.dcerpc.v5.dcomrt import DCOMCALL, DCOMANSWER, INTERFACE, PMInterfacePointer, IRemUnknown
24from impacket.dcerpc.v5.dcom.oaut import IDispatch, BSTR, VARIANT
25from impacket.dcerpc.v5.dtypes import INT, ULONG, LONG, BOOLEAN
26from impacket.dcerpc.v5.rpcrt import DCERPCException
27from impacket.dcerpc.v5.enum import Enum
28from impacket import hresult_errors
29from impacket.uuid import string_to_bin, uuidtup_to_bin
30
31class DCERPCSessionError(DCERPCException):
32    def __init__(self, error_string=None, error_code=None, packet=None):
33        DCERPCException.__init__(self, error_string, error_code, packet)
34
35    def __str__( self ):
36        if hresult_errors.ERROR_MESSAGES.has_key(self.error_code):
37            error_msg_short = hresult_errors.ERROR_MESSAGES[self.error_code][0]
38            error_msg_verbose = hresult_errors.ERROR_MESSAGES[self.error_code][1]
39            return 'COMEV SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
40        else:
41            return 'COMEV SessionError: unknown error code: 0x%x' % self.error_code
42
43################################################################################
44# CONSTANTS
45################################################################################
46# 1.9 Standards Assignments
47CLSID_EventSystem          = string_to_bin('4E14FBA2-2E22-11D1-9964-00C04FBBB345')
48CLSID_EventSystem2         = string_to_bin('99CC098F-A48A-4e9c-8E58-965C0AFC19D5')
49CLSID_EventClass           = string_to_bin('cdbec9c0-7a68-11d1-88f9-0080c7d771bf')
50CLSID_EventSubscription    = string_to_bin('7542e960-79c7-11d1-88f9-0080c7d771bf')
51GUID_DefaultAppPartition   = string_to_bin('41E90F3E-56C1-4633-81C3-6E8BAC8BDD70')
52IID_IEventSystem           = uuidtup_to_bin(('4E14FB9F-2E22-11D1-9964-00C04FBBB345','0.0'))
53IID_IEventSystem2          = uuidtup_to_bin(('99CC098F-A48A-4e9c-8E58-965C0AFC19D5','0.0'))
54IID_IEventSystemInitialize = uuidtup_to_bin(('a0e8f27a-888c-11d1-b763-00c04fb926af','0.0'))
55IID_IEventObjectCollection = uuidtup_to_bin(('f89ac270-d4eb-11d1-b682-00805fc79216','0.0'))
56IID_IEnumEventObject       = uuidtup_to_bin(('F4A07D63-2E25-11D1-9964-00C04FBBB345','0.0'))
57IID_IEventSubscription     = uuidtup_to_bin(('4A6B0E15-2E38-11D1-9965-00C04FBBB345','0.0'))
58IID_IEventSubscription2    = uuidtup_to_bin(('4A6B0E16-2E38-11D1-9965-00C04FBBB345','0.0'))
59IID_IEventSubscription3    = uuidtup_to_bin(('FBC1D17D-C498-43a0-81AF-423DDD530AF6','0.0'))
60IID_IEventClass            = uuidtup_to_bin(('fb2b72a0-7a68-11d1-88f9-0080c7d771bf','0.0'))
61IID_IEventClass2           = uuidtup_to_bin(('fb2b72a1-7a68-11d1-88f9-0080c7d771bf','0.0'))
62IID_IEventClass3           = uuidtup_to_bin(('7FB7EA43-2D76-4ea8-8CD9-3DECC270295E','0.0'))
63
64error_status_t = ULONG
65
66# 2.2.2.2 Property Value Types
67class VARENUM(NDRENUM):
68    class enumItems(Enum):
69        VT_EMPTY       = 0
70        VT_NULL        = 1
71        VT_I2          = 2
72        VT_I4          = 3
73        VT_R4          = 4
74        VT_R8          = 5
75        VT_CY          = 6
76        VT_DATE        = 7
77        VT_BSTR        = 8
78        VT_DISPATCH    = 9
79        VT_ERROR       = 0xa
80        VT_BOOL        = 0xb
81        VT_VARIANT     = 0xc
82        VT_UNKNOWN     = 0xd
83        VT_DECIMAL     = 0xe
84        VT_I1          = 0x10
85        VT_UI1         = 0x11
86        VT_UI2         = 0x12
87        VT_UI4         = 0x13
88        VT_I8          = 0x14
89        VT_UI8         = 0x15
90        VT_INT         = 0x16
91        VT_UINT        = 0x17
92        VT_VOID        = 0x18
93        VT_HRESULT     = 0x19
94        VT_PTR         = 0x1a
95        VT_SAFEARRAY   = 0x1b
96        VT_CARRAY      = 0x1c
97        VT_USERDEFINED = 0x1d
98        VT_LPSTR       = 0x1e
99        VT_LPWSTR      = 0x1f
100        VT_RECORD      = 0x24
101        VT_INT_PTR     = 0x25
102        VT_UINT_PTR    = 0x26
103        VT_ARRAY       = 0x2000
104        VT_BYREF       = 0x4000
105        VT_UINT_PTR     = 7
106
107################################################################################
108# STRUCTURES
109################################################################################
110# 2.2.44 TYPEATTR
111class TYPEATTR(NDRSTRUCT):
112    structure = (
113    )
114
115class OBJECT_ARRAY(NDRUniConformantVaryingArray):
116    item = PMInterfacePointer
117
118################################################################################
119# RPC CALLS
120################################################################################
121# 3.1.4.1 IEventSystem
122# 3.1.4.1.1 Query (Opnum 7)
123class IEventSystem_Query(DCOMCALL):
124    opnum = 7
125    structure = (
126       ('progID', BSTR),
127       ('queryCriteria', BSTR),
128    )
129
130class IEventSystem_QueryResponse(DCOMANSWER):
131    structure = (
132       ('errorIndex', INT),
133       ('ppInterface', PMInterfacePointer),
134       ('ErrorCode', error_status_t),
135    )
136
137# 3.1.4.1.2 Store (Opnum 8)
138class IEventSystem_Store(DCOMCALL):
139    opnum = 8
140    structure = (
141       ('progID', BSTR),
142       ('pInterface', PMInterfacePointer),
143    )
144
145class IEventSystem_StoreResponse(DCOMANSWER):
146    structure = (
147       ('ErrorCode', error_status_t),
148    )
149
150# 3.1.4.1.3 Remove (Opnum 9)
151class IEventSystem_Remove(DCOMCALL):
152    opnum = 9
153    structure = (
154       ('progID', BSTR),
155       ('queryCriteria', BSTR),
156    )
157
158class IEventSystem_RemoveResponse(DCOMANSWER):
159    structure = (
160       ('errorIndex', INT),
161       ('ErrorCode', error_status_t),
162    )
163
164# 3.1.4.1.4 get_EventObjectChangeEventClassID (Opnum 10)
165class IEventSystem_get_EventObjectChangeEventClassID(DCOMCALL):
166    opnum = 10
167    structure = (
168    )
169
170class IEventSystem_get_EventObjectChangeEventClassIDResponse(DCOMANSWER):
171    structure = (
172       ('pbstrEventClassID', BSTR),
173       ('ErrorCode', error_status_t),
174    )
175
176# 3.1.4.1.5 QueryS (Opnum 11)
177class IEventSystem_QueryS(DCOMCALL):
178    opnum = 11
179    structure = (
180       ('progID', BSTR),
181       ('queryCriteria', BSTR),
182    )
183
184class IEventSystem_QuerySResponse(DCOMANSWER):
185    structure = (
186       ('pInterface', PMInterfacePointer),
187       ('ErrorCode', error_status_t),
188    )
189
190# 3.1.4.1.6 RemoveS (Opnum 12)
191class IEventSystem_RemoveS(DCOMCALL):
192    opnum = 12
193    structure = (
194       ('progID', BSTR),
195       ('queryCriteria', BSTR),
196    )
197
198class IEventSystem_RemoveSResponse(DCOMANSWER):
199    structure = (
200       ('ErrorCode', error_status_t),
201    )
202
203################################################################################
204# 3.1.4.2 IEventClass
205# 3.1.4.2.1 get_EventClassID (Opnum 7)
206class IEventClass_get_EventClassID(DCOMCALL):
207    opnum = 7
208    structure = (
209    )
210
211class IEventClass_get_EventClassIDResponse(DCOMANSWER):
212    structure = (
213       ('pbstrEventClassID', BSTR),
214       ('ErrorCode', error_status_t),
215    )
216
217# 3.1.4.2.2 put_EventClassID (Opnum 8)
218class IEventClass_put_EventClassID(DCOMCALL):
219    opnum = 8
220    structure = (
221       ('bstrEventClassID', BSTR),
222    )
223
224class IEventClass_put_EventClassIDResponse(DCOMANSWER):
225    structure = (
226       ('ErrorCode', error_status_t),
227    )
228
229# 3.1.4.2.3 get_EventClassName (Opnum 9)
230class IEventClass_get_EventClassName(DCOMCALL):
231    opnum = 9
232    structure = (
233    )
234
235class IEventClass_get_EventClassNameResponse(DCOMANSWER):
236    structure = (
237       ('pbstrEventClassName', BSTR),
238       ('ErrorCode', error_status_t),
239    )
240
241# 3.1.4.2.4 put_EventClassName (Opnum 10)
242class IEventClass_put_EventClassName(DCOMCALL):
243    opnum = 10
244    structure = (
245       ('bstrEventClassName', BSTR),
246    )
247
248class IEventClass_put_EventClassNameResponse(DCOMANSWER):
249    structure = (
250       ('ErrorCode', error_status_t),
251    )
252
253# 3.1.4.2.5 get_OwnerSID (Opnum 11)
254class IEventClass_get_OwnerSID(DCOMCALL):
255    opnum = 11
256    structure = (
257    )
258
259class IEventClass_get_OwnerSIDResponse(DCOMANSWER):
260    structure = (
261       ('pbstrOwnerSID', BSTR),
262       ('ErrorCode', error_status_t),
263    )
264
265# 3.1.4.2.6 put_OwnerSID (Opnum 12)
266class IEventClass_put_OwnerSID(DCOMCALL):
267    opnum = 12
268    structure = (
269       ('bstrOwnerSID', BSTR),
270    )
271
272class IEventClass_put_OwnerSIDResponse(DCOMANSWER):
273    structure = (
274       ('ErrorCode', error_status_t),
275    )
276
277# 3.1.4.2.7 get_FiringInterfaceID (Opnum 13)
278class IEventClass_get_FiringInterfaceID(DCOMCALL):
279    opnum = 13
280    structure = (
281    )
282
283class IEventClass_get_FiringInterfaceIDResponse(DCOMANSWER):
284    structure = (
285       ('pbstrFiringInterfaceID', BSTR),
286       ('ErrorCode', error_status_t),
287    )
288
289# 3.1.4.2.8 put_FiringInterfaceID (Opnum 14)
290class IEventClass_put_FiringInterfaceID(DCOMCALL):
291    opnum = 14
292    structure = (
293       ('bstrFiringInterfaceID', BSTR),
294    )
295
296class IEventClass_put_FiringInterfaceIDResponse(DCOMANSWER):
297    structure = (
298       ('ErrorCode', error_status_t),
299    )
300
301# 3.1.4.2.9 get_Description (Opnum 15)
302class IEventClass_get_Description(DCOMCALL):
303    opnum = 15
304    structure = (
305    )
306
307class IEventClass_get_DescriptionResponse(DCOMANSWER):
308    structure = (
309       ('pbstrDescription', BSTR),
310       ('ErrorCode', error_status_t),
311    )
312
313# 3.1.4.2.10 put_Description (Opnum 16)
314class IEventClass_put_Description(DCOMCALL):
315    opnum = 16
316    structure = (
317       ('bstrDescription', BSTR),
318    )
319
320class IEventClass_put_DescriptionResponse(DCOMANSWER):
321    structure = (
322       ('ErrorCode', error_status_t),
323    )
324
325# 3.1.4.2.11 get_TypeLib (Opnum 19)
326class IEventClass_get_TypeLib(DCOMCALL):
327    opnum = 19
328    structure = (
329    )
330
331class IEventClass_get_TypeLibResponse(DCOMANSWER):
332    structure = (
333       ('pbstrTypeLib', BSTR),
334       ('ErrorCode', error_status_t),
335    )
336
337# 3.1.4.2.12 put_TypeLib (Opnum 20)
338class IEventClass_put_TypeLib(DCOMCALL):
339    opnum = 20
340    structure = (
341       ('bstrTypeLib', BSTR),
342    )
343
344class IEventClass_put_TypeLibResponse(DCOMANSWER):
345    structure = (
346       ('ErrorCode', error_status_t),
347    )
348
349################################################################################
350# 3.1.4.3 IEventClass2
351# 3.1.4.3.1 get_PublisherID (Opnum 21)
352class IEventClass2_get_PublisherID(DCOMCALL):
353    opnum = 21
354    structure = (
355    )
356
357class IEventClass2_get_PublisherIDResponse(DCOMANSWER):
358    structure = (
359       ('pbstrSubscriptionID', BSTR),
360       ('ErrorCode', error_status_t),
361    )
362
363# 3.1.4.3.2 put_PublisherID (Opnum 22)
364class IEventClass2_put_PublisherID(DCOMCALL):
365    opnum = 22
366    structure = (
367       ('bstrPublisherID', BSTR),
368    )
369
370class IEventClass2_put_PublisherIDResponse(DCOMANSWER):
371    structure = (
372       ('ErrorCode', error_status_t),
373    )
374
375# 3.1.4.3.3 get_MultiInterfacePublisherFilterCLSID (Opnum 23)
376class IEventClass2_get_MultiInterfacePublisherFilterCLSID(DCOMCALL):
377    opnum = 23
378    structure = (
379    )
380
381class IEventClass2_get_MultiInterfacePublisherFilterCLSIDResponse(DCOMANSWER):
382    structure = (
383       ('pbstrPubFilCLSID', BSTR),
384       ('ErrorCode', error_status_t),
385    )
386
387# 3.1.4.3.4 put_MultiInterfacePublisherFilterCLSID (Opnum 24)
388class IEventClass2_put_MultiInterfacePublisherFilterCLSID(DCOMCALL):
389    opnum = 24
390    structure = (
391       ('bstrPubFilCLSID', BSTR),
392    )
393
394class IEventClass2_put_MultiInterfacePublisherFilterCLSIDResponse(DCOMANSWER):
395    structure = (
396       ('ErrorCode', error_status_t),
397    )
398
399# 3.1.4.3.5 get_AllowInprocActivation (Opnum 25)
400class IEventClass2_get_AllowInprocActivation(DCOMCALL):
401    opnum = 25
402    structure = (
403    )
404
405class IEventClass2_get_AllowInprocActivationResponse(DCOMANSWER):
406    structure = (
407       ('pfAllowInprocActivation', BOOLEAN),
408       ('ErrorCode', error_status_t),
409    )
410
411# 3.1.4.3.6 put_AllowInprocActivation (Opnum 26)
412class IEventClass2_put_AllowInprocActivation(DCOMCALL):
413    opnum = 26
414    structure = (
415       ('fAllowInprocActivation', BOOLEAN),
416    )
417
418class IEventClass2_put_AllowInprocActivationResponse(DCOMANSWER):
419    structure = (
420       ('ErrorCode', error_status_t),
421    )
422
423# 3.1.4.3.7 get_FireInParallel (Opnum 27)
424class IEventClass2_get_FireInParallel(DCOMCALL):
425    opnum = 27
426    structure = (
427    )
428
429class IEventClass2_get_FireInParallelResponse(DCOMANSWER):
430    structure = (
431       ('pfFireInParallel', BOOLEAN),
432       ('ErrorCode', error_status_t),
433    )
434
435# 3.1.4.3.8 put_FireInParallel (Opnum 28)
436class IEventClass2_put_FireInParallel(DCOMCALL):
437    opnum = 28
438    structure = (
439       ('pfFireInParallel', BOOLEAN),
440    )
441
442class IEventClass2_put_FireInParallelResponse(DCOMANSWER):
443    structure = (
444       ('ErrorCode', error_status_t),
445    )
446
447################################################################################
448# 3.1.4.4 IEventSubscription
449# 3.1.4.4.1 get_SubscriptionID (Opnum 7)
450class IEventSubscription_get_SubscriptionID(DCOMCALL):
451    opnum = 7
452    structure = (
453    )
454
455class IEventSubscription_get_SubscriptionIDResponse(DCOMANSWER):
456    structure = (
457       ('pbstrSubscriptionID', BSTR),
458       ('ErrorCode', error_status_t),
459    )
460
461# 3.1.4.4.2 put_SubscriptionID (Opnum 8)
462class IEventSubscription_put_SubscriptionID(DCOMCALL):
463    opnum = 8
464    structure = (
465       ('bstrSubscriptionID', BSTR),
466    )
467
468class IEventSubscription_put_SubscriptionIDResponse(DCOMANSWER):
469    structure = (
470       ('ErrorCode', error_status_t),
471    )
472
473# 3.1.4.4.3 get_SubscriptionName (Opnum 9)
474class IEventSubscription_get_SubscriptionName(DCOMCALL):
475    opnum = 9
476    structure = (
477    )
478
479class IEventSubscription_get_SubscriptionNameResponse(DCOMANSWER):
480    structure = (
481       ('pbstrSubscriptionName', BSTR),
482       ('ErrorCode', error_status_t),
483    )
484
485# 3.1.4.4.4 put_SubscriptionName (Opnum 10)
486class IEventSubscription_put_SubscriptionName(DCOMCALL):
487    opnum = 10
488    structure = (
489       ('strSubscriptionID', BSTR),
490    )
491
492class IEventSubscription_put_SubscriptionNameResponse(DCOMANSWER):
493    structure = (
494       ('ErrorCode', error_status_t),
495    )
496
497# 3.1.4.4.5 get_PublisherID (Opnum 11)
498class IEventSubscription_get_PublisherID(DCOMCALL):
499    opnum = 11
500    structure = (
501    )
502
503class IEventSubscription_get_PublisherIDResponse(DCOMANSWER):
504    structure = (
505       ('pbstrPublisherID', BSTR),
506       ('ErrorCode', error_status_t),
507    )
508
509# 3.1.4.4.6 put_PublisherID (Opnum 12)
510class IEventSubscription_put_PublisherID(DCOMCALL):
511    opnum = 12
512    structure = (
513       ('bstrPublisherID', BSTR),
514    )
515
516class IEventSubscription_put_PublisherIDResponse(DCOMANSWER):
517    structure = (
518       ('ErrorCode', error_status_t),
519    )
520
521# 3.1.4.4.7 get_EventClassID (Opnum 13)
522class IEventSubscription_get_EventClassID(DCOMCALL):
523    opnum = 13
524    structure = (
525    )
526
527class IEventSubscription_get_EventClassIDResponse(DCOMANSWER):
528    structure = (
529       ('pbstrEventClassID', BSTR),
530       ('ErrorCode', error_status_t),
531    )
532
533# 3.1.4.4.8 put_EventClassID (Opnum 14)
534class IEventSubscription_put_EventClassID(DCOMCALL):
535    opnum = 14
536    structure = (
537       ('bstrEventClassID', BSTR),
538    )
539
540class IEventSubscription_put_EventClassIDResponse(DCOMANSWER):
541    structure = (
542       ('ErrorCode', error_status_t),
543    )
544
545# 3.1.4.4.9 get_MethodName (Opnum 15)
546class IEventSubscription_get_MethodName(DCOMCALL):
547    opnum = 15
548    structure = (
549    )
550
551class IEventSubscription_get_MethodNameResponse(DCOMANSWER):
552    structure = (
553       ('pbstrMethodName', BSTR),
554       ('ErrorCode', error_status_t),
555    )
556
557# 3.1.4.4.10 put_MethodName (Opnum 16)
558class IEventSubscription_put_MethodName(DCOMCALL):
559    opnum = 16
560    structure = (
561       ('bstrMethodName', BSTR),
562    )
563
564class IEventSubscription_put_MethodNameResponse(DCOMANSWER):
565    structure = (
566       ('ErrorCode', error_status_t),
567    )
568
569# 3.1.4.4.11 get_SubscriberCLSID (Opnum 17)
570class IEventSubscription_get_SubscriberCLSID(DCOMCALL):
571    opnum = 17
572    structure = (
573    )
574
575class IEventSubscription_get_SubscriberCLSIDResponse(DCOMANSWER):
576    structure = (
577       ('pbstrSubscriberCLSID', BSTR),
578       ('ErrorCode', error_status_t),
579    )
580
581# 3.1.4.4.12 put_SubscriberCLSID (Opnum 18)
582class IEventSubscription_put_SubscriberCLSID(DCOMCALL):
583    opnum = 18
584    structure = (
585       ('bstrSubscriberCLSID', BSTR),
586    )
587
588class IEventSubscription_put_SubscriberCLSIDResponse(DCOMANSWER):
589    structure = (
590       ('ErrorCode', error_status_t),
591    )
592
593# 3.1.4.4.13 get_SubscriberInterface (Opnum 19)
594class IEventSubscription_get_SubscriberInterface(DCOMCALL):
595    opnum = 19
596    structure = (
597    )
598
599class IEventSubscription_get_SubscriberInterfaceResponse(DCOMANSWER):
600    structure = (
601       ('ppSubscriberInterface', PMInterfacePointer),
602       ('ErrorCode', error_status_t),
603    )
604
605# 3.1.4.4.14 put_SubscriberInterface (Opnum 20)
606class IEventSubscription_put_SubscriberInterface(DCOMCALL):
607    opnum = 20
608    structure = (
609       ('pSubscriberInterface', PMInterfacePointer),
610    )
611
612class IEventSubscription_put_SubscriberInterfaceResponse(DCOMANSWER):
613    structure = (
614       ('ErrorCode', error_status_t),
615    )
616
617# 3.1.4.4.15 get_PerUser (Opnum 21)
618class IEventSubscription_get_PerUser(DCOMCALL):
619    opnum = 21
620    structure = (
621    )
622
623class IEventSubscription_get_PerUserResponse(DCOMANSWER):
624    structure = (
625       ('pfPerUser', BOOLEAN),
626       ('ErrorCode', error_status_t),
627    )
628
629# 3.1.4.4.16 put_PerUser (Opnum 22)
630class IEventSubscription_put_PerUser(DCOMCALL):
631    opnum = 22
632    structure = (
633       ('fPerUser', BOOLEAN),
634    )
635
636class IEventSubscription_put_PerUserResponse(DCOMANSWER):
637    structure = (
638       ('ErrorCode', error_status_t),
639    )
640
641# 3.1.4.4.17 get_OwnerSID (Opnum 23)
642class IEventSubscription_get_OwnerSID(DCOMCALL):
643    opnum = 23
644    structure = (
645    )
646
647class IEventSubscription_get_OwnerSIDResponse(DCOMANSWER):
648    structure = (
649       ('pbstrOwnerSID', BSTR),
650       ('ErrorCode', error_status_t),
651    )
652
653# 3.1.4.4.18 put_OwnerSID (Opnum 24)
654class IEventSubscription_put_OwnerSID(DCOMCALL):
655    opnum = 24
656    structure = (
657       ('bstrOwnerSID', BSTR),
658    )
659
660class IEventSubscription_put_OwnerSIDResponse(DCOMANSWER):
661    structure = (
662       ('ErrorCode', error_status_t),
663    )
664
665# 3.1.4.4.19 get_Enabled (Opnum 25)
666class IEventSubscription_get_Enabled(DCOMCALL):
667    opnum = 25
668    structure = (
669    )
670
671class IEventSubscription_get_EnabledResponse(DCOMANSWER):
672    structure = (
673       ('pfEnabled', BOOLEAN),
674       ('ErrorCode', error_status_t),
675    )
676
677# 3.1.4.4.20 put_Enabled (Opnum 26)
678class IEventSubscription_put_Enabled(DCOMCALL):
679    opnum = 26
680    structure = (
681       ('fEnabled', BOOLEAN),
682    )
683
684class IEventSubscription_put_EnabledResponse(DCOMANSWER):
685    structure = (
686       ('ErrorCode', error_status_t),
687    )
688
689# 3.1.4.4.21 get_Description (Opnum 27)
690class IEventSubscription_get_Description(DCOMCALL):
691    opnum = 27
692    structure = (
693    )
694
695class IEventSubscription_get_DescriptionResponse(DCOMANSWER):
696    structure = (
697       ('pbstrDescription', BSTR),
698       ('ErrorCode', error_status_t),
699    )
700
701# 3.1.4.4.22 put_Description (Opnum 28)
702class IEventSubscription_put_Description(DCOMCALL):
703    opnum = 28
704    structure = (
705       ('bstrDescription', BSTR),
706    )
707
708class IEventSubscription_put_DescriptionResponse(DCOMANSWER):
709    structure = (
710       ('ErrorCode', error_status_t),
711    )
712
713# 3.1.4.4.23 get_MachineName (Opnum 29)
714class IEventSubscription_get_MachineName(DCOMCALL):
715    opnum = 29
716    structure = (
717    )
718
719class IEventSubscription_get_MachineNameResponse(DCOMANSWER):
720    structure = (
721       ('pbstrMachineName', BSTR),
722       ('ErrorCode', error_status_t),
723    )
724
725# 3.1.4.4.24 put_MachineName (Opnum 30)
726class IEventSubscription_put_MachineName(DCOMCALL):
727    opnum = 30
728    structure = (
729       ('bstrMachineName', BSTR),
730    )
731
732class IEventSubscription_put_MachineNameResponse(DCOMANSWER):
733    structure = (
734       ('ErrorCode', error_status_t),
735    )
736
737# 3.1.4.4.25 GetPublisherProperty (Opnum 31)
738class IEventSubscription_GetPublisherProperty(DCOMCALL):
739    opnum = 31
740    structure = (
741       ('bstrPropertyName', BSTR),
742    )
743
744class IEventSubscription_GetPublisherPropertyResponse(DCOMANSWER):
745    structure = (
746       ('propertyValue', VARIANT),
747       ('ErrorCode', error_status_t),
748    )
749
750# 3.1.4.4.26 PutPublisherProperty (Opnum 32)
751class IEventSubscription_PutPublisherProperty(DCOMCALL):
752    opnum = 32
753    structure = (
754       ('bstrPropertyName', BSTR),
755       ('propertyValue', VARIANT),
756    )
757
758class IEventSubscription_PutPublisherPropertyResponse(DCOMANSWER):
759    structure = (
760       ('ErrorCode', error_status_t),
761    )
762
763# 3.1.4.4.27 RemovePublisherProperty (Opnum 33)
764class IEventSubscription_RemovePublisherProperty(DCOMCALL):
765    opnum = 33
766    structure = (
767       ('bstrPropertyName', BSTR),
768    )
769
770class IEventSubscription_RemovePublisherPropertyResponse(DCOMANSWER):
771    structure = (
772       ('ErrorCode', error_status_t),
773    )
774
775# 3.1.4.4.28 GetPublisherPropertyCollection (Opnum 34)
776class IEventSubscription_GetPublisherPropertyCollection(DCOMCALL):
777    opnum = 34
778    structure = (
779    )
780
781class IEventSubscription_GetPublisherPropertyCollectionResponse(DCOMANSWER):
782    structure = (
783       ('collection', PMInterfacePointer),
784       ('ErrorCode', error_status_t),
785    )
786
787# 3.1.4.4.29 GetSubscriberProperty (Opnum 35)
788class IEventSubscription_GetSubscriberProperty(DCOMCALL):
789    opnum = 35
790    structure = (
791       ('bstrPropertyName', BSTR),
792    )
793
794class IEventSubscription_GetSubscriberPropertyResponse(DCOMANSWER):
795    structure = (
796       ('propertyValue', VARIANT),
797       ('ErrorCode', error_status_t),
798    )
799
800# 3.1.4.4.30 PutSubscriberProperty (Opnum 36)
801class IEventSubscription_PutSubscriberProperty(DCOMCALL):
802    opnum = 36
803    structure = (
804       ('bstrPropertyName', BSTR),
805       ('propertyValue', VARIANT),
806    )
807
808class IEventSubscription_PutSubscriberPropertyResponse(DCOMANSWER):
809    structure = (
810       ('ErrorCode', error_status_t),
811    )
812
813# 3.1.4.4.31 RemoveSubscriberProperty (Opnum 37)
814class IEventSubscription_RemoveSubscriberProperty(DCOMCALL):
815    opnum = 37
816    structure = (
817       ('bstrPropertyName', BSTR),
818    )
819
820class IEventSubscription_RemoveSubscriberPropertyResponse(DCOMANSWER):
821    structure = (
822       ('ErrorCode', error_status_t),
823    )
824
825# 3.1.4.4.32 GetSubscriberPropertyCollection (Opnum 38)
826class IEventSubscription_GetSubscriberPropertyCollection(DCOMCALL):
827    opnum = 38
828    structure = (
829    )
830
831class IEventSubscription_GetSubscriberPropertyCollectionResponse(DCOMANSWER):
832    structure = (
833       ('collection', PMInterfacePointer),
834       ('ErrorCode', error_status_t),
835    )
836
837# 3.1.4.4.33 get_InterfaceID (Opnum 39)
838class IEventSubscription_get_InterfaceID(DCOMCALL):
839    opnum = 39
840    structure = (
841    )
842
843class IEventSubscription_get_InterfaceIDResponse(DCOMANSWER):
844    structure = (
845       ('pbstrInterfaceID', BSTR),
846       ('ErrorCode', error_status_t),
847    )
848
849# 3.1.4.4.34 put_InterfaceID (Opnum 40)
850class IEventSubscription_put_InterfaceID(DCOMCALL):
851    opnum = 40
852    structure = (
853       ('bstrInterfaceID', BSTR),
854    )
855
856class IEventSubscription_put_InterfaceIDResponse(DCOMANSWER):
857    structure = (
858       ('ErrorCode', error_status_t),
859    )
860
861################################################################################
862# 3.1.4.5 IEnumEventObject
863# 3.1.4.5.1 Clone (Opnum 3)
864class IEnumEventObject_Clone(DCOMCALL):
865    opnum = 3
866    structure = (
867    )
868
869class IEnumEventObject_CloneResponse(DCOMANSWER):
870    structure = (
871       ('ppInterface', PMInterfacePointer),
872       ('ErrorCode', error_status_t),
873    )
874
875# 3.1.4.5.2 Next (Opnum 4)
876class IEnumEventObject_Next(DCOMCALL):
877    opnum = 4
878    structure = (
879       ('cReqElem', ULONG),
880    )
881
882class IEnumEventObject_NextResponse(DCOMANSWER):
883    structure = (
884       ('ppInterface', OBJECT_ARRAY),
885       ('cRetElem', ULONG),
886       ('ErrorCode', error_status_t),
887    )
888
889# 3.1.4.5.3 Reset (Opnum 5)
890class IEnumEventObject_Reset(DCOMCALL):
891    opnum = 5
892    structure = (
893    )
894
895class IEnumEventObject_ResetResponse(DCOMANSWER):
896    structure = (
897       ('ErrorCode', error_status_t),
898    )
899
900# 3.1.4.5.4 Skip (Opnum 6)
901class IEnumEventObject_Skip(DCOMCALL):
902    opnum = 6
903    structure = (
904       ('cSkipElem', ULONG),
905    )
906
907class IEnumEventObject_SkipResponse(DCOMANSWER):
908    structure = (
909       ('ErrorCode', error_status_t),
910    )
911
912################################################################################
913# 3.1.4.6 IEventObjectCollection
914# 3.1.4.6.1 get__NewEnum (Opnum 7)
915class IEventObjectCollection_get__NewEnum(DCOMCALL):
916    opnum = 7
917    structure = (
918    )
919
920class IEventObjectCollection_get__NewEnumResponse(DCOMANSWER):
921    structure = (
922       ('ppUnkEnum', PMInterfacePointer),
923       ('ErrorCode', error_status_t),
924    )
925
926# 3.1.4.6.2 get_Item (Opnum 8)
927class IEventObjectCollection_get_Item(DCOMCALL):
928    opnum = 8
929    structure = (
930       ('objectID', BSTR),
931    )
932
933class IEventObjectCollection_get_ItemResponse(DCOMANSWER):
934    structure = (
935       ('pItem', VARIANT),
936       ('ErrorCode', error_status_t),
937    )
938
939# 3.1.4.6.3 get_NewEnum (Opnum 9)
940class IEventObjectCollection_get_NewEnum(DCOMCALL):
941    opnum = 9
942    structure = (
943    )
944
945class IEventObjectCollection_get_NewEnumResponse(DCOMANSWER):
946    structure = (
947       ('ppEnum', PMInterfacePointer),
948       ('ErrorCode', error_status_t),
949    )
950
951# 3.1.4.6.4 get_Count (Opnum 10)
952class IEventObjectCollection_get_Count(DCOMCALL):
953    opnum = 10
954    structure = (
955    )
956
957class IEventObjectCollection_get_CountResponse(DCOMANSWER):
958    structure = (
959       ('pCount', LONG),
960       ('ErrorCode', error_status_t),
961    )
962
963# 3.1.4.6.5 Add (Opnum 11)
964class IEventObjectCollection_Add(DCOMCALL):
965    opnum = 11
966    structure = (
967       ('item', VARIANT),
968       ('objectID', BSTR),
969    )
970
971class IEventObjectCollection_AddResponse(DCOMANSWER):
972    structure = (
973       ('ErrorCode', error_status_t),
974    )
975
976# 3.1.4.6.6 Remove (Opnum 12)
977class IEventObjectCollection_Remove(DCOMCALL):
978    opnum = 12
979    structure = (
980       ('objectID', BSTR),
981    )
982
983class IEventObjectCollection_RemoveResponse(DCOMANSWER):
984    structure = (
985       ('ErrorCode', error_status_t),
986    )
987
988################################################################################
989# 3.1.4.7 IEventClass3
990# 3.1.4.7.1 get_EventClassPartitionID (Opnum 29)
991class IEventClass3_get_EventClassPartitionID(DCOMCALL):
992    opnum = 29
993    structure = (
994    )
995
996class IEventClass3_get_EventClassPartitionIDResponse(DCOMANSWER):
997    structure = (
998       ('pbstrEventClassPartitionID', BSTR),
999       ('ErrorCode', error_status_t),
1000    )
1001
1002# 3.1.4.7.2 put_EventClassPartitionID (Opnum 30)
1003class IEventClass3_put_EventClassPartitionID(DCOMCALL):
1004    opnum = 30
1005    structure = (
1006       ('bstrEventClassPartitionID', BSTR),
1007    )
1008
1009class IEventClass3_put_EventClassPartitionIDResponse(DCOMANSWER):
1010    structure = (
1011       ('ErrorCode', error_status_t),
1012    )
1013
1014# 3.1.4.7.3 get_EventClassApplicationID (Opnum 31)
1015class IEventClass3_get_EventClassApplicationID(DCOMCALL):
1016    opnum = 31
1017    structure = (
1018    )
1019
1020class IEventClass3_get_EventClassApplicationIDResponse(DCOMANSWER):
1021    structure = (
1022       ('pbstrEventClassApplicationID', BSTR),
1023       ('ErrorCode', error_status_t),
1024    )
1025
1026# 3.1.4.7.4 put_EventClassApplicationID (Opnum 32)
1027class IEventClass3_put_EventClassApplicationID(DCOMCALL):
1028    opnum = 32
1029    structure = (
1030       ('bstrEventClassApplicationID', BSTR),
1031    )
1032
1033class IEventClass3_put_EventClassApplicationIDResponse(DCOMANSWER):
1034    structure = (
1035       ('ErrorCode', error_status_t),
1036    )
1037
1038################################################################################
1039# 3.1.4.8 IEventSubscription2
1040# 3.1.4.8.1 get_FilterCriteria (Opnum 41)
1041class IEventSubscription2_get_FilterCriteria(DCOMCALL):
1042    opnum = 41
1043    structure = (
1044    )
1045
1046class IEventSubscription2_get_FilterCriteriaResponse(DCOMANSWER):
1047    structure = (
1048       ('pbstrFilterCriteria', BSTR),
1049       ('ErrorCode', error_status_t),
1050    )
1051
1052# 3.1.4.8.2 put_FilterCriteria (Opnum 42)
1053class IEventSubscription2_put_FilterCriteria(DCOMCALL):
1054    opnum = 42
1055    structure = (
1056       ('bstrFilterCriteria', BSTR),
1057    )
1058
1059class IEventSubscription2_put_FilterCriteriaResponse(DCOMANSWER):
1060    structure = (
1061       ('ErrorCode', error_status_t),
1062    )
1063
1064# 3.1.4.8.3 get_SubscriberMoniker (Opnum 43)
1065class IEventSubscription2_get_SubscriberMoniker(DCOMCALL):
1066    opnum = 43
1067    structure = (
1068    )
1069
1070class IEventSubscription2_get_SubscriberMonikerResponse(DCOMANSWER):
1071    structure = (
1072       ('pbstrMoniker', BSTR),
1073       ('ErrorCode', error_status_t),
1074    )
1075
1076# 3.1.4.8.4 put_SubscriberMoniker (Opnum 44)
1077class IEventSubscription2_put_SubscriberMoniker(DCOMCALL):
1078    opnum = 44
1079    structure = (
1080       ('bstrMoniker', BSTR),
1081    )
1082
1083class IEventSubscription2_put_SubscriberMonikerResponse(DCOMANSWER):
1084    structure = (
1085       ('ErrorCode', error_status_t),
1086    )
1087
1088################################################################################
1089# 3.1.4.9 IEventSubscription3
1090# 3.1.4.9.1 get_EventClassPartitionID (Opnum 45)
1091class IEventSubscription3_get_EventClassPartitionID(DCOMCALL):
1092    opnum = 45
1093    structure = (
1094    )
1095
1096class IEventSubscription3_get_EventClassPartitionIDResponse(DCOMANSWER):
1097    structure = (
1098       ('pbstrEventClassPartitionID', BSTR),
1099       ('ErrorCode', error_status_t),
1100    )
1101
1102# 3.1.4.9.2 put_EventClassPartitionID (Opnum 46)
1103class IEventSubscription3_put_EventClassPartitionID(DCOMCALL):
1104    opnum = 46
1105    structure = (
1106       ('bstrEventClassPartitionID', BSTR),
1107    )
1108
1109class IEventSubscription3_put_EventClassPartitionIDResponse(DCOMANSWER):
1110    structure = (
1111       ('ErrorCode', error_status_t),
1112    )
1113
1114# 3.1.4.9.3 get_EventClassApplicationID (Opnum 47)
1115class IEventSubscription3_get_EventClassApplicationID(DCOMCALL):
1116    opnum = 47
1117    structure = (
1118    )
1119
1120class IEventSubscription3_get_EventClassApplicationIDResponse(DCOMANSWER):
1121    structure = (
1122       ('pbstrEventClassApplicationID', BSTR),
1123       ('ErrorCode', error_status_t),
1124    )
1125
1126# 3.1.4.9.4 put_EventClassApplicationID (Opnum 48)
1127class IEventSubscription3_put_EventClassApplicationID(DCOMCALL):
1128    opnum = 48
1129    structure = (
1130       ('bstrEventClassPartitionID', BSTR),
1131    )
1132
1133class IEventSubscription3_put_EventClassApplicationIDResponse(DCOMANSWER):
1134    structure = (
1135       ('ErrorCode', error_status_t),
1136    )
1137
1138# 3.1.4.9.5 get_SubscriberPartitionID (Opnum 49)
1139class IEventSubscription3_get_SubscriberPartitionID(DCOMCALL):
1140    opnum = 49
1141    structure = (
1142    )
1143
1144class IEventSubscription3_get_SubscriberPartitionIDResponse(DCOMANSWER):
1145    structure = (
1146       ('pbstrSubscriberPartitionID', BSTR),
1147       ('ErrorCode', error_status_t),
1148    )
1149
1150# 3.1.4.9.6 put_SubscriberPartitionID (Opnum 50)
1151class IEventSubscription3_put_SubscriberPartitionID(DCOMCALL):
1152    opnum = 50
1153    structure = (
1154       ('bstrSubscriberPartitionID', BSTR),
1155    )
1156
1157class IEventSubscription3_put_SubscriberPartitionIDResponse(DCOMANSWER):
1158    structure = (
1159       ('ErrorCode', error_status_t),
1160    )
1161
1162# 3.1.4.9.7 get_SubscriberApplicationID (Opnum 51)
1163class IEventSubscription3_get_SubscriberApplicationID(DCOMCALL):
1164    opnum = 51
1165    structure = (
1166    )
1167
1168class IEventSubscription3_get_SubscriberApplicationIDResponse(DCOMANSWER):
1169    structure = (
1170       ('pbstrSubscriberApplicationID', BSTR),
1171       ('ErrorCode', error_status_t),
1172    )
1173
1174# 3.1.4.9.8 put_SubscriberApplicationID (Opnum 52)
1175class IEventSubscription3_put_SubscriberApplicationID(DCOMCALL):
1176    opnum = 52
1177    structure = (
1178       ('bstrSubscriberApplicationID', BSTR),
1179    )
1180
1181class IEventSubscription3_put_SubscriberApplicationIDResponse(DCOMANSWER):
1182    structure = (
1183       ('ErrorCode', error_status_t),
1184    )
1185
1186################################################################################
1187# 3.1.4.10 IEventSystem2
1188# 3.1.4.10.1 GetVersion (Opnum 13)
1189class IEventSystem2_GetVersion(DCOMCALL):
1190    opnum = 13
1191    structure = (
1192    )
1193
1194class IEventSystem2_GetVersionResponse(DCOMANSWER):
1195    structure = (
1196       ('pnVersion', INT),
1197       ('ErrorCode', error_status_t),
1198    )
1199
1200# 3.1.4.10.2 VerifyTransientSubscribers (Opnum 14)
1201class IEventSystem2_VerifyTransientSubscribers(DCOMCALL):
1202    opnum = 14
1203    structure = (
1204    )
1205
1206class IEventSystem2_VerifyTransientSubscribersResponse(DCOMANSWER):
1207    structure = (
1208       ('ErrorCode', error_status_t),
1209    )
1210
1211################################################################################
1212# 3.1.4.11 IEventSystemInitialize
1213# 3.1.4.11.1 SetCOMCatalogBehaviour (Opnum 3)
1214class IEventSystemInitialize_SetCOMCatalogBehaviour(DCOMCALL):
1215    opnum = 3
1216    structure = (
1217       ('bRetainSubKeys', BOOLEAN),
1218    )
1219
1220class IEventSystemInitialize_SetCOMCatalogBehaviourResponse(DCOMANSWER):
1221    structure = (
1222       ('ErrorCode', error_status_t),
1223    )
1224
1225
1226################################################################################
1227# OPNUMs and their corresponding structures
1228################################################################################
1229OPNUMS = {
1230}
1231
1232################################################################################
1233# HELPER FUNCTIONS AND INTERFACES
1234################################################################################
1235class IEventClass(IDispatch):
1236    def __init__(self, interface):
1237        IDispatch.__init__(self,interface)
1238        self._iid = IID_IEventClass
1239
1240    def get_EventClassID(self):
1241        request = IEventClass_get_EventClassID()
1242        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1243        resp.dump()
1244        return resp
1245
1246    def put_EventClassID(self,bstrEventClassID):
1247        request = IEventClass_put_EventClassID()
1248        request['bstrEventClassID'] = bstrEventClassID
1249        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1250        resp.dump()
1251        return resp
1252
1253    def get_EventClassName(self):
1254        request = IEventClass_get_EventClassName()
1255        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1256        resp.dump()
1257        return resp
1258
1259    def put_EventClassName(self, bstrEventClassName):
1260        request = IEventClass_put_EventClassName()
1261        request['bstrEventClassName'] = bstrEventClassName
1262        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1263        resp.dump()
1264        return resp
1265
1266    def get_OwnerSID(self):
1267        request = IEventClass_get_OwnerSID()
1268        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1269        resp.dump()
1270        return resp
1271
1272    def put_OwnerSID(self, bstrOwnerSID):
1273        request = IEventClass_put_OwnerSID()
1274        request['bstrOwnerSID'] = bstrOwnerSID
1275        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1276        resp.dump()
1277        return resp
1278
1279    def get_FiringInterfaceID(self):
1280        request = IEventClass_get_FiringInterfaceID()
1281        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1282        resp.dump()
1283        return resp
1284
1285    def put_FiringInterfaceID(self, bstrFiringInterfaceID):
1286        request = IEventClass_put_FiringInterfaceID()
1287        request['bstrFiringInterfaceID'] = bstrFiringInterfaceID
1288        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1289        resp.dump()
1290        return resp
1291
1292    def get_Description(self):
1293        request = IEventClass_get_Description()
1294        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1295        resp.dump()
1296        return resp
1297
1298    def put_Description(self, bstrDescription):
1299        request = IEventClass_put_Description()
1300        request['bstrDescription'] = bstrDescription
1301        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1302        resp.dump()
1303        return resp
1304
1305    def get_TypeLib(self):
1306        request = IEventClass_get_TypeLib()
1307        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1308        resp.dump()
1309        return resp
1310
1311    def put_TypeLib(self, bstrTypeLib):
1312        request = IEventClass_put_TypeLib()
1313        request['bstrTypeLib'] = bstrTypeLib
1314        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1315        resp.dump()
1316        return resp
1317
1318class IEventClass2(IEventClass):
1319    def __init__(self, interface):
1320        IEventClass.__init__(self,interface)
1321        self._iid = IID_IEventClass2
1322
1323    def get_PublisherID(self):
1324        request = IEventClass2_get_PublisherID()
1325        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1326        resp.dump()
1327        return resp
1328
1329    def put_PublisherID(self, bstrPublisherID):
1330        request = IEventClass2_put_PublisherID()
1331        request['bstrPublisherID'] = bstrPublisherID
1332        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1333        resp.dump()
1334        return resp
1335
1336    def get_MultiInterfacePublisherFilterCLSID(self):
1337        request = IEventClass2_get_MultiInterfacePublisherFilterCLSID()
1338        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1339        resp.dump()
1340        return resp
1341
1342    def put_MultiInterfacePublisherFilterCLSID(self, bstrPubFilCLSID):
1343        request = IEventClass2_put_MultiInterfacePublisherFilterCLSID()
1344        request['bstrPubFilCLSID'] = bstrPubFilCLSID
1345        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1346        resp.dump()
1347        return resp
1348
1349    def get_AllowInprocActivation(self):
1350        request = IEventClass2_get_AllowInprocActivation()
1351        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1352        resp.dump()
1353        return resp
1354
1355    def put_AllowInprocActivation(self, fAllowInprocActivation):
1356        request = IEventClass2_put_AllowInprocActivation()
1357        request['fAllowInprocActivation '] = fAllowInprocActivation
1358        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1359        resp.dump()
1360        return resp
1361
1362    def get_FireInParallel(self):
1363        request = IEventClass2_get_FireInParallel()
1364        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1365        resp.dump()
1366        return resp
1367
1368    def put_FireInParallel(self, fFireInParallel):
1369        request = IEventClass2_put_FireInParallel()
1370        request['fFireInParallel '] = fFireInParallel
1371        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1372        resp.dump()
1373        return resp
1374
1375class IEventClass3(IEventClass2):
1376    def __init__(self, interface):
1377        IEventClass2.__init__(self,interface)
1378        self._iid = IID_IEventClass3
1379
1380    def get_EventClassPartitionID(self):
1381        request = IEventClass3_get_EventClassPartitionID()
1382        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1383        resp.dump()
1384        return resp
1385
1386    def put_EventClassPartitionID(self, bstrEventClassPartitionID):
1387        request = IEventClass3_put_EventClassPartitionID()
1388        request['bstrEventClassPartitionID '] = bstrEventClassPartitionID
1389        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1390        resp.dump()
1391        return resp
1392
1393    def get_EventClassApplicationID(self):
1394        request = IEventClass3_get_EventClassApplicationID()
1395        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1396        resp.dump()
1397        return resp
1398
1399    def put_EventClassApplicationID(self, bstrEventClassApplicationID):
1400        request = IEventClass3_put_EventClassApplicationID()
1401        request['bstrEventClassApplicationID '] = bstrEventClassApplicationID
1402        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1403        resp.dump()
1404        return resp
1405
1406class IEventSubscription(IDispatch):
1407    def __init__(self, interface):
1408        IDispatch.__init__(self,interface)
1409        self._iid = IID_IEventSubscription
1410
1411    def get_SubscriptionID(self):
1412        request = IEventSubscription_get_SubscriptionID()
1413        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1414        resp.dump()
1415        return resp
1416
1417    def put_SubscriptionID(self, bstrSubscriptionID):
1418        request = IEventSubscription_put_SubscriptionID()
1419        request['bstrSubscriptionID'] = bstrSubscriptionID
1420        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1421        resp.dump()
1422        return resp
1423
1424    def get_SubscriptionName(self):
1425        request = IEventSubscription_get_SubscriptionName()
1426        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1427        return resp
1428
1429    def put_SubscriptionName(self, bstrSubscriptionName):
1430        request = IEventSubscription_put_SubscriptionName()
1431        request['bstrSubscriptionName'] = bstrSubscriptionName
1432        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1433        resp.dump()
1434        return resp
1435
1436    def get_PublisherID(self):
1437        request = IEventSubscription_get_PublisherID()
1438        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1439        resp.dump()
1440        return resp
1441
1442    def put_PublisherID(self, bstrPublisherID):
1443        request = IEventSubscription_put_PublisherID()
1444        request['bstrPublisherID'] = bstrPublisherID
1445        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1446        resp.dump()
1447        return resp
1448
1449    def get_EventClassID(self):
1450        request = IEventSubscription_get_EventClassID()
1451        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1452        resp.dump()
1453        return resp
1454
1455    def put_EventClassID(self, pbstrEventClassID):
1456        request = IEventSubscription_put_EventClassID()
1457        request['pbstrEventClassID'] = pbstrEventClassID
1458        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1459        resp.dump()
1460        return resp
1461
1462    def get_MethodName(self):
1463        request = IEventSubscription_get_MethodName()
1464        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1465        resp.dump()
1466        return resp
1467
1468    def put_MethodName(self, bstrMethodName):
1469        request = IEventSubscription_put_MethodName()
1470        request['bstrMethodName'] = bstrMethodName
1471        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1472        resp.dump()
1473        return resp
1474
1475    def get_SubscriberCLSID(self):
1476        request = IEventSubscription_get_SubscriberCLSID()
1477        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1478        resp.dump()
1479        return resp
1480
1481    def put_SubscriberCLSID(self, bstrSubscriberCLSID):
1482        request = IEventSubscription_put_SubscriberCLSID()
1483        request['bstrSubscriberCLSID'] = bstrSubscriberCLSID
1484        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1485        resp.dump()
1486        return resp
1487
1488    def get_SubscriberInterface(self):
1489        request = IEventSubscription_get_SubscriberInterface()
1490        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1491        resp.dump()
1492        return resp
1493
1494    def put_SubscriberInterface(self, pSubscriberInterface):
1495        request = IEventSubscription_put_SubscriberInterface()
1496        request['pSubscriberInterface'] = pSubscriberInterface
1497        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1498        resp.dump()
1499        return resp
1500
1501    def get_PerUser(self):
1502        request = IEventSubscription_get_PerUser()
1503        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1504        resp.dump()
1505        return resp
1506
1507    def put_PerUser(self, fPerUser):
1508        request = IEventSubscription_put_PerUser()
1509        request['fPerUser'] = fPerUser
1510        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1511        resp.dump()
1512        return resp
1513
1514    def get_OwnerSID(self):
1515        request = IEventSubscription_get_OwnerSID()
1516        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1517        resp.dump()
1518        return resp
1519
1520    def put_OwnerSID(self, bstrOwnerSID):
1521        request = IEventSubscription_put_OwnerSID()
1522        request['bstrOwnerSID'] = bstrOwnerSID
1523        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1524        resp.dump()
1525        return resp
1526
1527    def get_Enabled(self):
1528        request = IEventSubscription_get_Enabled()
1529        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1530        resp.dump()
1531        return resp
1532
1533    def put_Enabled(self, fEnabled):
1534        request = IEventSubscription_put_Enabled()
1535        request['fEnabled'] = fEnabled
1536        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1537        resp.dump()
1538        return resp
1539
1540    def get_Description(self):
1541        request = IEventSubscription_get_Description()
1542        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1543        resp.dump()
1544        return resp
1545
1546    def put_Description(self, bstrDescription):
1547        request = IEventSubscription_put_Description()
1548        request['bstrDescription'] = bstrDescription
1549        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1550        resp.dump()
1551        return resp
1552
1553    def get_MachineName(self):
1554        request = IEventSubscription_get_MachineName()
1555        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1556        resp.dump()
1557        return resp
1558
1559    def put_MachineName(self, bstrMachineName):
1560        request = IEventSubscription_put_MachineName()
1561        request['bstrMachineName'] = bstrMachineName
1562        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1563        resp.dump()
1564        return resp
1565
1566    def GetPublisherProperty(self):
1567        request = IEventSubscription_GetPublisherProperty()
1568        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1569        resp.dump()
1570        return resp
1571
1572    def PutPublisherProperty(self, bstrPropertyName, propertyValue):
1573        request = IEventSubscription_PutPublisherProperty()
1574        request['bstrPropertyName'] = bstrPropertyName
1575        request['propertyValue'] = propertyValue
1576        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1577        resp.dump()
1578        return resp
1579
1580    def RemovePublisherProperty(self, bstrPropertyName):
1581        request = IEventSubscription_RemovePublisherProperty()
1582        request['bstrPropertyName'] = bstrPropertyName
1583        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1584        resp.dump()
1585        return resp
1586
1587    def GetPublisherPropertyCollection(self):
1588        request = IEventSubscription_GetPublisherPropertyCollection()
1589        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1590        resp.dump()
1591        return resp
1592
1593    def GetSubscriberProperty(self):
1594        request = IEventSubscription_GetSubscriberProperty()
1595        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1596        resp.dump()
1597        return resp
1598
1599    def PutSubscriberProperty(self, bstrPropertyName, propertyValue):
1600        request = IEventSubscription_PutSubscriberProperty()
1601        request['bstrPropertyName'] = bstrPropertyName
1602        request['propertyValue'] = propertyValue
1603        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1604        resp.dump()
1605        return resp
1606
1607    def RemoveSubscriberProperty(self, bstrPropertyName):
1608        request = IEventSubscription_RemoveSubscriberProperty()
1609        request['bstrPropertyName'] = bstrPropertyName
1610        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1611        resp.dump()
1612        return resp
1613
1614    def GetSubscriberPropertyCollection(self):
1615        request = IEventSubscription_GetSubscriberPropertyCollection()
1616        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1617        resp.dump()
1618        return resp
1619
1620    def get_InterfaceID(self):
1621        request = IEventSubscription_get_InterfaceID()
1622        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1623        resp.dump()
1624        return resp
1625
1626    def put_InterfaceID(self, bstrInterfaceID):
1627        request = IEventSubscription_put_InterfaceID()
1628        request['bstrInterfaceID'] = bstrInterfaceID
1629        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1630        resp.dump()
1631        return resp
1632
1633class IEventSubscription2(IEventSubscription):
1634    def __init__(self, interface):
1635        IEventSubscription.__init__(self,interface)
1636        self._iid = IID_IEventSubscription2
1637
1638    def get_FilterCriteria(self):
1639        request = IEventSubscription2_get_FilterCriteria()
1640        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1641        resp.dump()
1642        return resp
1643
1644    def put_FilterCriteria(self, bstrFilterCriteria):
1645        request = IEventSubscription2_put_FilterCriteria()
1646        request['bstrFilterCriteria'] = bstrFilterCriteria
1647        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1648        resp.dump()
1649        return resp
1650
1651    def get_SubscriberMoniker (self):
1652        request = IEventSubscription2_get_SubscriberMoniker ()
1653        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1654        resp.dump()
1655        return resp
1656
1657    def put_SubscriberMoniker(self, bstrMoniker):
1658        request = IEventSubscription2_put_SubscriberMoniker()
1659        request['bstrMoniker'] = bstrMoniker
1660        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1661        resp.dump()
1662        return resp
1663
1664class IEventSubscription3(IEventSubscription2):
1665    def __init__(self, interface):
1666        IEventSubscription2.__init__(self,interface)
1667        self._iid = IID_IEventSubscription3
1668
1669    def get_EventClassPartitionID(self):
1670        request = IEventSubscription3_get_EventClassPartitionID()
1671        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1672        resp.dump()
1673        return resp
1674
1675    def put_EventClassPartitionID(self, bstrEventClassPartitionID):
1676        request = IEventSubscription3_put_EventClassPartitionID()
1677        request['bstrEventClassPartitionID'] = bstrEventClassPartitionID
1678        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1679        resp.dump()
1680        return resp
1681
1682    def get_EventClassApplicationID(self):
1683        request = IEventSubscription3_get_EventClassApplicationID()
1684        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1685        resp.dump()
1686        return resp
1687
1688    def put_EventClassApplicationID(self, bstrEventClassApplicationID):
1689        request = IEventSubscription3_put_EventClassApplicationID()
1690        request['bstrEventClassApplicationID'] = bstrEventClassApplicationID
1691        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1692        resp.dump()
1693        return resp
1694
1695    def get_SubscriberPartitionID(self):
1696        request = IEventSubscription3_get_SubscriberPartitionID()
1697        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1698        resp.dump()
1699        return resp
1700
1701    def put_SubscriberPartitionID(self, bstrSubscriberPartitionID):
1702        request = IEventSubscription3_put_SubscriberPartitionID()
1703        request['bstrSubscriberPartitionID'] = bstrSubscriberPartitionID
1704        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1705        resp.dump()
1706        return resp
1707
1708    def get_SubscriberApplicationID(self):
1709        request = IEventSubscription3_get_SubscriberApplicationID()
1710        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1711        resp.dump()
1712        return resp
1713
1714    def put_SubscriberApplicationID(self, bstrSubscriberApplicationID):
1715        request = IEventSubscription3_put_SubscriberApplicationID()
1716        request['bstrSubscriberApplicationID'] = bstrSubscriberApplicationID
1717        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1718        resp.dump()
1719        return resp
1720
1721
1722class IEnumEventObject(IDispatch):
1723    def __init__(self, interface):
1724        IDispatch.__init__(self,interface)
1725        self._iid = IID_IEnumEventObject
1726
1727    def Clone(self):
1728        request = IEnumEventObject_Clone()
1729        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1730        return IEnumEventObject(INTERFACE(self.get_cinstance(), ''.join(resp['ppInterface']['abData']), self.get_ipidRemUnknown(), target = self.get_target()))
1731
1732    def Next(self, cReqElem):
1733        request = IEnumEventObject_Next()
1734        request['cReqElem'] = cReqElem
1735        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1736        interfaces = list()
1737        for interface in resp['ppInterface']:
1738            interfaces.append(IEventClass2(INTERFACE(self.get_cinstance(), ''.join(interface['abData']), self.get_ipidRemUnknown(), target = self.get_target())))
1739        return interfaces
1740
1741    def Reset(self):
1742        request = IEnumEventObject_Reset()
1743        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1744        return resp
1745
1746    def Skip(self, cSkipElem):
1747        request = IEnumEventObject_Skip()
1748        request['cSkipElem'] = cSkipElem
1749        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1750        return resp
1751
1752class IEventObjectCollection(IDispatch):
1753    def __init__(self, interface):
1754        IDispatch.__init__(self,interface)
1755        self._iid = IID_IEventObjectCollection
1756
1757    def get__NewEnum(self):
1758        request = IEventObjectCollection_get__NewEnum()
1759        resp = self.request(request, iid = self._iid , uuid = self.get_iPid())
1760        return IEnumEventObject(INTERFACE(self.get_cinstance(), ''.join(resp['ppEnum']['abData']), self.get_ipidRemUnknown(), target = self._get_target()))
1761
1762    def get_Item(self, objectID):
1763        request = IEventObjectCollection_get_Item()
1764        request['objectID']['asData'] = objectID
1765        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1766        return resp
1767
1768    def get_NewEnum(self):
1769        request = IEventObjectCollection_get_NewEnum()
1770        resp = self.request(request, iid = self._iid , uuid = self.get_iPid())
1771        return IEnumEventObject(INTERFACE(self.get_cinstance(), ''.join(resp['ppEnum']['abData']), self.get_ipidRemUnknown(), target = self.get_target()))
1772
1773    def get_Count(self):
1774        request = IEventObjectCollection_get_Count()
1775        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1776        return resp
1777
1778    def Add(self, item, objectID):
1779        request = IEventObjectCollection_Add()
1780        request['item'] = item
1781        request['objectID']['asData'] = objectID
1782        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1783        return resp
1784
1785    def Remove(self, objectID):
1786        request = IEventObjectCollection_Remove()
1787        request['objectID']['asData'] = objectID
1788        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1789        return resp
1790
1791class IEventSystem(IDispatch):
1792    def __init__(self, interface):
1793        IDispatch.__init__(self,interface)
1794        self._iid = IID_IEventSystem
1795
1796    def Query(self, progID, queryCriteria):
1797        request = IEventSystem_Query()
1798        request['progID']['asData']=progID
1799        request['queryCriteria']['asData']=queryCriteria
1800        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1801        iInterface = IDispatch(INTERFACE(self.get_cinstance(), ''.join(resp['ppInterface']['abData']), self.get_ipidRemUnknown(), target = self.get_target()))
1802        return IEventObjectCollection(iInterface.RemQueryInterface(1, (IID_IEventObjectCollection,)))
1803
1804    def Store(self, progID, pInterface):
1805        request = IEventSystem_Store()
1806        request['progID']['asData']=progID
1807        request['pInterface'] = pInterface
1808        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1809        return resp
1810
1811    def Remove(self, progID, queryCriteria):
1812        request = IEventSystem_Remove()
1813        request['progID']['asData']=progID
1814        request['queryCriteria'] = queryCriteria
1815        resp = self.request(request, uuid = self.get_iPid())
1816        return resp
1817
1818    def get_EventObjectChangeEventClassID(self):
1819        request = IEventSystem_get_EventObjectChangeEventClassID()
1820        resp = self.request(request, uuid = self.get_iPid())
1821        return resp
1822
1823    def QueryS(self,progID, queryCriteria):
1824        request = IEventSystem_QueryS()
1825        request['progID']['asData']=progID
1826        request['queryCriteria']['asData']=queryCriteria
1827        resp = self.request(request, uuid = self.get_iPid())
1828        iInterface = IDispatch(INTERFACE(self.get_cinstance(), ''.join(resp['ppInterface']['abData']), self.get_ipidRemUnknown(), target = self.get_target()))
1829        return IEventObjectCollection(iInterface.RemQueryInterface(1, (IID_IEventObjectCollection,)))
1830
1831    def RemoveS(self,progID, queryCriteria):
1832        request = IEventSystem_RemoveS()
1833        request['progID']['asData']=progID
1834        request['queryCriteria']['asData']=queryCriteria
1835        resp = self.request(request, uuid = self.get_iPid())
1836        return resp
1837
1838class IEventSystem2(IEventSystem):
1839    def __init__(self, interface):
1840        IEventSystem.__init__(self,interface)
1841        self._iid = IID_IEventSystem2
1842
1843    def GetVersion(self):
1844        request = IEventSystem2_GetVersion()
1845        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1846        return resp
1847
1848    def VerifyTransientSubscribers(self):
1849        request = IEventSystem2_GetVersion()
1850        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1851        return resp
1852
1853class IEventSystemInitialize(IRemUnknown):
1854    def __init__(self, interface):
1855        IRemUnknown.__init__(self,interface)
1856        self._iid = IID_IEventSystemInitialize
1857
1858    def SetCOMCatalogBehaviour(self, bRetainSubKeys):
1859        request = IEventSystem2_GetVersion()
1860        request['bRetainSubKeys'] = bRetainSubKeys
1861        resp = self.request(request, iid = self._iid, uuid = self.get_iPid())
1862        return resp
1863
1864