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.

133 lines
4.1 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. INFSCAN
  5. globalscan.h
  6. Abstract:
  7. Main class definitions
  8. History:
  9. Created July 2001 - JamieHun
  10. --*/
  11. #ifndef _INFSCAN_GLOBALSCAN_H_
  12. #define _INFSCAN_GLOBALSCAN_H_
  13. #define BUILD_CHANGED_DEVICES_DISABLED (0x00000000)
  14. #define BUILD_CHANGED_DEVICES_DEPCHANGED (0x00000001)
  15. #define BUILD_CHANGED_DEVICES_INFCHANGED (0x00000002)
  16. #define BUILD_CHANGED_DEVICES_ENABLED (0x80000000)
  17. #define BUILD_CHANGED_DEVICES_DEFAULT (0x00000003)
  18. class GlobalScan {
  19. private:
  20. //
  21. // data that's not thread-safe
  22. //
  23. int ThreadCount;
  24. StringSet GlobalFileSet;
  25. StringSet ExcludeInfs;
  26. JobThreadList JobThreads;
  27. JobList Jobs;
  28. JobList SerialJobs;
  29. JobList::iterator NextJob;
  30. protected:
  31. CriticalSection BottleNeck;
  32. public:
  33. //
  34. // once multi-threading starts, don't modify this stuff
  35. // but always ok to read
  36. //
  37. bool GeneratePnfs;
  38. bool GeneratePnfsOnly;
  39. bool Pedantic;
  40. bool Trace;
  41. bool IgnoreErrors;
  42. bool TargetsToo;
  43. bool DetermineCopySections;
  44. bool LimitedSourceDisksFiles;
  45. DWORD BuildChangedDevices;
  46. SafeString SourcePath;
  47. SafeString FilterPath;
  48. HINF InfFilter;
  49. HANDLE SourceFileList;
  50. HANDLE NewFilter;
  51. HANDLE DeviceFilterList;
  52. StringList Overrides;
  53. StringList NamedInfList;
  54. bool SpecifiedNames;
  55. StringToStringset GlobalInfDescriptions;
  56. StringToStringset GlobalInfHardwareIds;
  57. StringToStringset GlobalOtherInstallSections;
  58. BasicVerInfo Version;
  59. ParseInfContextList LayoutInfs;
  60. IntToString GlobalDirectories;
  61. ReportEntryMap GlobalErrorFilters;
  62. FileDispositionMap FileDispositions;
  63. FileDispositionMap GuidDispositions;
  64. SetupPrivate SetupAPI;
  65. StringSet BuildUnchangedFiles;
  66. public:
  67. //
  68. // constructor/destructor/main entry points
  69. //
  70. GlobalScan();
  71. ~GlobalScan();
  72. int ParseArgs(int argc,char *argv[]);
  73. int Scan();
  74. private:
  75. //
  76. // private functions
  77. // don't call these within threads
  78. //
  79. int ParseVersion(LPCSTR ver);
  80. int GenerateThreads();
  81. int StartThreads();
  82. int FinishThreads();
  83. int FinishJobs();
  84. int BuildFinalSourceList();
  85. int BuildNewInfFilter();
  86. int BuildDeviceInfMap();
  87. int LoadFileDispositions();
  88. int LoadOtherCopySections();
  89. int LoadListFromFile(const SafeStringA & file,StringList & list);
  90. int LoadListFromFile(const SafeStringW & file,StringList & list);
  91. int LoadListFromFile(HANDLE hFile,StringList & list);
  92. public:
  93. //
  94. // don't call these within threads
  95. //
  96. int AddSourceFiles(StringList & sources);
  97. int SaveForCrossInfInstallCheck(const SafeString & desc,const SafeString & src);
  98. int SaveForCrossInfDeviceCheck(const SafeString & hwid,const SafeString & src);
  99. int CheckCrossInfInstallConflict(const SafeString & desc,const SafeString & src, bool & f,SafeString & other);
  100. int CheckCrossInfDeviceConflict(const SafeString & hardwareId,const SafeString & src, bool & f,SafeString & others);
  101. int SetCopySections(const SafeString & filename,const StringSet & sections);
  102. public:
  103. int ExpandFullPath(const SafeString & subdir,const SafeString & name,SafeString & target);
  104. int ExpandFullPathWithOverride(const SafeString & name,SafeString & target);
  105. FileDisposition & GetGuidDisposition(const SafeString & guid);
  106. FileDisposition & GetFileDisposition(const SafeString & filename);
  107. int GetCopySections(const SafeString & filename,StringSet & target);
  108. bool IsFileChanged(const SafeString & file) const;
  109. JobEntry * GetNextJob();
  110. };
  111. #endif //!_INFSCAN_GLOBALSCAN_H_