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

import dissect.cstruct as __cs__

class _c_ntfs(__cs__.cstruct):
    class FILE_ATTRIBUTE(__cs__.Flag):
        READONLY = ...
        HIDDEN = ...
        SYSTEM = ...
        DIRECTORY = ...
        ARCHIVE = ...
        DEVICE = ...
        NORMAL = ...
        TEMPORARY = ...
        SPARSE_FILE = ...
        REPARSE_POINT = ...
        COMPRESSED = ...
        OFFLINE = ...
        NOT_CONTENT_INDEXED = ...
        ENCRYPTED = ...
        INTEGRITY_STREAM = ...
        VIRTUAL = ...
        NO_SCRUB_DATA = ...
        RECALL_ON_OPEN = ...
        PINNED = ...
        UNPINNED = ...
        RECALL_ON_DATA_ACCESS = ...

    class _BIOS_PARAMETER_BLOCK(__cs__.Structure):
        BytesPerSector: _c_ntfs.uint16
        SectorsPerCluster: _c_ntfs.int8
        ReservedSectors: _c_ntfs.uint16
        Fats: _c_ntfs.uint8
        RootEntries: _c_ntfs.uint16
        Sectors: _c_ntfs.uint16
        Media: _c_ntfs.uint8
        SectorsPerFat: _c_ntfs.uint16
        SectorsPerTrack: _c_ntfs.uint16
        Heads: _c_ntfs.uint16
        HiddenSectors: _c_ntfs.uint32
        LargeSectors: _c_ntfs.uint32
        @overload
        def __init__(
            self,
            BytesPerSector: _c_ntfs.uint16 | None = ...,
            SectorsPerCluster: _c_ntfs.int8 | None = ...,
            ReservedSectors: _c_ntfs.uint16 | None = ...,
            Fats: _c_ntfs.uint8 | None = ...,
            RootEntries: _c_ntfs.uint16 | None = ...,
            Sectors: _c_ntfs.uint16 | None = ...,
            Media: _c_ntfs.uint8 | None = ...,
            SectorsPerFat: _c_ntfs.uint16 | None = ...,
            SectorsPerTrack: _c_ntfs.uint16 | None = ...,
            Heads: _c_ntfs.uint16 | None = ...,
            HiddenSectors: _c_ntfs.uint32 | None = ...,
            LargeSectors: _c_ntfs.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    BIOS_PARAMETER_BLOCK: TypeAlias = _BIOS_PARAMETER_BLOCK
    class _BOOT_SECTOR(__cs__.Structure):
        Jump: __cs__.CharArray
        Oem: __cs__.CharArray
        Bpb: _c_ntfs._BIOS_PARAMETER_BLOCK
        Unused0: __cs__.CharArray
        NumberSectors: _c_ntfs.uint64
        MftStartLcn: _c_ntfs.uint64
        Mft2StartLcn: _c_ntfs.uint64
        ClustersPerFileRecordSegment: _c_ntfs.int8
        Reserved0: __cs__.CharArray
        ClustersPerIndexBuffer: _c_ntfs.int8
        Reserved1: __cs__.CharArray
        SerialNumber: _c_ntfs.uint64
        Checksum: _c_ntfs.uint32
        BootStrap: __cs__.CharArray
        @overload
        def __init__(
            self,
            Jump: __cs__.CharArray | None = ...,
            Oem: __cs__.CharArray | None = ...,
            Bpb: _c_ntfs._BIOS_PARAMETER_BLOCK | None = ...,
            Unused0: __cs__.CharArray | None = ...,
            NumberSectors: _c_ntfs.uint64 | None = ...,
            MftStartLcn: _c_ntfs.uint64 | None = ...,
            Mft2StartLcn: _c_ntfs.uint64 | None = ...,
            ClustersPerFileRecordSegment: _c_ntfs.int8 | None = ...,
            Reserved0: __cs__.CharArray | None = ...,
            ClustersPerIndexBuffer: _c_ntfs.int8 | None = ...,
            Reserved1: __cs__.CharArray | None = ...,
            SerialNumber: _c_ntfs.uint64 | None = ...,
            Checksum: _c_ntfs.uint32 | None = ...,
            BootStrap: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    BOOT_SECTOR: TypeAlias = _BOOT_SECTOR
    class _MFT_SEGMENT_REFERENCE(__cs__.Structure):
        SegmentNumberLowPart: _c_ntfs.uint32
        SegmentNumberHighPart: _c_ntfs.uint16
        SequenceNumber: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            SegmentNumberLowPart: _c_ntfs.uint32 | None = ...,
            SegmentNumberHighPart: _c_ntfs.uint16 | None = ...,
            SequenceNumber: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    MFT_SEGMENT_REFERENCE: TypeAlias = _MFT_SEGMENT_REFERENCE
    FILE_REFERENCE: TypeAlias = _MFT_SEGMENT_REFERENCE
    class _MULTI_SECTOR_HEADER(__cs__.Structure):
        Signature: __cs__.CharArray
        UpdateSequenceArrayOffset: _c_ntfs.uint16
        UpdateSequenceArraySize: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            UpdateSequenceArrayOffset: _c_ntfs.uint16 | None = ...,
            UpdateSequenceArraySize: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    MULTI_SECTOR_HEADER: TypeAlias = _MULTI_SECTOR_HEADER
    class _FILE_RECORD_SEGMENT_HEADER(__cs__.Structure):
        MultiSectorHeader: _c_ntfs._MULTI_SECTOR_HEADER
        Lsn: _c_ntfs.uint64
        SequenceNumber: _c_ntfs.uint16
        ReferenceCount: _c_ntfs.uint16
        FirstAttributeOffset: _c_ntfs.uint16
        Flags: _c_ntfs.uint16
        BytesInUse: _c_ntfs.uint32
        BytesAllocated: _c_ntfs.uint32
        BaseFileRecordSegment: _c_ntfs._MFT_SEGMENT_REFERENCE
        NextAttributeInstance: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            MultiSectorHeader: _c_ntfs._MULTI_SECTOR_HEADER | None = ...,
            Lsn: _c_ntfs.uint64 | None = ...,
            SequenceNumber: _c_ntfs.uint16 | None = ...,
            ReferenceCount: _c_ntfs.uint16 | None = ...,
            FirstAttributeOffset: _c_ntfs.uint16 | None = ...,
            Flags: _c_ntfs.uint16 | None = ...,
            BytesInUse: _c_ntfs.uint32 | None = ...,
            BytesAllocated: _c_ntfs.uint32 | None = ...,
            BaseFileRecordSegment: _c_ntfs._MFT_SEGMENT_REFERENCE | None = ...,
            NextAttributeInstance: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FILE_RECORD_SEGMENT_HEADER: TypeAlias = _FILE_RECORD_SEGMENT_HEADER
    class ATTRIBUTE_TYPE_CODE(__cs__.Enum):
        UNUSED = ...
        STANDARD_INFORMATION = ...
        ATTRIBUTE_LIST = ...
        FILE_NAME = ...
        OBJECT_ID = ...
        SECURITY_DESCRIPTOR = ...
        VOLUME_NAME = ...
        VOLUME_INFORMATION = ...
        DATA = ...
        INDEX_ROOT = ...
        INDEX_ALLOCATION = ...
        BITMAP = ...
        REPARSE_POINT = ...
        EA_INFORMATION = ...
        EA = ...
        PROPERTY_SET = ...
        LOGGED_UTILITY_STREAM = ...
        END = ...

    class _ATTRIBUTE_RECORD_HEADER(__cs__.Structure):
        TypeCode: _c_ntfs.ATTRIBUTE_TYPE_CODE
        RecordLength: _c_ntfs.uint32
        FormCode: _c_ntfs.uint8
        NameLength: _c_ntfs.uint8
        NameOffset: _c_ntfs.uint16
        Flags: _c_ntfs.uint16
        Instance: _c_ntfs.uint16
        class __anonymous_2__(__cs__.Union):
            class __anonymous_0__(__cs__.Structure):
                ValueLength: _c_ntfs.uint32
                ValueOffset: _c_ntfs.uint16
                Flags: _c_ntfs.uint8
                Reserved: _c_ntfs.uint8
                @overload
                def __init__(
                    self,
                    ValueLength: _c_ntfs.uint32 | None = ...,
                    ValueOffset: _c_ntfs.uint16 | None = ...,
                    Flags: _c_ntfs.uint8 | None = ...,
                    Reserved: _c_ntfs.uint8 | None = ...,
                ): ...
                @overload
                def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

            Resident: __anonymous_0__
            class __anonymous_1__(__cs__.Structure):
                LowestVcn: _c_ntfs.uint64
                HighestVcn: _c_ntfs.uint64
                MappingPairsOffset: _c_ntfs.uint16
                CompressionUnit: _c_ntfs.uint8
                Reserved: __cs__.Array[_c_ntfs.uint8]
                AllocatedLength: _c_ntfs.int64
                FileSize: _c_ntfs.int64
                ValidDataLength: _c_ntfs.int64
                TotalAllocated: _c_ntfs.int64
                @overload
                def __init__(
                    self,
                    LowestVcn: _c_ntfs.uint64 | None = ...,
                    HighestVcn: _c_ntfs.uint64 | None = ...,
                    MappingPairsOffset: _c_ntfs.uint16 | None = ...,
                    CompressionUnit: _c_ntfs.uint8 | None = ...,
                    Reserved: __cs__.Array[_c_ntfs.uint8] | None = ...,
                    AllocatedLength: _c_ntfs.int64 | None = ...,
                    FileSize: _c_ntfs.int64 | None = ...,
                    ValidDataLength: _c_ntfs.int64 | None = ...,
                    TotalAllocated: _c_ntfs.int64 | None = ...,
                ): ...
                @overload
                def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

            Nonresident: __anonymous_1__
            @overload
            def __init__(self, Resident: __anonymous_0__ | None = ..., Nonresident: __anonymous_1__ | None = ...): ...
            @overload
            def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

        Form: __anonymous_2__
        @overload
        def __init__(
            self,
            TypeCode: _c_ntfs.ATTRIBUTE_TYPE_CODE | None = ...,
            RecordLength: _c_ntfs.uint32 | None = ...,
            FormCode: _c_ntfs.uint8 | None = ...,
            NameLength: _c_ntfs.uint8 | None = ...,
            NameOffset: _c_ntfs.uint16 | None = ...,
            Flags: _c_ntfs.uint16 | None = ...,
            Instance: _c_ntfs.uint16 | None = ...,
            Form: __anonymous_2__ | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    ATTRIBUTE_RECORD_HEADER: TypeAlias = _ATTRIBUTE_RECORD_HEADER
    class _STANDARD_INFORMATION(__cs__.Structure):
        CreationTime: _c_ntfs.int64
        LastModificationTime: _c_ntfs.int64
        LastChangeTime: _c_ntfs.int64
        LastAccessTime: _c_ntfs.int64
        FileAttributes: _c_ntfs.uint32
        MaximumVersions: _c_ntfs.uint32
        VersionNumber: _c_ntfs.uint32
        ClassId: _c_ntfs.uint32
        OwnerId: _c_ntfs.uint32
        SecurityId: _c_ntfs.uint32
        QuotaCharged: _c_ntfs.uint64
        Usn: _c_ntfs.uint64
        @overload
        def __init__(
            self,
            CreationTime: _c_ntfs.int64 | None = ...,
            LastModificationTime: _c_ntfs.int64 | None = ...,
            LastChangeTime: _c_ntfs.int64 | None = ...,
            LastAccessTime: _c_ntfs.int64 | None = ...,
            FileAttributes: _c_ntfs.uint32 | None = ...,
            MaximumVersions: _c_ntfs.uint32 | None = ...,
            VersionNumber: _c_ntfs.uint32 | None = ...,
            ClassId: _c_ntfs.uint32 | None = ...,
            OwnerId: _c_ntfs.uint32 | None = ...,
            SecurityId: _c_ntfs.uint32 | None = ...,
            QuotaCharged: _c_ntfs.uint64 | None = ...,
            Usn: _c_ntfs.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    STANDARD_INFORMATION_EX: TypeAlias = _STANDARD_INFORMATION
    class _ATTRIBUTE_LIST_ENTRY(__cs__.Structure):
        AttributeTypeCode: _c_ntfs.ATTRIBUTE_TYPE_CODE
        RecordLength: _c_ntfs.uint16
        AttributeNameLength: _c_ntfs.uint8
        AttributeNameOffset: _c_ntfs.uint8
        LowestVcn: _c_ntfs.uint64
        SegmentReference: _c_ntfs._MFT_SEGMENT_REFERENCE
        Reserved: _c_ntfs.uint16
        AttributeName: __cs__.WcharArray
        @overload
        def __init__(
            self,
            AttributeTypeCode: _c_ntfs.ATTRIBUTE_TYPE_CODE | None = ...,
            RecordLength: _c_ntfs.uint16 | None = ...,
            AttributeNameLength: _c_ntfs.uint8 | None = ...,
            AttributeNameOffset: _c_ntfs.uint8 | None = ...,
            LowestVcn: _c_ntfs.uint64 | None = ...,
            SegmentReference: _c_ntfs._MFT_SEGMENT_REFERENCE | None = ...,
            Reserved: _c_ntfs.uint16 | None = ...,
            AttributeName: __cs__.WcharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    ATTRIBUTE_LIST_ENTRY: TypeAlias = _ATTRIBUTE_LIST_ENTRY
    class _FILE_NAME(__cs__.Structure):
        ParentDirectory: _c_ntfs._MFT_SEGMENT_REFERENCE
        CreationTime: _c_ntfs.int64
        LastModificationTime: _c_ntfs.int64
        LastChangeTime: _c_ntfs.int64
        LastAccessTime: _c_ntfs.int64
        AllocatedLength: _c_ntfs.int64
        FileSize: _c_ntfs.int64
        FileAttributes: _c_ntfs.uint32
        EaSize: _c_ntfs.uint16
        _: _c_ntfs.uint16
        ReparsePointTag: _c_ntfs.uint32
        FileNameLength: _c_ntfs.uint8
        Flags: _c_ntfs.uint8
        FileName: __cs__.WcharArray
        @overload
        def __init__(
            self,
            ParentDirectory: _c_ntfs._MFT_SEGMENT_REFERENCE | None = ...,
            CreationTime: _c_ntfs.int64 | None = ...,
            LastModificationTime: _c_ntfs.int64 | None = ...,
            LastChangeTime: _c_ntfs.int64 | None = ...,
            LastAccessTime: _c_ntfs.int64 | None = ...,
            AllocatedLength: _c_ntfs.int64 | None = ...,
            FileSize: _c_ntfs.int64 | None = ...,
            FileAttributes: _c_ntfs.uint32 | None = ...,
            EaSize: _c_ntfs.uint16 | None = ...,
            _: _c_ntfs.uint16 | None = ...,
            ReparsePointTag: _c_ntfs.uint32 | None = ...,
            FileNameLength: _c_ntfs.uint8 | None = ...,
            Flags: _c_ntfs.uint8 | None = ...,
            FileName: __cs__.WcharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FILE_NAME: TypeAlias = _FILE_NAME
    class IO_REPARSE_TAG(__cs__.Enum):
        RESERVED_ZERO = ...
        RESERVED_ONE = ...
        RESERVED_TWO = ...
        MOUNT_POINT = ...
        HSM = ...
        DRIVE_EXTENDER = ...
        HSM2 = ...
        SIS = ...
        WIM = ...
        CSV = ...
        DFS = ...
        FILTER_MANAGER = ...
        SYMLINK = ...
        IIS_CACHE = ...
        DFSR = ...
        DEDUP = ...
        APPXSTRM = ...
        NFS = ...
        FILE_PLACEHOLDER = ...
        DFM = ...
        WOF = ...
        WCI = ...
        WCI_1 = ...
        GLOBAL_REPARSE = ...
        CLOUD = ...
        CLOUD_1 = ...
        CLOUD_2 = ...
        CLOUD_3 = ...
        CLOUD_4 = ...
        CLOUD_5 = ...
        CLOUD_6 = ...
        CLOUD_7 = ...
        CLOUD_8 = ...
        CLOUD_9 = ...
        CLOUD_A = ...
        CLOUD_B = ...
        CLOUD_C = ...
        CLOUD_D = ...
        CLOUD_E = ...
        CLOUD_F = ...
        APPEXECLINK = ...
        PROJFS = ...
        LX_SYMLINK = ...
        STORAGE_SYNC = ...
        WCI_TOMBSTONE = ...
        UNHANDLED = ...
        ONEDRIVE = ...
        PROJFS_TOMBSTONE = ...
        AF_UNIX = ...
        LX_FIFO = ...
        LX_CHR = ...
        LX_BLK = ...
        WCI_LINK = ...
        WCI_LINK_1 = ...

    class _REPARSE_DATA_BUFFER(__cs__.Structure):
        ReparseTag: _c_ntfs.IO_REPARSE_TAG
        ReparseDataLength: _c_ntfs.uint16
        Reserved: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            ReparseTag: _c_ntfs.IO_REPARSE_TAG | None = ...,
            ReparseDataLength: _c_ntfs.uint16 | None = ...,
            Reserved: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    REPARSE_DATA_BUFFER: TypeAlias = _REPARSE_DATA_BUFFER
    class SYMLINK_FLAG(__cs__.Enum):
        ABSOLUTE = ...
        RELATIVE = ...

    class _SYMBOLIC_LINK_REPARSE_BUFFER(__cs__.Structure):
        SubstituteNameOffset: _c_ntfs.uint16
        SubstituteNameLength: _c_ntfs.uint16
        PrintNameOffset: _c_ntfs.uint16
        PrintNameLength: _c_ntfs.uint16
        Flags: _c_ntfs.SYMLINK_FLAG
        @overload
        def __init__(
            self,
            SubstituteNameOffset: _c_ntfs.uint16 | None = ...,
            SubstituteNameLength: _c_ntfs.uint16 | None = ...,
            PrintNameOffset: _c_ntfs.uint16 | None = ...,
            PrintNameLength: _c_ntfs.uint16 | None = ...,
            Flags: _c_ntfs.SYMLINK_FLAG | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    SYMBOLIC_LINK_REPARSE_BUFFER: TypeAlias = _SYMBOLIC_LINK_REPARSE_BUFFER
    class _MOUNT_POINT_REPARSE_BUFFER(__cs__.Structure):
        SubstituteNameOffset: _c_ntfs.uint16
        SubstituteNameLength: _c_ntfs.uint16
        PrintNameOffset: _c_ntfs.uint16
        PrintNameLength: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            SubstituteNameOffset: _c_ntfs.uint16 | None = ...,
            SubstituteNameLength: _c_ntfs.uint16 | None = ...,
            PrintNameOffset: _c_ntfs.uint16 | None = ...,
            PrintNameLength: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class COLLATION(__cs__.Enum):
        BINARY = ...
        FILE_NAME = ...
        UNICODE_STRING = ...
        NUMBER_RULES = ...
        NTOFS_ULONG = ...
        NTOFS_SID = ...
        NTOFS_SECURITY_HASH = ...
        NTOFS_ULONGS = ...

    COLLATION_RULE: TypeAlias = COLLATION
    class _INDEX_HEADER(__cs__.Structure):
        FirstEntryOffset: _c_ntfs.uint32
        TotalSizeOfEntries: _c_ntfs.uint32
        AllocatedSize: _c_ntfs.uint32
        Flags: _c_ntfs.uint8
        Reserved: __cs__.Array[_c_ntfs.uint8]
        @overload
        def __init__(
            self,
            FirstEntryOffset: _c_ntfs.uint32 | None = ...,
            TotalSizeOfEntries: _c_ntfs.uint32 | None = ...,
            AllocatedSize: _c_ntfs.uint32 | None = ...,
            Flags: _c_ntfs.uint8 | None = ...,
            Reserved: __cs__.Array[_c_ntfs.uint8] | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    INDEX_HEADER: TypeAlias = _INDEX_HEADER
    class _INDEX_ROOT(__cs__.Structure):
        AttributeType: _c_ntfs.ATTRIBUTE_TYPE_CODE
        CollationRule: _c_ntfs.COLLATION
        BytesPerIndexBuffer: _c_ntfs.uint32
        ClustersPerIndexBuffer: _c_ntfs.uint8
        Reserved: __cs__.Array[_c_ntfs.uint8]
        IndexHeader: _c_ntfs._INDEX_HEADER
        @overload
        def __init__(
            self,
            AttributeType: _c_ntfs.ATTRIBUTE_TYPE_CODE | None = ...,
            CollationRule: _c_ntfs.COLLATION | None = ...,
            BytesPerIndexBuffer: _c_ntfs.uint32 | None = ...,
            ClustersPerIndexBuffer: _c_ntfs.uint8 | None = ...,
            Reserved: __cs__.Array[_c_ntfs.uint8] | None = ...,
            IndexHeader: _c_ntfs._INDEX_HEADER | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    INDEX_ROOT: TypeAlias = _INDEX_ROOT
    class _INDEX_ALLOCATION_BUFFER(__cs__.Structure):
        MultiSectorHeader: _c_ntfs._MULTI_SECTOR_HEADER
        Lsn: _c_ntfs.uint64
        Vcn: _c_ntfs.uint64
        IndexHeader: _c_ntfs._INDEX_HEADER
        @overload
        def __init__(
            self,
            MultiSectorHeader: _c_ntfs._MULTI_SECTOR_HEADER | None = ...,
            Lsn: _c_ntfs.uint64 | None = ...,
            Vcn: _c_ntfs.uint64 | None = ...,
            IndexHeader: _c_ntfs._INDEX_HEADER | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    INDEX_ALLOCATION_BUFFER: TypeAlias = _INDEX_ALLOCATION_BUFFER
    class _INDEX_ENTRY(__cs__.Structure):
        FileReference: _c_ntfs._MFT_SEGMENT_REFERENCE
        DataOffset: _c_ntfs.uint16
        DataLength: _c_ntfs.uint16
        _: _c_ntfs.uint32
        Length: _c_ntfs.uint16
        KeyLength: _c_ntfs.uint16
        Flags: _c_ntfs.uint16
        Reserved: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            FileReference: _c_ntfs._MFT_SEGMENT_REFERENCE | None = ...,
            DataOffset: _c_ntfs.uint16 | None = ...,
            DataLength: _c_ntfs.uint16 | None = ...,
            _: _c_ntfs.uint32 | None = ...,
            Length: _c_ntfs.uint16 | None = ...,
            KeyLength: _c_ntfs.uint16 | None = ...,
            Flags: _c_ntfs.uint16 | None = ...,
            Reserved: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    INDEX_ENTRY: TypeAlias = _INDEX_ENTRY
    class SECURITY_DESCRIPTOR_CONTROL(__cs__.Flag):
        SE_OWNER_DEFAULTED = ...
        SE_GROUP_DEFAULTED = ...
        SE_DACL_PRESENT = ...
        SE_DACL_DEFAULTED = ...
        SE_SACL_PRESENT = ...
        SE_SACL_DEFAULTED = ...
        SE_DACL_AUTO_INHERIT_REQ = ...
        SE_SACL_AUTO_INHERIT_REQ = ...
        SE_DACL_AUTO_INHERITED = ...
        SE_SACL_AUTO_INHERITED = ...
        SE_DACL_PROTECTED = ...
        SE_SACL_PROTECTED = ...
        SE_RM_CONTROL_VALID = ...
        SE_SELF_RELATIVE = ...

    class ACCESS_MASK(__cs__.Flag):
        FILE_READ_DATA = ...
        FILE_LIST_DIRECTORY = ...
        FILE_WRITE_DATA = ...
        FILE_ADD_FILE = ...
        FILE_APPEND_DATA = ...
        FILE_ADD_SUBDIRECTORY = ...
        FILE_READ_EA = ...
        FILE_WRITE_EA = ...
        FILE_EXECUTE = ...
        FILE_TRAVERSE = ...
        FILE_DELETE_CHILD = ...
        FILE_READ_ATTRIBUTES = ...
        FILE_WRITE_ATTRIBUTES = ...
        DELETE = ...
        READ_CONTROL = ...
        WRITE_DAC = ...
        WRITE_OWNER = ...
        SYNCHRONIZE = ...
        STANDARD_RIGHTS_READ = ...
        STANDARD_RIGHTS_WRITE = ...
        STANDARD_RIGHTS_EXECUTE = ...
        STANDARD_RIGHTS_REQUIRED = ...
        STANDARD_RIGHTS_ALL = ...
        ACCESS_SYSTEM_SECURITY = ...
        MAXIMUM_ALLOWED = ...
        GENERIC_ALL = ...
        GENERIC_EXECUTE = ...
        GENERIC_WRITE = ...
        GENERIC_READ = ...

    class ACE_TYPE(__cs__.Enum):
        ACCESS_ALLOWED = ...
        ACCESS_DENIED = ...
        SYSTEM_AUDIT = ...
        SYSTEM_ALARM = ...
        ACCESS_ALLOWED_COMPOUND = ...
        ACCESS_ALLOWED_OBJECT = ...
        ACCESS_DENIED_OBJECT = ...
        SYSTEM_AUDIT_OBJECT = ...
        SYSTEM_ALARM_OBJECT = ...
        ACCESS_ALLOWED_CALLBACK = ...
        ACCESS_DENIED_CALLBACK = ...
        ACCESS_ALLOWED_CALLBACK_OBJECT = ...
        ACCESS_DENIED_CALLBACK_OBJECT = ...
        SYSTEM_AUDIT_CALLBACK = ...
        SYSTEM_ALARM_CALLBACK = ...
        SYSTEM_AUDIT_CALLBACK_OBJECT = ...
        SYSTEM_ALARM_CALLBACK_OBJECT = ...
        SYSTEM_MANDATORY_LABEL = ...
        SYSTEM_RESOURCE_ATTRIBUTE = ...
        SYSTEM_SCOPED_POLICY_ID = ...
        SYSTEM_PROCESS_TRUST_LABEL = ...
        SYSTEM_ACCESS_FILTER = ...

    class ACE_FLAGS(__cs__.Flag):
        OBJECT_INHERIT_ACE = ...
        CONTAINER_INHERIT_ACE = ...
        NO_PROPAGATE_INHERIT_ACE = ...
        INHERIT_ONLY_ACE = ...
        INHERITED_ACE = ...
        SUCCESSFUL_ACCESS_ACE_FLAG = ...
        FAILED_ACCESS_ACE_FLAG = ...

    class ACE_OBJECT_FLAGS(__cs__.Flag):
        ACE_OBJECT_TYPE_PRESENT = ...
        ACE_INHERITED_OBJECT_TYPE_PRESENT = ...

    class COMPOUND_ACE_TYPE(__cs__.Enum):
        COMPOUND_ACE_IMPERSONATION = ...

    class _ACL(__cs__.Structure):
        AclRevision: _c_ntfs.uint8
        Sbz1: _c_ntfs.uint8
        AclSize: _c_ntfs.uint16
        AceCount: _c_ntfs.uint16
        Sbz2: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            AclRevision: _c_ntfs.uint8 | None = ...,
            Sbz1: _c_ntfs.uint8 | None = ...,
            AclSize: _c_ntfs.uint16 | None = ...,
            AceCount: _c_ntfs.uint16 | None = ...,
            Sbz2: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    ACL: TypeAlias = _ACL
    class _ACE_HEADER(__cs__.Structure):
        AceType: _c_ntfs.ACE_TYPE
        AceFlags: _c_ntfs.ACE_FLAGS
        AceSize: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            AceType: _c_ntfs.ACE_TYPE | None = ...,
            AceFlags: _c_ntfs.ACE_FLAGS | None = ...,
            AceSize: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    ACE_HEADER: TypeAlias = _ACE_HEADER
    class _SECURITY_DESCRIPTOR_HEADER(__cs__.Structure):
        HashId: _c_ntfs.uint32
        SecurityId: _c_ntfs.uint32
        Offset: _c_ntfs.uint64
        Length: _c_ntfs.uint32
        @overload
        def __init__(
            self,
            HashId: _c_ntfs.uint32 | None = ...,
            SecurityId: _c_ntfs.uint32 | None = ...,
            Offset: _c_ntfs.uint64 | None = ...,
            Length: _c_ntfs.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    SECURITY_DESCRIPTOR_HEADER: TypeAlias = _SECURITY_DESCRIPTOR_HEADER
    class _SECURITY_DESCRIPTOR_RELATIVE(__cs__.Structure):
        Revision: _c_ntfs.uint8
        Sbz1: _c_ntfs.uint8
        Control: _c_ntfs.SECURITY_DESCRIPTOR_CONTROL
        Owner: _c_ntfs.uint32
        Group: _c_ntfs.uint32
        Sacl: _c_ntfs.uint32
        Dacl: _c_ntfs.uint32
        @overload
        def __init__(
            self,
            Revision: _c_ntfs.uint8 | None = ...,
            Sbz1: _c_ntfs.uint8 | None = ...,
            Control: _c_ntfs.SECURITY_DESCRIPTOR_CONTROL | None = ...,
            Owner: _c_ntfs.uint32 | None = ...,
            Group: _c_ntfs.uint32 | None = ...,
            Sacl: _c_ntfs.uint32 | None = ...,
            Dacl: _c_ntfs.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    SECURITY_DESCRIPTOR_RELATIVE: TypeAlias = _SECURITY_DESCRIPTOR_RELATIVE
    class USN_REASON(__cs__.Flag):
        DATA_OVERWRITE = ...
        DATA_EXTEND = ...
        DATA_TRUNCATION = ...
        NAMED_DATA_OVERWRITE = ...
        NAMED_DATA_EXTEND = ...
        NAMED_DATA_TRUNCATION = ...
        FILE_CREATE = ...
        FILE_DELETE = ...
        EA_CHANGE = ...
        SECURITY_CHANGE = ...
        RENAME_OLD_NAME = ...
        RENAME_NEW_NAME = ...
        INDEXABLE_CHANGE = ...
        BASIC_INFO_CHANGE = ...
        HARD_LINK_CHANGE = ...
        COMPRESSION_CHANGE = ...
        ENCRYPTION_CHANGE = ...
        OBJECT_ID_CHANGE = ...
        REPARSE_POINT_CHANGE = ...
        STREAM_CHANGE = ...
        TRANSACTED_CHANGE = ...
        INTEGRITY_CHANGE = ...
        CLOSE = ...

    class USN_SOURCE(__cs__.Flag):
        NORMAL = ...
        DATA_MANAGEMENT = ...
        AUXILIARY_DATA = ...
        REPLICATION_MANAGEMENT = ...
        CLIENT_REPLICATION_MANAGEMENT = ...

    class _FILE_ID_128(__cs__.Structure):
        Identifier: __cs__.Array[_c_ntfs.uint8]
        @overload
        def __init__(self, Identifier: __cs__.Array[_c_ntfs.uint8] | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FILE_ID_128: TypeAlias = _FILE_ID_128
    class USN_RECORD_COMMON_HEADER(__cs__.Structure):
        RecordLength: _c_ntfs.uint32
        MajorVersion: _c_ntfs.uint16
        MinorVersion: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            RecordLength: _c_ntfs.uint32 | None = ...,
            MajorVersion: _c_ntfs.uint16 | None = ...,
            MinorVersion: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class USN_RECORD_V2(__cs__.Structure):
        RecordLength: _c_ntfs.uint32
        MajorVersion: _c_ntfs.uint16
        MinorVersion: _c_ntfs.uint16
        FileReferenceNumber: _c_ntfs._MFT_SEGMENT_REFERENCE
        ParentFileReferenceNumber: _c_ntfs._MFT_SEGMENT_REFERENCE
        Usn: _c_ntfs.uint64
        TimeStamp: _c_ntfs.uint64
        Reason: _c_ntfs.USN_REASON
        SourceInfo: _c_ntfs.USN_SOURCE
        SecurityId: _c_ntfs.uint32
        FileAttributes: _c_ntfs.FILE_ATTRIBUTE
        FileNameLength: _c_ntfs.uint16
        FileNameOffset: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            RecordLength: _c_ntfs.uint32 | None = ...,
            MajorVersion: _c_ntfs.uint16 | None = ...,
            MinorVersion: _c_ntfs.uint16 | None = ...,
            FileReferenceNumber: _c_ntfs._MFT_SEGMENT_REFERENCE | None = ...,
            ParentFileReferenceNumber: _c_ntfs._MFT_SEGMENT_REFERENCE | None = ...,
            Usn: _c_ntfs.uint64 | None = ...,
            TimeStamp: _c_ntfs.uint64 | None = ...,
            Reason: _c_ntfs.USN_REASON | None = ...,
            SourceInfo: _c_ntfs.USN_SOURCE | None = ...,
            SecurityId: _c_ntfs.uint32 | None = ...,
            FileAttributes: _c_ntfs.FILE_ATTRIBUTE | None = ...,
            FileNameLength: _c_ntfs.uint16 | None = ...,
            FileNameOffset: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class USN_RECORD_V3(__cs__.Structure):
        RecordLength: _c_ntfs.uint32
        MajorVersion: _c_ntfs.uint16
        MinorVersion: _c_ntfs.uint16
        FileReferenceNumber: _c_ntfs._FILE_ID_128
        ParentFileReferenceNumber: _c_ntfs._FILE_ID_128
        Usn: _c_ntfs.uint64
        TimeStamp: _c_ntfs.uint64
        Reason: _c_ntfs.USN_REASON
        SourceInfo: _c_ntfs.USN_SOURCE
        SecurityId: _c_ntfs.uint32
        FileAttributes: _c_ntfs.FILE_ATTRIBUTE
        FileNameLength: _c_ntfs.uint16
        FileNameOffset: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            RecordLength: _c_ntfs.uint32 | None = ...,
            MajorVersion: _c_ntfs.uint16 | None = ...,
            MinorVersion: _c_ntfs.uint16 | None = ...,
            FileReferenceNumber: _c_ntfs._FILE_ID_128 | None = ...,
            ParentFileReferenceNumber: _c_ntfs._FILE_ID_128 | None = ...,
            Usn: _c_ntfs.uint64 | None = ...,
            TimeStamp: _c_ntfs.uint64 | None = ...,
            Reason: _c_ntfs.USN_REASON | None = ...,
            SourceInfo: _c_ntfs.USN_SOURCE | None = ...,
            SecurityId: _c_ntfs.uint32 | None = ...,
            FileAttributes: _c_ntfs.FILE_ATTRIBUTE | None = ...,
            FileNameLength: _c_ntfs.uint16 | None = ...,
            FileNameOffset: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class USN_RECORD_EXTENT(__cs__.Structure):
        Offset: _c_ntfs.int64
        Length: _c_ntfs.int64
        @overload
        def __init__(self, Offset: _c_ntfs.int64 | None = ..., Length: _c_ntfs.int64 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class USN_RECORD_V4(__cs__.Structure):
        RecordLength: _c_ntfs.uint32
        MajorVersion: _c_ntfs.uint16
        MinorVersion: _c_ntfs.uint16
        FileReferenceNumber: _c_ntfs._FILE_ID_128
        ParentFileReferenceNumber: _c_ntfs._FILE_ID_128
        Usn: _c_ntfs.uint64
        Reason: _c_ntfs.USN_REASON
        SourceInfo: _c_ntfs.USN_SOURCE
        RemainingExtents: _c_ntfs.uint32
        NumberOfExtents: _c_ntfs.uint16
        ExtentSize: _c_ntfs.uint16
        @overload
        def __init__(
            self,
            RecordLength: _c_ntfs.uint32 | None = ...,
            MajorVersion: _c_ntfs.uint16 | None = ...,
            MinorVersion: _c_ntfs.uint16 | None = ...,
            FileReferenceNumber: _c_ntfs._FILE_ID_128 | None = ...,
            ParentFileReferenceNumber: _c_ntfs._FILE_ID_128 | None = ...,
            Usn: _c_ntfs.uint64 | None = ...,
            Reason: _c_ntfs.USN_REASON | None = ...,
            SourceInfo: _c_ntfs.USN_SOURCE | None = ...,
            RemainingExtents: _c_ntfs.uint32 | None = ...,
            NumberOfExtents: _c_ntfs.uint16 | None = ...,
            ExtentSize: _c_ntfs.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

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

ATTRIBUTE_TYPE_CODE: TypeAlias = c_ntfs.ATTRIBUTE_TYPE_CODE
IO_REPARSE_TAG: TypeAlias = c_ntfs.IO_REPARSE_TAG
ACCESS_MASK: TypeAlias = c_ntfs.ACCESS_MASK
ACE_TYPE: TypeAlias = c_ntfs.ACE_TYPE
ACE_OBJECT_FLAGS: TypeAlias = c_ntfs.ACE_OBJECT_FLAGS
COLLATION: TypeAlias = c_ntfs.COLLATION

NTFS_SIGNATURE: bytes = ...

SECTOR_SIZE: int = ...
SECTOR_SHIFT: int = ...

USN_PAGE_SIZE: int = ...

DEFAULT_SECTOR_SIZE: int = ...
DEFAULT_CLUSTER_SIZE: int = ...
DEFAULT_RECORD_SIZE: int = ...
DEFAULT_INDEX_SIZE: int = ...

FILE_NUMBER_MFT: int = ...
FILE_NUMBER_MFTMIRR: int = ...
FILE_NUMBER_LOGFILE: int = ...
FILE_NUMBER_VOLUME: int = ...
FILE_NUMBER_ATTRDEF: int = ...
FILE_NUMBER_ROOT: int = ...
FILE_NUMBER_BITMAP: int = ...
FILE_NUMBER_BOOT: int = ...
FILE_NUMBER_BADCLUS: int = ...
FILE_NUMBER_SECURE: int = ...
FILE_NUMBER_UPCASE: int = ...
FILE_NUMBER_EXTEND: int = ...

FILE_RECORD_SEGMENT_IN_USE: int = ...
FILE_FILE_NAME_INDEX_PRESENT: int = ...

ATTRIBUTE_FLAG_COMPRESSION_MASK: int = ...
ATTRIBUTE_FLAG_ENCRYPTED: int = ...
ATTRIBUTE_FLAG_SPARSE: int = ...

FILE_NAME_NTFS: int = ...
FILE_NAME_DOS: int = ...

COMPRESSION_FORMAT_NONE: int = ...
COMPRESSION_FORMAT_DEFAULT: int = ...
COMPRESSION_FORMAT_LZNT1: int = ...

INDEX_NODE: int = ...
INDEX_ENTRY_NODE: int = ...
INDEX_ENTRY_END: int = ...
