### ms-comev.idl
"""
RPC definitions for the following interfaces:
- IEventObjectCollection (v0.0): f89ac270-d4eb-11d1-b682-00805fc79216
- IEventSystem (v0.0): 4E14FB9F-2E22-11D1-9964-00C04FBBB345
- IEventClass (v0.0): fb2b72a0-7a68-11d1-88f9-0080c7d771bf
- IEventClass2 (v0.0): fb2b72a1-7a68-11d1-88f9-0080c7d771bf
- IEnumEventObject (v0.0): F4A07D63-2E25-11D1-9964-00C04FBBB345
- IEventSubscription (v0.0): 4A6B0E15-2E38-11D1-9965-00C04FBBB345
- IEventSubscription2 (v0.0): 4A6B0E16-2E38-11D1-9965-00C04FBBB345
- IEventClass3 (v0.0): 7FB7EA43-2D76-4ea8-8CD9-3DECC270295E
- IEventSubscription3 (v0.0): FBC1D17D-C498-43a0-81AF-423DDD530AF6
- IEventSystem2 (v0.0): 99CC098F-A48A-4e9c-8E58-965C0AFC19D5
- IEventSystemInitialize (v0.0): a0e8f27a-888c-11d1-b763-00c04fb926af
This file is auto-generated by midl-to-scapy, do not modify.
"""

from enum import IntEnum
import uuid

from scapy.fields import PacketListField
from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfPacketListField,
    NDRConfStrLenField,
    NDRConfStrLenFieldUtf16,
    NDRConfVarPacketListField,
    NDRFullPointerField,
    NDRIntField,
    NDRPacketField,
    NDRRecursiveField,
    NDRRefEmbPointerField,
    NDRShortField,
    NDRSignedIntField,
    NDRSignedLongField,
    register_com_interface,
    register_dcerpc_interface,
)


class MInterfacePointer(NDRPacket):
    ALIGNMENT = (4, 8)
    DEPORTED_CONFORMANTS = ["abData"]
    fields_desc = [
        NDRIntField("ulCntData", None, size_of="abData"),
        NDRConfStrLenField(
            "abData", "", size_is=lambda pkt: pkt.ulCntData, conformant_in_struct=True
        ),
    ]


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


class get__NewEnum_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("ppUnkEnum", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 0),
    ]


class FLAGGED_WORD_BLOB(NDRPacket):
    ALIGNMENT = (4, 8)
    DEPORTED_CONFORMANTS = ["asData"]
    fields_desc = [
        NDRIntField("cBytes", 0),
        NDRIntField("clSize", None, size_of="asData"),
        NDRConfStrLenFieldUtf16(
            "asData", "", size_is=lambda pkt: pkt.clSize, conformant_in_struct=True
        ),
    ]


class VARENUM(IntEnum):
    VT_EMPTY = 0
    VT_NULL = 1
    VT_I2 = 2
    VT_I4 = 3
    VT_R4 = 4
    VT_R8 = 5
    VT_CY = 6
    VT_DATE = 7
    VT_BSTR = 8
    VT_DISPATCH = 9
    VT_ERROR = 10
    VT_BOOL = 11
    VT_VARIANT = 12
    VT_UNKNOWN = 13
    VT_DECIMAL = 14
    VT_I1 = 16
    VT_UI1 = 17
    VT_UI2 = 18
    VT_UI4 = 19
    VT_I8 = 20
    VT_UI8 = 21
    VT_INT = 22
    VT_UINT = 23
    VT_VOID = 24
    VT_HRESULT = 25
    VT_PTR = 26
    VT_SAFEARRAY = 27
    VT_CARRAY = 28
    VT_USERDEFINED = 29
    VT_LPSTR = 30
    VT_LPWSTR = 31
    VT_RECORD = 36
    VT_INT_PTR = 37
    VT_UINT_PTR = 38
    VT_ARRAY = 8192
    VT_BYREF = 16384


class CURRENCY(NDRPacket):
    ALIGNMENT = (8, 8)
    fields_desc = [NDRSignedLongField("int64", 0)]


