### ms-uamg.idl
"""
RPC definitions for the following interfaces:
- ICategoryCollection (v0.0): 3a56bfb8-576c-43f7-9335-fe4838fd7e37
- IUpdateCollection (v0.0): 07f7438c-7709-4ca5-b518-91279288134e
- IUpdate (v0.0): 6a92b07a-d821-4682-b423-5c805022cc4d
- IUpdateServiceManager2 (v0.0): 0bb8531d-7e8d-424f-986c-a0b8f60a3e7b
- IStringCollection (v0.0): eff90582-2ddc-480f-a06d-60f3fbc362c3
- IWindowsUpdateAgentInfo (v0.0): 85713fa1-7796-4fa2-be3b-e2d6124dd373
- IAutomaticUpdatesResults (v0.0): E7A4D634-7942-4DD9-A111-82228BA33901
- IAutomaticUpdates (v0.0): 673425bf-c082-4c7c-bdfd-569464b8e0ce
- IAutomaticUpdates2 (v0.0): 4A2F5C31-CFD9-410E-B7FB-29A653973A0F
- IUpdateIdentity (v0.0): 46297823-9940-4c09-aed9-cd3ea6d05968
- IImageInformation (v0.0): 7c907864-346c-4aeb-8f3f-57da289f969f
- ICategory (v0.0): 81ddc1b8-9d35-47a6-b471-5b80f519223b
- IInstallationBehavior (v0.0): d9a59339-e245-4dbd-9686-4d5763e39624
- IUpdateDownloadContent (v0.0): 54a2cb2d-9a0c-48b6-8a50-9abb69ee2d02
- IUpdateDownloadContent2 (v0.0): c97ad11b-f257-420b-9d9f-377f733f6f68
- IUpdateDownloadContentCollection (v0.0): bc5513c8-b3b8-4bf7-a4d4-361c0d8c88ba
- IWindowsDriverUpdate (v0.0): b383cd1a-5ce9-4504-9f63-764b1236f191
- IUpdate2 (v0.0): 144fe9b0-d23d-4a8b-8634-fb4457533b7a
- IUpdate3 (v0.0): 112EDA6B-95B3-476F-9D90-AEE82C6B8181
- IUpdate4 (v0.0): 27e94b0d-5139-49a2-9a61-93522dc54652
- IUpdate5 (v0.0): C1C2F21A-D2F4-4902-B5C6-8A081C19A890
- IWindowsDriverUpdateEntry (v0.0): ED8BFE40-A60B-42ea-9652-817DFCFA23EC
- IWindowsDriverUpdateEntryCollection (v0.0): 0D521700-A372-4bef-828B-3D00C10ADEBD
- IWindowsDriverUpdate2 (v0.0): 615c4269-7a48-43bd-96b7-bf6ca27d6c3e
- IWindowsDriverUpdate3 (v0.0): 49EBD502-4A96-41BD-9E3E-4C5057F4250C
- IWindowsDriverUpdate4 (v0.0): 004C6A2B-0C19-4c69-9F5C-A269B2560DB9
- IWindowsDriverUpdate5 (v0.0): 70CF5C82-8642-42bb-9DBC-0CFD263C6C4F
- IUpdateException (v0.0): a376dd5e-09d4-427f-af7c-fed5b6e1c1d6
- IUpdateExceptionCollection (v0.0): 503626a3-8e14-4729-9355-0fe664bd2321
- ISearchResult (v0.0): d40cff62-e08c-4498-941a-01e25f0fd33c
- IUpdateHistoryEntry (v0.0): be56a644-af0e-4e0e-a311-c1d8e695cbff
- IUpdateHistoryEntry2 (v0.0): c2bfb780-4539-4132-ab8c-0a8772013ab6
- IUpdateHistoryEntryCollection (v0.0): a7f04f3c-a290-435b-aadf-a116c3357a5c
- IUpdateSearcher (v0.0): 8f45abf1-f9ae-4b95-a933-f0f66e5056ea
- IUpdateSearcher2 (v0.0): 4cbdcb2d-1589-4beb-bd1c-3e582ff0add0
- IUpdateSearcher3 (v0.0): 04C6895D-EAF2-4034-97F3-311DE9BE413A
- IUpdateSession (v0.0): 816858a4-260d-4260-933a-2585f1abc76b
- IUpdateSession2 (v0.0): 91caf7b0-eb23-49ed-9937-c52d817f46f7
- IUpdateSession3 (v0.0): 918EFD1E-B5D8-4c90-8540-AEB9BDC56F9D
- IUpdateService (v0.0): 76b3b17e-aed6-4da5-85f0-83587f81abe3
- IUpdateService2 (v0.0): 1518b460-6518-4172-940f-c75883b24ceb
- IUpdateServiceCollection (v0.0): 9b0353aa-0e52-44ff-b8b0-1f7fa0437f88
- IUpdateServiceRegistration (v0.0): dde02280-12b3-4e0b-937b-6747f6acb286
- IUpdateServiceManager (v0.0): 23857e3c-02ba-44a3-9423-b1c900805f37
This file is auto-generated by midl-to-scapy, do not modify.
"""

from enum import IntEnum
import uuid


from scapy.layers.dcerpc import (
    NDRPacket,
    DceRpcOp,
    NDRConfPacketListField,
    NDRConfStrLenField,
    NDRConfStrLenFieldUtf16,
    NDRFullPointerField,
    NDRIEEEDoubleField,
    NDRIntEnumField,
    NDRIntField,
    NDRLongField,
    NDRPacketField,
    NDRRecursiveField,
    NDRRefEmbPointerField,
    NDRShortField,
    NDRSignedByteField,
    NDRSignedIntField,
    NDRSignedLongField,
    NDRSignedShortField,
    register_com_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_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


ICATEGORYCOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    2: DceRpcOp(get_Count_Request, get_Count_Response),
}
register_com_interface(
    name="ICategoryCollection",
    uuid=uuid.UUID("3a56bfb8-576c-43f7-9335-fe4838fd7e37"),
    opnums=ICATEGORYCOLLECTION_OPNUMS,
)


class get_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class put_Item_Request(NDRPacket):
    fields_desc = [
        NDRSignedIntField("index", 0),
        NDRPacketField("value", MInterfacePointer(), MInterfacePointer),
    ]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


class get_ReadOnly_Request(NDRPacket):
    fields_desc = []


class get_ReadOnly_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class Add_Request(NDRPacket):
    fields_desc = [NDRPacketField("value", MInterfacePointer(), MInterfacePointer)]


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


class Clear_Request(NDRPacket):
    fields_desc = []


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


class Insert_Request(NDRPacket):
    fields_desc = [
        NDRSignedIntField("index", 0),
        NDRPacketField("value", MInterfacePointer(), MInterfacePointer),
    ]


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


class RemoveAt_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


IUPDATECOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(put_Item_Request, put_Item_Response),
    2: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    3: DceRpcOp(get_Count_Request, get_Count_Response),
    4: DceRpcOp(get_ReadOnly_Request, get_ReadOnly_Response),
    5: DceRpcOp(Add_Request, Add_Response),
    6: DceRpcOp(Clear_Request, Clear_Response),
    # 7: Opnum15NotUsedOnWire,
    8: DceRpcOp(Insert_Request, Insert_Response),
    9: DceRpcOp(RemoveAt_Request, RemoveAt_Response),
}
register_com_interface(
    name="IUpdateCollection",
    uuid=uuid.UUID("07f7438c-7709-4ca5-b518-91279288134e"),
    opnums=IUPDATECOLLECTION_OPNUMS,
)


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 get_Title_Request(NDRPacket):
    fields_desc = []


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


class get_AutoSelectOnWebSites_Request(NDRPacket):
    fields_desc = []


