How to Disable Citrix API Hooks on a Per-application Basis

Caution! Refer to the Disclaimer at the end of this article before using Registry Editor.

From XenApp and XenDesktop version 7.9 and newer, changes to API hooks configuration must be followed by a reboot.

Renaming an API hook DLL to disable it is not supported.

You can disable all Citrix API hooks for a single executable file by creating the following registry values:

For Windows 32-bit version

Key: HKEY_LOCAL_MACHINESOFTWARECitrixCtxHook

Value Name: ExcludedImageNames

Type: REG_SZ

Value: badapp1.exe,badapp2.exe,badapp3.exe

For Windows 64-bit version

Keys:

HKEY_LOCAL_MACHINESOFTWARECitrixCtxHook

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeCitrixCtxHook

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeCitrixCtxHook64

Value Name: ExcludedImageNames

Type: REG_SZ

Value: badapp1.exe,badapp2.exe,badapp3.exe

Note: The CtxHook64 key does not exist on Windows 2008 R2 or higher and it is not required.

Note: You can disable a specific Citrix API hook, corresponding to an associated feature, for all processes by creating the following registry values:

For the 32-bit version

Key: HKEY_LOCAL_MACHINESOFTWARECitrixCtxHookAppInit_Dlls<Feature>

Value Name: Flag

Type: REG_DWORD

Value: 0

For the 64-bit version

Keys:

HKEY_LOCAL_MACHINESOFTWARECitrixCtxHookAppInit_Dlls<Feature>

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeCitrixCtxHookAppInit_Dlls<Feature>

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeCitrixCtxHook64AppInit_Dlls<Feature>

Value Name: Flag

Type: REG_DWORD

Value: 0

Note: The CtxHook64 key does not exist on Windows 2008 R2 or higher and it is not required.

<Feature> is replaced with the name of the relevant registry key; for example Smart Card Redirection is controlled by the key “Smart Card Hook”.

An alternative to setting each value Flag to zero, is to remove the Hook DLL subkey from HKLMSOFTWARECitrixCtxHookAppInit_Dlls, and then reboot.

XenDesktop/XenApp 7.9 and later utilizes Kernel APC Hooking as a replacement of AppInit_DLLs used in previous versions of the products. You can completely disable all Citrix Hooking (including MfApHook.dll and MfApHook64.dll) on XenDesktop/XenApp 7.9 and later for specific applications by creating the following registry value:

Key: HKLMSYSTEMCurrentControlSetservicesCtxUvi

Value Name: UviProcessExcludes

Type: REG_SZ

Value: badapp1.exe;badlongname.ex;badapp2.exe

Notes

  • You must reboot the VDA to have the changes take effect.
  • There is a 14 character limit on the process names – this means to exclude an application named “badlongname.exe” you would add “badlongname.ex”.
  • The UviProcessExcludes key does not support wild cards.
  • The registry will already exist on XenDesktop/XenApp 7.14.1 and newer VDAs so additional applications can be appended with a semicolon delimiter.

Related:

  • No Related Posts

Leave a Reply