"Kirill K. Smirnov" lich@math.spbu.ru wrote:
- /* Try to set invalid CP */
- ok(!SetConsoleCP(0), "Shouldn't succeed\n");
- ok(GetLastError()==ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %u\n", ERROR_INVALID_PARAMETER,
GetLastError());
- ok(!SetConsoleOutputCP(0), "Shouldn't succeed\n");
- ok(GetLastError()==ERROR_INVALID_PARAMETER, "GetLastError: expecting %u got %u\n", ERROR_INVALID_PARAMETER,
GetLastError());
You need to set last error value to something (usually 0xdeadbeef) before calling an API if you're planning to check last error value after the call.
Also keeping code lines in a reasonable limit would be nice.