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

 
Предыдущий Следующий
ERROR_INVALID_KEYBOARD_HANDLE ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION

ERROR_HOOK_TYPE_NOT_ALLOWED

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

ERROR_HOOK_TYPE_NOT_ALLOWED — этот тип перехватчика запрещён.

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

Зафиксируйте тип WH_*, ID целевого потока, дескриптор модуля и параметры SetWindowsHookEx, при которых получен ERROR_HOOK_TYPE_NOT_ALLOWED.

  • Для глобального перехватчика проверьте разрядность вызывающего и целевых процессов, наличие подходящей DLL и границы сеанса, рабочего стола и уровня целостности.
  • Сверьте ограничения именно выбранного типа перехватчика; если глобальный перехватчик для сценария не поддерживается, рассмотрите Raw Input, UI Automation, event hooks или обработку сообщений внутри приложения.
  • Сверьте поддерживаемые версии, возможности и режимы для конкретного API/устройства, возвращающего ERROR_HOOK_TYPE_NOT_ALLOWED. Если возможность отсутствует, выбирайте поддерживаемый режим или API вместо повторных попыток.

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

  • Windows policy or platform rules prohibit installing the requested type of hook in the chosen scope.
  • For keyboard and mouse observation, evaluate whether Raw Input, accessibility APIs, event hooks, or application-level message handling provide the required behavior without invasive global hooks. Do not weaken integrity or security policy simply to make an unsupported hook load.
  • the callback module does not meet cross-process injection requirements
  • A 64-bit automation host tries to install one global DLL hook into both 64-bit and 32-bit applications. The unsupported target combination returns 1458. Providing documented architecture-specific components, or switching to UI Automation, resolves the capability mismatch.
  • Use an allowed scope, install architecture-correct hook components, move the feature to the target process, or replace the hook with a supported API. Treat installation failure as a capability decision and disable only the dependent feature. Repeatedly retrying the same prohibited hook cannot succeed.

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


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