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.

141 lines
3.5 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1996 - 1999
  3. Module Name:
  4. NotfyWin
  5. Abstract:
  6. This file contains the definition of the CNotifyWind class.
  7. Author:
  8. Chris Dudley 7/28/1997
  9. Environment:
  10. Win32, C++ w/Exceptions, MFC
  11. Revision History:
  12. Amanda Matlosz 4/30/1998 -- threading redone, PnP awareness added,
  13. replaced CSCardEnv, et. al with CScStatusMonitor
  14. Amanda Matlosz 12/21/1998 -- removed certificate propagation code
  15. Notes:
  16. --*/
  17. #ifndef __NOTFYWIN_H__
  18. #define __NOTFYWIN_H__
  19. /////////////////////////////////////////////////////////////////////////////
  20. //
  21. // Includes
  22. //
  23. #include "ScAlert.h"
  24. #include "statdlg.h"
  25. #include "ResMgrSt.h"
  26. // forward decl
  27. class CSCStatusApp;
  28. /////////////////////////////////////////////////////////////////////////////
  29. //
  30. // CNotifyWin dialog
  31. //
  32. class CNotifyWin : public CWnd
  33. {
  34. // Construction
  35. public:
  36. CNotifyWin()
  37. {
  38. m_pApp = NULL;
  39. // state management
  40. m_fShutDown = FALSE;
  41. m_lpStatusDlgThrd = NULL;
  42. m_lpResMgrStsThrd = NULL;
  43. m_lpNewReaderThrd = NULL;
  44. m_lpCardStatusThrd = NULL;
  45. m_lpRemOptThrd = NULL;
  46. m_hKillNewReaderThrd = NULL;
  47. m_hKillResMgrStatusThrd = NULL;
  48. m_hKillRemOptThrd= NULL;
  49. // other mem.vars
  50. m_aIdleList.RemoveAll();
  51. }
  52. ~CNotifyWin() { FinalRelease(); }
  53. BOOL FinalConstruct(void); // Implements two phase construction
  54. void FinalRelease(void);
  55. // Implementation
  56. protected:
  57. HICON m_hIcon;
  58. NOTIFYICONDATA m_nidIconData;
  59. CSCStatusApp* m_pApp;
  60. // Generated message map functions
  61. //{{AFX_MSG(CSCStatusDlg)
  62. afx_msg LONG OnSCardStatusDlgExit( UINT , LONG );
  63. afx_msg LONG OnCertPropThrdExit( UINT , LONG );
  64. afx_msg LONG OnSCardNotify( UINT , LONG ); // task bar notification
  65. afx_msg LONG OnResMgrExit( UINT , LONG );
  66. afx_msg LONG OnResMgrStatus( UINT ui, LONG l); // ui is the WPARAM
  67. afx_msg LONG OnNewReader( UINT , LONG );
  68. afx_msg LONG OnNewReaderExit( UINT , LONG );
  69. afx_msg LONG OnCardStatus( UINT uStatus, LONG );
  70. afx_msg LONG OnCardStatusExit( UINT , LONG );
  71. afx_msg LONG OnRemovalOptionsChange ( UINT, LONG );
  72. afx_msg LONG OnRemovalOptionsExit ( UINT, LONG );
  73. afx_msg void OnContextClose();
  74. afx_msg void OnContextStatus();
  75. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  76. //}}AFX_MSG
  77. DECLARE_MESSAGE_MAP()
  78. void CheckSystemStatus(BOOL fForceUpdate=FALSE);
  79. void SetSystemStatus(BOOL fCalaisUp, BOOL fForceUpdate=FALSE, DWORD dwState=k_State_Unknown);
  80. // members
  81. protected:
  82. CMenu m_ContextMenu; // Context/pop-up menu pointer
  83. // state management
  84. BOOL m_fCalaisUp; // TRUE if Smart card stack is running
  85. DWORD m_dwCardState; // one of four: see cmnstat.h
  86. BOOL m_fShutDown; // for state checkin
  87. CStringArray m_aIdleList;
  88. CCriticalSection m_ThreadLock;
  89. // child threads to do the dirty work
  90. CSCStatusDlgThrd* m_lpStatusDlgThrd; // Pointer to the status dlg thread
  91. CResMgrStatusThrd* m_lpResMgrStsThrd; // Pointer to IsResMgrBackUpYet? thread
  92. CNewReaderThrd* m_lpNewReaderThrd; // Pointer to AreThereNewReaders? thread
  93. CCardStatusThrd* m_lpCardStatusThrd; // Pointer to the status dlg thread
  94. CRemovalOptionsThrd* m_lpRemOptThrd; // Pointer to the RemovalOptions change thread
  95. // kill-thread events
  96. HANDLE m_hKillNewReaderThrd;
  97. HANDLE m_hKillResMgrStatusThrd;
  98. HANDLE m_hKillRemOptThrd;
  99. public:
  100. CString m_sClassName; // The Window class name for this window
  101. };
  102. /////////////////////////////////////////////////////////////////////////////////////////
  103. #endif // __NOTFYWIN_H__