class get_AutoSelectOnWebSites_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_BundledUpdates_Request(NDRPacket):
    fields_desc = []


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


class get_CanRequireSource_Request(NDRPacket):
    fields_desc = []


class get_CanRequireSource_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_Categories_Request(NDRPacket):
    fields_desc = []


class get_Categories_Response(NDRPacket):
    fields_desc = [
        NDRFullPointerField(
            NDRPacketField("retval", MInterfacePointer(), MInterfacePointer)
        ),
        NDRIntField("status", 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 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_Deadline_Request(NDRPacket):
    fields_desc = []


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


class get_DeltaCompressedContentAvailable_Request(NDRPacket):
    fields_desc = []


class get_DeltaCompressedContentAvailable_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_DeltaCompressedContentPreferred_Request(NDRPacket):
    fields_desc = []


class get_DeltaCompressedContentPreferred_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_Description_Request(NDRPacket):
    fields_desc = []


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


class get_EulaAccepted_Request(NDRPacket):
    fields_desc = []


class get_EulaAccepted_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_EulaText_Request(NDRPacket):
    fields_desc = []


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


class get_HandlerID_Request(NDRPacket):
    fields_desc = []


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


class get_Identity_Request(NDRPacket):
    fields_desc = []


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


class get_Image_Request(NDRPacket):
    fields_desc = []


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


class get_InstallationBehavior_Request(NDRPacket):
    fields_desc = []


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


class get_IsBeta_Request(NDRPacket):
    fields_desc = []


class get_IsBeta_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsDownloaded_Request(NDRPacket):
    fields_desc = []


class get_IsDownloaded_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsHidden_Request(NDRPacket):
    fields_desc = []


class get_IsHidden_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsInstalled_Request(NDRPacket):
    fields_desc = []


class get_IsInstalled_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsMandatory_Request(NDRPacket):
    fields_desc = []


class get_IsMandatory_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsUninstallable_Request(NDRPacket):
    fields_desc = []


class get_IsUninstallable_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_Languages_Request(NDRPacket):
    fields_desc = []


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


class get_LastDeploymentChangeTime_Request(NDRPacket):
    fields_desc = []


class get_LastDeploymentChangeTime_Response(NDRPacket):
    fields_desc = [NDRIEEEDoubleField("retval", 0), NDRIntField("status", 0)]


class DECIMAL(NDRPacket):
    ALIGNMENT = (8, 8)
    fields_desc = [
        NDRShortField("wReserved", 0),
        NDRSignedByteField("scale", 0),
        NDRSignedByteField("sign", 0),
        NDRIntField("Hi32", 0),
        NDRLongField("Lo64", 0),
    ]


class get_MaxDownloadSize_Request(NDRPacket):
    fields_desc = []


class get_MaxDownloadSize_Response(NDRPacket):
    fields_desc = [
        NDRPacketField("retval", DECIMAL(), DECIMAL),
        NDRIntField("status", 0),
    ]


class get_MinDownloadSize_Request(NDRPacket):
    fields_desc = []


class get_MinDownloadSize_Response(NDRPacket):
    fields_desc = [
        NDRPacketField("retval", DECIMAL(), DECIMAL),
        NDRIntField("status", 0),
    ]


class get_MoreInfoUrls_Request(NDRPacket):
    fields_desc = []


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


class get_MsrcSeverity_Request(NDRPacket):
    fields_desc = []


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


class get_RecommendedCpuSpeed_Request(NDRPacket):
    fields_desc = []


class get_RecommendedCpuSpeed_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_RecommendedHardDiskSpace_Request(NDRPacket):
    fields_desc = []


class get_RecommendedHardDiskSpace_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_RecommendedMemory_Request(NDRPacket):
    fields_desc = []


class get_RecommendedMemory_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_ReleaseNotes_Request(NDRPacket):
    fields_desc = []


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


class get_SecurityBulletinIDs_Request(NDRPacket):
    fields_desc = []


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


class get_SupersededUpdateIDs_Request(NDRPacket):
    fields_desc = []


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


class get_SupportUrl_Request(NDRPacket):
    fields_desc = []


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


class UpdateType(IntEnum):
    utSoftware = 1
    utDriver = 2


class get_Type_Request(NDRPacket):
    fields_desc = []


class get_Type_Response(NDRPacket):
    fields_desc = [NDRIntEnumField("retval", 0, UpdateType), NDRIntField("status", 0)]


class get_UninstallationNotes_Request(NDRPacket):
    fields_desc = []


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


class get_UninstallationBehavior_Request(NDRPacket):
    fields_desc = []


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


class get_UninstallationSteps_Request(NDRPacket):
    fields_desc = []


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


class get_KBArticleIDs_Request(NDRPacket):
    fields_desc = []


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


class DeploymentAction(IntEnum):
    daNone = 0
    daInstallation = 1
    daUninstallation = 2
    daDetection = 3


class get_DeploymentAction_Request(NDRPacket):
    fields_desc = []


class get_DeploymentAction_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, DeploymentAction),
        NDRIntField("status", 0),
    ]


class DownloadPriority(IntEnum):
    dpLow = 1
    dpNormal = 2
    dpHigh = 3
    dpExtraHigh = 4


class get_DownloadPriority_Request(NDRPacket):
    fields_desc = []


class get_DownloadPriority_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, DownloadPriority),
        NDRIntField("status", 0),
    ]


class get_DownloadContents_Request(NDRPacket):
    fields_desc = []


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


IUPDATE_OPNUMS = {
    0: DceRpcOp(get_Title_Request, get_Title_Response),
    1: DceRpcOp(get_AutoSelectOnWebSites_Request, get_AutoSelectOnWebSites_Response),
    2: DceRpcOp(get_BundledUpdates_Request, get_BundledUpdates_Response),
    3: DceRpcOp(get_CanRequireSource_Request, get_CanRequireSource_Response),
    4: DceRpcOp(get_Categories_Request, get_Categories_Response),
    5: DceRpcOp(get_Deadline_Request, get_Deadline_Response),
    6: DceRpcOp(
        get_DeltaCompressedContentAvailable_Request,
        get_DeltaCompressedContentAvailable_Response,
    ),
    7: DceRpcOp(
        get_DeltaCompressedContentPreferred_Request,
        get_DeltaCompressedContentPreferred_Response,
    ),
    8: DceRpcOp(get_Description_Request, get_Description_Response),
    9: DceRpcOp(get_EulaAccepted_Request, get_EulaAccepted_Response),
    10: DceRpcOp(get_EulaText_Request, get_EulaText_Response),
    11: DceRpcOp(get_HandlerID_Request, get_HandlerID_Response),
    12: DceRpcOp(get_Identity_Request, get_Identity_Response),
    13: DceRpcOp(get_Image_Request, get_Image_Response),
    14: DceRpcOp(get_InstallationBehavior_Request, get_InstallationBehavior_Response),
    15: DceRpcOp(get_IsBeta_Request, get_IsBeta_Response),
    16: DceRpcOp(get_IsDownloaded_Request, get_IsDownloaded_Response),
    17: DceRpcOp(get_IsHidden_Request, get_IsHidden_Response),
    # 18: Opnum26NotUsedOnWire,
    19: DceRpcOp(get_IsInstalled_Request, get_IsInstalled_Response),
    20: DceRpcOp(get_IsMandatory_Request, get_IsMandatory_Response),
    21: DceRpcOp(get_IsUninstallable_Request, get_IsUninstallable_Response),
    22: DceRpcOp(get_Languages_Request, get_Languages_Response),
    23: DceRpcOp(
        get_LastDeploymentChangeTime_Request, get_LastDeploymentChangeTime_Response
    ),
    24: DceRpcOp(get_MaxDownloadSize_Request, get_MaxDownloadSize_Response),
    25: DceRpcOp(get_MinDownloadSize_Request, get_MinDownloadSize_Response),
    26: DceRpcOp(get_MoreInfoUrls_Request, get_MoreInfoUrls_Response),
    27: DceRpcOp(get_MsrcSeverity_Request, get_MsrcSeverity_Response),
    28: DceRpcOp(get_RecommendedCpuSpeed_Request, get_RecommendedCpuSpeed_Response),
    29: DceRpcOp(
        get_RecommendedHardDiskSpace_Request, get_RecommendedHardDiskSpace_Response
    ),
    30: DceRpcOp(get_RecommendedMemory_Request, get_RecommendedMemory_Response),
    31: DceRpcOp(get_ReleaseNotes_Request, get_ReleaseNotes_Response),
    32: DceRpcOp(get_SecurityBulletinIDs_Request, get_SecurityBulletinIDs_Response),
    33: DceRpcOp(get_SupersededUpdateIDs_Request, get_SupersededUpdateIDs_Response),
    34: DceRpcOp(get_SupportUrl_Request, get_SupportUrl_Response),
    35: DceRpcOp(get_Type_Request, get_Type_Response),
    36: DceRpcOp(get_UninstallationNotes_Request, get_UninstallationNotes_Response),
    37: DceRpcOp(
        get_UninstallationBehavior_Request, get_UninstallationBehavior_Response
    ),
    38: DceRpcOp(get_UninstallationSteps_Request, get_UninstallationSteps_Response),
    39: DceRpcOp(get_KBArticleIDs_Request, get_KBArticleIDs_Response),
    # 40: Opnum48NotUsedOnWire,
    41: DceRpcOp(get_DeploymentAction_Request, get_DeploymentAction_Response),
    # 42: Opnum50NotUsedOnWire,
    43: DceRpcOp(get_DownloadPriority_Request, get_DownloadPriority_Response),
    44: DceRpcOp(get_DownloadContents_Request, get_DownloadContents_Response),
}
register_com_interface(
    name="IUpdate",
    uuid=uuid.UUID("6a92b07a-d821-4682-b423-5c805022cc4d"),
    opnums=IUPDATE_OPNUMS,
)


