Skip to content

Commit 4b53972

Browse files
committed
[IPCONFIG] Print an error message on unrecognized or incomplete command line
1 parent 4e425b5 commit 4b53972

File tree

22 files changed

+30
-8
lines changed

22 files changed

+30
-8
lines changed

base/applications/network/ipconfig/ipconfig.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#include <stdio.h>
2323
#include <tchar.h>
2424
#include <time.h>
25-
//#include <winsock2.h>
26-
//#include <iptypes.h>
2725
#include <iphlpapi.h>
2826
#include <ndk/rtlfuncs.h>
2927
#include <inaddr.h>
@@ -1331,8 +1329,11 @@ SetClassId(
13311329
}
13321330

13331331
VOID
1334-
Usage(VOID)
1332+
Usage(
1333+
_In_ BOOL Error)
13351334
{
1335+
if (Error)
1336+
ConResPrintf(StdOut, IDS_CMDLINEERROR);
13361337
ConResPrintf(StdOut, IDS_USAGE);
13371338
}
13381339

@@ -1402,7 +1403,7 @@ int wmain(int argc, wchar_t *argv[])
14021403
break;
14031404
case 2: /* Process all the options that take no parameters */
14041405
if (DoUsage)
1405-
Usage();
1406+
Usage(FALSE);
14061407
else if (DoAll)
14071408
ShowInfo(TRUE, TRUE);
14081409
else if (DoRelease)
@@ -1416,7 +1417,7 @@ int wmain(int argc, wchar_t *argv[])
14161417
else if (DoDisplaydns)
14171418
DisplayDns();
14181419
else
1419-
Usage();
1420+
Usage(TRUE);
14201421
break;
14211422
case 3: /* Process all the options that can have 1 parameter */
14221423
if (DoRelease)
@@ -1428,16 +1429,16 @@ int wmain(int argc, wchar_t *argv[])
14281429
else if (DoSetclassid)
14291430
SetClassId(argv[2], NULL);
14301431
else
1431-
Usage();
1432+
Usage(TRUE);
14321433
break;
14331434
case 4: /* Process all the options that can have 2 parameters */
14341435
if (DoSetclassid)
14351436
SetClassId(argv[2], argv[3]);
14361437
else
1437-
Usage();
1438+
Usage(TRUE);
14381439
break;
14391440
default:
1440-
Usage();
1441+
Usage(TRUE);
14411442
}
14421443

14431444
return 0;

base/applications/network/ipconfig/lang/bg-BG.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,5 @@ BEGIN
139139
> ipconfig /release *Con* ... освобождава всички съвпадащи свързвания,\n\
140140
например „Local Area Connection 1“\n\
141141
или „Local Area Connection 2“\n"
142+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
142143
END

base/applications/network/ipconfig/lang/de-DE.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,5 @@ Beispiele:\n\
141141
> ipconfig /release *Ver* ... Gibt alle passenden Verbindungen frei,\n\
142142
z.B. ""Lokale Verbindung 1""\n\
143143
oder ""Lokale Verbindung 2""\n"
144+
IDS_CMDLINEERROR "\nFehler: Nicht erkannte oder unvollständige Befehlszeile.\n"
144145
END

base/applications/network/ipconfig/lang/el-GR.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,5 @@ Options:\n\
140140
> ipconfig /release *Con* ... αποδεσμεύει όλες τις συνδέσεις που ταιριάζουν,\n\
141141
eg. ""Local Area Connection 1""\n\
142142
or ""Local Area Connection 2""\n"
143+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
143144
END

base/applications/network/ipconfig/lang/en-US.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,5 @@ Examples:\n\
137137
> ipconfig /release *Con* ... release all matching connections,\n\
138138
eg. ""Local Area Connection 1""\n\
139139
or ""Local Area Connection 2""\n"
140+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
140141
END

base/applications/network/ipconfig/lang/es-ES.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,5 @@ Ejemplos:\n\
140140
> ipconfig /release *Con* ... Libera todas las conexiones coincidentes,\n\
141141
por ejemplo. ""Conexión de área local 1""\n\
142142
o ""Conexión de área local 2"".\n"
143+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
143144
END

base/applications/network/ipconfig/lang/fr-FR.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,5 @@ Exemples :\n\
144144
> ipconfig /release *Con* ... Libère toutes les connexions concernées,\n\
145145
par ex. ""Connexion au réseau local 1""\n\
146146
ou ""Connexion au réseau local 2""\n"
147+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
147148
END

base/applications/network/ipconfig/lang/id-ID.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,5 @@ Contoh:\n\
138138
> ipconfig /release *Con* ... melepaskan semua koneksi yang sama,\n\
139139
""Local Area Connection 1"" atau\n\
140140
""Local Area Connection 2""\n"
141+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
141142
END

base/applications/network/ipconfig/lang/it-IT.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,5 @@ Esempi:\n\
137137
> ipconfig /release *Con* ... libera tutte le connessioni corrispondenti,\n\
138138
es: ""Connessione area locale 1""\n\
139139
or ""Connessione area locale 2""\n"
140+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
140141
END

base/applications/network/ipconfig/lang/ja-JP.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,5 @@ setclassid の場合、classid が指定されていなければ、classid は
136136
> ipconfig /release *Con* ... すべてのマッチする接続を解放します。\n\
137137
例 ""Local Area Connection 1"" または\n\
138138
""Local Area Connection 2""\n"
139+
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
139140
END

0 commit comments

Comments
 (0)