Skip to content

Commit

Permalink
gh-896: Fix regression: cygwin/msys process creation was broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Oct 10, 2016
1 parent f22db9c commit 67f4299
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 7 additions & 9 deletions src/ConEmuHk/SetHook.cpp
Expand Up @@ -891,15 +891,7 @@ bool StartupHooks()
print_timings(L"SetAllHooks");
HLOG1("SetAllHooks",0);
bool lbRc = SetAllHooks();
if (lbRc)
{
gnDllState |= ds_HooksStarted;

//_ASSERTE(FALSE); -- it must TRIGGER OnCreateFileW
SetImports(WIN3264TEST(L"ConEmuHk",L"ConEmuHk64"), ghOurModule, TRUE);
//_ASSERTE(FALSE); -- it must BYPASS OnCreateFileW and call trampolined function
}
else
if (!lbRc)
{
gnDllState &= ~ds_HooksStarted;
gnDllState |= ds_HooksStartFailed;
Expand Down Expand Up @@ -1686,6 +1678,12 @@ bool SetAllHooks()

DebugString(L"SetAllHooks finished\n");


SetImports(WIN3264TEST(L"ConEmuHk",L"ConEmuHk64"), ghOurModule, TRUE);

DebugString(L"SetImports finished\n");


extern FARPROC CallWriteConsoleW;
CallWriteConsoleW = (FARPROC)GetOriginalAddress((LPVOID)OnWriteConsoleW, HOOK_FN_ID(WriteConsoleW), NULL, NULL, gbPrepareDefaultTerminal);

Expand Down
4 changes: 3 additions & 1 deletion src/ConEmuHk/hkConsole.cpp
Expand Up @@ -42,6 +42,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../common/HandleKeeper.h"
#include "../common/MModule.h"
#include "../common/WConsole.h"
#include "../common/WErrGuard.h"

#include "Ansi.h"
#include "DefTermHk.h"
Expand Down Expand Up @@ -494,8 +495,9 @@ BOOL WINAPI OnFreeConsole(void)

if (ghConWnd)
{
CLastErrorGuard guard;
int (WINAPI* fnRequestLocalServer)(/*[IN/OUT]*/RequestLocalServerParm* Parm);
MModule server(WIN3264TEST(L"ConEmuCD.dll",L"ConEmuCD64.dll"));
MModule server(GetModuleHandle(WIN3264TEST(L"ConEmuCD.dll",L"ConEmuCD64.dll")));
if (server.GetProcAddress("PrivateEntry",fnRequestLocalServer))
{
RequestLocalServerParm args = {sizeof(args)};
Expand Down

0 comments on commit 67f4299

Please sign in to comment.