class VARENUM(IntEnum):
    VT_EMPTY = 0
    VT_NULL = 1
    VT_I2 = 2
    VT_I4 = 3
    VT_R4 = 4
    VT_R8 = 5
    VT_CY = 6
    VT_DATE = 7
    VT_BSTR = 8
    VT_DISPATCH = 9
    VT_ERROR = 10
    VT_BOOL = 11
    VT_VARIANT = 12
    VT_UNKNOWN = 13
    VT_DECIMAL = 14
    VT_I1 = 16
    VT_UI1 = 17
    VT_UI2 = 18
    VT_UI4 = 19
    VT_I8 = 20
    VT_UI8 = 21
    VT_INT = 22
    VT_UINT = 23
    VT_VOID = 24
    VT_HRESULT = 25
    VT_PTR = 26
    VT_SAFEARRAY = 27
    VT_CARRAY = 28
    VT_USERDEFINED = 29
    VT_LPSTR = 30
    VT_LPWSTR = 31
    VT_RECORD = 36
    VT_INT_PTR = 37
    VT_UINT_PTR = 38
    VT_ARRAY = 8192
    VT_BYREF = 16384


class SF_TYPE(IntEnum):
    SF_ERROR = VARENUM.VT_ERROR
    SF_I1 = VARENUM.VT_I1
    SF_I2 = VARENUM.VT_I2
    SF_I4 = VARENUM.VT_I4
    SF_I8 = VARENUM.VT_I8
    SF_BSTR = VARENUM.VT_BSTR
    SF_UNKNOWN = VARENUM.VT_UNKNOWN
    SF_DISPATCH = VARENUM.VT_DISPATCH
    SF_VARIANT = VARENUM.VT_VARIANT
    SF_RECORD = VARENUM.VT_RECORD
    SF_HAVEIID = VARENUM.VT_UNKNOWN | 32768


class SAFEARR_BSTR(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("Size", None, size_of="aBstr"),
        NDRRefEmbPointerField(
            NDRConfPacketListField(
                "aBstr", [], FLAGGED_WORD_BLOB, size_is=lambda pkt: pkt.Size
            ),
            deferred=True,
        ),
    ]


class SAFEARR_UNKNOWN(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("Size", None, size_of="apUnknown"),
        NDRRefEmbPointerField(
            NDRConfPacketListField(
                "apUnknown", [], MInterfacePointer, size_is=lambda pkt: pkt.Size
            ),
            deferred=True,
        ),
    ]


class SAFEARR_DISPATCH(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRIntField("Size", None, size_of="apDispatch"),
        NDRRefEmbPointerField(
            NDRConfPacketListField(
                "apDispatch", [], MInterfacePointer, size_is=lambda pkt: pkt.Size
            ),
            deferred=True,
        ),
    ]


class wireVARIANTStr(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [
        NDRIntField("clSize", 0),
        NDRIntField("rpcReserved", 0),
        NDRShortField("vt", 0),
        NDRShortField("wReserved1", 0),
        NDRShortField("wReserved2", 0),
        NDRShortField("wReserved3", 0),
        NDRRecursiveField("_varUnion"),
    ]


class get_Item_Request(NDRPacket):
    fields_desc = [NDRPacketField("objectID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


class get_Item_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRPacketField("pItem", wireVARIANTStr(), wireVARIANTStr)),
        NDRIntField("status", 0),
    ]


class get_NewEnum_Request(NDRPacket):
    fields_desc = []


class get_NewEnum_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("ppEnum", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 0),
    ]


class get_Count_Request(NDRPacket):
    fields_desc = []


class get_Count_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("pCount", 0), NDRIntField("status", 0)]


