Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.0 KiB

  1. #pragma once
  2. #include "resource.h"
  3. #include "wlbsparm.h"
  4. #define WLBS_IP_FIELD_ZERO_LOW 1
  5. #define WLBS_IP_FIELD_ZERO_HIGH 223
  6. //+----------------------------------------------------------------------------
  7. //
  8. // class CIpSubnetMaskControl
  9. //
  10. // Description: Add error checking for an IP address and subnet mask pair.
  11. // Generate default subnetmask based on ip
  12. //
  13. // History: shouse initial code
  14. // fengsun Created class 1/12/01
  15. //
  16. //+----------------------------------------------------------------------------
  17. class CIpSubnetMaskControl
  18. {
  19. public:
  20. CIpSubnetMaskControl(DWORD dwIpAddressResourceId, DWORD dwSubnetMaskResourceId);
  21. ~CIpSubnetMaskControl(){};
  22. void OnInitDialog(HWND hWnd, HINSTANCE hInstance);
  23. LRESULT OnSubnetMask(WORD wNotifyCode);
  24. LRESULT OnIpFieldChange(int idCtrl, LPNMHDR pnmh);
  25. void SetInfo(const WCHAR* pszIpAddress, const WCHAR* pszSubnetMask);
  26. void UpdateInfo(OUT WCHAR* pszIpAddress, OUT WCHAR* pszSubnetMask);
  27. /*
  28. We expect that above outparams are of
  29. (CVY_MAX_CL_IP_ADDR + 1) and (CVY_MAX_CL_NET_MASK + 1)
  30. characters each, respectively.
  31. */
  32. bool ValidateInfo();
  33. protected:
  34. DWORD m_dwIpAddressId;
  35. DWORD m_dwSubnetMaskId;
  36. HWND m_hWndDialog; // parent dialog window handle
  37. HINSTANCE m_hInstance; // instance handle for error string resource
  38. //
  39. // The PropertySheet may call us twice for the same change, so we have to do the bookkeeping to make
  40. // sure we only alert the user once. Use static variables to keep track of our state. This will
  41. // allow us to ignore duplicate alerts.
  42. //
  43. struct {
  44. UINT IpControl;
  45. int Field;
  46. int Value;
  47. UINT RejectTimes;
  48. } m_IPFieldChangeState;
  49. };
  50. INT
  51. WINAPIV
  52. NcMsgBox (
  53. IN HINSTANCE hinst,
  54. IN HWND hwnd,
  55. IN UINT unIdCaption,
  56. IN UINT unIdFormat,
  57. IN UINT unStyle,
  58. IN ...);