class get_ClientApplicationID_Request(NDRPacket):
    fields_desc = []


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


class put_ClientApplicationID_Request(NDRPacket):
    fields_desc = [NDRPacketField("value", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class QueryServiceRegistration_Request(NDRPacket):
    fields_desc = [NDRPacketField("serviceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class AddService2_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("serviceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRSignedIntField("flags", 0),
        NDRPacketField("authorizationCabPath", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


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


IUPDATESERVICEMANAGER2_OPNUMS = {
    0: DceRpcOp(get_ClientApplicationID_Request, get_ClientApplicationID_Response),
    1: DceRpcOp(put_ClientApplicationID_Request, put_ClientApplicationID_Response),
    2: DceRpcOp(QueryServiceRegistration_Request, QueryServiceRegistration_Response),
    3: DceRpcOp(AddService2_Request, AddService2_Response),
}
register_com_interface(
    name="IUpdateServiceManager2",
    uuid=uuid.UUID("0bb8531d-7e8d-424f-986c-a0b8f60a3e7b"),
    opnums=IUPDATESERVICEMANAGER2_OPNUMS,
)


class get_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class put_Item_Request(NDRPacket):
    fields_desc = [
        NDRSignedIntField("index", 0),
        NDRPacketField("value", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


class get_ReadOnly_Request(NDRPacket):
    fields_desc = []


class get_ReadOnly_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class Add_Request(NDRPacket):
    fields_desc = [NDRPacketField("value", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class Clear_Request(NDRPacket):
    fields_desc = []


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


class Copy_Request(NDRPacket):
    fields_desc = []


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


class Insert_Request(NDRPacket):
    fields_desc = [
        NDRSignedIntField("index", 0),
        NDRPacketField("value", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
    ]


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


class RemoveAt_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


ISTRINGCOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(put_Item_Request, put_Item_Response),
    2: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    3: DceRpcOp(get_Count_Request, get_Count_Response),
    4: DceRpcOp(get_ReadOnly_Request, get_ReadOnly_Response),
    5: DceRpcOp(Add_Request, Add_Response),
    6: DceRpcOp(Clear_Request, Clear_Response),
    7: DceRpcOp(Copy_Request, Copy_Response),
    8: DceRpcOp(Insert_Request, Insert_Response),
    9: DceRpcOp(RemoveAt_Request, RemoveAt_Response),
}
register_com_interface(
    name="IStringCollection",
    uuid=uuid.UUID("eff90582-2ddc-480f-a06d-60f3fbc362c3"),
    opnums=ISTRINGCOLLECTION_OPNUMS,
)


class GetInfo_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("varInfoIdentifier", wireVARIANTStr(), wireVARIANTStr)
    ]


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


IWINDOWSUPDATEAGENTINFO_OPNUMS = {0: DceRpcOp(GetInfo_Request, GetInfo_Response)}
register_com_interface(
    name="IWindowsUpdateAgentInfo",
    uuid=uuid.UUID("85713fa1-7796-4fa2-be3b-e2d6124dd373"),
    opnums=IWINDOWSUPDATEAGENTINFO_OPNUMS,
)


class get_LastSearchSuccessDate_Request(NDRPacket):
    fields_desc = []


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


class get_LastInstallationSuccessDate_Request(NDRPacket):
    fields_desc = []


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


IAUTOMATICUPDATESRESULTS_OPNUMS = {
    0: DceRpcOp(get_LastSearchSuccessDate_Request, get_LastSearchSuccessDate_Response),
    1: DceRpcOp(
        get_LastInstallationSuccessDate_Request,
        get_LastInstallationSuccessDate_Response,
    ),
}
register_com_interface(
    name="IAutomaticUpdatesResults",
    uuid=uuid.UUID("E7A4D634-7942-4DD9-A111-82228BA33901"),
    opnums=IAUTOMATICUPDATESRESULTS_OPNUMS,
)


class DetectNow_Request(NDRPacket):
    fields_desc = []


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


IAUTOMATICUPDATES_OPNUMS = {
    0: DceRpcOp(DetectNow_Request, DetectNow_Response),
    # 1: Opnum9NotUsedOnWire,
    # 2: Opnum10NotUsedOnWire,
    # 3: Opnum11NotUsedOnWire,
    # 4: Opnum12NotUsedOnWire,
    # 5: Opnum13NotUsedOnWire,
    # 6: Opnum14NotUsedOnWire
}
register_com_interface(
    name="IAutomaticUpdates",
    uuid=uuid.UUID("673425bf-c082-4c7c-bdfd-569464b8e0ce"),
    opnums=IAUTOMATICUPDATES_OPNUMS,
)


class get_Results_Request(NDRPacket):
    fields_desc = []


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


IAUTOMATICUPDATES2_OPNUMS = {0: DceRpcOp(get_Results_Request, get_Results_Response)}
register_com_interface(
    name="IAutomaticUpdates2",
    uuid=uuid.UUID("4A2F5C31-CFD9-410E-B7FB-29A653973A0F"),
    opnums=IAUTOMATICUPDATES2_OPNUMS,
)


class get_RevisionNumber_Request(NDRPacket):
    fields_desc = []


class get_RevisionNumber_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_UpdateID_Request(NDRPacket):
    fields_desc = []


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


IUPDATEIDENTITY_OPNUMS = {
    0: DceRpcOp(get_RevisionNumber_Request, get_RevisionNumber_Response),
    1: DceRpcOp(get_UpdateID_Request, get_UpdateID_Response),
}
register_com_interface(
    name="IUpdateIdentity",
    uuid=uuid.UUID("46297823-9940-4c09-aed9-cd3ea6d05968"),
    opnums=IUPDATEIDENTITY_OPNUMS,
)


class get_AltText_Request(NDRPacket):
    fields_desc = []


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


class get_Height_Request(NDRPacket):
    fields_desc = []


class get_Height_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_Source_Request(NDRPacket):
    fields_desc = []


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


class get_Width_Request(NDRPacket):
    fields_desc = []


class get_Width_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


IIMAGEINFORMATION_OPNUMS = {
    0: DceRpcOp(get_AltText_Request, get_AltText_Response),
    1: DceRpcOp(get_Height_Request, get_Height_Response),
    2: DceRpcOp(get_Source_Request, get_Source_Response),
    3: DceRpcOp(get_Width_Request, get_Width_Response),
}
register_com_interface(
    name="IImageInformation",
    uuid=uuid.UUID("7c907864-346c-4aeb-8f3f-57da289f969f"),
    opnums=IIMAGEINFORMATION_OPNUMS,
)


class get_Name_Request(NDRPacket):
    fields_desc = []


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


class get_CategoryID_Request(NDRPacket):
    fields_desc = []


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


class get_Children_Request(NDRPacket):
    fields_desc = []


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


class get_Description_Request(NDRPacket):
    fields_desc = []


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


class get_Image_Request(NDRPacket):
    fields_desc = []


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


class get_Order_Request(NDRPacket):
    fields_desc = []


class get_Order_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_Parent_Request(NDRPacket):
    fields_desc = []


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


class get_Type_Request(NDRPacket):
    fields_desc = []


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


class get_Updates_Request(NDRPacket):
    fields_desc = []


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


ICATEGORY_OPNUMS = {
    0: DceRpcOp(get_Name_Request, get_Name_Response),
    1: DceRpcOp(get_CategoryID_Request, get_CategoryID_Response),
    2: DceRpcOp(get_Children_Request, get_Children_Response),
    3: DceRpcOp(get_Description_Request, get_Description_Response),
    4: DceRpcOp(get_Image_Request, get_Image_Response),
    5: DceRpcOp(get_Order_Request, get_Order_Response),
    6: DceRpcOp(get_Parent_Request, get_Parent_Response),
    7: DceRpcOp(get_Type_Request, get_Type_Response),
    8: DceRpcOp(get_Updates_Request, get_Updates_Response),
}
register_com_interface(
    name="ICategory",
    uuid=uuid.UUID("81ddc1b8-9d35-47a6-b471-5b80f519223b"),
    opnums=ICATEGORY_OPNUMS,
)


class get_CanRequestUserInput_Request(NDRPacket):
    fields_desc = []


class get_CanRequestUserInput_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class InstallationImpact(IntEnum):
    iiNormal = 0
    iiMinor = 1
    iiRequiresExclusiveHandling = 2


class get_Impact_Request(NDRPacket):
    fields_desc = []


class get_Impact_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, InstallationImpact),
        NDRIntField("status", 0),
    ]


class InstallationRebootBehavior(IntEnum):
    irbNeverReboots = 0
    irbAlwaysRequiresReboot = 1
    irbCanRequestReboot = 2


class get_RebootBehavior_Request(NDRPacket):
    fields_desc = []


class get_RebootBehavior_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, InstallationRebootBehavior),
        NDRIntField("status", 0),
    ]


class get_RequiresNetworkConnectivity_Request(NDRPacket):
    fields_desc = []


class get_RequiresNetworkConnectivity_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


IINSTALLATIONBEHAVIOR_OPNUMS = {
    0: DceRpcOp(get_CanRequestUserInput_Request, get_CanRequestUserInput_Response),
    1: DceRpcOp(get_Impact_Request, get_Impact_Response),
    2: DceRpcOp(get_RebootBehavior_Request, get_RebootBehavior_Response),
    3: DceRpcOp(
        get_RequiresNetworkConnectivity_Request,
        get_RequiresNetworkConnectivity_Response,
    ),
}
register_com_interface(
    name="IInstallationBehavior",
    uuid=uuid.UUID("d9a59339-e245-4dbd-9686-4d5763e39624"),
    opnums=IINSTALLATIONBEHAVIOR_OPNUMS,
)


class get_DownloadUrl_Request(NDRPacket):
    fields_desc = []


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


IUPDATEDOWNLOADCONTENT_OPNUMS = {
    0: DceRpcOp(get_DownloadUrl_Request, get_DownloadUrl_Response)
}
register_com_interface(
    name="IUpdateDownloadContent",
    uuid=uuid.UUID("54a2cb2d-9a0c-48b6-8a50-9abb69ee2d02"),
    opnums=IUPDATEDOWNLOADCONTENT_OPNUMS,
)


class get_IsDeltaCompressedContent_Request(NDRPacket):
    fields_desc = []


class get_IsDeltaCompressedContent_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


IUPDATEDOWNLOADCONTENT2_OPNUMS = {
    0: DceRpcOp(
        get_IsDeltaCompressedContent_Request, get_IsDeltaCompressedContent_Response
    )
}
register_com_interface(
    name="IUpdateDownloadContent2",
    uuid=uuid.UUID("c97ad11b-f257-420b-9d9f-377f733f6f68"),
    opnums=IUPDATEDOWNLOADCONTENT2_OPNUMS,
)


class get_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


IUPDATEDOWNLOADCONTENTCOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    2: DceRpcOp(get_Count_Request, get_Count_Response),
}
register_com_interface(
    name="IUpdateDownloadContentCollection",
    uuid=uuid.UUID("bc5513c8-b3b8-4bf7-a4d4-361c0d8c88ba"),
    opnums=IUPDATEDOWNLOADCONTENTCOLLECTION_OPNUMS,
)


class get_DriverClass_Request(NDRPacket):
    fields_desc = []


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


class get_DriverHardwareID_Request(NDRPacket):
    fields_desc = []


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


class get_DriverManufacturer_Request(NDRPacket):
    fields_desc = []


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


class get_DriverModel_Request(NDRPacket):
    fields_desc = []


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


class get_DriverProvider_Request(NDRPacket):
    fields_desc = []


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


class get_DriverVerDate_Request(NDRPacket):
    fields_desc = []


class get_DriverVerDate_Response(NDRPacket):
    fields_desc = [NDRIEEEDoubleField("retval", 0), NDRIntField("status", 0)]


class get_DeviceProblemNumber_Request(NDRPacket):
    fields_desc = []


class get_DeviceProblemNumber_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_DeviceStatus_Request(NDRPacket):
    fields_desc = []


class get_DeviceStatus_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


IWINDOWSDRIVERUPDATE_OPNUMS = {
    0: DceRpcOp(get_DriverClass_Request, get_DriverClass_Response),
    1: DceRpcOp(get_DriverHardwareID_Request, get_DriverHardwareID_Response),
    2: DceRpcOp(get_DriverManufacturer_Request, get_DriverManufacturer_Response),
    3: DceRpcOp(get_DriverModel_Request, get_DriverModel_Response),
    4: DceRpcOp(get_DriverProvider_Request, get_DriverProvider_Response),
    5: DceRpcOp(get_DriverVerDate_Request, get_DriverVerDate_Response),
    6: DceRpcOp(get_DeviceProblemNumber_Request, get_DeviceProblemNumber_Response),
    7: DceRpcOp(get_DeviceStatus_Request, get_DeviceStatus_Response),
}
register_com_interface(
    name="IWindowsDriverUpdate",
    uuid=uuid.UUID("b383cd1a-5ce9-4504-9f63-764b1236f191"),
    opnums=IWINDOWSDRIVERUPDATE_OPNUMS,
)


class get_RebootRequired_Request(NDRPacket):
    fields_desc = []


class get_RebootRequired_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsPresent_Request(NDRPacket):
    fields_desc = []


class get_IsPresent_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_CveIDs_Request(NDRPacket):
    fields_desc = []


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


IUPDATE2_OPNUMS = {
    0: DceRpcOp(get_RebootRequired_Request, get_RebootRequired_Response),
    1: DceRpcOp(get_IsPresent_Request, get_IsPresent_Response),
    2: DceRpcOp(get_CveIDs_Request, get_CveIDs_Response),
    # 3: Opnum56NotUsedOnWire
}
register_com_interface(
    name="IUpdate2",
    uuid=uuid.UUID("144fe9b0-d23d-4a8b-8634-fb4457533b7a"),
    opnums=IUPDATE2_OPNUMS,
)


class get_BrowseOnly_Request(NDRPacket):
    fields_desc = []


class get_BrowseOnly_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


IUPDATE3_OPNUMS = {0: DceRpcOp(get_BrowseOnly_Request, get_BrowseOnly_Response)}
register_com_interface(
    name="IUpdate3",
    uuid=uuid.UUID("112EDA6B-95B3-476F-9D90-AEE82C6B8181"),
    opnums=IUPDATE3_OPNUMS,
)


class get_PerUser_Request(NDRPacket):
    fields_desc = []


class get_PerUser_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


IUPDATE4_OPNUMS = {0: DceRpcOp(get_PerUser_Request, get_PerUser_Response)}
register_com_interface(
    name="IUpdate4",
    uuid=uuid.UUID("27e94b0d-5139-49a2-9a61-93522dc54652"),
    opnums=IUPDATE4_OPNUMS,
)


class AutoSelectionMode(IntEnum):
    asLetWindowsUpdateDecide = 0
    asAutoSelectIfDownloaded = 1
    asNeverAutoSelect = 2
    asAlwaysAutoSelect = 3


class get_AutoSelection_Request(NDRPacket):
    fields_desc = []


class get_AutoSelection_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, AutoSelectionMode),
        NDRIntField("status", 0),
    ]


class AutoDownloadMode(IntEnum):
    adLetWindowsUpdateDecide = 0
    adNeverAutoDownload = 1
    adAlwaysAutoDownload = 2


class get_AutoDownload_Request(NDRPacket):
    fields_desc = []


class get_AutoDownload_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, AutoDownloadMode),
        NDRIntField("status", 0),
    ]


