### ms-tsch_SaSecRpc.idl
"""
RPC definitions for the following interfaces:
- sasec (v1.0): 378E52B0-C0A9-11CF-822D-00AA0051E40F
This file is auto-generated by midl-to-scapy, do not modify.
"""

import uuid


from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfStrLenField,
    NDRConfStrLenFieldUtf16,
    NDRConfVarStrNullField,
    NDRConfVarStrNullFieldUtf16,
    NDRFullPointerField,
    NDRIntField,
    register_dcerpc_interface,
)


class SASetAccountInformation_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("Handle", "")),
        NDRConfVarStrNullFieldUtf16("pwszJobName", ""),
        NDRConfVarStrNullFieldUtf16("pwszAccount", ""),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszPassword", "")),
        NDRIntField("dwJobFlags", 0),
    ]


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


class SASetNSAccountInformation_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("Handle", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszAccount", "")),
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("pwszPassword", "")),
    ]


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


class SAGetNSAccountInformation_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("Handle", "")),
        NDRIntField("ccBufferSize", None, size_of="wszBuffer"),
        NDRConfStrLenFieldUtf16("wszBuffer", "", size_is=lambda pkt: pkt.ccBufferSize),
    ]


class SAGetNSAccountInformation_Response(NDRPacket):
    fields_desc = [
        NDRConfStrLenFieldUtf16("wszBuffer", "", size_is=lambda pkt: pkt.ccBufferSize),
        NDRIntField("status", 0),
    ]


class SAGetAccountInformation_Request(NDRPacket):
    fields_desc = [
        NDRFullPointerField(NDRConfVarStrNullFieldUtf16("Handle", "")),
        NDRConfVarStrNullFieldUtf16("pwszJobName", ""),
        NDRIntField("ccBufferSize", None, size_of="wszBuffer"),
        NDRConfStrLenFieldUtf16("wszBuffer", "", size_is=lambda pkt: pkt.ccBufferSize),
    ]


class SAGetAccountInformation_Response(NDRPacket):
    fields_desc = [
        NDRConfStrLenFieldUtf16("wszBuffer", "", size_is=lambda pkt: pkt.ccBufferSize),
        NDRIntField("status", 0),
    ]


SASEC_OPNUMS = {
    0: DceRpcOp(SASetAccountInformation_Request, SASetAccountInformation_Response),
    1: DceRpcOp(SASetNSAccountInformation_Request, SASetNSAccountInformation_Response),
    2: DceRpcOp(SAGetNSAccountInformation_Request, SAGetNSAccountInformation_Response),
    3: DceRpcOp(SAGetAccountInformation_Request, SAGetAccountInformation_Response),
}
register_dcerpc_interface(
    name="sasec",
    uuid=uuid.UUID("378E52B0-C0A9-11CF-822D-00AA0051E40F"),
    version="1.0",
    opnums=SASEC_OPNUMS,
)
