# Generated by cstruct-stubgen
from typing import BinaryIO, Literal, TypeAlias, overload

import dissect.cstruct as __cs__

class _c_regf(__cs__.cstruct):
    HTYPE_COUNT: Literal[2] = ...
    HCELL_INDEX: TypeAlias = _c_regf.uint32
    LARGE_INTEGER: TypeAlias = _c_regf.uint64
    class KEY(__cs__.Flag):
        IS_VOLATILE = ...
        HIVE_EXIT = ...
        HIVE_ENTRY = ...
        NO_DELETE = ...
        SYM_LINK = ...
        COMP_NAME = ...
        PREDEF_HANDLE = ...
        VIRT_MIRRORED = ...
        VIRT_TARGET = ...
        VIRTUAL_STORE = ...

    class VALUE(__cs__.Flag):
        COMP_NAME = ...
        TOMBSTONE = ...

    class _HBASE_BLOCK(__cs__.Structure):
        Signature: _c_regf.uint32
        Sequence1: _c_regf.uint32
        Sequence2: _c_regf.uint32
        TimeStamp: _c_regf.uint64
        Major: _c_regf.uint32
        Minor: _c_regf.uint32
        Type: _c_regf.uint32
        Format: _c_regf.uint32
        RootCell: _c_regf.uint32
        Length: _c_regf.uint32
        Cluster: _c_regf.uint32
        FileName: __cs__.WcharArray
        Reserved1: __cs__.Array[_c_regf.uint32]
        CheckSum: _c_regf.uint32
        Reserved2: __cs__.Array[_c_regf.uint32]
        BootType: _c_regf.uint32
        BootRecover: _c_regf.uint32
        @overload
        def __init__(
            self,
            Signature: _c_regf.uint32 | None = ...,
            Sequence1: _c_regf.uint32 | None = ...,
            Sequence2: _c_regf.uint32 | None = ...,
            TimeStamp: _c_regf.uint64 | None = ...,
            Major: _c_regf.uint32 | None = ...,
            Minor: _c_regf.uint32 | None = ...,
            Type: _c_regf.uint32 | None = ...,
            Format: _c_regf.uint32 | None = ...,
            RootCell: _c_regf.uint32 | None = ...,
            Length: _c_regf.uint32 | None = ...,
            Cluster: _c_regf.uint32 | None = ...,
            FileName: __cs__.WcharArray | None = ...,
            Reserved1: __cs__.Array[_c_regf.uint32] | None = ...,
            CheckSum: _c_regf.uint32 | None = ...,
            Reserved2: __cs__.Array[_c_regf.uint32] | None = ...,
            BootType: _c_regf.uint32 | None = ...,
            BootRecover: _c_regf.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    HBASE_BLOCK: TypeAlias = _HBASE_BLOCK
    class _HBIN(__cs__.Structure):
        Signature: _c_regf.uint32
        FileOffset: _c_regf.uint32
        Size: _c_regf.uint32
        Reserved: __cs__.Array[_c_regf.uint32]
        TimeStamp: _c_regf.uint64
        Spare: _c_regf.uint32
        @overload
        def __init__(
            self,
            Signature: _c_regf.uint32 | None = ...,
            FileOffset: _c_regf.uint32 | None = ...,
            Size: _c_regf.uint32 | None = ...,
            Reserved: __cs__.Array[_c_regf.uint32] | None = ...,
            TimeStamp: _c_regf.uint64 | None = ...,
            Spare: _c_regf.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    HBIN: TypeAlias = _HBIN
    class _CHILD_LIST(__cs__.Structure):
        Count: _c_regf.uint32
        List: _c_regf.uint32
        @overload
        def __init__(self, Count: _c_regf.uint32 | None = ..., List: _c_regf.uint32 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CHILD_LIST: TypeAlias = _CHILD_LIST
    class _CM_KEY_NODE(__cs__.Structure):
        Signature: __cs__.CharArray
        Flags: _c_regf.KEY
        LastWriteTime: _c_regf.uint64
        Spare: _c_regf.uint32
        Parent: _c_regf.uint32
        SubKeyCounts: __cs__.Array[_c_regf.uint32]
        SubKeyLists: __cs__.Array[_c_regf.uint32]
        ValueList: _c_regf._CHILD_LIST
        Security: _c_regf.uint32
        Class: _c_regf.uint32
        MaxNameLen: _c_regf.uint32
        MaxClassLen: _c_regf.uint32
        MaxValueNameLen: _c_regf.uint32
        MaxValueDataLen: _c_regf.uint32
        WorkVar: _c_regf.uint32
        NameLength: _c_regf.uint16
        ClassLength: _c_regf.uint16
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            Flags: _c_regf.KEY | None = ...,
            LastWriteTime: _c_regf.uint64 | None = ...,
            Spare: _c_regf.uint32 | None = ...,
            Parent: _c_regf.uint32 | None = ...,
            SubKeyCounts: __cs__.Array[_c_regf.uint32] | None = ...,
            SubKeyLists: __cs__.Array[_c_regf.uint32] | None = ...,
            ValueList: _c_regf._CHILD_LIST | None = ...,
            Security: _c_regf.uint32 | None = ...,
            Class: _c_regf.uint32 | None = ...,
            MaxNameLen: _c_regf.uint32 | None = ...,
            MaxClassLen: _c_regf.uint32 | None = ...,
            MaxValueNameLen: _c_regf.uint32 | None = ...,
            MaxValueDataLen: _c_regf.uint32 | None = ...,
            WorkVar: _c_regf.uint32 | None = ...,
            NameLength: _c_regf.uint16 | None = ...,
            ClassLength: _c_regf.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_KEY_NODE: TypeAlias = _CM_KEY_NODE
    class _CM_INDEX(__cs__.Structure):
        Cell: _c_regf.uint32
        NameHint: __cs__.Array[_c_regf.uint8]
        @overload
        def __init__(self, Cell: _c_regf.uint32 | None = ..., NameHint: __cs__.Array[_c_regf.uint8] | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_INDEX: TypeAlias = _CM_INDEX
    class _CM_HASH_INDEX(__cs__.Structure):
        Cell: _c_regf.uint32
        HashKey: _c_regf.uint32
        @overload
        def __init__(self, Cell: _c_regf.uint32 | None = ..., HashKey: _c_regf.uint32 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_HASH_INDEX: TypeAlias = _CM_HASH_INDEX
    class _CM_KEY_INDEX(__cs__.Structure):
        Signature: __cs__.CharArray
        Count: _c_regf.uint16
        List: __cs__.Array[_c_regf.uint32]
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            Count: _c_regf.uint16 | None = ...,
            List: __cs__.Array[_c_regf.uint32] | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_KEY_INDEX: TypeAlias = _CM_KEY_INDEX
    class _CM_KEY_FAST_INDEX(__cs__.Structure):
        Signature: __cs__.CharArray
        Count: _c_regf.uint16
        class _CM_INDEX(__cs__.Structure):
            Cell: _c_regf.uint32
            NameHint: __cs__.Array[_c_regf.uint8]
            @overload
            def __init__(
                self, Cell: _c_regf.uint32 | None = ..., NameHint: __cs__.Array[_c_regf.uint8] | None = ...
            ): ...
            @overload
            def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

        List: __cs__.Array[_CM_INDEX]
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            Count: _c_regf.uint16 | None = ...,
            List: __cs__.Array[_CM_INDEX] | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_KEY_FAST_INDEX: TypeAlias = _CM_KEY_FAST_INDEX
    class _CM_KEY_HASH_INDEX(__cs__.Structure):
        Signature: __cs__.CharArray
        Count: _c_regf.uint16
        class _CM_HASH_INDEX(__cs__.Structure):
            Cell: _c_regf.uint32
            HashKey: _c_regf.uint32
            @overload
            def __init__(self, Cell: _c_regf.uint32 | None = ..., HashKey: _c_regf.uint32 | None = ...): ...
            @overload
            def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

        List: __cs__.Array[_CM_HASH_INDEX]
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            Count: _c_regf.uint16 | None = ...,
            List: __cs__.Array[_CM_HASH_INDEX] | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_KEY_HASH_INDEX: TypeAlias = _CM_KEY_HASH_INDEX
    class _CM_KEY_VALUE(__cs__.Structure):
        Signature: __cs__.CharArray
        NameLength: _c_regf.uint16
        DataLength: _c_regf.uint32
        Data: _c_regf.uint32
        Type: _c_regf.uint32
        Flags: _c_regf.VALUE
        Spare: _c_regf.uint16
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            NameLength: _c_regf.uint16 | None = ...,
            DataLength: _c_regf.uint32 | None = ...,
            Data: _c_regf.uint32 | None = ...,
            Type: _c_regf.uint32 | None = ...,
            Flags: _c_regf.VALUE | None = ...,
            Spare: _c_regf.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_KEY_VALUE: TypeAlias = _CM_KEY_VALUE
    class _CM_KEY_SECURITY(__cs__.Structure):
        Signature: __cs__.CharArray
        Reserved: _c_regf.uint16
        Flink: _c_regf.uint32
        Blink: _c_regf.uint32
        ReferenceCount: _c_regf.uint32
        DescriptorLength: _c_regf.uint32
        Descriptor: __cs__.CharArray
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            Reserved: _c_regf.uint16 | None = ...,
            Flink: _c_regf.uint32 | None = ...,
            Blink: _c_regf.uint32 | None = ...,
            ReferenceCount: _c_regf.uint32 | None = ...,
            DescriptorLength: _c_regf.uint32 | None = ...,
            Descriptor: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_KEY_SECURITY: TypeAlias = _CM_KEY_SECURITY
    class _CM_BIG_DATA(__cs__.Structure):
        Signature: __cs__.CharArray
        Count: _c_regf.uint16
        List: _c_regf.uint32
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            Count: _c_regf.uint16 | None = ...,
            List: _c_regf.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    CM_BIG_DATA: TypeAlias = _CM_BIG_DATA

# Technically `c_regf` is an instance of `_c_regf`, but then we can't use it in type hints
c_regf: TypeAlias = _c_regf

KEY = c_regf.KEY
VALUE = c_regf.VALUE

REG_NONE: int
REG_SZ: int
REG_EXPAND_SZ: int
REG_BINARY: int
REG_DWORD: int
REG_DWORD_BIG_ENDIAN: int
REG_LINK: int
REG_MULTI_SZ: int
REG_RESOURCE_LIST: int
REG_FULL_RESOURCE_DESCRIPTOR: int
REG_RESOURCE_REQUIREMENTS_LIST: int
REG_QWORD: int
