Index: base/applications/cmdutils/mode/CMakeLists.txt =================================================================== --- base/applications/cmdutils/mode/CMakeLists.txt (revision 72995) +++ base/applications/cmdutils/mode/CMakeLists.txt (working copy) @@ -1,6 +1,9 @@ +include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) + add_executable(mode mode.c mode.rc) set_module_type(mode win32cui UNICODE) +target_link_libraries(mode conutils ${PSEH_LIB}) add_importlibs(mode user32 msvcrt kernel32) set_target_properties(mode PROPERTIES SUFFIX ".com") add_cd_file(TARGET mode DESTINATION reactos/system32 FOR all) Index: base/applications/cmdutils/mode/lang/en-US.rc =================================================================== --- base/applications/cmdutils/mode/lang/en-US.rc (nonexistent) +++ base/applications/cmdutils/mode/lang/en-US.rc (working copy) @@ -0,0 +1,62 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_USAGE "Configure System Devices.\n\n\ + Device Status: MODE [device] [/STATUS]\n\ + Select code page: MODE CON[:] CP SELECT=yyy\n\ + Code page status: MODE CON[:] CP [/STATUS]\n\ + Display mode: MODE CON[:] [COLS=c] [LINES=n]\n\ + Typematic rate: MODE CON[:] [RATE=r DELAY=d]\n\ + Redirect printing: MODE LPTn[:]=COMm[:]\n\ + Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]\n\ + [to=on|off] [xon=on|off] [odsr=on|off]\n\ + [octs=on|off] [dtr=on|off|hs]\n\ + [rts=on|off|hs|tg] [idsr=on|off]\n" + IDS_QUERY_SERIAL_FOUND "\tFound serial device - %s\n" + IDS_QUERY_PRINTER_FOUND "\tFound printer device - %s\n" + IDS_QUERY_PARALLEL_FOUND "\tFound parallel device - %s\n" + IDS_QUERY_MISC_FOUND "\tFound other device - %s\n" +END + +STRINGTABLE +BEGIN + IDS_PARALLEL_STATUS_HEADER "\nStatus for device LPT%d:\n" + IDS_PRINTER_OUTPUT_NOT_REROUTED "\tPrinter output is not being rerouted.\n" + IDS_PRINTER_OUTPUT_REROUTED_SERIAL "\tPrinter output is being rerouted to serial port %s.\n" + IDS_CONSOLE_STATUS_HEADER "\nStatus for device CON:\n" + IDS_CONSOLE_STATUS_LINES "\tLines: %d\n" + IDS_CONSOLE_STATUS_COL "\tColumns: %d\n" + IDS_CONSOLE_KBD_DELAY "\tKeyboard delay: %ld\n" + IDS_CONSOLE_KBD_RATE "\tKeyboard rate: %ld\n" + IDS_CONSOLE_CODEPAGE "\tCode page: %d\n" + IDS_COM_STATUS_HEADER "\nStatus for device COM%d:\n" + IDS_COM_STATUS_BAUD "\tBaud: %ld\n" + IDS_COM_STATUS_PARITY "\tParity: %s\n" + IDS_COM_STATUS_DATA_BITS "\tData Bits: %d\n" + IDS_COM_STATUS_STOP_BITS "\tStop Bits: %s\n" + IDS_COM_STATUS_TIMEOUT "\tTimeout: " + IDS_COM_STATUS_XON_XOFF "\n\tXON/XOFF: " + IDS_COM_STATUS_CTS_HANDSHAKING "\n\tCTS handshaking: " + IDS_COM_STATUS_DSR_HANDSHAKING "\n\tDSR handshaking: " + IDS_COM_STATUS_DSR_SENSITIVITY "\n\tDSR sensitivity: " + IDS_COM_STATUS_DTR_CIRCUIT "\n\tDTR circuit: %s\n" + IDS_COM_STATUS_RTS_CIRCUIT "\tRTS circuit: %s\n" + IDS_ON "ON" + IDS_OFF "OFF" +END + +STRINGTABLE +BEGIN + IDS_ERROR_QUERY_DEVICES "ERROR: Unable to query DOS devices (0x%lx).\n" + IDS_ERROR_QUERY_DEVICES_FORM "\tQueryDosDeviceW(%s) returned unrecognised form %s.\n" + IDS_ERROR_SET_PARALLEL_STATE "SetParallelState(%d) - DefineDosDevice(%s) (0x%lx)\n" + IDS_ERROR_INVALID_PARAMETER "ERROR: Invalid parameter - %s\n" + IDS_ERROR_ILLEGAL_DEVICE_NAME "ERROR: Illegal device name - %s (0x%lx)\n" + IDS_ERROR_STATUS_GET_DEVICE "ERROR: Failed to get the status for device COM%d:\n" + IDS_ERROR_STATUS_SET_DEVICE "ERROR: Failed to set the status for device COM%d:\n" + IDS_ERROR_INVALID_PARITY_BITS "ERROR: Invalid value for Parity Bits %d:\n" + IDS_ERROR_INVALID_STOP_BITS "ERROR: Invalid value for Stop Bits %d:\n" + IDS_ERROR_NO_MEMORY "ERROR: Not enough memory\n" + IDS_ERROR_SCREEN_LINES_COL "ERROR: The screen cannot be set to the number of lines and columns specified.\n" +END Index: base/applications/cmdutils/mode/lang/en-US.rc =================================================================== --- base/applications/cmdutils/mode/lang/en-US.rc (nonexistent) +++ base/applications/cmdutils/mode/lang/en-US.rc (working copy) @@ -0,0 +1,62 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_USAGE "Configure System Devices.\n\n\ + Device Status: MODE [device] [/STATUS]\n\ + Select code page: MODE CON[:] CP SELECT=yyy\n\ + Code page status: MODE CON[:] CP [/STATUS]\n\ + Display mode: MODE CON[:] [COLS=c] [LINES=n]\n\ + Typematic rate: MODE CON[:] [RATE=r DELAY=d]\n\ + Redirect printing: MODE LPTn[:]=COMm[:]\n\ + Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]\n\ + [to=on|off] [xon=on|off] [odsr=on|off]\n\ + [octs=on|off] [dtr=on|off|hs]\n\ + [rts=on|off|hs|tg] [idsr=on|off]\n" + IDS_QUERY_SERIAL_FOUND "\tFound serial device - %s\n" + IDS_QUERY_PRINTER_FOUND "\tFound printer device - %s\n" + IDS_QUERY_PARALLEL_FOUND "\tFound parallel device - %s\n" + IDS_QUERY_MISC_FOUND "\tFound other device - %s\n" +END + +STRINGTABLE +BEGIN + IDS_PARALLEL_STATUS_HEADER "\nStatus for device LPT%d:\n" + IDS_PRINTER_OUTPUT_NOT_REROUTED "\tPrinter output is not being rerouted.\n" + IDS_PRINTER_OUTPUT_REROUTED_SERIAL "\tPrinter output is being rerouted to serial port %s.\n" + IDS_CONSOLE_STATUS_HEADER "\nStatus for device CON:\n" + IDS_CONSOLE_STATUS_LINES "\tLines: %d\n" + IDS_CONSOLE_STATUS_COL "\tColumns: %d\n" + IDS_CONSOLE_KBD_DELAY "\tKeyboard delay: %ld\n" + IDS_CONSOLE_KBD_RATE "\tKeyboard rate: %ld\n" + IDS_CONSOLE_CODEPAGE "\tCode page: %d\n" + IDS_COM_STATUS_HEADER "\nStatus for device COM%d:\n" + IDS_COM_STATUS_BAUD "\tBaud: %ld\n" + IDS_COM_STATUS_PARITY "\tParity: %s\n" + IDS_COM_STATUS_DATA_BITS "\tData Bits: %d\n" + IDS_COM_STATUS_STOP_BITS "\tStop Bits: %s\n" + IDS_COM_STATUS_TIMEOUT "\tTimeout: " + IDS_COM_STATUS_XON_XOFF "\n\tXON/XOFF: " + IDS_COM_STATUS_CTS_HANDSHAKING "\n\tCTS handshaking: " + IDS_COM_STATUS_DSR_HANDSHAKING "\n\tDSR handshaking: " + IDS_COM_STATUS_DSR_SENSITIVITY "\n\tDSR sensitivity: " + IDS_COM_STATUS_DTR_CIRCUIT "\n\tDTR circuit: %s\n" + IDS_COM_STATUS_RTS_CIRCUIT "\tRTS circuit: %s\n" + IDS_ON "ON" + IDS_OFF "OFF" +END + +STRINGTABLE +BEGIN + IDS_ERROR_QUERY_DEVICES "ERROR: Unable to query DOS devices (0x%lx).\n" + IDS_ERROR_QUERY_DEVICES_FORM "\tQueryDosDeviceW(%s) returned unrecognised form %s.\n" + IDS_ERROR_SET_PARALLEL_STATE "SetParallelState(%d) - DefineDosDevice(%s) (0x%lx)\n" + IDS_ERROR_INVALID_PARAMETER "ERROR: Invalid parameter - %s\n" + IDS_ERROR_ILLEGAL_DEVICE_NAME "ERROR: Illegal device name - %s (0x%lx)\n" + IDS_ERROR_STATUS_GET_DEVICE "ERROR: Failed to get the status for device COM%d:\n" + IDS_ERROR_STATUS_SET_DEVICE "ERROR: Failed to set the status for device COM%d:\n" + IDS_ERROR_INVALID_PARITY_BITS "ERROR: Invalid value for Parity Bits %d:\n" + IDS_ERROR_INVALID_STOP_BITS "ERROR: Invalid value for Stop Bits %d:\n" + IDS_ERROR_NO_MEMORY "ERROR: Not enough memory\n" + IDS_ERROR_SCREEN_LINES_COL "ERROR: The screen cannot be set to the number of lines and columns specified.\n" +END Index: base/applications/cmdutils/mode/mode.c =================================================================== --- base/applications/cmdutils/mode/mode.c (revision 72995) +++ base/applications/cmdutils/mode/mode.c (working copy) @@ -35,37 +35,15 @@ #include #include +#include + +#include "resource.h" + #define MAX_PORTNAME_LEN 20 #define MAX_COMPORT_NUM 10 #define ASSERT(a) -const WCHAR* const usage_strings[] = -{ - L"Device Status: MODE [device] [/STATUS]", - L"Select code page: MODE CON[:] CP SELECT=yyy", - L"Code page status: MODE CON[:] CP [/STATUS]", - L"Display mode: MODE CON[:] [COLS=c] [LINES=n]", - L"Typematic rate: MODE CON[:] [RATE=r DELAY=d]", - L"Redirect printing: MODE LPTn[:]=COMm[:]", - L"Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]\n" \ - L" [to=on|off] [xon=on|off] [odsr=on|off]\n" \ - L" [octs=on|off] [dtr=on|off|hs]\n" \ - L" [rts=on|off|hs|tg] [idsr=on|off]", -}; - -void Usage(void) -{ - UINT i; - - wprintf(L"\nConfigures system devices.\n\n"); - for (i = 0; i < ARRAYSIZE(usage_strings); i++) - { - wprintf(L"%s\n", usage_strings[i]); - } - wprintf(L"\n"); -} - int QueryDevices(VOID) { WCHAR buffer[20240]; @@ -79,19 +57,19 @@ { if (wcsstr(ptr, L"COM")) { - wprintf(L" Found serial device - %s\n", ptr); + ConResPrintf(StdOut, IDS_QUERY_SERIAL_FOUND, ptr); } else if (wcsstr(ptr, L"PRN")) { - wprintf(L" Found printer device - %s\n", ptr); + ConResPrintf(StdOut, IDS_QUERY_PRINTER_FOUND, ptr); } else if (wcsstr(ptr, L"LPT")) { - wprintf(L" Found parallel device - %s\n", ptr); + ConResPrintf(StdOut, IDS_QUERY_PARALLEL_FOUND, ptr); } else { - // wprintf(L" Found other device - %s\n", ptr); + ConResPrintf(StdOut, IDS_QUERY_MISC_FOUND, ptr); } ptr += (wcslen(ptr) + 1); } @@ -98,7 +76,7 @@ } else { - wprintf(L" ERROR: QueryDosDeviceW(...) failed: 0x%lx\n", GetLastError()); + ConResPrintf(StdOut, IDS_ERROR_QUERY_DEVICES, GetLastError()); } return 1; } @@ -109,7 +87,7 @@ WCHAR szPortName[MAX_PORTNAME_LEN]; swprintf(szPortName, L"LPT%d", nPortNum); - wprintf(L"\nStatus for device LPT%d:\n", nPortNum); + ConResPrintf(StdOut, IDS_PARALLEL_STATUS_HEADER, nPortNum); wprintf(L"-----------------------\n"); if (QueryDosDeviceW(szPortName, buffer, ARRAYSIZE(buffer))) { @@ -118,22 +96,22 @@ { if (_wcsicmp(szPortName, ++ptr) == 0) { - wprintf(L" Printer output is not being rerouted.\n"); + ConResPrintf(StdOut, IDS_PRINTER_OUTPUT_NOT_REROUTED); } else { - wprintf(L" Printer output is being rerouted to serial port %s\n", ptr); + ConResPrintf(StdOut, IDS_PRINTER_OUTPUT_REROUTED_SERIAL, ptr); } return 0; } else { - wprintf(L" QueryDosDeviceW(%s) returned unrecognised form %s.\n", szPortName, buffer); + ConResPrintf(StdOut, IDS_ERROR_QUERY_DEVICES_FORM, szPortName, buffer); } } else { - wprintf(L" ERROR: QueryDosDeviceW(%s) failed: 0x%lx\n", szPortName, GetLastError()); + ConResPrintf(StdOut, IDS_ERROR_QUERY_DEVICES, GetLastError()); } return 1; } @@ -147,7 +125,7 @@ swprintf(szTargetPath, L"COM%d", nPortNum); if (!DefineDosDeviceW(DDD_REMOVE_DEFINITION, szPortName, szTargetPath)) { - wprintf(L"SetParallelState(%d) - DefineDosDevice(%s) failed: 0x%lx\n", nPortNum, szPortName, GetLastError()); + ConResPrintf(StdOut, IDS_ERROR_QUERY_DEVICES, nPortNum, szPortName, GetLastError()); } ShowParallelStatus(nPortNum); @@ -189,34 +167,34 @@ int ShowConsoleStatus(VOID) { - HANDLE hConOut = GetStdHandle(STD_OUTPUT_HANDLE); - CONSOLE_SCREEN_BUFFER_INFO csbi; + HANDLE hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); + CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo; DWORD dwKbdDelay, dwKbdSpeed; - wprintf(L"\nStatus for device CON:\n"); + ConResPrintf(StdOut, IDS_CONSOLE_STATUS_HEADER); wprintf(L"-----------------------\n"); - if (GetConsoleScreenBufferInfo(hConOut, &csbi)) + if (GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleScreenBufferInfo)) { - wprintf(L" Lines: %d\n", csbi.dwSize.Y); - wprintf(L" Columns: %d\n", csbi.dwSize.X); + ConResPrintf(StdOut, IDS_CONSOLE_STATUS_LINES, ConsoleScreenBufferInfo.dwSize.Y); + ConResPrintf(StdOut, IDS_CONSOLE_STATUS_COL, ConsoleScreenBufferInfo.dwSize.X); } if (SystemParametersInfoW(SPI_GETKEYBOARDDELAY, 0, &dwKbdDelay, 0)) { - wprintf(L" Keyboard delay: %ld\n", dwKbdDelay); + ConResPrintf(StdOut, IDS_CONSOLE_KBD_DELAY, dwKbdDelay); } if (SystemParametersInfoW(SPI_GETKEYBOARDSPEED, 0, &dwKbdSpeed, 0)) { - wprintf(L" Keyboard rate: %ld\n", dwKbdSpeed); + ConResPrintf(StdOut, IDS_CONSOLE_KBD_RATE, dwKbdSpeed); } - wprintf(L" Code page: %d\n", GetConsoleOutputCP()); + ConResPrintf(StdOut, IDS_CONSOLE_CODEPAGE, GetConsoleOutputCP()); return 0; } int ShowConsoleCPStatus(VOID) { - wprintf(L"\nStatus for device CON:\n"); + ConResPrintf(StdOut, IDS_CONSOLE_STATUS_HEADER); wprintf(L"-----------------------\n"); - wprintf(L" Code page: %d\n", GetConsoleOutputCP()); + ConResPrintf(StdOut, IDS_CONSOLE_CODEPAGE, GetConsoleOutputCP()); return 0; } @@ -364,12 +342,12 @@ Quit: ClearScreen(hConOut, &csbi); if (!ResizeTextConsole(hConOut, &csbi, Resolution)) - wprintf(L"The screen cannot be set to the number of lines and columns specified.\n"); + ConResPrintf(StdOut, IDS_ERROR_SCREEN_LINES_COL); return 0; invalid_parameter: - wprintf(L"Invalid parameter - %s\n", ArgStr); + ConResPrintf(StdOut, IDS_ERROR_INVALID_PARAMETER, ArgStr); return 1; } @@ -442,7 +420,7 @@ else { invalid_parameter: - wprintf(L"Invalid parameter - %s\n", ArgStr); + ConResPrintf(StdOut, IDS_ERROR_INVALID_PARAMETER, ArgStr); return 1; } } @@ -451,7 +429,7 @@ { ClearScreen(hConOut, &csbi); if (!ResizeTextConsole(hConOut, &csbi, Resolution)) - wprintf(L"The screen cannot be set to the number of lines and columns specified.\n"); + ConResPrintf(StdOut, IDS_ERROR_SCREEN_LINES_COL); } else if (kbdMode) { @@ -493,7 +471,7 @@ else { invalid_parameter: - wprintf(L"Invalid parameter - %s\n", ArgStr); + ConResPrintf(StdOut, IDS_ERROR_INVALID_PARAMETER, ArgStr); return 1; } @@ -526,8 +504,7 @@ if (hPort == INVALID_HANDLE_VALUE) { - wprintf(L"Illegal device name - %s\n", szPortName); - wprintf(L"Last error = 0x%lx\n", GetLastError()); + ConResPrintf(StdOut, IDS_ERROR_ILLEGAL_DEVICE_NAME, szPortName, GetLastError()); return FALSE; } @@ -535,7 +512,7 @@ : GetCommState(hPort, pDCB); if (!Success) { - wprintf(L"Failed to %s the status for device COM%d:\n", bWrite ? L"set" : L"get", nPortNum); + ConResPrintf(StdOut, (bWrite ? IDS_ERROR_STATUS_SET_DEVICE : IDS_ERROR_STATUS_GET_DEVICE), nPortNum); goto Quit; } @@ -543,7 +520,7 @@ : GetCommTimeouts(hPort, pCommTimeouts); if (!Success) { - wprintf(L"Failed to %s timeout status for device COM%d:\n", bWrite ? L"set" : L"get", nPortNum); + ConResPrintf(StdOut, (bWrite ? IDS_ERROR_STATUS_SET_DEVICE : IDS_ERROR_STATUS_GET_DEVICE), nPortNum); goto Quit; } @@ -574,29 +551,34 @@ } if (dcb.Parity >= ARRAYSIZE(parity_strings)) { - wprintf(L"ERROR: Invalid value for Parity Bits %d:\n", dcb.Parity); + ConResPrintf(StdOut, IDS_ERROR_INVALID_PARITY_BITS, dcb.Parity); dcb.Parity = 0; } if (dcb.StopBits >= ARRAYSIZE(stopbit_strings)) { - wprintf(L"ERROR: Invalid value for Stop Bits %d:\n", dcb.StopBits); + ConResPrintf(StdOut, IDS_ERROR_INVALID_STOP_BITS, dcb.StopBits); dcb.StopBits = 0; } - wprintf(L"\nStatus for device COM%d:\n", nPortNum); + ConResPrintf(StdOut, IDS_COM_STATUS_HEADER, nPortNum); wprintf(L"-----------------------\n"); - wprintf(L" Baud: %ld\n", dcb.BaudRate); - wprintf(L" Parity: %s\n", parity_strings[dcb.Parity]); - wprintf(L" Data Bits: %d\n", dcb.ByteSize); - wprintf(L" Stop Bits: %s\n", stopbit_strings[dcb.StopBits]); - wprintf(L" Timeout: %s\n", - (CommTimeouts.ReadTotalTimeoutConstant != 0) || - (CommTimeouts.WriteTotalTimeoutConstant != 0) ? L"ON" : L"OFF"); - wprintf(L" XON/XOFF: %s\n", dcb.fOutX ? L"ON" : L"OFF"); - wprintf(L" CTS handshaking: %s\n", dcb.fOutxCtsFlow ? L"ON" : L"OFF"); - wprintf(L" DSR handshaking: %s\n", dcb.fOutxDsrFlow ? L"ON" : L"OFF"); - wprintf(L" DSR sensitivity: %s\n", dcb.fDsrSensitivity ? L"ON" : L"OFF"); - wprintf(L" DTR circuit: %s\n", control_strings[dcb.fDtrControl]); - wprintf(L" RTS circuit: %s\n", control_strings[dcb.fRtsControl]); + ConResPrintf(StdOut, IDS_COM_STATUS_BAUD, dcb.BaudRate); + ConResPrintf(StdOut, IDS_COM_STATUS_PARITY, parity_strings[dcb.Parity]); + ConResPrintf(StdOut, IDS_COM_STATUS_DATA_BITS, dcb.ByteSize); + ConResPrintf(StdOut, IDS_COM_STATUS_STOP_BITS, stopbit_strings[dcb.StopBits]); + ConResPrintf(StdOut, IDS_COM_STATUS_TIMEOUT); + ConResPrintf(StdOut, ((CommTimeouts.ReadTotalTimeoutConstant != 0) || + (CommTimeouts.WriteTotalTimeoutConstant != 0) ? IDS_ON : IDS_OFF)); + ConResPrintf(StdOut, IDS_COM_STATUS_XON_XOFF); + ConResPrintf(StdOut, (dcb.fOutX ? IDS_ON : IDS_OFF)); + ConResPrintf(StdOut, IDS_COM_STATUS_CTS_HANDSHAKING); + ConResPrintf(StdOut, (dcb.fOutxCtsFlow ? IDS_ON : IDS_OFF)); + ConResPrintf(StdOut, IDS_COM_STATUS_DSR_HANDSHAKING); + ConResPrintf(StdOut, (dcb.fOutxDsrFlow ? IDS_ON : IDS_OFF)); + ConResPrintf(StdOut, IDS_COM_STATUS_DSR_SENSITIVITY); + ConResPrintf(StdOut, (dcb.fDsrSensitivity ? IDS_ON : IDS_OFF)); + ConResPrintf(StdOut, IDS_COM_STATUS_DTR_CIRCUIT, control_strings[dcb.fDtrControl]); + ConResPrintf(StdOut, IDS_COM_STATUS_RTS_CIRCUIT, control_strings[dcb.fRtsControl]); + return 0; } @@ -1033,7 +1015,7 @@ if (!Success) { - wprintf(L"Invalid parameter - %s\n", ArgStr); + ConResPrintf(StdOut, IDS_ERROR_INVALID_PARAMETER, ArgStr); return 1; } @@ -1079,6 +1061,8 @@ PCWSTR ArgStr, argStr; INT nPortNum; + + ConInitStdStreams(); /* * MODE.COM has a very peculiar way of parsing its arguments, @@ -1108,7 +1092,7 @@ ArgStr = HeapAlloc(GetProcessHeap(), 0, (ArgStrSize + 1) * sizeof(WCHAR)); if (ArgStr == NULL) { - wprintf(L"ERROR: Not enough memory\n"); + ConResPrintf(StdOut, IDS_ERROR_NO_MEMORY); return 1; } @@ -1130,7 +1114,8 @@ if (wcsstr(argStr, L"/?") || wcsstr(argStr, L"-?")) { - Usage(); + ConResPrintf(StdOut, IDS_USAGE); + goto Quit; } else if (_wcsnicmp(argStr, L"/STA", 4) == 0) @@ -1214,7 +1199,7 @@ goto Quit; invalid_parameter: - wprintf(L"Invalid parameter - %s\n", ArgStr); + ConResPrintf(StdOut, IDS_ERROR_INVALID_PARAMETER, ArgStr); goto Quit; Quit: Index: base/applications/cmdutils/mode/mode.rc =================================================================== --- base/applications/cmdutils/mode/mode.rc (revision 72995) +++ base/applications/cmdutils/mode/mode.rc (working copy) @@ -1,5 +1,15 @@ +#include +#include "resource.h" + #define REACTOS_STR_FILE_DESCRIPTION "ReactOS Mode Utility" #define REACTOS_STR_INTERNAL_NAME "mode" #define REACTOS_STR_ORIGINAL_FILENAME "mode.com" #include + +/* UTF-8 */ +#pragma code_page(65001) + +#ifdef LANGUAGE_EN_US + #include "lang/en-US.rc" +#endif Index: base/applications/cmdutils/mode/resource.h =================================================================== --- base/applications/cmdutils/mode/resource.h (nonexistent) +++ base/applications/cmdutils/mode/resource.h (working copy) @@ -0,0 +1,47 @@ +#ifndef RESOURCE_H +#define RESOURCE_H + +#define IDS_USAGE 0 + +#define IDS_QUERY_SERIAL_FOUND 1 +#define IDS_QUERY_PRINTER_FOUND 2 +#define IDS_QUERY_PARALLEL_FOUND 3 +#define IDS_QUERY_MISC_FOUND 4 + +#define IDS_PARALLEL_STATUS_HEADER 5 +#define IDS_PRINTER_OUTPUT_NOT_REROUTED 6 +#define IDS_PRINTER_OUTPUT_REROUTED_SERIAL 7 +#define IDS_CONSOLE_STATUS_HEADER 8 +#define IDS_CONSOLE_STATUS_LINES 9 +#define IDS_CONSOLE_STATUS_COL 10 +#define IDS_CONSOLE_KBD_DELAY 11 +#define IDS_CONSOLE_KBD_RATE 12 +#define IDS_CONSOLE_CODEPAGE 13 +#define IDS_COM_STATUS_HEADER 14 +#define IDS_COM_STATUS_BAUD 15 +#define IDS_COM_STATUS_PARITY 16 +#define IDS_COM_STATUS_DATA_BITS 17 +#define IDS_COM_STATUS_STOP_BITS 18 +#define IDS_COM_STATUS_TIMEOUT 19 +#define IDS_COM_STATUS_XON_XOFF 20 +#define IDS_COM_STATUS_CTS_HANDSHAKING 21 +#define IDS_COM_STATUS_DSR_HANDSHAKING 22 +#define IDS_COM_STATUS_DSR_SENSITIVITY 23 +#define IDS_COM_STATUS_DTR_CIRCUIT 24 +#define IDS_COM_STATUS_RTS_CIRCUIT 25 +#define IDS_ON 26 +#define IDS_OFF 27 + +#define IDS_ERROR_QUERY_DEVICES 28 +#define IDS_ERROR_QUERY_DEVICES_FORM 29 +#define IDS_ERROR_SET_PARALLEL_STATE 30 +#define IDS_ERROR_INVALID_PARAMETER 31 +#define IDS_ERROR_ILLEGAL_DEVICE_NAME 32 +#define IDS_ERROR_STATUS_GET_DEVICE 33 +#define IDS_ERROR_STATUS_SET_DEVICE 34 +#define IDS_ERROR_INVALID_PARITY_BITS 35 +#define IDS_ERROR_INVALID_STOP_BITS 36 +#define IDS_ERROR_NO_MEMORY 37 +#define IDS_ERROR_SCREEN_LINES_COL 38 + +#endif /* RESOURCE_H */ \ No newline at end of file