IUPDATE5_OPNUMS = {
    0: DceRpcOp(get_AutoSelection_Request, get_AutoSelection_Response),
    1: DceRpcOp(get_AutoDownload_Request, get_AutoDownload_Response),
}
register_com_interface(
    name="IUpdate5",
    uuid=uuid.UUID("C1C2F21A-D2F4-4902-B5C6-8A081C19A890"),
    opnums=IUPDATE5_OPNUMS,
)


class get_DriverClass_Request(NDRPacket):
    fields_desc = []


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


class get_DriverHardwareID_Request(NDRPacket):
    fields_desc = []


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


class get_DriverManufacturer_Request(NDRPacket):
    fields_desc = []


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


class get_DriverModel_Request(NDRPacket):
    fields_desc = []


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


class get_DriverProvider_Request(NDRPacket):
    fields_desc = []


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


class get_DriverVerDate_Request(NDRPacket):
    fields_desc = []


class get_DriverVerDate_Response(NDRPacket):
    fields_desc = [NDRIEEEDoubleField("retval", 0), NDRIntField("status", 0)]


class get_DeviceProblemNumber_Request(NDRPacket):
    fields_desc = []


class get_DeviceProblemNumber_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_DeviceStatus_Request(NDRPacket):
    fields_desc = []


class get_DeviceStatus_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