class Add_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRPacketField("item", wireVARIANTStr(), wireVARIANTStr)),
        NDRPacketField("objectID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


class Add_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class Remove_Request(NDRPacket):
    fields_desc = [NDRPacketField("objectID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


class Remove_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTOBJECTCOLLECTION_OPNUMS = {
    0: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    1: DceRpcOp(get_Item_Request, get_Item_Response),
    2: DceRpcOp(get_NewEnum_Request, get_NewEnum_Response),
    3: DceRpcOp(get_Count_Request, get_Count_Response),
    4: DceRpcOp(Add_Request, Add_Response),
    5: DceRpcOp(Remove_Request, Remove_Response),
}
register_com_interface(
    name="IEventObjectCollection",
    uuid=uuid.UUID("f89ac270-d4eb-11d1-b682-00805fc79216"),
    opnums=IEVENTOBJECTCOLLECTION_OPNUMS,
)


class Query_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("progID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRPacketField("queryCriteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


class Query_Response(NDRPacket):
    fields_desc = [
        NDRSignedIntField("errorIndex", 0),
        NDRFullPointerField(
            NDRPacketField("ppInterface", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 0),
    ]


class Store_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("ProgID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRPacketField("pInterface", MInterfacePointer(), MInterfacePointer),
    ]


class Store_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class Remove_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("progID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRPacketField("queryCriteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


class Remove_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("errorIndex", 0), NDRIntField("status", 0)]


class get_EventObjectChangeEventClassID_Request(NDRPacket):
    fields_desc = []


class get_EventObjectChangeEventClassID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrEventClassID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class QueryS_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("progID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRPacketField("queryCriteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


class QueryS_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("ppInterface", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 0),
    ]


class RemoveS_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("progID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRPacketField("queryCriteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


class RemoveS_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTSYSTEM_OPNUMS = {
    0: DceRpcOp(Query_Request, Query_Response),
    1: DceRpcOp(Store_Request, Store_Response),
    2: DceRpcOp(Remove_Request, Remove_Response),
    3: DceRpcOp(
        get_EventObjectChangeEventClassID_Request,
        get_EventObjectChangeEventClassID_Response,
    ),
    4: DceRpcOp(QueryS_Request, QueryS_Response),
    5: DceRpcOp(RemoveS_Request, RemoveS_Response),
}
register_com_interface(
    name="IEventSystem",
    uuid=uuid.UUID("4E14FB9F-2E22-11D1-9964-00C04FBBB345"),
    opnums=IEVENTSYSTEM_OPNUMS,
)


class get_EventClassID_Request(NDRPacket):
    fields_desc = []


class get_EventClassID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrEventClassID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_EventClassID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrEventClassID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_EventClassID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_EventClassName_Request(NDRPacket):
    fields_desc = []


class get_EventClassName_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrEventClassName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_EventClassName_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrEventClassName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_EventClassName_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_OwnerSID_Request(NDRPacket):
    fields_desc = []


class get_OwnerSID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrOwnerSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_OwnerSID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrOwnerSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_OwnerSID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_FiringInterfaceID_Request(NDRPacket):
    fields_desc = []


class get_FiringInterfaceID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrFiringInterfaceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_FiringInterfaceID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrFiringInterfaceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_FiringInterfaceID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_Description_Request(NDRPacket):
    fields_desc = []


class get_Description_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrDescription", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_Description_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrDescription", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_Description_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_TypeLib_Request(NDRPacket):
    fields_desc = []


class get_TypeLib_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrTypeLib", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_TypeLib_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrTypeLib", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_TypeLib_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTCLASS_OPNUMS = {
    0: DceRpcOp(get_EventClassID_Request, get_EventClassID_Response),
    1: DceRpcOp(put_EventClassID_Request, put_EventClassID_Response),
    2: DceRpcOp(get_EventClassName_Request, get_EventClassName_Response),
    3: DceRpcOp(put_EventClassName_Request, put_EventClassName_Response),
    4: DceRpcOp(get_OwnerSID_Request, get_OwnerSID_Response),
    5: DceRpcOp(put_OwnerSID_Request, put_OwnerSID_Response),
    6: DceRpcOp(get_FiringInterfaceID_Request, get_FiringInterfaceID_Response),
    7: DceRpcOp(put_FiringInterfaceID_Request, put_FiringInterfaceID_Response),
    8: DceRpcOp(get_Description_Request, get_Description_Response),
    9: DceRpcOp(put_Description_Request, put_Description_Response),
    # 10: Opnum17NotUsedOnWire,
    # 11: Opnum18NotUsedOnWire,
    12: DceRpcOp(get_TypeLib_Request, get_TypeLib_Response),
    13: DceRpcOp(put_TypeLib_Request, put_TypeLib_Response),
}
register_com_interface(
    name="IEventClass",
    uuid=uuid.UUID("fb2b72a0-7a68-11d1-88f9-0080c7d771bf"),
    opnums=IEVENTCLASS_OPNUMS,
)


class get_PublisherID_Request(NDRPacket):
    fields_desc = []


class get_PublisherID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrPublisherID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_PublisherID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPublisherID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_PublisherID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_MultiInterfacePublisherFilterCLSID_Request(NDRPacket):
    fields_desc = []


class get_MultiInterfacePublisherFilterCLSID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrPubFilCLSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_MultiInterfacePublisherFilterCLSID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPubFilCLSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_MultiInterfacePublisherFilterCLSID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_AllowInprocActivation_Request(NDRPacket):
    fields_desc = []


class get_AllowInprocActivation_Response(NDRPacket):
    fields_desc = [
        NDRSignedIntField("pfAllowInprocActivation", 0),
        NDRIntField("status", 0),
    ]


class put_AllowInprocActivation_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("fAllowInprocActivation", 0)]


class put_AllowInprocActivation_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_FireInParallel_Request(NDRPacket):
    fields_desc = []


class get_FireInParallel_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("pfFireInParallel", 0), NDRIntField("status", 0)]


class put_FireInParallel_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("fFireInParallel", 0)]


class put_FireInParallel_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTCLASS2_OPNUMS = {
    0: DceRpcOp(get_PublisherID_Request, get_PublisherID_Response),
    1: DceRpcOp(put_PublisherID_Request, put_PublisherID_Response),
    2: DceRpcOp(
        get_MultiInterfacePublisherFilterCLSID_Request,
        get_MultiInterfacePublisherFilterCLSID_Response,
    ),
    3: DceRpcOp(
        put_MultiInterfacePublisherFilterCLSID_Request,
        put_MultiInterfacePublisherFilterCLSID_Response,
    ),
    4: DceRpcOp(get_AllowInprocActivation_Request, get_AllowInprocActivation_Response),
    5: DceRpcOp(put_AllowInprocActivation_Request, put_AllowInprocActivation_Response),
    6: DceRpcOp(get_FireInParallel_Request, get_FireInParallel_Response),
    7: DceRpcOp(put_FireInParallel_Request, put_FireInParallel_Response),
}
register_com_interface(
    name="IEventClass2",
    uuid=uuid.UUID("fb2b72a1-7a68-11d1-88f9-0080c7d771bf"),
    opnums=IEVENTCLASS2_OPNUMS,
)


class Clone_Request(NDRPacket):
    fields_desc = []


class Clone_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("ppInterface", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 0),
    ]


class Next_Request(NDRPacket):
    fields_desc = [NDRIntField("cReqElem", 0)]


class Next_Response(NDRPacket):
    fields_desc = [
        NDRConfVarPacketListField(
            "ppInterface",
            [],
            MInterfacePointer,
            size_is=lambda pkt: pkt.cReqElem,
            length_is=lambda pkt: pkt.cRetElem,
            ptr_pack=True,
        ),
        NDRIntField("cRetElem", None, size_of="ppInterface"),
        NDRIntField("status", 0),
    ]


class Reset_Request(NDRPacket):
    fields_desc = []


class Reset_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class Skip_Request(NDRPacket):
    fields_desc = [NDRIntField("cSkipElem", 0)]


class Skip_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IENUMEVENTOBJECT_OPNUMS = {
    0: DceRpcOp(Clone_Request, Clone_Response),
    1: DceRpcOp(Next_Request, Next_Response),
    2: DceRpcOp(Reset_Request, Reset_Response),
    3: DceRpcOp(Skip_Request, Skip_Response),
}
register_com_interface(
    name="IEnumEventObject",
    uuid=uuid.UUID("F4A07D63-2E25-11D1-9964-00C04FBBB345"),
    opnums=IENUMEVENTOBJECT_OPNUMS,
)


class get_SubscriptionID_Request(NDRPacket):
    fields_desc = []


class get_SubscriptionID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrSubscriptionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_SubscriptionID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrSubscriptionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_SubscriptionID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_SubscriptionName_Request(NDRPacket):
    fields_desc = []


class get_SubscriptionName_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrSubscriptionName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_SubscriptionName_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrSubscriptionName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_SubscriptionName_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_PublisherID_Request(NDRPacket):
    fields_desc = []


class get_PublisherID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrPublisherID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_PublisherID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPublisherID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_PublisherID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_EventClassID_Request(NDRPacket):
    fields_desc = []


class get_EventClassID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrEventClassID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_EventClassID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrEventClassID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_EventClassID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_MethodName_Request(NDRPacket):
    fields_desc = []


class get_MethodName_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrMethodName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_MethodName_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrMethodName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_MethodName_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_SubscriberCLSID_Request(NDRPacket):
    fields_desc = []


class get_SubscriberCLSID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrSubscriberCLSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_SubscriberCLSID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrSubscriberCLSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_SubscriberCLSID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_SubscriberInterface_Request(NDRPacket):
    fields_desc = []


class get_SubscriberInterface_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "ppSubscriberInterface", MInterfacePointer(), MInterfacePointer
            )
        ),
        NDRIntField("status", 0),
    ]


