Tags: adoxa/ansicon
Tags
Fix ANSICON environment variable Creating a console handle in `set_ansicon` was assumed to succeed, but that is not the case when there is no console (if the process was started detached or freed its console). This left the console info uninitialised, causing my `printf` replacement to get stuck in a loop. Resolves #127.
Fixes Unhook on terminate, to properly exit (Vista CMD.EXE and a MinGW-built ansicon.exe would seem to exit okay, but the exit code was wrong). Fixes #123. Verify the DLL exists prior to injection. With the DLL now being added to the import table, failing to find it would prevent the process itself from loading.
Create the flush thread on first use Some processes just return from the entry point; this only exits the thread, not the process. It seems that when ANSICON created its flush thread in DllMain, that became the primary thread, so when the entry point returned the process was still waiting for the flush thread to exit. Creating the flush thread the first time it is used avoids this problem, letting the process exit.
PreviousNext