OPENVPN_ADD_LIBS(-lcrypt32)
OPENVPN_ADD_LIBS(-liphlpapi)
OPENVPN_ADD_LIBS(-lwinmm)
+ OPENVPN_ADD_LIBS(-lshell32)
;;
*-*-dragonfly*)
AC_DEFINE(TARGET_DRAGONFLY, 1, [Are we running on DragonFlyBSD?])
bool is_console = (GetFileType (in) == FILE_TYPE_CHAR);
DWORD flags_save = 0;
int status = 0;
+ WCHAR *winput;
if (is_console)
{
is_console = 0;
}
- status = ReadFile (in, input, capacity, &len, NULL);
+ if (is_console)
+ {
+ winput = malloc (capacity * sizeof (WCHAR));
+ if (winput == NULL)
+ return false;
+
+ status = ReadConsoleW (in, winput, capacity, &len, NULL);
+ WideCharToMultiByte (CP_UTF8, 0, winput, len, input, capacity, NULL, NULL);
+ free (winput);
+ }
+ else
+ status = ReadFile (in, input, capacity, &len, NULL);
string_null_terminate (input, (int)len, capacity);
chomp (input);