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.

189 lines
5.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation
  4. Module Name:
  5. PolicyPage1.h
  6. Abstract:
  7. Header file for the CPolicyPage1 class.
  8. This is our handler class for the first CPolicyNode property page.
  9. See PolicyPage1.cpp for implementation.
  10. Revision History:
  11. mmaguire 12/15/97 - created
  12. --*/
  13. //////////////////////////////////////////////////////////////////////////////
  14. #if !defined(_NAP_POLICY_PAGE_1_H_)
  15. #define _NAP_POLICY_PAGE_1_H_
  16. //===============================================================
  17. // for local case, neet to set footprint after saving data
  18. #define RAS_REG_ROOT HKEY_LOCAL_MACHINE
  19. #define REGKEY_REMOTEACCESS_PARAMS L"SYSTEM\\CurrentControlSet\\Services\\RemoteAccess\\Parameters"
  20. #define REGVAL_NAME_USERSCONFIGUREDWITHMMC L"UsersConfiguredWithMMC"
  21. #define REGVAL_VAL_USERSCONFIGUREDWITHMMC 1
  22. //////////////////////////////////////////////////////////////////////////////
  23. // BEGIN INCLUDES
  24. //
  25. // where we can find what this class derives from:
  26. //
  27. #include "PropertyPage.h"
  28. //
  29. //
  30. // where we can find what this class has or uses:
  31. //
  32. class CPolicyNode;
  33. #include "Condition.h"
  34. #include "IASAttrList.h"
  35. #include "condlist.h"
  36. #include "atltmp.h"
  37. //
  38. // END INCLUDES
  39. //////////////////////////////////////////////////////////////////////////////
  40. class CPolicyPage1 : public CIASPropertyPage<CPolicyPage1>
  41. {
  42. public :
  43. // ISSUE: how is base class initialization going to work with subclassing???
  44. CPolicyPage1(
  45. LONG_PTR hNotificationHandle
  46. , CPolicyNode *pPolicyNode
  47. , CIASAttrList *pIASAttrList
  48. , TCHAR* pTitle = NULL
  49. , BOOL bOwnsNotificationHandle = FALSE
  50. , bool isWin2k = false
  51. );
  52. ~CPolicyPage1();
  53. // This is the ID of the dialog resource we want for this class.
  54. // An enum is used here because the correct value of
  55. // IDD must be initialized before the base class's constructor is called
  56. enum { IDD = IDD_PROPPAGE_POLICY1 };
  57. BEGIN_MSG_MAP(CPolicyPage1)
  58. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  59. COMMAND_ID_HANDLER(IDC_BUTTON_CONDITION_ADD, OnConditionAdd)
  60. COMMAND_ID_HANDLER(IDC_BUTTON_CONDITION_REMOVE, OnConditionRemove)
  61. COMMAND_ID_HANDLER(IDC_LIST_CONDITIONS, OnConditionList)
  62. COMMAND_ID_HANDLER(IDC_BUTTON_CONDITION_EDIT, OnConditionEdit)
  63. COMMAND_ID_HANDLER( IDC_BUTTON_EDITPROFILE, OnEditProfile )
  64. COMMAND_ID_HANDLER( IDC_RADIO_DENY_DIALIN, OnDialinCheck)
  65. COMMAND_ID_HANDLER( IDC_RADIO_GRANT_DIALIN, OnDialinCheck)
  66. CHAIN_MSG_MAP(CIASPropertyPage<CPolicyPage1>)
  67. END_MSG_MAP()
  68. LRESULT OnInitDialog(
  69. UINT uMsg
  70. , WPARAM wParam
  71. , LPARAM lParam
  72. , BOOL& bHandled
  73. );
  74. LRESULT OnConditionAdd(
  75. UINT uMsg
  76. , WPARAM wParam
  77. , HWND hWnd
  78. , BOOL& bHandled
  79. );
  80. LRESULT OnEditProfile(
  81. UINT uMsg
  82. , WPARAM wParam
  83. , HWND hWnd
  84. , BOOL& bHandled
  85. );
  86. LRESULT OnDialinCheck(
  87. UINT uMsg
  88. , WPARAM wParam
  89. , HWND hWnd
  90. , BOOL& bHandled
  91. );
  92. LRESULT OnConditionRemove(
  93. UINT uMsg
  94. , WPARAM wParam
  95. , HWND hWnd
  96. , BOOL& bHandled
  97. );
  98. LRESULT OnConditionList(
  99. UINT uNotifyCode,
  100. UINT uID,
  101. HWND hWnd,
  102. BOOL &bHandled
  103. );
  104. LRESULT OnConditionEdit(
  105. UINT uNotifyCode,
  106. UINT uID,
  107. HWND hWnd,
  108. BOOL &bHandled
  109. );
  110. BOOL OnApply();
  111. BOOL OnQueryCancel();
  112. BOOL OnCancel();
  113. public:
  114. BOOL ValidPolicyName(LPCTSTR pszName);
  115. BOOL m_fDialinAllowed;
  116. // Pointer to streams into which this page's Sdo interface
  117. // pointers will be marshalled.
  118. LPSTREAM m_pStreamPolicySdoMarshall; // marshalled policy sdo pointer
  119. LPSTREAM m_pStreamDictionarySdoMarshall; // marshalled dictionary sdo pointer
  120. LPSTREAM m_pStreamProfileSdoMarshall; // marshalled profile sdo
  121. LPSTREAM m_pStreamProfilesCollectionSdoMarshall; // marshalled profile collection sdo
  122. LPSTREAM m_pStreamPoliciesCollectionSdoMarshall; // marshalled policy collection sdo
  123. LPSTREAM m_pStreamSdoServiceControlMarshall; // marshalled policy collection sdo
  124. protected:
  125. BOOL GetSdoPointers();
  126. HRESULT GetDialinSetting(BOOL &fDialinAllowed);
  127. HRESULT SetDialinSetting(BOOL fDialinAllowed);
  128. CPolicyNode *m_pPolicyNode; // policy node pointer
  129. CIASAttrList *m_pIASAttrList; // condition attribute list
  130. bool m_isWin2k;
  131. // condition collection -- created in the page
  132. CComPtr<ISdoCollection> m_spConditionCollectionSdo; // condition collection
  133. // profile sdos
  134. CComPtr<ISdoDictionaryOld> m_spDictionarySdo; // dictionary sdo pointer
  135. CComPtr<ISdo> m_spProfileSdo; // profiles collection sdo pointer
  136. CComPtr<ISdo> m_spPolicySdo; // policy sdo pointer
  137. CComPtr<ISdoCollection> m_spProfilesCollectionSdo; // profile collection Sdo
  138. CComPtr<ISdoCollection> m_spPoliciesCollectionSdo; // policy collection Sdo
  139. // Smart pointer to interface for telling service to reload data.
  140. CComPtr<ISdoServiceControl> m_spSdoServiceControl;
  141. //
  142. // condition list
  143. //
  144. ConditionList condList;
  145. };
  146. #endif // _NAP_POLICY_PAGE_1_H_