class put_SubscriberInterface_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("pSubscriberInterface", MInterfacePointer(), MInterfacePointer)
    ]


class put_SubscriberInterface_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_PerUser_Request(NDRPacket):
    fields_desc = []


class get_PerUser_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("pfPerUser", 0), NDRIntField("status", 0)]


class put_PerUser_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("fPerUser", 0)]


class put_PerUser_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_OwnerSID_Request(NDRPacket):
    fields_desc = []


class get_OwnerSID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrOwnerSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_OwnerSID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrOwnerSID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_OwnerSID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_Enabled_Request(NDRPacket):
    fields_desc = []


class get_Enabled_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("pfEnabled", 0), NDRIntField("status", 0)]


class put_Enabled_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("fEnabled", 0)]


class put_Enabled_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_Description_Request(NDRPacket):
    fields_desc = []


class get_Description_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrDescription", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_Description_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrDescription", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_Description_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_MachineName_Request(NDRPacket):
    fields_desc = []


class get_MachineName_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrMachineName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_MachineName_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrMachineName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_MachineName_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class GetPublisherProperty_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPropertyName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class GetPublisherProperty_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("propertyValue", wireVARIANTStr(), wireVARIANTStr)
        ),
        NDRIntField("status", 0),
    ]


class PutPublisherProperty_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPropertyName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRFullPointerField(
            NDRPacketField("propertyValue", wireVARIANTStr(), wireVARIANTStr)
        ),
    ]


