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.

184 lines
5.1 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2001.
  5. //
  6. // File: sprpage.h
  7. //
  8. // Contents: WiF Policy Snapin
  9. //
  10. //
  11. // History: TaroonM
  12. // 10/30/01
  13. //
  14. //----------------------------------------------------------------------------
  15. #if !defined(AFX_SPAPAGE_H__6E562BE1_40D6_11D1_89DB_00A024CDD4DE__INCLUDED_)
  16. #define AFX_SPAPAGE_H__6E562BE1_40D6_11D1_89DB_00A024CDD4DE__INCLUDED_
  17. #if _MSC_VER >= 1000
  18. #pragma once
  19. #endif // _MSC_VER >= 1000
  20. // sprage.h : header file
  21. //
  22. class CWiz97Sheet;
  23. typedef enum
  24. {
  25. NOTMODIFIED,
  26. MODIFIED,
  27. NEW,
  28. BEREMOVED,
  29. REMOVED,
  30. NEWREMOVED
  31. } PS_STATUS;
  32. //structure which holds all the WIRELESS_SNP_PS_DATA
  33. typedef struct _SNP_PS_DATA
  34. {
  35. PWIRELESS_PS_DATA pWirelessPSData;
  36. PS_STATUS status;
  37. } SNP_PS_DATA, *PSNP_PS_DATA;
  38. typedef vector<PSNP_PS_DATA> SNP_PS_LIST;
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CSecPolRulesPage dialog
  41. class CSecPolRulesPage : public CSnapinPropPage
  42. {
  43. DECLARE_DYNCREATE(CSecPolRulesPage)
  44. // Construction
  45. public:
  46. CSecPolRulesPage();
  47. ~CSecPolRulesPage();
  48. // Dialog Data
  49. //{{AFX_DATA(CSecPolRulesPage)
  50. enum { IDD = IDD_PS_LIST };
  51. CListCtrl m_lstActions;
  52. PWIRELESS_PS_DATA * _ppWirelessPSData;
  53. DWORD _dwNumPSObjects;
  54. //}}AFX_DATA
  55. // Overrides
  56. // ClassWizard generate virtual function overrides
  57. //{{AFX_VIRTUAL(CSecPolRulesPage)
  58. public:
  59. virtual void OnCancel();
  60. virtual BOOL OnApply();
  61. protected:
  62. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  63. //}}AFX_VIRTUAL
  64. UINT static AFX_CDECL DoThreadActionAdd(LPVOID pParam);
  65. void OnThreadSafeActionAdd();
  66. UINT static AFX_CDECL DoThreadActionEdit(LPVOID pParam);
  67. void OnThreadSafeActionEdit();
  68. // Implementation
  69. protected:
  70. // Generated message map functions
  71. //{{AFX_MSG(CSecPolRulesPage)
  72. virtual BOOL OnInitDialog();
  73. afx_msg void OnActionAdd();
  74. afx_msg void OnActionEdit();
  75. afx_msg void OnActionRemove();
  76. afx_msg void OnDblclkActionslist(NMHDR* pNMHDR, LRESULT* pResult);
  77. afx_msg void OnColumnclickActionslist(NMHDR* pNMHDR, LRESULT* pResult);
  78. afx_msg void OnClickActionslist(NMHDR* pNMHDR, LRESULT* pResult);
  79. afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  80. afx_msg void OnItemchangedActionslist(NMHDR* pNMHDR, LRESULT* pResult);
  81. afx_msg void OnKeydownActionslist(NMHDR* pNMHDR, LRESULT* pResult);
  82. afx_msg void OnDestroy();
  83. afx_msg void OnClickUseWizard();
  84. afx_msg void OnActionUp();
  85. afx_msg void OnActionDown();
  86. //}}AFX_MSG
  87. DECLARE_MESSAGE_MAP()
  88. CString GetColumnStrBuffer (PWIRELESS_PS_DATA pWirelessPSData, int iColumn);
  89. int m_iSortSubItem;
  90. BOOL m_bSortOrder;
  91. WTL::CImageList m_imagelistChecks;
  92. void PopulateListControl ();
  93. void UnPopulateListControl ();
  94. int DisplayPSProperties (PSNP_PS_DATA pNfaData, CString strTitle, BOOL bDoingAdd, BOOL* pbAfterWizardHook);
  95. void EnableDisableButtons ();
  96. void DisableControls();
  97. HRESULT ToggleRuleActivation( int nItemIndex );
  98. void GenerateUniquePSName(UINT, CString &);
  99. BOOL PSsRemovable();
  100. private:
  101. // when polstore triggers a commit
  102. void HandleSideEffectApply();
  103. static const TCHAR STICKY_SETTING_USE_SEC_POLICY_WIZARD[];
  104. DWORD m_MMCthreadID;
  105. CPropertySheet* m_pPrpSh;
  106. CCriticalSection m_csDlg;
  107. BOOL m_bHasWarnedPSCorruption;
  108. BOOL m_bReadOnly;
  109. //for linked list which stores all the rules
  110. SNP_PS_LIST m_NfaList;
  111. PWIRELESS_POLICY_DATA m_currentWirelessPolicyData;
  112. void InitialzeNfaList();
  113. HRESULT UpdateWlstore();
  114. };
  115. class CSecPolPropSheetManager : public CMMCPropSheetManager
  116. {
  117. public:
  118. CSecPolPropSheetManager() :
  119. CMMCPropSheetManager(),
  120. m_pSecPolItem(NULL)
  121. {}
  122. virtual ~CSecPolPropSheetManager()
  123. {
  124. if (m_pSecPolItem)
  125. m_pSecPolItem->Release();
  126. }
  127. void Initialize(
  128. CComObject<CSecPolItem> * pSecPolItem
  129. )
  130. {
  131. CComObject<CSecPolItem> * pOldItem = m_pSecPolItem;
  132. m_pSecPolItem = pSecPolItem;
  133. if (m_pSecPolItem)
  134. {
  135. m_pSecPolItem->AddRef();
  136. EnableConsoleNotify(
  137. pSecPolItem->GetNotifyHandle(),
  138. (LPARAM)m_pSecPolItem
  139. );
  140. }
  141. if (pOldItem)
  142. pOldItem->Release();
  143. }
  144. virtual BOOL OnApply();
  145. protected:
  146. CComObject<CSecPolItem>* m_pSecPolItem;
  147. };
  148. //{{AFX_INSERT_LOCATION}}
  149. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  150. #endif // !defined(AFX_SPAPAGE_H__6E562BE1_40D6_11D1_89DB_00A024CDD4DE__INCLUDED_)