IWINDOWSDRIVERUPDATEENTRY_OPNUMS = {
    0: DceRpcOp(get_DriverClass_Request, get_DriverClass_Response),
    1: DceRpcOp(get_DriverHardwareID_Request, get_DriverHardwareID_Response),
    2: DceRpcOp(get_DriverManufacturer_Request, get_DriverManufacturer_Response),
    3: DceRpcOp(get_DriverModel_Request, get_DriverModel_Response),
    4: DceRpcOp(get_DriverProvider_Request, get_DriverProvider_Response),
    5: DceRpcOp(get_DriverVerDate_Request, get_DriverVerDate_Response),
    6: DceRpcOp(get_DeviceProblemNumber_Request, get_DeviceProblemNumber_Response),
    7: DceRpcOp(get_DeviceStatus_Request, get_DeviceStatus_Response),
}
register_com_interface(
    name="IWindowsDriverUpdateEntry",
    uuid=uuid.UUID("ED8BFE40-A60B-42ea-9652-817DFCFA23EC"),
    opnums=IWINDOWSDRIVERUPDATEENTRY_OPNUMS,
)


class get_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


IWINDOWSDRIVERUPDATEENTRYCOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    2: DceRpcOp(get_Count_Request, get_Count_Response),
}
register_com_interface(
    name="IWindowsDriverUpdateEntryCollection",
    uuid=uuid.UUID("0D521700-A372-4bef-828B-3D00C10ADEBD"),
    opnums=IWINDOWSDRIVERUPDATEENTRYCOLLECTION_OPNUMS,
)


class get_RebootRequired_Request(NDRPacket):
    fields_desc = []


class get_RebootRequired_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsPresent_Request(NDRPacket):
    fields_desc = []


class get_IsPresent_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_CveIDs_Request(NDRPacket):
    fields_desc = []


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


IWINDOWSDRIVERUPDATE2_OPNUMS = {
    0: DceRpcOp(get_RebootRequired_Request, get_RebootRequired_Response),
    1: DceRpcOp(get_IsPresent_Request, get_IsPresent_Response),
    2: DceRpcOp(get_CveIDs_Request, get_CveIDs_Response),
    # 3: Opnum64NotUsedOnWire
}
register_com_interface(
    name="IWindowsDriverUpdate2",
    uuid=uuid.UUID("615c4269-7a48-43bd-96b7-bf6ca27d6c3e"),
    opnums=IWINDOWSDRIVERUPDATE2_OPNUMS,
)


class get_BrowseOnly_Request(NDRPacket):
    fields_desc = []


class get_BrowseOnly_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


IWINDOWSDRIVERUPDATE3_OPNUMS = {
    0: DceRpcOp(get_BrowseOnly_Request, get_BrowseOnly_Response)
}
register_com_interface(
    name="IWindowsDriverUpdate3",
    uuid=uuid.UUID("49EBD502-4A96-41BD-9E3E-4C5057F4250C"),
    opnums=IWINDOWSDRIVERUPDATE3_OPNUMS,
)


class get_WindowsDriverUpdateEntries_Request(NDRPacket):
    fields_desc = []


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


class get_PerUser_Request(NDRPacket):
    fields_desc = []


class get_PerUser_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


IWINDOWSDRIVERUPDATE4_OPNUMS = {
    0: DceRpcOp(
        get_WindowsDriverUpdateEntries_Request, get_WindowsDriverUpdateEntries_Response
    ),
    1: DceRpcOp(get_PerUser_Request, get_PerUser_Response),
}
register_com_interface(
    name="IWindowsDriverUpdate4",
    uuid=uuid.UUID("004C6A2B-0C19-4c69-9F5C-A269B2560DB9"),
    opnums=IWINDOWSDRIVERUPDATE4_OPNUMS,
)


class get_AutoSelection_Request(NDRPacket):
    fields_desc = []


class get_AutoSelection_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, AutoSelectionMode),
        NDRIntField("status", 0),
    ]


class get_AutoDownload_Request(NDRPacket):
    fields_desc = []


class get_AutoDownload_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, AutoDownloadMode),
        NDRIntField("status", 0),
    ]


