I am developing an application that is launched from a Windows service. This application links to several DLLs which, indirectly link to cvirte.dll. This procedure succeeds when I am working from my development setup.
I created a Windows installer for my application, however, when the Windows service launches the application from its directory within %ProgramFiles(x86)% it fails.
From a dump of the failing process I find the following exception:
Unhandled exception at 0x774F1E0B (ntdll.dll) in app.exe.8480.dmp: 0xC0000005: Access violation writing location 0x00000014. occurred
and the associated call stack:
ntdll.dll!RtlpWaitOnCriticalSection()
ntdll.dll!RtlpEnterCriticalSectionContended()
ntdll.dll!_RtlEnterCriticalSection@4()
cvirte.dll!687df3cc()
[Frames below may be incorrect and/or missing, no symbols loaded for cvirte.dll]
cvirte.dll!685c967a()
cvirte.dll!685b4b4a()
cvirte.dll!688007c3()
cvirte.dll!688351f1()
cvirte.dll!688352b4()
[External Code]
The interesting thing is that I only get this error when the application is installed and is then launched from the Windows service. I can launch it manually, whether or not installed, or it will launch from the service when the service is started from script.
My assumption is that this failing code is a part of the DLL initialization code since my application's WinMain function is never hit when I get this failure. I expect that cvirte.dll needs access to a resource but due to some security constraints it cannot reach it and then fails in ntdll.dll when it tries to proceed. Without knowing what cvirte.dll might be doing I have not been able to confirm my hypothesis.
Version information:
cvirte.dll: 17.0.0.295 (32-bit) from NI Automated Test Software Suite (SPR18)
Windows 10: 1809 (OS build 17763.914)