Skip to content

Commit 55ccd6e

Browse files
Merge branch 'reactos:master' into AppleTV-Desktop
2 parents 2795360 + 24e88af commit 55ccd6e

File tree

24 files changed

+335
-181
lines changed

24 files changed

+335
-181
lines changed

base/applications/network/netsh/interpreter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ InterpretInteractive(VOID)
427427
if (dwError == ERROR_CMD_NOT_FOUND)
428428
{
429429
PWSTR pszCommandString = MergeStrings(args_vector, dwArgCount);
430-
ConResPrintf(StdErr, IDS_INVALID_COMMAND, pszCommandString);
430+
PrintError(NULL, dwError, pszCommandString);
431431
HeapFree(GetProcessHeap(), 0, pszCommandString);
432432
}
433433

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ STRINGTABLE
1212
BEGIN
1313
IDS_APP_USAGE "\nUsage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] \
1414
\n [Command | -f ScriptFile]\n"
15-
IDS_INVALID_COMMAND "The following command was not found: %ls.\n"
1615
IDS_OPEN_FAILED "The file %ls could not be openend.\n"
17-
IDS_INVALID_SYNTAX "The syntax supplied for this command is not valid. Check help for the correct syntax.\n\n"
1816
IDS_THIS_COMMANDS "\nCommands in this context:\n"
1917
IDS_CONTEXT_COMMANDS "\nCommands in the %s-context:\n"
2018
END
@@ -76,3 +74,9 @@ BEGIN
7674
IDS_HLP_GROUP_SET "Updates configuration settings.\n"
7775
IDS_HLP_GROUP_SHOW "Displays information.\n"
7876
END
77+
78+
STRINGTABLE
79+
BEGIN
80+
ERROR_INVALID_SYNTAX "The syntax supplied for this command is not valid. Check help for the correct syntax.\n"
81+
ERROR_CMD_NOT_FOUND "The following command was not found: %1!s!.\n"
82+
END

base/applications/network/netsh/netsh.c

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,81 @@ PrintError(
383383
_In_ DWORD dwErrId,
384384
...)
385385
{
386-
DPRINT1("PrintError()\n");
387-
return 1;
386+
PWSTR pszInBuffer = NULL, pszOutBuffer = NULL;
387+
DWORD dwLength = 0;
388+
va_list ap;
389+
390+
DPRINT("PrintError(%p %lu ...)\n", hModule, dwErrId);
391+
392+
va_start(ap, dwErrId);
393+
394+
pszOutBuffer = HeapAlloc(GetProcessHeap(), 0, HUGE_BUFFER_SIZE * sizeof(WCHAR));
395+
if (pszOutBuffer == NULL)
396+
goto done;
397+
398+
if (hModule)
399+
{
400+
pszInBuffer = HeapAlloc(GetProcessHeap(), 0, HUGE_BUFFER_SIZE * sizeof(WCHAR));
401+
if (pszInBuffer == NULL)
402+
goto done;
403+
404+
dwLength = LoadStringW(hModule, dwErrId, pszInBuffer, HUGE_BUFFER_SIZE);
405+
if (dwLength == 0)
406+
goto done;
407+
408+
dwLength = FormatMessageW(FORMAT_MESSAGE_FROM_STRING,
409+
pszInBuffer,
410+
0,
411+
0,
412+
pszOutBuffer,
413+
HUGE_BUFFER_SIZE,
414+
&ap);
415+
}
416+
else
417+
{
418+
if ((dwErrId > NETSH_ERROR_BASE) && (dwErrId < NETSH_ERROR_END))
419+
{
420+
pszInBuffer = HeapAlloc(GetProcessHeap(), 0, HUGE_BUFFER_SIZE * sizeof(WCHAR));
421+
if (pszInBuffer == NULL)
422+
goto done;
423+
424+
dwLength = LoadStringW(GetModuleHandle(NULL), dwErrId, pszInBuffer, HUGE_BUFFER_SIZE);
425+
if (dwLength == 0)
426+
goto done;
427+
428+
dwLength = FormatMessageW(FORMAT_MESSAGE_FROM_STRING,
429+
pszInBuffer,
430+
0,
431+
0L,
432+
pszOutBuffer,
433+
HUGE_BUFFER_SIZE,
434+
&ap);
435+
}
436+
else
437+
{
438+
dwLength = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM,
439+
NULL,
440+
dwErrId,
441+
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
442+
pszOutBuffer,
443+
HUGE_BUFFER_SIZE,
444+
&ap);
445+
}
446+
}
447+
448+
va_end(ap);
449+
450+
if (dwLength > 0)
451+
ConPuts(StdOut, pszOutBuffer);
452+
453+
done:
454+
if (pszOutBuffer)
455+
HeapFree(GetProcessHeap(), 0, pszOutBuffer);
456+
457+
if (pszInBuffer)
458+
HeapFree(GetProcessHeap(), 0, pszInBuffer);
459+
460+
return dwLength;
388461
}
389462

390463
DWORD

base/applications/network/netsh/netsh.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <windef.h>
2+
#include <netsh.h>
23

