diff --git a/dll/win32/ifmon/ip.c b/dll/win32/ifmon/ip.c index 8ed9c98554d..dd16c98a2d7 100644 --- a/dll/win32/ifmon/ip.c +++ b/dll/win32/ifmon/ip.c @@ -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)); diff --git a/dll/win32/ifmon/lang/en-US.rc b/dll/win32/ifmon/lang/en-US.rc index 0263a107bfa..d497d33baba 100644 --- a/dll/win32/ifmon/lang/en-US.rc +++ b/dll/win32/ifmon/lang/en-US.rc @@ -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 diff --git a/dll/win32/ifmon/resource.h b/dll/win32/ifmon/resource.h index 065110752e5..d4479b06960 100644 --- a/dll/win32/ifmon/resource.h +++ b/dll/win32/ifmon/resource.h @@ -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