One of the problems I was having with running on Windows 8 was the fact that any time my application threw an exception (even one that was caught and handled), the application would crash with a 0xC00001A5 exception (which appears to be new in Windows 8). The exception is STATUS_INVALID_EXCEPTION_HANDLER (parameter 2) and it occurs in AQNatProf.dll.
After pursuing things for a while, I was able to determine that the AQNatProf.dll file was compiled with the SAFESEH flag, thus compiling in all of the exception handlers within the DLL. However, my hunch is that the AQNatProf.dll injection module actually dynamically creates exception handlers. Because the SAFESEH flag is used, these dynamic exception handlers are not found in the SEH handler list compiled into the DLL and thus Windows throws the 0xC00001A5 (parameter 2) exception in the NTDLL!RtlIsValidHandler() routine during exception stack unwinding.
The best way for SmartBear to handle this is either to use a static handler or to create the DLL without the SAFESEH flag enabled. However, in the mean time, it is possible to modify the DLL so that this exception doesn't occur. To do that, use your favorite Portable Executable file editor and do the following:
- In the Optional header, set the Checksum field to 0, since we're modifying the DLL and the checksum will no longer be valid.
- In the Data Directory list, set the Security Directory RVA and Size to 0, since we're modifying the DLL and the signature will no longer verify.
- In the Data Directory list, set the Configuration Directory RVA and Size to 0, effectively disabling the Safe SEH data from use by Windows (thereby disabling the invalid handler exception).
Save the modified DLL somewhere safe and rename the old DLL in C:\Program Files (x86)\SmartBear\AQTime\Extensions\AQNatProf.dll to AQNatProf.dll.old. Then copy the modified DLL into the above folder and AQTime should now work with caught exceptions.