### ms-dltw.idl
"""
RPC definitions for the following interfaces:
- trkwks (v1.2): 300f3532-38cc-11d0-a3f0-0020af6b0add
This file is auto-generated by midl-to-scapy, do not modify.
"""

import uuid

from scapy.fields import StrFixedLenField
from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfVarStrLenField,
    NDRConfVarStrLenFieldUtf16,
    NDRIntField,
    NDRPacketField,
    NDRShortField,
    register_dcerpc_interface,
)


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


class CVolumeId(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [NDRPacketField("_volume", GUID(), GUID)]


class CObjId(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [NDRPacketField("_object", GUID(), GUID)]


class CDomainRelativeObjId(NDRPacket):
    ALIGNMENT = (4, 4)
    fields_desc = [
        NDRPacketField("_volume", CVolumeId(), CVolumeId),
        NDRPacketField("_object", CObjId(), CObjId),
    ]


class CMachineId(NDRPacket):
    fields_desc = [StrFixedLenField("_szMachine", "", length=16)]


class LnkSearchMachine_Request(NDRPacket):
    fields_desc = [
        NDRIntField("Restrictions", 0),
        NDRPacketField("pdroidBirthLast", CDomainRelativeObjId(), CDomainRelativeObjId),
        NDRPacketField("pdroidLast", CDomainRelativeObjId(), CDomainRelativeObjId),
    ]


class LnkSearchMachine_Response(NDRPacket):
    fields_desc = [
        NDRPacketField("pdroidBirthNext", CDomainRelativeObjId(), CDomainRelativeObjId),
        NDRPacketField("pdroidNext", CDomainRelativeObjId(), CDomainRelativeObjId),
        NDRPacketField("pmcidNext", CMachineId(), CMachineId),
        NDRConfVarStrLenFieldUtf16("ptszPath", "", size_is=lambda pkt: 261),
        NDRIntField("status", 0),
    ]


TRKWKS_OPNUMS = {  # 0: Opnum0NotUsedOnWire,
    # 1: Opnum1NotUsedOnWire,
    # 2: Opnum2NotUsedOnWire,
    # 3: Opnum3NotUsedOnWire,
    # 4: Opnum4NotUsedOnWire,
    # 5: Opnum5NotUsedOnWire,
    # 6: Opnum6NotUsedOnWire,
    # 7: Opnum7NotUsedOnWire,
    # 8: Opnum8NotUsedOnWire,
    # 9: Opnum9NotUsedOnWire,
    # 10: Opnum10NotUsedOnWire,
    # 11: Opnum11NotUsedOnWire,
    12: DceRpcOp(LnkSearchMachine_Request, LnkSearchMachine_Response)
}
register_dcerpc_interface(
    name="trkwks",
    uuid=uuid.UUID("300f3532-38cc-11d0-a3f0-0020af6b0add"),
    version="1.2",
    opnums=TRKWKS_OPNUMS,
)
