For an unknown reason, passing NULL pointer instead of &written worked
on Windows 10 and on Windows 7 when stdout is not redirected.
Closes https://github.com/espressif/esp-idf/issues/3740
(StrCmp(argv[1], TEXT("--version")) == 0 ||
StrCmp(argv[1], TEXT("-v")) == 0)) {
LPCSTR msg = VERSION "\n";
- WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msg, lstrlen(msg), NULL, NULL);
+ DWORD written;
+ WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msg, lstrlen(msg), &written, NULL);
return 0;
}