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.

159 lines
3.5 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. CFLBuilder.h
  5. Abstract: see CFLBuilder.cpp
  6. Revision History:
  7. Eugene Mesgar (eugenem) 6/16/99
  8. created
  9. ******************************************************************************/
  10. #ifndef __FLBUILDER__
  11. #define __FLBUILDER__
  12. #include "xmlparser.h"
  13. //
  14. // Local Data structres.
  15. //
  16. typedef struct flFileListTag FL_FILELIST, *LPFL_FILELIST;
  17. struct flFileListTag {
  18. LPTSTR szFileName;
  19. TCHAR chType;
  20. LPFL_FILELIST pNext;
  21. };
  22. typedef struct flTreeNodeTag FLTREE_NODE, *LPFLTREE_NODE;
  23. struct flTreeNodeTag
  24. {
  25. LPTSTR szPath;
  26. TCHAR chType;
  27. //
  28. // hashlist info
  29. //
  30. LPFL_FILELIST pFileList;
  31. LONG lNumFilesHashed;
  32. LONG lFileDataSize; // # of chars in data file
  33. LPFLTREE_NODE pParent;
  34. LPFLTREE_NODE pChild;
  35. LPFLTREE_NODE pSibling;
  36. //
  37. // long node number
  38. //
  39. LONG lNodeNumber;
  40. //
  41. // is this a protected directory
  42. //
  43. BOOL fDisableDirectory;
  44. };
  45. class CFLDatBuilder
  46. {
  47. LONG m_lNodeCount, m_lFileListCount;
  48. LONG m_lNumFiles, m_lNumChars;
  49. //
  50. // xml parser
  51. //
  52. CXMLFileListParser m_XMLParser;
  53. //
  54. // tree root node
  55. //
  56. LPFLTREE_NODE m_pRoot;
  57. //
  58. // default node type
  59. //
  60. TCHAR m_chDefaultType;
  61. HANDLE m_hHeapToUse;
  62. public:
  63. BOOL BuildTree(LPCTSTR pszFile, LPCTSTR pszOutFile);
  64. BOOL VerifyVxdDat(LPCTSTR pszFile);
  65. CFLDatBuilder();
  66. virtual ~CFLDatBuilder();
  67. private:
  68. LPFLTREE_NODE CreateNode(LPTSTR szPath, TCHAR chType, LPFLTREE_NODE pParent, BOOL fDisable);
  69. LPFL_FILELIST CreateList();
  70. void PrintTree(LPFLTREE_NODE pTree, LONG lLevel);
  71. void PrintList(LPFL_FILELIST pList, LONG lLevel);
  72. //
  73. // nulls list and recurses
  74. //
  75. BOOL DeleteTree(LPFLTREE_NODE pTree);
  76. BOOL DeleteList(LPFL_FILELIST pList);
  77. //
  78. // This is for files or directories like *:\Recycle Bin
  79. //
  80. BOOL AddMetaDriveFileDir( LPTSTR szInPath, TCHAR chType, BOOL fFile, BOOL fDisable );
  81. BOOL AddTreeNode(LPFLTREE_NODE *pParent, LPTSTR szFullPath, TCHAR chType, LONG lNumElements, LONG lLevel, BOOL fFile, BOOL fDisable);
  82. BOOL AddFileToList(LPFLTREE_NODE pNode, LPFL_FILELIST *pList, LPTSTR szFile, TCHAR chType);
  83. LONG CountTokens(LPTSTR szStr, TCHAR chDelim);
  84. LPTSTR _MyStrDup( LPTSTR szIn );
  85. LONG GetNextHighestPrime( LONG lNumber );
  86. BOOL IsPrime(LONG lNumber);
  87. LONG CalculateNumberOfHashBuckets( LPFLTREE_NODE pRoot );
  88. BOOL ConvertToInternalFormat ( LPTSTR szBuf, LPTSTR szBuf2 );
  89. //
  90. // Additional info merging routines
  91. //
  92. DWORD SetPrivilegeInAccessToken( LPCTSTR pszPrivilegeName );
  93. BOOL MergeUserRegistryInfo(
  94. LPCTSTR pszUserProfilePath,
  95. LPCTSTR pszUserProfileHive,
  96. LPCTSTR pszUserSid );
  97. BOOL AddUserProfileInfo(
  98. HKEY hKeyUser,
  99. LPCTSTR pszUserProfilePath );
  100. BOOL AddNodeForKeyValue(
  101. HKEY hKeyUser,
  102. LPCTSTR pszSubKey,
  103. LPCTSTR pszValue );
  104. BOOL AddRegistrySnapshotEntry(LPTSTR pszPath);
  105. BOOL MergeFilesNotToBackupInfo( );
  106. BOOL MergeDriveTableInfo( );
  107. BOOL MergeAllUserRegistryInfo( );
  108. BOOL MergeSfcDllCacheInfo( );
  109. };
  110. #endif