IWINDOWSDRIVERUPDATE5_OPNUMS = {
    0: DceRpcOp(get_AutoSelection_Request, get_AutoSelection_Response),
    1: DceRpcOp(get_AutoDownload_Request, get_AutoDownload_Response),
}
register_com_interface(
    name="IWindowsDriverUpdate5",
    uuid=uuid.UUID("70CF5C82-8642-42bb-9DBC-0CFD263C6C4F"),
    opnums=IWINDOWSDRIVERUPDATE5_OPNUMS,
)


class get_Message_Request(NDRPacket):
    fields_desc = []


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


class get_HResult_Request(NDRPacket):
    fields_desc = []


class get_HResult_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class UpdateExceptionContext(IntEnum):
    uecGeneral = 1
    uecWindowsDriver = 2
    uecWindowsInstaller = 3


class get_Context_Request(NDRPacket):
    fields_desc = []


class get_Context_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, UpdateExceptionContext),
        NDRIntField("status", 0),
    ]


IUPDATEEXCEPTION_OPNUMS = {
    0: DceRpcOp(get_Message_Request, get_Message_Response),
    1: DceRpcOp(get_HResult_Request, get_HResult_Response),
    2: DceRpcOp(get_Context_Request, get_Context_Response),
}
register_com_interface(
    name="IUpdateException",
    uuid=uuid.UUID("a376dd5e-09d4-427f-af7c-fed5b6e1c1d6"),
    opnums=IUPDATEEXCEPTION_OPNUMS,
)


class get_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


IUPDATEEXCEPTIONCOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    2: DceRpcOp(get_Count_Request, get_Count_Response),
}
register_com_interface(
    name="IUpdateExceptionCollection",
    uuid=uuid.UUID("503626a3-8e14-4729-9355-0fe664bd2321"),
    opnums=IUPDATEEXCEPTIONCOLLECTION_OPNUMS,
)


class OperationResultCode(IntEnum):
    orcNotStarted = 0
    orcInProgress = 1
    orcSucceeded = 2
    orcSucceededWithErrors = 3
    orcFailed = 4
    orcAborted = 5


class get_ResultCode_Request(NDRPacket):
    fields_desc = []


class get_ResultCode_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, OperationResultCode),
        NDRIntField("status", 0),
    ]


class get_RootCategories_Request(NDRPacket):
    fields_desc = []


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


class get_Updates_Request(NDRPacket):
    fields_desc = []


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


class get_Warnings_Request(NDRPacket):
    fields_desc = []


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


ISEARCHRESULT_OPNUMS = {
    0: DceRpcOp(get_ResultCode_Request, get_ResultCode_Response),
    1: DceRpcOp(get_RootCategories_Request, get_RootCategories_Response),
    2: DceRpcOp(get_Updates_Request, get_Updates_Response),
    3: DceRpcOp(get_Warnings_Request, get_Warnings_Response),
}
register_com_interface(
    name="ISearchResult",
    uuid=uuid.UUID("d40cff62-e08c-4498-941a-01e25f0fd33c"),
    opnums=ISEARCHRESULT_OPNUMS,
)


class UpdateOperation(IntEnum):
    uoInstallation = 1
    uoUninstallation = 2


class get_Operation_Request(NDRPacket):
    fields_desc = []


class get_Operation_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, UpdateOperation),
        NDRIntField("status", 0),
    ]


class get_ResultCode_Request(NDRPacket):
    fields_desc = []


class get_ResultCode_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, OperationResultCode),
        NDRIntField("status", 0),
    ]


class get_HResult_Request(NDRPacket):
    fields_desc = []


class get_HResult_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_Date_Request(NDRPacket):
    fields_desc = []


class get_Date_Response(NDRPacket):
    fields_desc = [NDRIEEEDoubleField("retval", 0), NDRIntField("status", 0)]


class get_UpdateIdentity_Request(NDRPacket):
    fields_desc = []


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


class get_Title_Request(NDRPacket):
    fields_desc = []


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


class get_Description_Request(NDRPacket):
    fields_desc = []


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


class get_UnmappedResultCode_Request(NDRPacket):
    fields_desc = []


class get_UnmappedResultCode_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_ClientApplicationID_Request(NDRPacket):
    fields_desc = []


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


class ServerSelection(IntEnum):
    ssDefault = 0
    ssManagedServer = 1
    ssWindowsUpdate = 2
    ssOthers = 3


class get_ServerSelection_Request(NDRPacket):
    fields_desc = []


class get_ServerSelection_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, ServerSelection),
        NDRIntField("status", 0),
    ]


class get_ServiceID_Request(NDRPacket):
    fields_desc = []


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


class get_UninstallationSteps_Request(NDRPacket):
    fields_desc = []


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


class get_UninstallationNotes_Request(NDRPacket):
    fields_desc = []


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


class get_SupportUrl_Request(NDRPacket):
    fields_desc = []


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


IUPDATEHISTORYENTRY_OPNUMS = {
    0: DceRpcOp(get_Operation_Request, get_Operation_Response),
    1: DceRpcOp(get_ResultCode_Request, get_ResultCode_Response),
    2: DceRpcOp(get_HResult_Request, get_HResult_Response),
    3: DceRpcOp(get_Date_Request, get_Date_Response),
    4: DceRpcOp(get_UpdateIdentity_Request, get_UpdateIdentity_Response),
    5: DceRpcOp(get_Title_Request, get_Title_Response),
    6: DceRpcOp(get_Description_Request, get_Description_Response),
    7: DceRpcOp(get_UnmappedResultCode_Request, get_UnmappedResultCode_Response),
    8: DceRpcOp(get_ClientApplicationID_Request, get_ClientApplicationID_Response),
    9: DceRpcOp(get_ServerSelection_Request, get_ServerSelection_Response),
    10: DceRpcOp(get_ServiceID_Request, get_ServiceID_Response),
    11: DceRpcOp(get_UninstallationSteps_Request, get_UninstallationSteps_Response),
    12: DceRpcOp(get_UninstallationNotes_Request, get_UninstallationNotes_Response),
    13: DceRpcOp(get_SupportUrl_Request, get_SupportUrl_Response),
}
register_com_interface(
    name="IUpdateHistoryEntry",
    uuid=uuid.UUID("be56a644-af0e-4e0e-a311-c1d8e695cbff"),
    opnums=IUPDATEHISTORYENTRY_OPNUMS,
)


class get_Categories_Request(NDRPacket):
    fields_desc = []


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


IUPDATEHISTORYENTRY2_OPNUMS = {
    0: DceRpcOp(get_Categories_Request, get_Categories_Response)
}
register_com_interface(
    name="IUpdateHistoryEntry2",
    uuid=uuid.UUID("c2bfb780-4539-4132-ab8c-0a8772013ab6"),
    opnums=IUPDATEHISTORYENTRY2_OPNUMS,
)


class get_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


IUPDATEHISTORYENTRYCOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    2: DceRpcOp(get_Count_Request, get_Count_Response),
}
register_com_interface(
    name="IUpdateHistoryEntryCollection",
    uuid=uuid.UUID("a7f04f3c-a290-435b-aadf-a116c3357a5c"),
    opnums=IUPDATEHISTORYENTRYCOLLECTION_OPNUMS,
)


class get_CanAutomaticallyUpgradeService_Request(NDRPacket):
    fields_desc = []


class get_CanAutomaticallyUpgradeService_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class put_CanAutomaticallyUpgradeService_Request(NDRPacket):
    fields_desc = [NDRSignedShortField("value", 0)]


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


class get_ClientApplicationID_Request(NDRPacket):
    fields_desc = []


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


