mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[IFMON] Test for DHCP configuration in the 'add address' and 'delete address' commands
This commit is contained in:
@@ -711,6 +711,14 @@ IpAddAddress(
|
||||
|
||||
if (pszAddress && pszMask)
|
||||
{
|
||||
if (pProperties->dwDhcp)
|
||||
{
|
||||
PrintMessageFromModule(hDllInstance,
|
||||
IDS_ERROR_ADD_DHCP_ADDRESS);
|
||||
dwError = ERROR_SUPPRESS_OUTPUT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
dwLength = wcslen(pProperties->pszIpAddress) + wcslen(pszAddress) + 2;
|
||||
pszNewIpAddress = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwLength * sizeof(WCHAR));
|
||||
if (pszNewIpAddress == NULL)
|
||||
@@ -1113,6 +1121,12 @@ IpDeleteAddress(
|
||||
|
||||
if (bHaveAddress && pszAddress)
|
||||
{
|
||||
if (pProperties->dwDhcp)
|
||||
{
|
||||
PrintMessageFromModule(hDllInstance,
|
||||
IDS_ERROR_DELETE_DHCP_ADDRESS);
|
||||
return ERROR_SUPPRESS_OUTPUT;
|
||||
}
|
||||
#if 0
|
||||
dwLength = wcslen(pProperties->pszIpAddress) + 1;
|
||||
pszNewIpAddress = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwLength * sizeof(WCHAR));
|
||||
|
||||
@@ -218,4 +218,7 @@ Parameters:\n\n\
|
||||
IDS_ERROR_BAD_VALUE "\n%1!s! is not an acceptable value for %1!s!.\n"
|
||||
IDS_ERROR_ALREADY_DHCP "\nDhcp is already enabled on this interface.\n"
|
||||
IDS_ERROR_GET_PROPERTIES "\nError obtaining configuration for interface %1!s!.\n"
|
||||
|
||||
IDS_ERROR_ADD_DHCP_ADDRESS "\nCannot add a static IP address to an interface configured for DHCP.\n"
|
||||
IDS_ERROR_DELETE_DHCP_ADDRESS "\nCannot delete Dhcp configured IP Address.\n"
|
||||
END
|
||||
|
||||
@@ -67,3 +67,5 @@
|
||||
#define IDS_ERROR_BAD_VALUE 2001
|
||||
#define IDS_ERROR_ALREADY_DHCP 2002
|
||||
#define IDS_ERROR_GET_PROPERTIES 2003
|
||||
#define IDS_ERROR_ADD_DHCP_ADDRESS 2004
|
||||
#define IDS_ERROR_DELETE_DHCP_ADDRESS 2005
|
||||
|
||||
Reference in New Issue
Block a user