class PutPublisherProperty_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class RemovePublisherProperty_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPropertyName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class RemovePublisherProperty_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class GetPublisherPropertyCollection_Request(NDRPacket):
    fields_desc = []


class GetPublisherPropertyCollection_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("collection", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 0),
    ]


class GetSubscriberProperty_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPropertyName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class GetSubscriberProperty_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("propertyValue", wireVARIANTStr(), wireVARIANTStr)
        ),
        NDRIntField("status", 0),
    ]


class PutSubscriberProperty_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPropertyName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRFullPointerField(
            NDRPacketField("propertyValue", wireVARIANTStr(), wireVARIANTStr)
        ),
    ]


class PutSubscriberProperty_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class RemoveSubscriberProperty_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrPropertyName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class RemoveSubscriberProperty_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class GetSubscriberPropertyCollection_Request(NDRPacket):
    fields_desc = []


class GetSubscriberPropertyCollection_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("collection", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 0),
    ]


class get_InterfaceID_Request(NDRPacket):
    fields_desc = []


class get_InterfaceID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrInterfaceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_InterfaceID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrInterfaceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_InterfaceID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTSUBSCRIPTION_OPNUMS = {
    0: DceRpcOp(get_SubscriptionID_Request, get_SubscriptionID_Response),
    1: DceRpcOp(put_SubscriptionID_Request, put_SubscriptionID_Response),
    2: DceRpcOp(get_SubscriptionName_Request, get_SubscriptionName_Response),
    3: DceRpcOp(put_SubscriptionName_Request, put_SubscriptionName_Response),
    4: DceRpcOp(get_PublisherID_Request, get_PublisherID_Response),
    5: DceRpcOp(put_PublisherID_Request, put_PublisherID_Response),
    6: DceRpcOp(get_EventClassID_Request, get_EventClassID_Response),
    7: DceRpcOp(put_EventClassID_Request, put_EventClassID_Response),
    8: DceRpcOp(get_MethodName_Request, get_MethodName_Response),
    9: DceRpcOp(put_MethodName_Request, put_MethodName_Response),
    10: DceRpcOp(get_SubscriberCLSID_Request, get_SubscriberCLSID_Response),
    11: DceRpcOp(put_SubscriberCLSID_Request, put_SubscriberCLSID_Response),
    12: DceRpcOp(get_SubscriberInterface_Request, get_SubscriberInterface_Response),
    13: DceRpcOp(put_SubscriberInterface_Request, put_SubscriberInterface_Response),
    14: DceRpcOp(get_PerUser_Request, get_PerUser_Response),
    15: DceRpcOp(put_PerUser_Request, put_PerUser_Response),
    16: DceRpcOp(get_OwnerSID_Request, get_OwnerSID_Response),
    17: DceRpcOp(put_OwnerSID_Request, put_OwnerSID_Response),
    18: DceRpcOp(get_Enabled_Request, get_Enabled_Response),
    19: DceRpcOp(put_Enabled_Request, put_Enabled_Response),
    20: DceRpcOp(get_Description_Request, get_Description_Response),
    21: DceRpcOp(put_Description_Request, put_Description_Response),
    22: DceRpcOp(get_MachineName_Request, get_MachineName_Response),
    23: DceRpcOp(put_MachineName_Request, put_MachineName_Response),
    24: DceRpcOp(GetPublisherProperty_Request, GetPublisherProperty_Response),
    25: DceRpcOp(PutPublisherProperty_Request, PutPublisherProperty_Response),
    26: DceRpcOp(RemovePublisherProperty_Request, RemovePublisherProperty_Response),
    27: DceRpcOp(
        GetPublisherPropertyCollection_Request, GetPublisherPropertyCollection_Response
    ),
    28: DceRpcOp(GetSubscriberProperty_Request, GetSubscriberProperty_Response),
    29: DceRpcOp(PutSubscriberProperty_Request, PutSubscriberProperty_Response),
    30: DceRpcOp(RemoveSubscriberProperty_Request, RemoveSubscriberProperty_Response),
    31: DceRpcOp(
        GetSubscriberPropertyCollection_Request,
        GetSubscriberPropertyCollection_Response,
    ),
    32: DceRpcOp(get_InterfaceID_Request, get_InterfaceID_Response),
    33: DceRpcOp(put_InterfaceID_Request, put_InterfaceID_Response),
}
register_com_interface(
    name="IEventSubscription",
    uuid=uuid.UUID("4A6B0E15-2E38-11D1-9965-00C04FBBB345"),
    opnums=IEVENTSUBSCRIPTION_OPNUMS,
)


