Source code of Windows XP (NT5)
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.

64 lines
2.9 KiB

  1. /*****************************************************************************
  2. * account.h
  3. *****************************************************************************/
  4. #ifndef _ACCOUNT_H
  5. #define _ACCOUNT_H
  6. /*****************************************************************************\
  7. CLASS: CAccounts
  8. \*****************************************************************************/
  9. #define LOGINFLAGS_DEFAULT 0x00000000 // Default to Anonymous when dialog is displayed
  10. #define LOGINFLAGS_ANON_ISDEFAULT 0x00000001 // Default to Anonymous when dialog is displayed
  11. #define LOGINFLAGS_ANON_LOGINJUSTFAILED 0x00000002 // The attempt to login anonymously just failed
  12. #define LOGINFLAGS_USER_LOGINJUSTFAILED 0x00000004 // The attempt to login as a user just failed
  13. class CAccounts
  14. {
  15. public:
  16. CAccounts();
  17. ~CAccounts();
  18. // Public Member Functions
  19. HRESULT DisplayLoginDialog(HWND hwnd, DWORD dwLoginFlags, LPCTSTR pszServer, LPTSTR pszUserName, DWORD cchUserNameSize, LPTSTR pszPassword, DWORD cchPasswordSize);
  20. HRESULT GetUserName(LPCTSTR pszServer, LPTSTR pszUserName, DWORD cchUserName);
  21. HRESULT GetPassword(LPCTSTR pszServer, LPCTSTR pszUserName, LPTSTR pszPassword, DWORD cchPassword);
  22. protected:
  23. // Private Member Functions
  24. HRESULT _GetAccountKey(LPCTSTR pszServer, LPTSTR pszKey, DWORD cchKeySize);
  25. HRESULT _GetUserAccountKey(LPCTSTR pszServer, LPCTSTR pszUserName, LPTSTR pszKey, DWORD cchKeySize);
  26. HRESULT _LoadLoginAttributes(DWORD * pdwLoginAttribs);
  27. HRESULT _SaveLoginAttributes(LPCTSTR pszServer, DWORD dwLoginAttribs);
  28. HRESULT _SetLoginType(HWND hDlg, BOOL fLoginAnnonymously);
  29. HRESULT _LoadEMailName(HWND hDlg);
  30. HRESULT _SaveEMailName(HWND hDlg);
  31. BOOL _SaveDialogData(HWND hDlg);
  32. HRESULT _LoadMessage(HWND hDlg);
  33. HRESULT _PopulateUserNameDropDown(HWND hDlg, LPCTSTR pszServer);
  34. HRESULT _LoadDefaultPassword(BOOL fLoadPersisted);
  35. HRESULT _SaveUserName(HWND hDlg);
  36. HRESULT _UserChangeSelect(HWND hDlg, BOOL fSelectChange);
  37. HRESULT _SavePassword(HWND hDlg, LPCTSTR pszUser, BOOL fPersist);
  38. HRESULT _GetPassword(LPCTSTR pszServer, LPCTSTR pszUserName, LPTSTR pszPassword, DWORD cchPassword);
  39. BOOL _InitDialog(HWND hdlg);
  40. LRESULT _OnCommand(HWND hdlg, WPARAM wParam, LPARAM lParam);
  41. LRESULT _OnNotify(HWND hDlg, NMHDR * pNMHdr, int idControl);
  42. static INT_PTR CALLBACK _LoginDialogProc(HWND hdlg, UINT wm, WPARAM wParam, LPARAM lParam);
  43. // Private Variables Functions
  44. LPCTSTR m_pszServer; // What is the server name?
  45. LPCTSTR m_pszUser; // What is the user name?
  46. LPCTSTR m_pszPassword; // What is the password?
  47. UINT m_uiMessageID; // What is the String ID of the message for the dialog?
  48. BOOL m_dwLoginFlags; // How should we behave?
  49. HWND m_hDlg;
  50. };
  51. #endif // _ACCOUNT_H