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.

93 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1994-2002 Microsoft Corporation
  3. Module Name :
  4. strpass.h
  5. Abstract:
  6. Message Functions Definitions
  7. Author:
  8. Aaron Lee (aaronl)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef _STRPASS_H_
  14. #define _STRPASS_H_
  15. #ifdef _COMEXPORT
  16. class COMDLL CStrPassword
  17. #elif defined(_DLLEXP)
  18. class _EXPORT CStrPassword
  19. #else
  20. class CStrPassword
  21. #endif
  22. {
  23. public:
  24. // constructor/destructor
  25. CStrPassword();
  26. ~CStrPassword();
  27. // copy constructors
  28. CStrPassword(LPTSTR lpsz);
  29. CStrPassword(LPCTSTR lpsz);
  30. CStrPassword(CStrPassword& csPassword);
  31. // get character count
  32. int GetLength() const;
  33. // get byte count
  34. int GetByteLength() const;
  35. // TRUE if zero length
  36. BOOL IsEmpty() const;
  37. // clear contents to empty
  38. void Empty();
  39. // straight character comparison
  40. int Compare(LPCTSTR lpsz) const;
  41. int Compare(CString& lpsz) const;
  42. int Compare(CStrPassword& lpsz) const;
  43. // copy string content from UNICODE string (converts to TCHAR)
  44. const CStrPassword& operator=(LPCTSTR lpsz);
  45. const CStrPassword& operator=(CStrPassword& lpStrPass);
  46. // copy to...
  47. void CopyTo(CString& stringSrc);
  48. void CopyTo(CStrPassword& stringSrc);
  49. // Get Data out from it (unencrypted)
  50. // Each call to GetClearTextPassword() should have an equal
  51. // DestroyClearTextPassword() call to it.
  52. LPTSTR GetClearTextPassword();
  53. void DestroyClearTextPassword(LPTSTR lpClearTextPassword) const;
  54. // not implemented
  55. operator TCHAR*();
  56. // returns CString
  57. operator CString();
  58. bool operator== (CStrPassword& csCompareToMe);
  59. bool operator!= (CStrPassword& csCompareToMe)
  60. {
  61. return !(operator==(csCompareToMe));
  62. }
  63. private:
  64. void ClearPasswordBuffers(void);
  65. protected:
  66. LPTSTR m_pszDataEncrypted;
  67. DWORD m_cbDataEncrypted;
  68. };
  69. #endif