docs: def OpenKey(key, sub_key):
    """This calls the Windows OpenKeyEx function in a Unicode safe way."""
    regopenkeyex = advapi32["RegOpenKeyExW"]
    regopenkeyex.restype = ctypes.c_long
    regopenkeyex.argtypes = [
        ctypes.c_void_p, ctypes.c_wchar_p, ctypes.c_ulong, ctypes.c_ulong,
        ctypes.POINTER(ctypes.c_void_p)
    ]
  
    new_key = KeyHandle()
    # Don't use KEY_WOW64_64KEY (0x100) since it breaks on Windows 2000
    rc = regopenkeyex(
        key.handle, sub_key, 0, KEY_READ,
        ctypes.cast(
            ctypes.byref(new_key.handle), ctypes.POINTER(ctypes.c_void_p)))
    if rc != ERROR_SUCCESS:
      raise ctypes.WinError(2)
  
    return new_key