34
#include "resource.h"
45

base/applications/network/netsh/precomp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
/* DEFINES *******************************************************************/
3737

38+
#define HUGE_BUFFER_SIZE 2048
39+
3840
#define MAX_STRING_SIZE 1024
3941
#define MAX_ARGS_COUNT 256
4042

base/applications/network/netsh/resource.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111

1212
#define IDS_APP_USAGE 100
1313
#define IDS_APP_PROMPT 101
14-
#define IDS_INVALID_COMMAND 102
15-
#define IDS_OPEN_FAILED 103
16-
#define IDS_INVALID_SYNTAX 104
17-
#define IDS_THIS_COMMANDS 105
18-
#define IDS_CONTEXT_COMMANDS 106
14+
#define IDS_OPEN_FAILED 102
15+
#define IDS_THIS_COMMANDS 103
16+
#define IDS_CONTEXT_COMMANDS 104
1917

2018
#define IDS_HELP_HEADER 200
2119
#define IDS_HELP_FOOTER 201

boot/bootdata/hivesys.inf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#CC_0601","Clas
2626
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1033&DEV_0001","Service",0x00000000,"isapnp"
2727
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1033&DEV_0001","ClassGUID",0x00000000,"{4D36E97D-E325-11CE-BFC1-08002BE10318}"
2828

29+
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1033&DEV_002C","Service",0x00000000,"isapnp"
30+
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1033&DEV_002C","ClassGUID",0x00000000,"{4D36E97D-E325-11CE-BFC1-08002BE10318}"
31+
2932
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1033&DEV_002D","Service",0x00000000,"isapnp"
3033
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1033&DEV_002D","ClassGUID",0x00000000,"{4D36E97D-E325-11CE-BFC1-08002BE10318}"
3134

dll/win32/ifmon/lang/en-US.rc

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,30 @@ BEGIN
88

99
IDS_HLP_IP_SHOW "Displays IP information.\n"
1010
IDS_HLP_ADDRESSES "Displays IP address configuration.\n"
11-
IDS_HLP_ADDRESSES_EX "Usage: addresses [string]\n\n Display IP address configuration.\n"
11+
IDS_HLP_ADDRESSES_EX "\nUsage: %1!s! [[name=]string]\n\n\
12+
Parameters:\n\n\
13+
Tag Value\n\
14+
name The name of a specific interface.\n\n\
15+
Remarks: Displays the IP address configuration for a specific interface or interfaces.\n\n\
16+
Examples:\n\n\
17+
%1!s! ""Local Area network""\n"
1218
IDS_HLP_CONFIG "Displays IP address and additional information.\n"
13-
IDS_HLP_CONFIG_EX "Usage: config [string]\n\n Display IP address and additional information.\n"
19+
IDS_HLP_CONFIG_EX "\nUsage: %1!s! [[name=]string]\n\n\
20+
Parameters:\n\n\
21+
Tag Value\n\
22+
name The name of a specific interface.\n\n\
23+
Remarks: Displays the IP address and DNS server configuration for a specific interface\nor interfaces.\n\n\
24+
Examples:\n\n\
25+
%1!s! ""Local Area Network""\n"
1426
IDS_HLP_DNS "Displays the DNS server addresses.\n"
15-
IDS_HLP_DNS_EX "Usage: dns [string]\n\n Display DNS server adresses.\n"
27+
IDS_HLP_DNS_EX "\nUsage: %1!s! [[name=]string]\n\n\
28+
Parameters:\n\n\
29+
Tag Value\n\
30+
name The name of a specific interface.\n\n\
31+
Remarks:\n\n\
32+
Displays the DNS server configuration for a specific interface\nor interfaces.\n\n\
33+
Examples:\n\n\
34+
%1!s! ""Local Area Network""\n"
1635

1736
IDS_IP_HEADER "\nConfiguration for interface ""%s""\n"
1837
IDS_DHCP_ON " DHCP enabled: Yes\n"

drivers/network/dd/netkvm/Common/ParaNdis-Common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static const tConfigurationEntries defaultConfiguration =
134134
{
135135
{ "Promiscuous", 0, 0, 1 },
136136
{ "Priority", 0, 0, 1 },
137-
{ "ConnectRate", 100,10,10000 },
137+
{ "ConnectRate", 10000,100,10 },
138138
{ "DoLog", 1, 0, 1 },
139139
{ "DebugLevel", 2, 0, 8 },
140140
{ "ConnectTimer", 0, 0, 300000 },

drivers/network/dd/netkvm/Common/kdebugprint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void _LogOutString(int level, const char *s);
5656
#define WPP_INIT_TRACING(a,b)
5757
#define WPP_CLEANUP(a)
5858

59-
#define MAX_DEBUG_LEVEL 1
59+
#define MAX_DEBUG_LEVEL 0
6060

6161
#define DPrintf(Level, Fmt) { if ( (Level) > MAX_DEBUG_LEVEL || (Level) > nDebugLevel || !bDebugPrint ) {} else { pDebugPrint Fmt; } }
6262

0 commit comments

Comments
 (0)