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.

373 lines
6.7 KiB

  1. #ifndef _KRDLG_H_
  2. #define _KRDLG_H_
  3. /*++
  4. Copyright (c) 2000 Microsoft Corporation
  5. Module Name:
  6. krdlg.h
  7. Abstract:
  8. keyring dialog class definitions
  9. Author:
  10. johnhaw 991118 created
  11. georgema 000310 modified
  12. Environment:
  13. Revision History:
  14. --*/
  15. #include "switches.h"
  16. #include "Dlg.h"
  17. #include <scuisupp.h>
  18. #include <wincred.h>
  19. #define MAX_STRING_SIZE 256
  20. void CheckForCredentialExpiry( HINSTANCE hInst, HWND hWnd );
  21. //////////////////////////////////////////////////////////////////////////////
  22. //
  23. // C_ChangePasswordDlg
  24. //
  25. class C_ChangePasswordDlg
  26. : public C_Dlg
  27. {
  28. public: // operations
  29. C_ChangePasswordDlg(
  30. HWND hwndParent,
  31. HINSTANCE hInstance,
  32. LONG lIDD,
  33. DLGPROC pfnDlgProc = NULL
  34. );
  35. ~C_ChangePasswordDlg( )
  36. {
  37. } // ~C_ChangePasswordDlg
  38. virtual BOOL
  39. OnInitDialog(
  40. HWND hwndDlg,
  41. HWND hwndFocus
  42. );
  43. virtual BOOL
  44. OnCommand(
  45. WORD wNotifyCode,
  46. WORD wSenderId,
  47. HWND hwndSender
  48. );
  49. virtual void
  50. AssertValid( ) const
  51. {
  52. C_Dlg::AssertValid( );
  53. } // AssertValid
  54. protected: // operations
  55. public: // data
  56. HINSTANCE m_hInst;
  57. HWND m_hDlg;
  58. TCHAR m_szFullUsername[MAX_STRING_SIZE];
  59. TCHAR m_szUsername[MAX_STRING_SIZE];
  60. TCHAR m_szDomain[MAX_STRING_SIZE];
  61. TCHAR m_szOldPassword[MAX_STRING_SIZE];
  62. TCHAR m_szNewPassword[MAX_STRING_SIZE];
  63. TCHAR m_szConfirmPassword[MAX_STRING_SIZE];
  64. BOOL m_bIsDefault;
  65. private: // operations
  66. virtual void
  67. OnOK( );
  68. // Explicitly disallow copy constructor and assignment operator.
  69. //
  70. C_ChangePasswordDlg(
  71. const C_ChangePasswordDlg& rhs
  72. );
  73. C_ChangePasswordDlg&
  74. operator=(
  75. const C_ChangePasswordDlg& rhs
  76. );
  77. private: // data
  78. }; // C_ChangePasswordDlg
  79. //////////////////////////////////////////////////////////////////////////////
  80. //
  81. // C_KeyringDlg
  82. //
  83. class C_KeyringDlg
  84. : public C_Dlg
  85. {
  86. public: // operations
  87. C_KeyringDlg(
  88. HWND hwndParent,
  89. HINSTANCE hInstance,
  90. LONG lIDD,
  91. DLGPROC pfnDlgProc = NULL
  92. );
  93. // Perform miscellaneous cleanups required as the dialog is
  94. // destroyed
  95. ~C_KeyringDlg( )
  96. {
  97. } // ~C_KeyringDlg
  98. virtual BOOL
  99. OnInitDialog(
  100. HWND hwndDlg,
  101. HWND hwndFocus
  102. );
  103. virtual BOOL
  104. OnDestroyDialog(void);
  105. virtual BOOL
  106. OnCommand(
  107. WORD wNotifyCode,
  108. WORD wSenderId,
  109. HWND hwndSender
  110. );
  111. // TOOL TIP functions
  112. virtual BOOL
  113. InitTooltips(void);
  114. // HELP functions
  115. virtual BOOL
  116. OnHelpInfo(
  117. LPARAM lp
  118. );
  119. virtual UINT
  120. MapID(UINT uid);
  121. virtual void
  122. AssertValid( ) const
  123. {
  124. C_Dlg::AssertValid( );
  125. } // AssertValid
  126. virtual BOOL
  127. OnAppMessage(
  128. UINT uMessage,
  129. WPARAM wparam,
  130. LPARAM lparam
  131. );
  132. // Register the windows messages expected from the smartcard
  133. // subsystem
  134. BOOL
  135. RegisterMessages(void);
  136. protected:
  137. HINSTANCE m_hInst;
  138. HWND m_hDlg;
  139. BOOL fInit;
  140. private: // operations
  141. virtual void
  142. OnOK( );
  143. BOOL DoEdit(void);
  144. void BuildList();
  145. void SetCurrentKey(LONG_PTR iKey);
  146. void DeleteKey();
  147. void OnChangePassword();
  148. LONG_PTR C_KeyringDlg::GetCredentialType();
  149. BOOL
  150. OnHelpButton(void);
  151. // Explicitly disallow copy constructor and assignment operator.
  152. //
  153. C_KeyringDlg(
  154. const C_KeyringDlg& rhs
  155. );
  156. C_KeyringDlg&
  157. operator=(
  158. const C_KeyringDlg& rhs
  159. );
  160. private: // data
  161. }; // C_KeyringDlg
  162. //////////////////////////////////////////////////////////////////////////////
  163. //
  164. // C_AddKeyDlg
  165. //
  166. class C_AddKeyDlg
  167. : public C_Dlg
  168. {
  169. public: // operations
  170. C_AddKeyDlg(
  171. HWND hwndParent,
  172. HINSTANCE hInstance,
  173. LONG lIDD,
  174. DLGPROC pfnDlgProc = NULL
  175. );
  176. ~C_AddKeyDlg( )
  177. {
  178. } // ~C_AddKeyDlg
  179. virtual BOOL
  180. OnInitDialog(
  181. HWND hwndDlg,
  182. HWND hwndFocus
  183. );
  184. virtual BOOL
  185. OnDestroyDialog(void);
  186. virtual BOOL
  187. OnCommand(
  188. WORD wNotifyCode,
  189. WORD wSenderId,
  190. HWND hwndSender
  191. );
  192. virtual BOOL
  193. OnHelpInfo(
  194. LPARAM lp
  195. );
  196. virtual UINT
  197. MapID(
  198. UINT uid
  199. );
  200. virtual void
  201. AssertValid( ) const
  202. {
  203. C_Dlg::AssertValid( );
  204. } // AssertValid
  205. virtual BOOL
  206. OnAppMessage(
  207. UINT uMessage,
  208. WPARAM wparam,
  209. LPARAM lparam
  210. );
  211. void
  212. AdviseUser(void);
  213. BOOL
  214. AddItem(TCHAR *psz,INT iImageIndex,INT *pIndexOut);
  215. BOOL
  216. SetItemData(INT_PTR iIndex,LPARAM dwData);
  217. BOOL
  218. GetItemData(INT_PTR iIndex,LPARAM *dwData);
  219. BOOL
  220. SetItemIcon(INT iIndex,INT iWhich);
  221. void
  222. UpdateSCard(INT,CERT_ENUM *pCE);
  223. void
  224. SaveName(void);
  225. void
  226. RestoreName(void);
  227. void
  228. ShowDescriptionText(DWORD,DWORD);
  229. public:
  230. // Public data members
  231. BOOL m_bEdit; // set outside the class
  232. HWND m_hDlg; // used by C_KeyringDlg for g_wmUpdate
  233. private:
  234. void
  235. EditFillDialog(void);
  236. HWND m_hwndTName;
  237. HWND m_hwndCred;
  238. HWND m_hwndDomain;
  239. HWND m_hwndChgPsw;
  240. HWND m_hwndPswLbl;
  241. HWND m_hwndDescription;
  242. INT m_iUNCount;
  243. TCHAR *pUNList;
  244. HINSTANCE m_hInst;
  245. DWORD m_dwOldType;
  246. TCHAR m_szUsername[CRED_MAX_USERNAME_LENGTH];
  247. TCHAR m_szPassword[MAX_STRING_SIZE];
  248. TCHAR m_szDomain[MAX_STRING_SIZE];
  249. private: // operations
  250. void OnChangePassword();
  251. DWORD
  252. SetPersistenceOptions(void);
  253. virtual void
  254. OnOK( );
  255. // Explicitly disallow copy constructor and assignment operator.
  256. //
  257. C_AddKeyDlg(
  258. const C_AddKeyDlg& rhs
  259. );
  260. C_AddKeyDlg&
  261. operator=(
  262. const C_AddKeyDlg& rhs
  263. );
  264. }; // C_AddKeyDlg
  265. #endif // _KRDLG_H_
  266. //
  267. ///// End of file: KrDlg.h ///////////////////////////////////////