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.

248 lines
7.9 KiB

  1. /*******************************************************************************
  2. * Copyright (C) 1997 Gemplus International All Rights Reserved
  3. *
  4. * Name : GPKGUI.H
  5. *
  6. * Description : GUI used by Cryptographic Service Provider for GPK Card.
  7. *
  8. Author : Laurent CASSIER (1.0), Francois Jacques (2.0)
  9. Compiler : Microsoft Visual C 6.0
  10. Host : IBM PC and compatible machines under Windows 32 bit
  11. * Release : 2.00.000
  12. *
  13. * Last Modif. : 15/04/99: V2.00.000 - International support, merged PKCS11/CSP UI
  14. * 02/11/97: V1.00.002 - Separate code from GpkCsp Code.
  15. * 27/08/97: V1.00.001 - Begin implementation based on CSP kit.
  16. *
  17. ********************************************************************************
  18. *
  19. * Warning :
  20. *
  21. * Remark :
  22. *
  23. *******************************************************************************/
  24. /*------------------------------------------------------------------------------
  25. Name definition:
  26. _GPKGUI_H is used to avoid multiple inclusion.
  27. ------------------------------------------------------------------------------*/
  28. #ifndef _GPKGUI_H
  29. #define _GPKGUI_H
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /*-----------------------------------------------------------------------------
  34. Global Variable and Declaration for PIN an Progress DialogBox management
  35. ------------------------------------------------------------------------------*/
  36. #define PIN_MAX (8)
  37. #define PIN_MIN (4) // [JMR 02-04]
  38. #define MAX_STRING MAX_PATH
  39. #define MAX_REAL_KEY (16)
  40. #define ACCEPT_CONTAINER (1)
  41. #define ABORT_OPERATION (2)
  42. extern HINSTANCE g_hInstMod;
  43. extern HINSTANCE g_hInstRes;
  44. extern HWND g_hMainWnd;
  45. /* PIN DialogBox */
  46. extern char szGpkPin[PIN_MAX+2]; // [JMR 02-04]
  47. extern DWORD dwGpkPinLen;
  48. extern char szGpkNewPin[PIN_MAX+2]; // [JMR 02-04]
  49. extern WORD wGpkNewPinLen;
  50. extern BOOL bChangePin;
  51. //extern BOOL bAdmPin;
  52. extern BOOL NoDisplay;
  53. extern BOOL bNewPin;
  54. extern BOOL bHideChange;
  55. extern BOOL bUnblockPin;
  56. extern BOOL bUser;
  57. /* ProgressText DialogBox */
  58. /* FJ: changed char to TCHAR
  59. extern char szProgTitle[256];
  60. extern char szProgText[256];
  61. */
  62. extern TCHAR szProgTitle[MAX_STRING];
  63. extern TCHAR szProgText[MAX_STRING];
  64. extern BOOL IsProgButtonClick;
  65. extern HWND hProgressDlg;
  66. extern FARPROC lpProgressDlg;
  67. extern HCURSOR hCursor, hCursor2;
  68. void DisplayMessage( LPTSTR szMsg, LPTSTR szCaption, void* pValue);
  69. /*------------------------------------------------------------------------------
  70. Functions for PIN (User and SO) Dialog Box Management
  71. ------------------------------------------------------------------------------*/
  72. LRESULT WINAPI PinDlgProc(HWND hDlg,
  73. UINT message,
  74. WPARAM wParam,
  75. LPARAM lParam);
  76. //#ifdef _GPKCSP
  77. /*------------------------------------------------------------------------------
  78. Functions for Container Dialogue Management
  79. ------------------------------------------------------------------------------*/
  80. LRESULT WINAPI ContDlgProc(HWND hDlg,
  81. UINT message,
  82. WPARAM wParam,
  83. LPARAM lParam);
  84. //#endif /* _GPKCSP */
  85. /*------------------------------------------------------------------------------
  86. Functions for Key Dialog Box Management
  87. ------------------------------------------------------------------------------*/
  88. LRESULT WINAPI KeyDlgProc (HWND hDlg,
  89. UINT message,
  90. WPARAM wParam,
  91. LPARAM lParam);
  92. /*------------------------------------------------------------------------------
  93. Functions for Progress Dialog Box Management
  94. ------------------------------------------------------------------------------*/
  95. /*******************************************************************************
  96. * void Wait (DWORD ulStep,
  97. * DWORD ulMaxStep,
  98. * DWORD ulSecond)
  99. *
  100. * Description : Change Progress Box Text.
  101. *
  102. * Remarks : Nothing.
  103. *
  104. * In : ulStep = Current step number.
  105. * ulMaxStep = Maximum step number.
  106. * ulSecond =
  107. *
  108. * Out : Nothing.
  109. *
  110. * Response : Nothing.
  111. *
  112. *******************************************************************************/
  113. void Wait(DWORD ulStep,
  114. DWORD ulMaxStep,
  115. DWORD ulSecond
  116. );
  117. /*******************************************************************************/
  118. void ShowProgressWrapper(WORD wKeySize);
  119. /*******************************************************************************/
  120. void ChangeProgressWrapper(DWORD dwTime);
  121. /*******************************************************************************
  122. * void ShowProgress (HWND hWnd,
  123. * LPTSTR lpstrTitle,
  124. * LPTSTR lpstrText,
  125. * LPTSTR lpstrButton
  126. * )
  127. *
  128. * Description : Initialize Progress dialog box CALLBACK.
  129. *
  130. * Remarks : If lpstrButton is null, then don't display cancel button
  131. *
  132. * In : hWnd = Handle of parent window.
  133. * lpstrTitle = Pointer to Title of dialog box.
  134. * lpstrText = Pointer to Text of dialog box.
  135. * lpstrButton = Pointer to Text of button.
  136. *
  137. * Out : Nothing.
  138. *
  139. * Response : Nothing.
  140. *
  141. *******************************************************************************/
  142. void ShowProgress (HWND hWnd,
  143. LPTSTR lpstrTitle,
  144. LPTSTR lpstrText,
  145. LPTSTR lpstrButton
  146. );
  147. /*******************************************************************************
  148. * void ChangeProgressText (LPTSTR lpstrText)
  149. *
  150. * Description : Change Progress Box Text.
  151. *
  152. * Remarks : Nothing.
  153. *
  154. * In : lpstrText = Pointer to Text of dialog box.
  155. *
  156. * Out : Nothing.
  157. *
  158. * Response : Nothing.
  159. *
  160. *******************************************************************************/
  161. void ChangeProgressText (LPTSTR lpstrText);
  162. /*******************************************************************************
  163. * void DestroyProgress (void)
  164. *
  165. * Description : Destroy Progress dialog box CALLBACK.
  166. *
  167. * Remarks : Nothing.
  168. *
  169. * In : Nothing.
  170. *
  171. * Out : Nothing.
  172. *
  173. * Response : Nothing.
  174. *
  175. *******************************************************************************/
  176. void DestroyProgress (void);
  177. /*******************************************************************************
  178. * BOOL EXPORT CALLBACK ProgressDlgProc(HWND hDlg,
  179. * UINT message,
  180. * WPARAM wParam,
  181. * LPARAM lParam
  182. * )
  183. *
  184. * Description : CALLBACK for management of Progess Dialog Box.
  185. *
  186. * Remarks : Nothing.
  187. *
  188. * In : hDlg = Window handle.
  189. * message = Type of message.
  190. * wParam = Word message-specific information.
  191. * lParam = Long message-specific information.
  192. *
  193. * Out : Nothing.
  194. *
  195. * Responses : If everything is OK :
  196. * G_OK
  197. * If an condition error is raised:
  198. *
  199. *******************************************************************************/
  200. CALLBACK ProgressDlgProc(HWND hDlg,
  201. UINT message,
  202. WPARAM wParam,
  203. LPARAM lParam
  204. );
  205. /*******************************************************************************
  206. Functions for setting cursor in wait mode
  207. *******************************************************************************/
  208. void BeginWait(void);
  209. void EndWait(void);
  210. #ifdef __cplusplus
  211. }
  212. #endif
  213. #endif