class get_FilterCriteria_Request(NDRPacket):
    fields_desc = []


class get_FilterCriteria_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrFilterCriteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_FilterCriteria_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrFilterCriteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_FilterCriteria_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_SubscriberMoniker_Request(NDRPacket):
    fields_desc = []


class get_SubscriberMoniker_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pbstrMoniker", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
        ),
        NDRIntField("status", 0),
    ]


class put_SubscriberMoniker_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("bstrMoniker", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)
    ]


class put_SubscriberMoniker_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTSUBSCRIPTION2_OPNUMS = {
    0: DceRpcOp(get_FilterCriteria_Request, get_FilterCriteria_Response),
    1: DceRpcOp(put_FilterCriteria_Request, put_FilterCriteria_Response),
    2: DceRpcOp(get_SubscriberMoniker_Request, get_SubscriberMoniker_Response),
    3: DceRpcOp(put_SubscriberMoniker_Request, put_SubscriberMoniker_Response),
}
register_com_interface(
    name="IEventSubscription2",
    uuid=uuid.UUID("4A6B0E16-2E38-11D1-9965-00C04FBBB345"),
    opnums=IEVENTSUBSCRIPTION2_OPNUMS,
)


class get_EventClassPartitionID_Request(NDRPacket):
    fields_desc = []


class get_EventClassPartitionID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrEventClassPartitionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_EventClassPartitionID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "bstrEventClassPartitionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
        )
    ]


class put_EventClassPartitionID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_EventClassApplicationID_Request(NDRPacket):
    fields_desc = []


class get_EventClassApplicationID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrEventClassApplicationID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_EventClassApplicationID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "bstrEventClassApplicationID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
        )
    ]