class put_ClientApplicationID_Request(NDRPacket):
    fields_desc = [NDRPacketField("value", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class get_IncludePotentiallySupersededUpdates_Request(NDRPacket):
    fields_desc = []


class get_IncludePotentiallySupersededUpdates_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class put_IncludePotentiallySupersededUpdates_Request(NDRPacket):
    fields_desc = [NDRSignedShortField("value", 0)]


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


class get_ServerSelection_Request(NDRPacket):
    fields_desc = []


class get_ServerSelection_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, ServerSelection),
        NDRIntField("status", 0),
    ]


class put_ServerSelection_Request(NDRPacket):
    fields_desc = [NDRIntEnumField("value", 0, ServerSelection)]


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


class EscapeString_Request(NDRPacket):
    fields_desc = [NDRPacketField("unescaped", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class QueryHistory_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("startIndex", 0), NDRSignedIntField("count", 0)]


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


class Search_Request(NDRPacket):
    fields_desc = [NDRPacketField("criteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class get_Online_Request(NDRPacket):
    fields_desc = []


class get_Online_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class put_Online_Request(NDRPacket):
    fields_desc = [NDRSignedShortField("value", 0)]


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


class GetTotalHistoryCount_Request(NDRPacket):
    fields_desc = []


class GetTotalHistoryCount_Response(NDRPacket):
    fields_desc = [NDRSignedIntField("retval", 0), NDRIntField("status", 0)]


class get_ServiceID_Request(NDRPacket):
    fields_desc = []


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


class put_ServiceID_Request(NDRPacket):
    fields_desc = [NDRPacketField("value", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


IUPDATESEARCHER_OPNUMS = {
    0: DceRpcOp(
        get_CanAutomaticallyUpgradeService_Request,
        get_CanAutomaticallyUpgradeService_Response,
    ),
    1: DceRpcOp(
        put_CanAutomaticallyUpgradeService_Request,
        put_CanAutomaticallyUpgradeService_Response,
    ),
    2: DceRpcOp(get_ClientApplicationID_Request, get_ClientApplicationID_Response),
    3: DceRpcOp(put_ClientApplicationID_Request, put_ClientApplicationID_Response),
    4: DceRpcOp(
        get_IncludePotentiallySupersededUpdates_Request,
        get_IncludePotentiallySupersededUpdates_Response,
    ),
    5: DceRpcOp(
        put_IncludePotentiallySupersededUpdates_Request,
        put_IncludePotentiallySupersededUpdates_Response,
    ),
    6: DceRpcOp(get_ServerSelection_Request, get_ServerSelection_Response),
    7: DceRpcOp(put_ServerSelection_Request, put_ServerSelection_Response),
    # 8: Opnum16NotUsedOnWire,
    # 9: Opnum17NotUsedOnWire,
    10: DceRpcOp(EscapeString_Request, EscapeString_Response),
    11: DceRpcOp(QueryHistory_Request, QueryHistory_Response),
    12: DceRpcOp(Search_Request, Search_Response),
    13: DceRpcOp(get_Online_Request, get_Online_Response),
    14: DceRpcOp(put_Online_Request, put_Online_Response),
    15: DceRpcOp(GetTotalHistoryCount_Request, GetTotalHistoryCount_Response),
    16: DceRpcOp(get_ServiceID_Request, get_ServiceID_Response),
    17: DceRpcOp(put_ServiceID_Request, put_ServiceID_Response),
}
register_com_interface(
    name="IUpdateSearcher",
    uuid=uuid.UUID("8f45abf1-f9ae-4b95-a933-f0f66e5056ea"),
    opnums=IUPDATESEARCHER_OPNUMS,
)


class get_IgnoreDownloadPriority_Request(NDRPacket):
    fields_desc = []


class get_IgnoreDownloadPriority_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class put_IgnoreDownloadPriority_Request(NDRPacket):
    fields_desc = [NDRSignedShortField("value", 0)]


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


IUPDATESEARCHER2_OPNUMS = {
    0: DceRpcOp(
        get_IgnoreDownloadPriority_Request, get_IgnoreDownloadPriority_Response
    ),
    1: DceRpcOp(
        put_IgnoreDownloadPriority_Request, put_IgnoreDownloadPriority_Response
    ),
}
register_com_interface(
    name="IUpdateSearcher2",
    uuid=uuid.UUID("4cbdcb2d-1589-4beb-bd1c-3e582ff0add0"),
    opnums=IUPDATESEARCHER2_OPNUMS,
)


class SearchScope(IntEnum):
    searchScopeDefault = 0
    searchScopeMachineOnly = 1
    searchScopeCurrentUserOnly = 2
    searchScopeMachineAndCurrentUser = 3
    searchScopeMachineAndAllUsers = 4
    searchScopeAllUsers = 5


class get_SearchScope_Request(NDRPacket):
    fields_desc = []


class get_SearchScope_Response(NDRPacket):
    fields_desc = [NDRIntEnumField("retval", 0, SearchScope), NDRIntField("status", 0)]


class put_SearchScope_Request(NDRPacket):
    fields_desc = [NDRIntEnumField("value", 0, SearchScope)]


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


IUPDATESEARCHER3_OPNUMS = {
    0: DceRpcOp(get_SearchScope_Request, get_SearchScope_Response),
    1: DceRpcOp(put_SearchScope_Request, put_SearchScope_Response),
}
register_com_interface(
    name="IUpdateSearcher3",
    uuid=uuid.UUID("04C6895D-EAF2-4034-97F3-311DE9BE413A"),
    opnums=IUPDATESEARCHER3_OPNUMS,
)


class get_ClientApplicationID_Request(NDRPacket):
    fields_desc = []


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


class put_ClientApplicationID_Request(NDRPacket):
    fields_desc = [NDRPacketField("value", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class get_ReadOnly_Request(NDRPacket):
    fields_desc = []


class get_ReadOnly_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class CreateUpdateSearcher_Request(NDRPacket):
    fields_desc = []


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


IUPDATESESSION_OPNUMS = {
    0: DceRpcOp(get_ClientApplicationID_Request, get_ClientApplicationID_Response),
    1: DceRpcOp(put_ClientApplicationID_Request, put_ClientApplicationID_Response),
    2: DceRpcOp(get_ReadOnly_Request, get_ReadOnly_Response),
    # 3: Opnum11NotUsedOnWire,
    # 4: Opnum12NotUsedOnWire,
    5: DceRpcOp(CreateUpdateSearcher_Request, CreateUpdateSearcher_Response),
    # 6: Opnum14NotUsedOnWire,
    # 7: Opnum15NotUsedOnWire
}
register_com_interface(
    name="IUpdateSession",
    uuid=uuid.UUID("816858a4-260d-4260-933a-2585f1abc76b"),
    opnums=IUPDATESESSION_OPNUMS,
)


class get_UserLocale_Request(NDRPacket):
    fields_desc = []


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


class put_UserLocale_Request(NDRPacket):
    fields_desc = [NDRIntField("lcid", 0)]


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


IUPDATESESSION2_OPNUMS = {
    0: DceRpcOp(get_UserLocale_Request, get_UserLocale_Response),
    1: DceRpcOp(put_UserLocale_Request, put_UserLocale_Response),
}
register_com_interface(
    name="IUpdateSession2",
    uuid=uuid.UUID("91caf7b0-eb23-49ed-9937-c52d817f46f7"),
    opnums=IUPDATESESSION2_OPNUMS,
)


class CreateUpdateServiceManager_Request(NDRPacket):
    fields_desc = []


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


class QueryHistory_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("criteria", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRSignedIntField("startIndex", 0),
        NDRSignedIntField("count", 0),
    ]


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


IUPDATESESSION3_OPNUMS = {
    0: DceRpcOp(
        CreateUpdateServiceManager_Request, CreateUpdateServiceManager_Response
    ),
    1: DceRpcOp(QueryHistory_Request, QueryHistory_Response),
}
register_com_interface(
    name="IUpdateSession3",
    uuid=uuid.UUID("918EFD1E-B5D8-4c90-8540-AEB9BDC56F9D"),
    opnums=IUPDATESESSION3_OPNUMS,
)


class get_Name_Request(NDRPacket):
    fields_desc = []


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


class get_ContentValidationCert_Request(NDRPacket):
    fields_desc = []


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


class get_ExpirationDate_Request(NDRPacket):
    fields_desc = []


class get_ExpirationDate_Response(NDRPacket):
    fields_desc = [NDRIEEEDoubleField("retval", 0), NDRIntField("status", 0)]


class get_IsManaged_Request(NDRPacket):
    fields_desc = []


class get_IsManaged_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IsRegisteredWithAU_Request(NDRPacket):
    fields_desc = []


class get_IsRegisteredWithAU_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_IssueDate_Request(NDRPacket):
    fields_desc = []


class get_IssueDate_Response(NDRPacket):
    fields_desc = [NDRIEEEDoubleField("retval", 0), NDRIntField("status", 0)]


class get_OffersWindowsUpdates_Request(NDRPacket):
    fields_desc = []


class get_OffersWindowsUpdates_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_RedirectUrls_Request(NDRPacket):
    fields_desc = []


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


class get_ServiceID_Request(NDRPacket):
    fields_desc = []


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


class get_IsScanPackageService_Request(NDRPacket):
    fields_desc = []


class get_IsScanPackageService_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_CanRegisterWithAU_Request(NDRPacket):
    fields_desc = []


class get_CanRegisterWithAU_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_ServiceUrl_Request(NDRPacket):
    fields_desc = []


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


class get_SetupPrefix_Request(NDRPacket):
    fields_desc = []


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


IUPDATESERVICE_OPNUMS = {
    0: DceRpcOp(get_Name_Request, get_Name_Response),
    1: DceRpcOp(get_ContentValidationCert_Request, get_ContentValidationCert_Response),
    2: DceRpcOp(get_ExpirationDate_Request, get_ExpirationDate_Response),
    3: DceRpcOp(get_IsManaged_Request, get_IsManaged_Response),
    4: DceRpcOp(get_IsRegisteredWithAU_Request, get_IsRegisteredWithAU_Response),
    5: DceRpcOp(get_IssueDate_Request, get_IssueDate_Response),
    6: DceRpcOp(get_OffersWindowsUpdates_Request, get_OffersWindowsUpdates_Response),
    7: DceRpcOp(get_RedirectUrls_Request, get_RedirectUrls_Response),
    8: DceRpcOp(get_ServiceID_Request, get_ServiceID_Response),
    9: DceRpcOp(get_IsScanPackageService_Request, get_IsScanPackageService_Response),
    10: DceRpcOp(get_CanRegisterWithAU_Request, get_CanRegisterWithAU_Response),
    11: DceRpcOp(get_ServiceUrl_Request, get_ServiceUrl_Response),
    12: DceRpcOp(get_SetupPrefix_Request, get_SetupPrefix_Response),
}
register_com_interface(
    name="IUpdateService",
    uuid=uuid.UUID("76b3b17e-aed6-4da5-85f0-83587f81abe3"),
    opnums=IUPDATESERVICE_OPNUMS,
)


class get_IsDefaultAUService_Request(NDRPacket):
    fields_desc = []


class get_IsDefaultAUService_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


IUPDATESERVICE2_OPNUMS = {
    0: DceRpcOp(get_IsDefaultAUService_Request, get_IsDefaultAUService_Response)
}
register_com_interface(
    name="IUpdateService2",
    uuid=uuid.UUID("1518b460-6518-4172-940f-c75883b24ceb"),
    opnums=IUPDATESERVICE2_OPNUMS,
)


class get_Item_Request(NDRPacket):
    fields_desc = [NDRSignedIntField("index", 0)]


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


class get__NewEnum_Request(NDRPacket):
    fields_desc = []


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


class get_Count_Request(NDRPacket):
    fields_desc = []


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


IUPDATESERVICECOLLECTION_OPNUMS = {
    0: DceRpcOp(get_Item_Request, get_Item_Response),
    1: DceRpcOp(get__NewEnum_Request, get__NewEnum_Response),
    2: DceRpcOp(get_Count_Request, get_Count_Response),
}
register_com_interface(
    name="IUpdateServiceCollection",
    uuid=uuid.UUID("9b0353aa-0e52-44ff-b8b0-1f7fa0437f88"),
    opnums=IUPDATESERVICECOLLECTION_OPNUMS,
)


class UpdateServiceRegistrationState(IntEnum):
    usrsNotRegistered = 1
    usrsRegistrationPending = 2
    usrsRegistered = 3


class get_RegistrationState_Request(NDRPacket):
    fields_desc = []


class get_RegistrationState_Response(NDRPacket):
    fields_desc = [
        NDRIntEnumField("retval", 0, UpdateServiceRegistrationState),
        NDRIntField("status", 0),
    ]


class get_ServiceID_Request(NDRPacket):
    fields_desc = []


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


class get_IsPendingRegistrationWithAU_Request(NDRPacket):
    fields_desc = []


class get_IsPendingRegistrationWithAU_Response(NDRPacket):
    fields_desc = [NDRSignedShortField("retval", 0), NDRIntField("status", 0)]


class get_Service_Request(NDRPacket):
    fields_desc = []


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


IUPDATESERVICEREGISTRATION_OPNUMS = {
    0: DceRpcOp(get_RegistrationState_Request, get_RegistrationState_Response),
    1: DceRpcOp(get_ServiceID_Request, get_ServiceID_Response),
    2: DceRpcOp(
        get_IsPendingRegistrationWithAU_Request,
        get_IsPendingRegistrationWithAU_Response,
    ),
    3: DceRpcOp(get_Service_Request, get_Service_Response),
}
register_com_interface(
    name="IUpdateServiceRegistration",
    uuid=uuid.UUID("dde02280-12b3-4e0b-937b-6747f6acb286"),
    opnums=IUPDATESERVICEREGISTRATION_OPNUMS,
)


class get_Services_Request(NDRPacket):
    fields_desc = []


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


class RegisterServiceWithAU_Request(NDRPacket):
    fields_desc = [NDRPacketField("serviceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class RemoveService_Request(NDRPacket):
    fields_desc = [NDRPacketField("serviceID", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB)]


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


class AddScanPackageService_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("serviceName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRPacketField("scanFileLocation", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRSignedIntField("flags", 0),
    ]


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


class SetOption_Request(NDRPacket):
    fields_desc = [
        NDRPacketField("optionName", FLAGGED_WORD_BLOB(), FLAGGED_WORD_BLOB),
        NDRPacketField("optionValue", wireVARIANTStr(), wireVARIANTStr),
    ]


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


IUPDATESERVICEMANAGER_OPNUMS = {
    0: DceRpcOp(get_Services_Request, get_Services_Response),
    # 1: Opnum9NotUsedOnWire,
    2: DceRpcOp(RegisterServiceWithAU_Request, RegisterServiceWithAU_Response),
    3: DceRpcOp(RemoveService_Request, RemoveService_Response),
    # 4: Opnum12NotUsedOnWire,
    5: DceRpcOp(AddScanPackageService_Request, AddScanPackageService_Response),
    6: DceRpcOp(SetOption_Request, SetOption_Response),
}
register_com_interface(
    name="IUpdateServiceManager",
    uuid=uuid.UUID("23857e3c-02ba-44a3-9423-b1c900805f37"),
    opnums=IUPDATESERVICEMANAGER_OPNUMS,
)
