OfficeMail OFMA printer driver randomly not available in Citrix environment


OFMA printer driver randomly not available in Citrix environment; Windows Server 2008 R2 SP1 on Citrix XenApp 6.5.
The OFMA printer driver failed to run/open with Windows pop-up error of "Word cannot print. There is no printer installed".


The OFMA printer driver is loaded into the memory by the OS with the help of a loader.
he loader is an API executed by ntdll.dll (LdrLoadDll).
After the driver dll is loaded into memory, the loader would relocate reference addresses specified in the relocation tables of the dll.
When dll is loaded, the CRT initialization code (provided by Microsoft and linked into the driver) is calling _CRT_INIT which should call pre_c_init to initialize the CRT.
The pointer to this function on correctly working system is correctly relocated into address space of the driver.

When this error occurs, the driver is loaded with incorrect address relocation and points outside of the address space of the driver dll.

The driver dll could be moved in memory either by the loader or by some Citrix memory optimization feature, but the list of the pointers after the move would not be relocated correctly.
The wrong address is causing the CRT initialization code to attempt to access the memory space outside of the driver address space which causes the exception and has caused this failure.


UPDATED: March 31, 2017
Please report this to Citrix and Microsoft support team
Environment Details