"""Compatibility shim for platforms that report Windows but lack winreg.

Kodi builds on some consoles can expose a Windows-like platform string while
not shipping Python's `winreg` module. Libraries such as `mimetypes` (and in
turn `requests`) may still attempt to import `winreg`.

This shim provides the minimal API surface used by `mimetypes` and always
raises OSError for registry access so callers gracefully fall back to built-in
MIME mappings.
"""

HKEY_CLASSES_ROOT = 0
REG_SZ = 1
REG_EXPAND_SZ = 2


class HKEYType(object):
    pass


def OpenKey(*args, **kwargs):
    raise OSError("Windows registry is not available on this platform")


def EnumKey(*args, **kwargs):
    raise OSError("Windows registry is not available on this platform")


def QueryValueEx(*args, **kwargs):
    raise OSError("Windows registry is not available on this platform")


def CloseKey(*args, **kwargs):
    return None