class put_EventClassApplicationID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTCLASS3_OPNUMS = {
    0: DceRpcOp(get_EventClassPartitionID_Request, get_EventClassPartitionID_Response),
    1: DceRpcOp(put_EventClassPartitionID_Request, put_EventClassPartitionID_Response),
    2: DceRpcOp(
        get_EventClassApplicationID_Request, get_EventClassApplicationID_Response
    ),
    3: DceRpcOp(
        put_EventClassApplicationID_Request, put_EventClassApplicationID_Response
    ),
}
register_com_interface(
    name="IEventClass3",
    uuid=uuid.UUID("7FB7EA43-2D76-4ea8-8CD9-3DECC270295E"),
    opnums=IEVENTCLASS3_OPNUMS,
)


class get_EventClassPartitionID_Request(NDRPacket):
    fields_desc = []


class get_EventClassPartitionID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrEventClassPartitionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_EventClassPartitionID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "bstrEventClassPartitionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
        )
    ]


class put_EventClassPartitionID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_EventClassApplicationID_Request(NDRPacket):
    fields_desc = []


class get_EventClassApplicationID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrEventClassApplicationID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_EventClassApplicationID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "bstrEventClassApplicationID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
        )
    ]


class put_EventClassApplicationID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_SubscriberPartitionID_Request(NDRPacket):
    fields_desc = []


class get_SubscriberPartitionID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrSubscriberPartitionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_SubscriberPartitionID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "bstrSubscriberPartitionID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
        )
    ]


class put_SubscriberPartitionID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


class get_SubscriberApplicationID_Request(NDRPacket):
    fields_desc = []


class get_SubscriberApplicationID_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField(
                "pbstrSubscriberApplicationID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
            )
        ),
        NDRIntField("status", 0),
    ]


class put_SubscriberApplicationID_Request(NDRPacket):
    fields_desc = [
        NDRPacketField(
            "bstrSubscriberApplicationID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB
        )
    ]


class put_SubscriberApplicationID_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTSUBSCRIPTION3_OPNUMS = {
    0: DceRpcOp(get_EventClassPartitionID_Request, get_EventClassPartitionID_Response),
    1: DceRpcOp(put_EventClassPartitionID_Request, put_EventClassPartitionID_Response),
    2: DceRpcOp(
        get_EventClassApplicationID_Request, get_EventClassApplicationID_Response
    ),
    3: DceRpcOp(
        put_EventClassApplicationID_Request, put_EventClassApplicationID_Response
    ),
    4: DceRpcOp(get_SubscriberPartitionID_Request, get_SubscriberPartitionID_Response),
    5: DceRpcOp(put_SubscriberPartitionID_Request, put_SubscriberPartitionID_Response),
    6: DceRpcOp(
        get_SubscriberApplicationID_Request, get_SubscriberApplicationID_Response
    ),
    7: DceRpcOp(
        put_SubscriberApplicationID_Request, put_SubscriberApplicationID_Response
    ),
}
register_com_interface(
    name="IEventSubscription3",
    uuid=uuid.UUID("FBC1D17D-C498-43a0-81AF-423DDD530AF6"),
    opnums=IEVENTSUBSCRIPTION3_OPNUMS,
)


class GetVersion_Request(NDRPacket):
    fields_desc = []


class GetVersion_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("pnVersion", 0), NDRIntField("status", 0)]


class VerifyTransientSubscribers_Request(NDRPacket):
    fields_desc = []


class VerifyTransientSubscribers_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTSYSTEM2_OPNUMS = {
    0: DceRpcOp(GetVersion_Request, GetVersion_Response),
    1: DceRpcOp(
        VerifyTransientSubscribers_Request, VerifyTransientSubscribers_Response
    ),
}
register_com_interface(
    name="IEventSystem2",
    uuid=uuid.UUID("99CC098F-A48A-4e9c-8E58-965C0AFC19D5"),
    opnums=IEVENTSYSTEM2_OPNUMS,
)


class SetCOMCatalogBehaviour_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("bRetainSubKeys", 0)]


class SetCOMCatalogBehaviour_Response(NDRPacket):
    fields_desc = [NDRIntField("status", 0)]


IEVENTSYSTEMINITIALIZE_OPNUMS = {
    0: DceRpcOp(SetCOMCatalogBehaviour_Request, SetCOMCatalogBehaviour_Response)
}
register_dcerpc_interface(
    name="IEventSystemInitialize",
    uuid=uuid.UUID("a0e8f27a-888c-11d1-b763-00c04fb926af"),
    version="0.0",
    opnums=IEVENTSYSTEMINITIALIZE_OPNUMS,
)
