]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winplink.c
A major purpose of PuTTY's memory-allocation functions is to succeed or die
[PuTTY.git] / windows / winplink.c
index fdf019013fca65c9ff5011659cb354fe67baefb5..ae80bf9bd903f6c8c8f060239a69c22b4d731589 100644 (file)
@@ -598,16 +598,16 @@ int main(int argc, char **argv)
     inhandle = GetStdHandle(STD_INPUT_HANDLE);
     outhandle = GetStdHandle(STD_OUTPUT_HANDLE);
     errhandle = GetStdHandle(STD_ERROR_HANDLE);
-    GetConsoleMode(inhandle, &orig_console_mode);
-    SetConsoleMode(inhandle, ENABLE_PROCESSED_INPUT);
-
-    main_thread_id = GetCurrentThreadId();
-
     /*
      * Turn off ECHO and LINE input modes. We don't care if this
      * call fails, because we know we aren't necessarily running in
      * a console.
      */
+    GetConsoleMode(inhandle, &orig_console_mode);
+    SetConsoleMode(inhandle, ENABLE_PROCESSED_INPUT);
+
+    main_thread_id = GetCurrentThreadId();
+
     handles[0] = netevent;
     handles[1] = stdinevent;
     handles[2] = stdoutevent;