### mc-mqac.idl
"""
RPC definitions for the following interfaces:
- ITransaction (v0.0): 0fb15084-af41-11ce-bd2b-204c4f4f5020
- IEnumConnections (v0.0): B196B287-BAB4-101A-B69C-00AA00341D07
- IConnectionPointContainer (v0.0): B196B284-BAB4-101A-B69C-00AA00341D07
- IConnectionPoint (v0.0): B196B286-BAB4-101A-B69C-00AA00341D07
- IEnumConnectionPoints (v0.0): B196B285-BAB4-101A-B69C-00AA00341D07
- IMSMQQuery (v0.0): None
- IMSMQQueueInfo (v0.0): None
- IMSMQQueueInfo2 (v0.0): None
- IMSMQQueueInfo3 (v0.0): None
- IMSMQQueueInfo4 (v0.0): None
- IMSMQQueue (v0.0): None
- IMSMQQueue2 (v0.0): None
- IMSMQQueue3 (v0.0): None
- IMSMQQueue4 (v0.0): None
- IMSMQMessage (v0.0): None
- IMSMQQueueInfos (v0.0): None
- IMSMQQueueInfos2 (v0.0): None
- IMSMQQueueInfos3 (v0.0): None
- IMSMQQueueInfos4 (v0.0): None
- IMSMQEvent (v0.0): None
- IMSMQEvent2 (v0.0): None
- IMSMQEvent3 (v0.0): None
- IMSMQTransaction (v0.0): None
- IMSMQCoordinatedTransactionDispenser (v0.0): None
- IMSMQTransactionDispenser (v0.0): None
- IMSMQQuery2 (v0.0): None
- IMSMQQuery3 (v0.0): None
- IMSMQQuery4 (v0.0): None
- IMSMQMessage2 (v0.0): None
- IMSMQMessage3 (v0.0): None
- IMSMQMessage4 (v0.0): None
- IMSMQPrivateEvent (v0.0): None
- IMSMQTransaction2 (v0.0): None
- IMSMQTransaction3 (v0.0): None
- IMSMQCoordinatedTransactionDispenser2 (v0.0): None
- IMSMQCoordinatedTransactionDispenser3 (v0.0): None
- IMSMQTransactionDispenser2 (v0.0): None
- IMSMQTransactionDispenser3 (v0.0): None
- IMSMQApplication (v0.0): None
- IMSMQApplication2 (v0.0): None
- IMSMQApplication3 (v0.0): None
- IMSMQDestination (v0.0): None
- IMSMQPrivateDestination (v0.0): None
- IMSMQCollection (v0.0): None
- IMSMQManagement (v0.0): None
- IMSMQOutgoingQueueManagement (v0.0): None
- IMSMQQueueManagement (v0.0): None
This file is auto-generated by midl-to-scapy, do not modify.
"""

import uuid

from scapy.fields import PacketListField, StrFixedLenField
from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfStrLenField,
    NDRConfVarPacketListField,
    NDRFullPointerField,
    NDRIntField,
    NDRPacketField,
    NDRShortField,
    NDRSignedIntField,
    NDRSignedShortField,
    register_com_interface,
)


class Commit_Request(NDRPacket):
    fields_desc = [
        NDRSignedShortField("fRetaining", 0),
        NDRIntField("grfTC", 0),
        NDRIntField("grfRM", 0),
    ]


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


class BOID(NDRPacket):
    fields_desc = [StrFixedLenField("rgb", "", length=16)]


class Abort_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRPacketField("pboidReason", BOID(), BOID)),
        NDRSignedShortField("fRetaining", 0),
        NDRSignedShortField("fAsync", 0),
    ]


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


class XACTTRANSINFO(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [
        NDRPacketField("uow", BOID(), BOID),
        NDRSignedIntField("isoLevel", 0),
        NDRIntField("isoFlags", 0),
        NDRIntField("grfTCSupported", 0),
        NDRIntField("grfRMSupported", 0),
        NDRIntField("grfTCSupportedRetaining", 0),
        NDRIntField("grfRMSupportedRetaining", 0),
    ]


class GetTransactionInfo_Request(NDRPacket):
    fields_desc = []


class GetTransactionInfo_Response(NDRPacket):
    fields_desc = [
        NDRPacketField("pinfo", XACTTRANSINFO(), XACTTRANSINFO),
        NDRIntField("status", 0),
    ]


ITRANSACTION_OPNUMS = {
    0: DceRpcOp(Commit_Request, Commit_Response),
    1: DceRpcOp(Abort_Request, Abort_Response),
    2: DceRpcOp(GetTransactionInfo_Request, GetTransactionInfo_Response),
}
register_com_interface(
    name="ITransaction",
    uuid=uuid.UUID("0fb15084-af41-11ce-bd2b-204c4f4f5020"),
    opnums=ITRANSACTION_OPNUMS,
)


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 CONNECTDATA(NDRPacket):
    ALIGNMENT = (4, 8)
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("pUnk", MInterfacePointer(), MInterfacePointer),
            deferred=True,
        ),
        NDRIntField("dwCookie", 0),
    ]


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


