Что означает код ошибки Windows 1462 (ERROR_INCORRECT_SIZE)?

 
Предыдущий Следующий
ERROR_INVALID_MONITOR_HANDLE ERROR_SYMLINK_CLASS_DISABLED

ERROR_INCORRECT_SIZE

Что означает ERROR_INCORRECT_SIZE

ERROR_INCORRECT_SIZE — указан неверный размер.

Что проверить

Запишите фактический размер/длину, переданную API, и размер структуры или буфера, который действительно выделен.

  • Сверьте единицы измерения, version-dependent размер структуры и требования к выравниванию конкретного вызова.
  • Для API с двухэтапным запросом размера используйте возвращённое required size, а не жёстко заданную константу.

Исходная формулировка

  • An API rejected a length, count, or structure-size argument.
  • Centralize checked size calculations, use typed span or array abstractions internally, and convert to Win32 units only at the call boundary. Add compile-time assertions for structures shared with drivers or other processes. Treat data from files and networks as untrusted before using embedded lengths.
  • mixing ANSI and Unicode structure or string lengths
  • A 64-bit binding declares a structure with default language packing instead of the Windows ABI layout. Its cbSize reflects the wrong layout and the API returns 1462. Matching native packing and verifying offsets against the SDK header corrects the call.
  • setting cbSize to the pointer size instead of sizeof(structure)

Технические ссылки


Нужно найти другой код? Найти другой код состояния или ошибки.