def get_type_info (handle):
  public_object_type_information = PUBLIC_OBJECT_TYPE_INFORMATION ()
  size = DWORD (sizeof (public_object_type_information))
  while True:
    result = signed_to_unsigned (
      ntdll.ZwQueryObject (
        handle, 2, byref (public_object_type_information), size, None
      )
    )
    if result == STATUS_SUCCESS:
      return public_object_type_information.Name.Buffer
    elif result > STATUS_INFO_LENGTH_MISMATCH:
      size = DWORD (size.value * 4)
      resize (public_object_type_information, size.value)
    elif result == STATUS_INVALID_HANDLE:
      return None
    else:
      raise x_file_handles ("ZwQueryObject.2", hex (result))
dataset/ETHPy150Open tjguk/winsys/random/file_handles.py/get_type_info/operator `==` -> `>`