### ms-bkrp.idl
"""
RPC definitions for the following interfaces:
- BackupKey (v1.0): 3dde7c30-165d-11d1-ab8f-00805f14db40
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,
    NDRConfStrLenField,
    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 BackuprKey_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("pguidActionAgent", GUID(), GUID),
        NDRConfStrLenField("pDataIn", "", size_is=lambda pkt: pkt.cbDataIn),
        NDRIntField("cbDataIn", None, size_of="pDataIn"),
        NDRIntField("dwParam", 0),
    ]


class BackuprKey_Response(NDRPacket):
    fields_desc = [
        NDRConfStrLenField("ppDataOut", "", size_is=lambda pkt: pkt.pcbDataOut),
        NDRIntField("pcbDataOut", None, size_of="ppDataOut"),
        NDRIntField("status", 0),
    ]


BACKUPKEY_OPNUMS = {0: DceRpcOp(BackuprKey_Request, BackuprKey_Response)}
register_dcerpc_interface(
    name="BackupKey",
    uuid=uuid.UUID("3dde7c30-165d-11d1-ab8f-00805f14db40"),
    version="1.0",
    opnums=BACKUPKEY_OPNUMS,
)
