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.

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