Author: pschweitzer
Date: Sun Dec 11 10:23:02 2016
New Revision: 73449
URL:
http://svn.reactos.org/svn/reactos?rev=73449&view=rev
Log:
[NET/USE]
On enumeration, don't print raw status
Modified:
trunk/reactos/base/applications/network/net/cmdUse.c
trunk/reactos/base/applications/network/net/lang/en-US.rc
trunk/reactos/base/applications/network/net/lang/es-ES.rc
trunk/reactos/base/applications/network/net/lang/ro-RO.rc
trunk/reactos/base/applications/network/net/lang/ru-RU.rc
trunk/reactos/base/applications/network/net/lang/tr-TR.rc
trunk/reactos/base/applications/network/net/lang/zh-CN.rc
trunk/reactos/base/applications/network/net/lang/zh-TW.rc
trunk/reactos/base/applications/network/net/resource.h
Modified: trunk/reactos/base/applications/network/net/cmdUse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/cmdUse.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/cmdUse.c [iso-8859-1] Sun Dec 11 10:23:02
2016
@@ -63,6 +63,21 @@
return 0;
}
+static
+VOID
+PrintError(DWORD Status)
+{
+ LPWSTR Buffer;
+
+ ConResPrintf(StdErr, IDS_ERROR_SYSTEM_ERROR, Status);
+
+ if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, Status, 0, (LPWSTR)&Buffer, 0, NULL))
+ {
+ ConPrintf(StdErr, L"\n%s", Buffer);
+ LocalFree(Buffer);
+ }
+}
+
INT
cmdUse(
INT argc,
@@ -73,7 +88,11 @@
if (argc == 2)
{
Status = EnumerateConnections(NULL);
- ConPrintf(StdOut, L"Status: %lu\n", Status);
+ if (Status == NO_ERROR)
+ ConResPrintf(StdOut, IDS_ERROR_NO_ERROR);
+ else
+ PrintError(Status);
+
return 0;
}
else if (argc == 3)
@@ -92,7 +111,11 @@
}
Status = EnumerateConnections(argv[2]);
- ConPrintf(StdOut, L"Status: %lu\n", Status);
+ if (Status == NO_ERROR)
+ ConResPrintf(StdOut, IDS_ERROR_NO_ERROR);
+ else
+ PrintError(Status);
+
return 0;
}
@@ -100,7 +123,6 @@
if (Len != 1 && Len != 2)
{
ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, L"DeviceName");
- ConPrintf(StdOut, L"Len: %lu\n", Len);
return 1;
}
@@ -192,17 +214,7 @@
if (argv[2][0] == L'*' && Status == NO_ERROR && OutFlags
== CONNECT_LOCALDRIVE)
ConResPrintf(StdOut, IDS_USE_NOW_CONNECTED, argv[3], Access);
else if (Status != NO_ERROR)
- {
- LPWSTR Buffer;
-
- ConResPrintf(StdErr, IDS_ERROR_SYSTEM_ERROR, Status);
-
- if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS, NULL, Status, 0, (LPWSTR)&Buffer, 0, NULL))
- {
- ConPrintf(StdErr, L"\n%s\n", Buffer);
- LocalFree(Buffer);
- }
- }
+ PrintError(Status);
return Status;
}
Modified: trunk/reactos/base/applications/network/net/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/lang/en-US.rc [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -123,4 +123,5 @@
IDS_ERROR_OPTION_NOT_SUPPORTED "The %s option is not supported yet.\n"
IDS_ERROR_INVALID_OPTION_VALUE "You entered an invalid value for the %s
option.\n"
IDS_ERROR_SYSTEM_ERROR "The system error %d happened.\n"
+ IDS_ERROR_NO_ERROR "The command got executed successfully.\n"
END
Modified: trunk/reactos/base/applications/network/net/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/lang/es-ES.rc [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -126,4 +126,5 @@
IDS_ERROR_OPTION_NOT_SUPPORTED "La opción %s todavÃa no está
disponible.\n"
IDS_ERROR_INVALID_OPTION_VALUE "El valor para la opción %s no es
válido.\n"
IDS_ERROR_SYSTEM_ERROR "The system error %d happened.\n"
+ IDS_ERROR_NO_ERROR "The command got executed successfully.\n"
END
Modified: trunk/reactos/base/applications/network/net/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/lang/ro-RO.rc [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -129,4 +129,5 @@
IDS_ERROR_OPTION_NOT_SUPPORTED "OpÅ£iunea %s încÄ nu este admisÄ.\n"
IDS_ERROR_INVALID_OPTION_VALUE "AÅ£i introdus o valoare nevalidÄ pentru
opţiunea %s.\n"
IDS_ERROR_SYSTEM_ERROR "The system error %d happened.\n"
+ IDS_ERROR_NO_ERROR "The command got executed successfully.\n"
END
Modified: trunk/reactos/base/applications/network/net/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/lang/ru-RU.rc [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -125,4 +125,5 @@
IDS_ERROR_OPTION_NOT_SUPPORTED "ÐпÑÐ¸Ñ %s в даннÑй Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð½Ðµ
поддеÑживаеÑÑÑ.\n"
IDS_ERROR_INVALID_OPTION_VALUE "ÐÑ Ð²Ð²ÐµÐ»Ð¸ невеÑнÑй даннÑе
Ð´Ð»Ñ Ð´Ð°Ð½Ð½Ð¾Ð¹ опÑии %s.\n"
IDS_ERROR_SYSTEM_ERROR "The system error %d happened.\n"
+ IDS_ERROR_NO_ERROR "The command got executed successfully.\n"
END
Modified: trunk/reactos/base/applications/network/net/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/lang/tr-TR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/lang/tr-TR.rc [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -125,4 +125,5 @@
IDS_ERROR_OPTION_NOT_SUPPORTED "%s seçeneÄi daha desteklenmiyor.\n"
IDS_ERROR_INVALID_OPTION_VALUE "%s seçeneÄi için geçersiz bir deÄer
girdiniz.\n"
IDS_ERROR_SYSTEM_ERROR "The system error %d happened.\n"
+ IDS_ERROR_NO_ERROR "The command got executed successfully.\n"
END
Modified: trunk/reactos/base/applications/network/net/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/lang/zh-CN.rc [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -125,4 +125,5 @@
IDS_ERROR_OPTION_NOT_SUPPORTED "å°ä¸æ¯æ %s é项ã\n"
IDS_ERROR_INVALID_OPTION_VALUE "Yæ¨è¾å
¥äºæ æçå¼ä¸º %s é项ã\n"
IDS_ERROR_SYSTEM_ERROR "The system error %d happened.\n"
+ IDS_ERROR_NO_ERROR "The command got executed successfully.\n"
END
Modified: trunk/reactos/base/applications/network/net/lang/zh-TW.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/lang/zh-TW.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/lang/zh-TW.rc [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -125,4 +125,5 @@
IDS_ERROR_OPTION_NOT_SUPPORTED "å°ä¸æ¯æ´ %s é¸é
ã\n"
IDS_ERROR_INVALID_OPTION_VALUE "æ¨è¼¸å
¥äºç¡æçå¼çº %s é¸é
ã\n"
IDS_ERROR_SYSTEM_ERROR "The system error %d happened.\n"
+ IDS_ERROR_NO_ERROR "The command got executed successfully.\n"
END
Modified: trunk/reactos/base/applications/network/net/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/resource.h [iso-8859-1] Sun Dec 11
10:23:02 2016
@@ -103,3 +103,4 @@
#define IDS_ERROR_OPTION_NOT_SUPPORTED 700
#define IDS_ERROR_INVALID_OPTION_VALUE 701
#define IDS_ERROR_SYSTEM_ERROR 702
+#define IDS_ERROR_NO_ERROR 703