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.

43 lines
1.2 KiB

  1. /*****************************************************************************
  2. *
  3. * $Workfile: HostName.h $
  4. *
  5. * Copyright (C) 1997 Hewlett-Packard Company.
  6. * All rights reserved.
  7. *
  8. * 11311 Chinden Blvd.
  9. * Boise, Idaho 83714
  10. *
  11. *****************************************************************************/
  12. #ifndef INC_HOSTNAME_H
  13. #define INC_HOSTNAME_H
  14. #define MAX_FULLY_QUALIFIED_HOSTNAME_LENGTH 128
  15. #define MAX_HOSTNAME_LEN MAX_FULLY_QUALIFIED_HOSTNAME_LENGTH
  16. class CHostName
  17. {
  18. public:
  19. CHostName();
  20. CHostName(LPTSTR psztHostName);
  21. ~CHostName();
  22. // if the string passed in to IsValid in AddressString param is not a valid
  23. // host name then the returnVal is filled with the last valid HostName from
  24. // the previous time this method was called. This facilitates validation for
  25. // each keystroke the user makes.
  26. BOOL IsValid(TCHAR * psztAddressString, TCHAR * psztReturnVal = NULL, DWORD cRtnVal = 0);
  27. BOOL IsValid();
  28. void SetAddress(TCHAR *psztAddressString);
  29. void ToString(TCHAR *psztBuffer, int iSize);
  30. private:
  31. TCHAR m_psztAddress[MAX_FULLY_QUALIFIED_HOSTNAME_LENGTH];
  32. TCHAR m_psztStorageString[MAX_FULLY_QUALIFIED_HOSTNAME_LENGTH];
  33. };
  34. #endif // INC_HOSTNAME_H