class Next_Response(NDRPacket):
    fields_desc = [
        NDRConfVarPacketListField(
            "rgcd",
            [CONNECTDATA()],
            CONNECTDATA,
            size_is=lambda pkt: pkt.cConnections,
            length_is=lambda pkt: pkt.pcFetched,
        ),
        NDRIntField("pcFetched", None, size_of="rgcd"),
        NDRIntField("status", 0),
    ]


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


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


class Reset_Request(NDRPacket):
    fields_desc = []


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


class Clone_Request(NDRPacket):
    fields_desc = []


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


IENUMCONNECTIONS_OPNUMS = {
    0: DceRpcOp(Next_Request, Next_Response),
    1: DceRpcOp(Skip_Request, Skip_Response),
    2: DceRpcOp(Reset_Request, Reset_Response),
    3: DceRpcOp(Clone_Request, Clone_Response),
}
register_com_interface(
    name="IEnumConnections",
    uuid=uuid.UUID("B196B287-BAB4-101A-B69C-00AA00341D07"),
    opnums=IENUMCONNECTIONS_OPNUMS,
)


class EnumConnectionPoints_Request(NDRPacket):
    fields_desc = []


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


class GUID(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [
        NDRIntField("Data1", 0),
        NDRShortField("Data2", 0),
        NDRShortField("Data3", 0),
        StrFixedLenField("Data4", "", length=8),
    ]


class FindConnectionPoint_Request(NDRPacket):
    fields_desc = [NDRPacketField("riid", GUID(), GUID)]


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


ICONNECTIONPOINTCONTAINER_OPNUMS = {
    0: DceRpcOp(EnumConnectionPoints_Request, EnumConnectionPoints_Response),
    1: DceRpcOp(FindConnectionPoint_Request, FindConnectionPoint_Response),
}
register_com_interface(
    name="IConnectionPointContainer",
    uuid=uuid.UUID("B196B284-BAB4-101A-B69C-00AA00341D07"),
    opnums=ICONNECTIONPOINTCONTAINER_OPNUMS,
)


class GetConnectionInterface_Request(NDRPacket):
    fields_desc = []


class GetConnectionInterface_Response(NDRPacket):
    fields_desc = [NDRPacketField("pIID", GUID(), GUID), NDRIntField("status", 0)]


class GetConnectionPointContainer_Request(NDRPacket):
    fields_desc = []


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


class Advise_Request(NDRPacket):
    fields_desc = [NDRPacketField("pUnkSink", MInterfacePointer(), MInterfacePointer)]


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


class Unadvise_Request(NDRPacket):
    fields_desc = [NDRIntField("dwCookie", 0)]


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


class EnumConnections_Request(NDRPacket):
    fields_desc = []


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


ICONNECTIONPOINT_OPNUMS = {
    0: DceRpcOp(GetConnectionInterface_Request, GetConnectionInterface_Response),
    1: DceRpcOp(
        GetConnectionPointContainer_Request, GetConnectionPointContainer_Response
    ),
    2: DceRpcOp(Advise_Request, Advise_Response),
    3: DceRpcOp(Unadvise_Request, Unadvise_Response),
    4: DceRpcOp(EnumConnections_Request, EnumConnections_Response),
}
register_com_interface(
    name="IConnectionPoint",
    uuid=uuid.UUID("B196B286-BAB4-101A-B69C-00AA00341D07"),
    opnums=ICONNECTIONPOINT_OPNUMS,
)


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


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


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


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


class Reset_Request(NDRPacket):
    fields_desc = []


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


class Clone_Request(NDRPacket):
    fields_desc = []


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


IENUMCONNECTIONPOINTS_OPNUMS = {
    0: DceRpcOp(Next_Request, Next_Response),
    1: DceRpcOp(Skip_Request, Skip_Response),
    2: DceRpcOp(Reset_Request, Reset_Response),
    3: DceRpcOp(Clone_Request, Clone_Response),
}
register_com_interface(
    name="IEnumConnectionPoints",
    uuid=uuid.UUID("B196B285-BAB4-101A-B69C-00AA00341D07"),
    opnums=IENUMCONNECTIONPOINTS_OPNUMS,
)
