Update win_console.c

This commit is contained in:
janbodnar 2016-01-31 13:49:30 +01:00
parent 17a4da48d8
commit 937a293c4a

View File

@ -1 +1,17 @@
#include <windows.h>
#include <wchar.h>
int wmain(int argc, wchar_t **argv) {
PDWORD cChars = NULL;
HANDLE std = GetStdHandle(STD_OUTPUT_HANDLE);
if (std == INVALID_HANDLE_VALUE) {
wprintf(L"Cannot retrieve standard output handle\n (%d)",
GetLastError());
}
WriteConsoleW(std, argv[1], wcslen(argv[1]), cChars, NULL);
return EXIT_SUCCESS;
}