https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3d66048b162fe35002404…
commit 3d66048b162fe350024045e50a1852b1f4bd1516
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Mon Apr 2 18:10:31 2018 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Mon Apr 2 18:10:31 2018 +0200
[TRACERT] Use ConUtils lib and update de-DE.rc CORE-14265
Most likely this also improves formerly unprintable characters for
fr-FR, it-IT, ro-RO, ru-RU, zh-CN.
---
base/applications/network/tracert/CMakeLists.txt | 4 ++-
base/applications/network/tracert/lang/de-DE.rc | 41 +++++++++++++-----------
base/applications/network/tracert/tracert.cpp | 10 ++++--
3 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/base/applications/network/tracert/CMakeLists.txt
b/base/applications/network/tracert/CMakeLists.txt
index 132f7fc6de..f1a3a58389 100644
--- a/base/applications/network/tracert/CMakeLists.txt
+++ b/base/applications/network/tracert/CMakeLists.txt
@@ -1,5 +1,7 @@
+include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
add_executable(tracert tracert.cpp tracert.rc)
set_module_type(tracert win32cui UNICODE)
-add_importlibs(tracert ws2_32 iphlpapi user32 msvcrt kernel32 ntdll)
+target_link_libraries(tracert conutils ${PSEH_LIB})
+add_importlibs(tracert ws2_32 iphlpapi msvcrt kernel32 ntdll)
add_cd_file(TARGET tracert DESTINATION reactos/system32 FOR all)
diff --git a/base/applications/network/tracert/lang/de-DE.rc
b/base/applications/network/tracert/lang/de-DE.rc
index dae8fce082..220d3a01d4 100644
--- a/base/applications/network/tracert/lang/de-DE.rc
+++ b/base/applications/network/tracert/lang/de-DE.rc
@@ -1,26 +1,31 @@
+/*
+ * FILE: base/applications/network/tracert/de-DE.rc
+ * PURPOSE: German translations for ReactOS Tracert Command
+ * TRANSLATORS: reactosfanboy <Joachim.Henze(a)reactos.org>
+ */
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
STRINGTABLE
BEGIN
IDS_USAGE "\r\n\
-Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name \r\n\r\n\
-Options:\r\n\
- -d Do not resolve addresses to hostnames.\r\n\
- -h maximum_hops Maximum number of hops to search for target.\r\n\
- -j host-list Loose source route along host-list.\r\n\
- -w timeout Wait timeout milliseconds for each reply.\r\n\
- -4 Force using IPv4.\r\n\
- -6 Force using IPv6.\r\n\
+Syntax: tracert [-d] [-h maximum_hops] [-j Hostliste] [-w Zeitlimit] Zielname \r\n\r\n\
+Optionen:\r\n\
+ -d Adressen nicht in Hostnamen auflösen.\r\n\
+ -h maximum_hops Maximale Sprunganzahl bei Zielsuche.\r\n\
+ -j Hostliste 'Loose Source Route' gemäß Hostliste.\r\n\
+ -w Zeitlimit Zeitlimit in Millisekunden für eine Antwort.\r\n\
+ -4 erzwingt IPv4.\r\n\
+ -6 erzwingt IPv6.\r\n\
\r\n"
- IDS_INVALID_OPTION "%1 is not a valid command option.\r\n"
- IDS_TRACE_INFO "\r\nTracing route to %1 [%2]\r\nover a maximum of %3!u!
hops:\r\n\r\n"
- IDS_TRACE_COMPLETE "\r\nTrace complete.\r\n"
- IDS_UNABLE_RESOLVE "Unable to resolve target system name %1.\r\n"
+ IDS_INVALID_OPTION "%1 ist keine gültige Befehlsoption.\r\n"
+ IDS_TRACE_INFO "\r\nRoutenverfolgung zu %1 [%2]\r\nüber maximal %3!u!
Hops:\r\n\r\n"
+ IDS_TRACE_COMPLETE "\r\nRoutenverfolgung beendet.\r\n"
+ IDS_UNABLE_RESOLVE "Der Zielname %1 konnte nicht aufgelöst werden.\r\n"
- IDS_GEN_FAILURE "General failure.\r\n"
- IDS_TRANSMIT_FAILED "Transmit failed. (Error %1!u!)\r\n"
+ IDS_GEN_FAILURE "Allgemeiner Fehler.\r\n"
+ IDS_TRANSMIT_FAILED "Übertragungsfehler. (Fehler %1!u!)\r\n"
IDS_HOP_COUNT "%1!3lu! %0\r\n"
IDS_HOP_TIME "%1!4lu! ms %0\r\n"
@@ -29,9 +34,9 @@ Options:\r\n\
IDS_HOP_RES_INFO "%1 [%2]"
IDS_HOP_IP_INFO "%1"
IDS_LINEBREAK "\r\n"
- IDS_REQ_TIMED_OUT "Request timed out.\r\n"
- IDS_HOP_RESPONSE " reports: "
- IDS_DEST_HOST_UNREACHABLE "Destination host unreachable.\r\n"
- IDS_DEST_NET_UNREACHABLE "Destination network unreachable.\r\n"
+ IDS_REQ_TIMED_OUT "Zeitüberschreitung der Anforderung.\r\n"
+ IDS_HOP_RESPONSE " Antwort: "
+ IDS_DEST_HOST_UNREACHABLE "Zielhost nicht erreichbar.\r\n"
+ IDS_DEST_NET_UNREACHABLE "Zielnetz nicht erreichbar.\r\n"
END
diff --git a/base/applications/network/tracert/tracert.cpp
b/base/applications/network/tracert/tracert.cpp
index 1b52d56650..d90a78a52a 100644
--- a/base/applications/network/tracert/tracert.cpp
+++ b/base/applications/network/tracert/tracert.cpp
@@ -8,15 +8,16 @@
*/
#ifdef __REACTOS__
+#define USE_CONUTILS
#define WIN32_NO_STATUS
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#define _INC_WINDOWS
-#include <stdio.h>
#include <stdlib.h>
#include <winsock2.h>
+#include <conutils.h>
#else
#include <winsock2.h>
#include <Windows.h>
@@ -144,7 +145,7 @@ OutputText(
return Ret;
}
#else
-#define OutputText(Id, ...) ConResPrintf(StdOut, Id, __VA_ARGS__)
+#define OutputText(Id, ...) ConResMsgPrintfEx(StdOut, NULL, 0, Id,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), ##__VA_ARGS__)
#endif //USE_CONUTILS
static
@@ -554,6 +555,11 @@ ParseCmdline(int argc, wchar_t *argv[])
EXTERN_C
int wmain(int argc, wchar_t *argv[])
{
+#ifdef USE_CONUTILS
+ /* Initialize the Console Standard Streams */
+ ConInitStdStreams();
+#endif
+
Info.ResolveAddresses = true;
Info.MaxHops = 30;
Info.Timeout = 4000;