[IPCONFIG] Print an error message on unrecognized or incomplete command line

This commit is contained in:
Eric Kohl
2025-07-26 12:35:40 +02:00
parent 4e425b54b6
commit 4b53972724
22 changed files with 30 additions and 8 deletions

View File

@@ -22,8 +22,6 @@
#include <stdio.h>
#include <tchar.h>
#include <time.h>
//#include <winsock2.h>
//#include <iptypes.h>
#include <iphlpapi.h>
#include <ndk/rtlfuncs.h>
#include <inaddr.h>
@@ -1331,8 +1329,11 @@ done:
}
VOID
Usage(VOID)
Usage(
_In_ BOOL Error)
{
if (Error)
ConResPrintf(StdOut, IDS_CMDLINEERROR);
ConResPrintf(StdOut, IDS_USAGE);
}
@@ -1402,7 +1403,7 @@ int wmain(int argc, wchar_t *argv[])
break;
case 2: /* Process all the options that take no parameters */
if (DoUsage)
Usage();
Usage(FALSE);
else if (DoAll)
ShowInfo(TRUE, TRUE);
else if (DoRelease)
@@ -1416,7 +1417,7 @@ int wmain(int argc, wchar_t *argv[])
else if (DoDisplaydns)
DisplayDns();
else
Usage();
Usage(TRUE);
break;
case 3: /* Process all the options that can have 1 parameter */
if (DoRelease)
@@ -1428,16 +1429,16 @@ int wmain(int argc, wchar_t *argv[])
else if (DoSetclassid)
SetClassId(argv[2], NULL);
else
Usage();
Usage(TRUE);
break;
case 4: /* Process all the options that can have 2 parameters */
if (DoSetclassid)
SetClassId(argv[2], argv[3]);
else
Usage();
Usage(TRUE);
break;
default:
Usage();
Usage(TRUE);
}
return 0;

View File

@@ -139,4 +139,5 @@ BEGIN
> ipconfig /release *Con* ... освобождава всички съвпадащи свързвания,\n\
например „Local Area Connection 1“\n\
или „Local Area Connection 2“\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -141,4 +141,5 @@ Beispiele:\n\
> ipconfig /release *Ver* ... Gibt alle passenden Verbindungen frei,\n\
z.B. ""Lokale Verbindung 1""\n\
oder ""Lokale Verbindung 2""\n"
IDS_CMDLINEERROR "\nFehler: Nicht erkannte oder unvollständige Befehlszeile.\n"
END

View File

@@ -140,4 +140,5 @@ Options:\n\
> ipconfig /release *Con* ... αποδεσμεύει όλες τις συνδέσεις που ταιριάζουν,\n\
eg. ""Local Area Connection 1""\n\
or ""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -137,4 +137,5 @@ Examples:\n\
> ipconfig /release *Con* ... release all matching connections,\n\
eg. ""Local Area Connection 1""\n\
or ""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -140,4 +140,5 @@ Ejemplos:\n\
> ipconfig /release *Con* ... Libera todas las conexiones coincidentes,\n\
por ejemplo. ""Conexión de área local 1""\n\
o ""Conexión de área local 2"".\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -144,4 +144,5 @@ Exemples :\n\
> ipconfig /release *Con* ... Libère toutes les connexions concernées,\n\
par ex. ""Connexion au réseau local 1""\n\
ou ""Connexion au réseau local 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -138,4 +138,5 @@ Contoh:\n\
> ipconfig /release *Con* ... melepaskan semua koneksi yang sama,\n\
""Local Area Connection 1"" atau\n\
""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -137,4 +137,5 @@ Esempi:\n\
> ipconfig /release *Con* ... libera tutte le connessioni corrispondenti,\n\
es: ""Connessione area locale 1""\n\
or ""Connessione area locale 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

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

View File

@@ -137,4 +137,5 @@ Eksempler:\n\
> ipconfig /release *Til* ... Frigi alle samsvarende tilkoblinger,\n\
for eksempel ""Lokal tilkobling 1""\n\
eller ""Lokaltilkobling 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -144,4 +144,5 @@ Przykłady:\n\
> ipconfig /release *Poł* ... Zwalnia wszystkie pasujące połączenia,\n\
np. ""Połączenie lokalne 1""\n\
lub ""Połączenie lokalne 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -143,4 +143,5 @@ Exemple:\n\
numele lor secvența ""Con"".\n\
ex. ""Conexiune locală 1""\n\
sau ""Conexiune locală 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -142,4 +142,5 @@ IP-адреса для всех адаптеров, для которых сущ
с соответствующим именем, например:\n\
""Local Area Connection 1"" или\n\
""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -137,4 +137,5 @@ Príklady:\n\
> ipconfig /release *Con* ... release all matching connections,\n\
napr. ""Lokálne pripojenie 1""\n\
alebo ""Lokálne pripojenie 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -139,4 +139,5 @@ Examples:\n\
> ipconfig /release *Con* ... renovo te gjithe lidhjet përputhese,\n\
eg. ""Local Area Connection 1""\n\
or ""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -138,4 +138,5 @@ Exempel:\n\
> ipconfig /release *Ans* ... frigör alla matchande anslutningar,\n\
t.ex. ""Anslutning till lokalt nätverk 1""\n\
eller ""Anslutning till lokalt nätverk 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -138,4 +138,5 @@ setclassid için, bir sınıf kimliği belirtilmemişse sınıf kimliği silinmi
> ipconfig /release *Bağ* ... Eşleşen tüm bağlantıları bırakır.\n\
Ör: ""Yerel Ağ Bağlantısı 1"" veya\n\
""Yerel Ağ Bağlantısı 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -140,4 +140,5 @@ IP-адреса звільняється чи оновлюється для вс
всі з'єднання, які містять у назві ""Сon""\n\
напр. ""Local Area Connection 1""\n\
чи ""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -138,4 +138,5 @@ BEGIN
> ipconfig /release *Con* ... 释放所有匹配的连接,\n\
如 ""Local Area Connection 1""\n\
或 ""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -138,4 +138,5 @@ BEGIN
> ipconfig /release *Con* ... 釋放所有相符的連接,\n\
如 ""Local Area Connection 1""\n\
或 ""Local Area Connection 2""\n"
IDS_CMDLINEERROR "\nError: unrecongnized or incomplete command line.\n"
END

View File

@@ -66,6 +66,7 @@
#define IDS_DNSTYPESRV 179
#define IDS_USAGE 180
#define IDS_CMDLINEERROR 181
#define IDS_DNSNORECORD 200
#define IDS_DNSNONAME 201