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.

134 lines
3.5 KiB

  1. #ifndef _MASSUPDT_H_
  2. #define _MASSUPDT_H_
  3. //---------------------------------------------------------------
  4. // Abstract class for mass property updates
  5. class CMassPropertyUpdater : public CMDKey
  6. {
  7. public:
  8. CMassPropertyUpdater(DWORD dwMDIdentifier, DWORD dwMDDataType );
  9. ~CMassPropertyUpdater();
  10. // pass in the starting node
  11. virtual HRESULT Update( LPCTSTR strStartNode, BOOL fStopOnErrors = FALSE );
  12. protected:
  13. // update at a certain path
  14. virtual HRESULT UpdateOne( LPWSTR strPath ) = 0;
  15. DWORD m_dwMDIdentifier;
  16. DWORD m_dwMDDataType;
  17. CStringList m_pathList;
  18. };
  19. //---------------------------------------------------------------
  20. class CInvertScriptMaps : public CMassPropertyUpdater
  21. {
  22. public:
  23. CInvertScriptMaps():
  24. CMassPropertyUpdater(MD_SCRIPT_MAPS, MULTISZ_METADATA) {;}
  25. ~CInvertScriptMaps() {;}
  26. protected:
  27. #define SZ_INVERT_ALL_VERBS _T("OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE")
  28. // update at a certain path
  29. virtual HRESULT UpdateOne( LPWSTR strPath );
  30. HRESULT InvertOneScriptMap( CString& csMap );
  31. };
  32. //---------------------------------------------------------------
  33. class CIPSecRefBitAdder : public CMassPropertyUpdater
  34. {
  35. public:
  36. CIPSecRefBitAdder():
  37. CMassPropertyUpdater(MD_IP_SEC, BINARY_METADATA) {;}
  38. ~CIPSecRefBitAdder() {;}
  39. protected:
  40. // update at a certain path
  41. virtual HRESULT UpdateOne( LPWSTR strPath );
  42. };
  43. //---------------------------------------------------------------
  44. // use this one for c:\windows\system type paths
  45. class CPhysicalPathFixer : public CMassPropertyUpdater
  46. {
  47. public:
  48. CPhysicalPathFixer( CString& szOldSysPath, CString &szNewSysPath );
  49. ~CPhysicalPathFixer() {;}
  50. void SetPaths( CString& szOldSysPath, CString &szNewSysPath )
  51. { m_szOldSysPath = szOldSysPath; m_szNewSysPath = szNewSysPath; }
  52. // pass in the starting node
  53. virtual HRESULT Update( LPCTSTR strStartNode, BOOL fStopOnErrors = FALSE );
  54. protected:
  55. // update at a certain path
  56. virtual HRESULT UpdateOne( LPWSTR strPath );
  57. HRESULT UpdateOneMULTISZ_DATA( LPWSTR strPath );
  58. HRESULT UpdateOneSTRING_DATA( LPWSTR strPath );
  59. HRESULT UpdateOneSTRING_DATA_EXPAND( LPWSTR strPath );
  60. HRESULT UpdateOnePath( CString& csPath );
  61. // instance variables
  62. CString m_szOldSysPath;
  63. CString m_szNewSysPath;
  64. };
  65. //---------------------------------------------------------------
  66. // use this one for c:\windows type paths
  67. class CPhysicalPathFixer2 : public CPhysicalPathFixer
  68. {
  69. public:
  70. CPhysicalPathFixer2( CString& szOldSysPath, CString &szNewSysPath ):
  71. CPhysicalPathFixer( szOldSysPath , szNewSysPath )
  72. {;}
  73. ~CPhysicalPathFixer2() {;}
  74. // pass in the starting node
  75. virtual HRESULT Update( LPCTSTR strStartNode, BOOL fStopOnErrors = FALSE );
  76. };
  77. //---------------------------------------------------------------
  78. class CFixCustomErrors : public CMassPropertyUpdater
  79. {
  80. public:
  81. CFixCustomErrors():
  82. CMassPropertyUpdater(MD_CUSTOM_ERROR, MULTISZ_METADATA) {;}
  83. ~CFixCustomErrors() {;}
  84. protected:
  85. // update at a certain path
  86. virtual HRESULT UpdateOne( LPWSTR strPath );
  87. };
  88. //---------------------------------------------------------------
  89. class CEnforceMaxConnection : public CMassPropertyUpdater
  90. {
  91. public:
  92. CEnforceMaxConnection():
  93. CMassPropertyUpdater(MD_MAX_CONNECTIONS, DWORD_METADATA) {;}
  94. ~CEnforceMaxConnection() {;}
  95. protected:
  96. // update at a certain path
  97. virtual HRESULT UpdateOne( LPWSTR strPath );
  98. };
  99. #endif //_MASSUPDT_H_