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.

151 lines
6.0 KiB

  1. #ifndef __RSOP_SECURITY_H__
  2. #define __RSOP_SECURITY_H__
  3. #include "rsop.h"
  4. #include <tchar.h>
  5. class CRegTreeOptions;
  6. #define REGSTR_PATH_SECURITY_LOCKOUT TEXT("Software\\Policies\\Microsoft\\Windows\\CurrentVersion\\Internet Settings")
  7. #define REGSTR_VAL_HKLM_ONLY TEXT("Security_HKLM_only")
  8. typedef struct tagSECURITYZONESETTINGS
  9. {
  10. BOOL dwFlags; // from the ZONEATTRIBUTES struct
  11. DWORD dwZoneIndex; // as defined by ZoneManager
  12. DWORD dwSecLevel; // current level (High, Medium, Low, Custom)
  13. DWORD dwPrevSecLevel;
  14. DWORD dwMinSecLevel; // current min level (High, Medium, Low, Custom)
  15. DWORD dwRecSecLevel; // current recommended level (High, Medium, Low, Custom)
  16. TCHAR szDescription[MAX_ZONE_DESCRIPTION];
  17. TCHAR szDisplayName[MAX_ZONE_PATH];
  18. HICON hicon;
  19. WCHAR wszObjPath[MAX_PATH]; // added for RSoP functionality
  20. long nMappings; // added for RSoP functionality
  21. } SECURITYZONESETTINGS, *LPSECURITYZONESETTINGS;
  22. // structure for main security page
  23. typedef struct tagSECURITYPAGE
  24. {
  25. HWND hDlg; // handle to window
  26. LPURLZONEMANAGER pInternetZoneManager; // pointer to InternetZoneManager
  27. IInternetSecurityManager *pInternetSecurityManager; // pointer to InternetSecurityManager
  28. HIMAGELIST himl; // imagelist for Zones combobox
  29. HWND hwndZones; // zones combo box hwnd
  30. LPSECURITYZONESETTINGS pszs; // current settings for displayed zone
  31. INT iZoneSel; // selected zone (as defined by ComboBox)
  32. DWORD dwZoneCount; // number of zones
  33. BOOL fChanged;
  34. BOOL fPendingChange; // to prevent the controls sending multiple sets (for cancel, mostly)
  35. HINSTANCE hinstUrlmon;
  36. BOOL fNoEdit; // hklm lockout of level edit
  37. BOOL fNoAddSites; // hklm lockout of addsites
  38. BOOL fNoZoneMapEdit; // hklm lockout of zone map edits
  39. HFONT hfontBolded; // special bolded font created for the zone title
  40. BOOL fForceUI; // Force every zone to show ui?
  41. BOOL fDisableAddSites; // Automatically disable add sites button?
  42. CDlgRSoPData *pDRD; // added for RSoP functionality
  43. } SECURITYPAGE, *LPSECURITYPAGE;
  44. // structure for Intranet Add Sites
  45. typedef struct tagADDSITESINTRANETINFO {
  46. HWND hDlg; // handle to window
  47. BOOL fUseIntranet; // Use local defined intranet addresses (in reg)
  48. BOOL fUseProxyExclusion; // Use proxy exclusion list
  49. BOOL fUseUNC; // Include UNC in intranet
  50. LPSECURITYPAGE pSec;
  51. } ADDSITESINTRANETINFO, *LPADDSITESINTRANETINFO;
  52. // structure for Add Sites
  53. typedef struct tagADDSITESINFO {
  54. HWND hDlg; // handle to window
  55. BOOL fRequireServerVerification; // Require Server Verification on sites in zone
  56. HWND hwndWebSites; // handle to list
  57. HWND hwndAdd; // handle to edit
  58. TCHAR szWebSite[MAX_ZONE_PATH]; // text in edit control
  59. BOOL fRSVOld;
  60. LPSECURITYPAGE pSec;
  61. } ADDSITESINFO, *LPADDSITESINFO;
  62. // structure for Custom Settings
  63. typedef struct tagCUSTOMSETTINGSINFO {
  64. HWND hDlg; // handle to window
  65. HWND hwndTree;
  66. LPSECURITYPAGE pSec;
  67. HWND hwndCombo;
  68. INT iLevelSel;
  69. CRegTreeOptions *pTO;
  70. BOOL fUseHKLM; // get/set settings from HKLM
  71. DWORD dwJavaPolicy; // Java policy selected
  72. BOOL fChanged;
  73. } CUSTOMSETTINGSINFO, *LPCUSTOMSETTINGSINFO;
  74. #define NUM_TEMPLATE_LEVELS 4
  75. extern TCHAR g_szLevel[3][64];
  76. extern TCHAR LEVEL_DESCRIPTION0[];
  77. extern TCHAR LEVEL_DESCRIPTION1[];
  78. extern TCHAR LEVEL_DESCRIPTION2[];
  79. extern TCHAR LEVEL_DESCRIPTION3[];
  80. extern LPTSTR LEVEL_DESCRIPTION[];
  81. extern TCHAR CUSTOM_DESCRIPTION[];
  82. extern TCHAR LEVEL_NAME0[];
  83. extern TCHAR LEVEL_NAME1[];
  84. extern TCHAR LEVEL_NAME2[];
  85. extern TCHAR LEVEL_NAME3[];
  86. extern LPTSTR LEVEL_NAME[];
  87. extern TCHAR CUSTOM_NAME[];
  88. typedef DWORD REG_CMD;
  89. typedef DWORD WALK_TREE_CMD;
  90. struct ACTION_SETTING
  91. {
  92. TCHAR szName[MAX_PATH];
  93. DWORD dwValue;
  94. };
  95. /////////////////////////////////////////////////////////////////////
  96. class CRegTreeOptions
  97. {
  98. public:
  99. CRegTreeOptions();
  100. ~CRegTreeOptions();
  101. STDMETHODIMP InitTree( HWND hwndTree, HKEY hkeyRoot, LPCSTR pszRegKey, LPSECURITYPAGE pSec);
  102. STDMETHODIMP WalkTree( WALK_TREE_CMD cmd );
  103. // STDMETHODIMP ToggleItem( HTREEITEM hti );
  104. protected:
  105. BOOL RegEnumTree(HKEY hkeyRoot, LPCSTR pszRoot, HTREEITEM htviparent, HTREEITEM htvins);
  106. int DefaultIconImage(HKEY hkey, int iImage);
  107. DWORD GetCheckStatus(HKEY hkey, BOOL *pbChecked, BOOL bUseDefault);
  108. DWORD RegGetSetSetting(HKEY hKey, DWORD *pType, LPBYTE pData, DWORD *pcbData, REG_CMD cmd);
  109. BOOL WalkTreeRecursive(HTREEITEM htvi,WALK_TREE_CMD cmd);
  110. // DWORD SaveCheckStatus(HKEY hkey, BOOL bChecked);
  111. BOOL RegIsRestricted(HKEY hsubkey);
  112. // UINT cRef;
  113. HWND m_hwndTree;
  114. // LPTSTR pszParam;
  115. HIMAGELIST m_hIml;
  116. ACTION_SETTING m_as[50]; // as of Oct.2000, only 25, but give it room to grow
  117. long m_nASCount;
  118. };
  119. /////////////////////////////////////////////////////////////////////
  120. // Pics Tree Dialog Stuff (content ratings) ------------------------------
  121. struct PRSD{
  122. HINSTANCE hInst;
  123. // PicsRatingSystemInfo *pPRSI;
  124. CDlgRSoPData *pDRD;
  125. HWND hwndBitmapCategory;
  126. HWND hwndBitmapLabel;
  127. BOOL fNewProviders;
  128. };
  129. #endif //__RSOP_SECURITY_H__