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.

76 lines
2.3 KiB

  1. /*****************************************************************************************************************
  2. FILENAME: diskview.hpp
  3. COPYRIGHT 2001 Microsoft Corporation and Executive Software International, Inc.
  4. */
  5. #ifndef _DISKVIEW_H
  6. #define _DISKVIEW_H
  7. class DiskView {
  8. private:
  9. int Clusters; // number of clusters on the disk
  10. int ClusterArraySize; // number of elements in pClusterArray
  11. int NumLines; // number of lines in the line array
  12. int ClusterFactor; // number of clusters per line in the line array
  13. int MftZoneStart; // first cluster of the MFT zone (or reserved space)
  14. int MftZoneEnd; // last cluster of the MFT zone (or reserved space)
  15. char * pClusterArray; // memory array holding data about the fragmented or contiguous
  16. // etc state for each cluster on the volume
  17. // (one nibble per cluster)
  18. char * pLineArray; // memory array holding condensed cluster data for GUI
  19. BOOL m_bIsDataSent;
  20. BOOL m_IsActive; // is this DiskView in use
  21. UINT m_FragColorThreshold; // required % fragmented clusters to turn line red
  22. BOOL m_bMemAllocFailed; // failed to allocate cluster or line array
  23. INT m_nFreeDelta;
  24. INT m_nFragDelta;
  25. INT m_nNonMovableDelta;
  26. INT m_nUsedDelta;
  27. void InitFragColorThreshold();
  28. BOOL TransferToLineArray();
  29. BOOL Invariant() const;
  30. CRITICAL_SECTION m_CriticalSection;
  31. public:
  32. DiskView(const int, const int, const int);
  33. DiskView(const DiskView&);
  34. DiskView();
  35. DiskView& operator=(const DiskView&);
  36. ~DiskView();
  37. BOOL IsActive() {return m_IsActive;}
  38. BOOL IsDataSent() {return m_bIsDataSent;}
  39. BOOL HasMapMemory() const;
  40. void SetNumLines(const int numLines);
  41. void SetClusterCount(const int InClusters);
  42. void SetMftZone(const int InZoneStart, const int InZoneEnd);
  43. BOOL GetLineArray(char ** ppOutLineArray, DWORD *pNumLines);
  44. void UpdateClusterArray(PBYTE);
  45. void EnterMyCriticalSection();
  46. void LeaveMyCriticalSection();
  47. };
  48. // must match DiskDisp.h
  49. #define SystemFileColor 0 // green
  50. #define PageFileColor 1 // green
  51. #define FragmentColor 2 // red
  52. #define UsedSpaceColor 3 // blue
  53. #define FreeSpaceColor 4 // white
  54. #define DirectoryColor 5 // blue
  55. #define MftZoneFreeSpaceColor 6 // green
  56. #define NUM_COLORS 7
  57. #define DirtyColor 12
  58. #endif // #define _DISKVIEW_H