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.

179 lines
5.1 KiB

  1. /*
  2. **------------------------------------------------------------------------------
  3. ** Module: Disk Space Cleanup Property Sheets
  4. ** File: dmgrinfo.h
  5. **
  6. ** Purpose: Defines the CleanupMgrInfo class for the property tab
  7. ** Notes:
  8. ** Mod Log: Created by Jason Cobb (2/97)
  9. **
  10. ** Copyright (c)1997 Microsoft Corporation, All Rights Reserved
  11. **------------------------------------------------------------------------------
  12. */
  13. #ifndef DMGRINFO_H
  14. #define DMGRINFO_H
  15. /*
  16. **------------------------------------------------------------------------------
  17. ** Project include files
  18. **------------------------------------------------------------------------------
  19. */
  20. #ifndef COMMON_H
  21. #include "common.h"
  22. #endif
  23. #ifndef EMPTYVC_H
  24. #include <emptyvc.h>
  25. #endif
  26. #ifndef DISKUTIL_H
  27. #include "diskutil.h"
  28. #endif
  29. #ifndef CALLBACK_H
  30. #include "callback.h"
  31. #endif
  32. /*
  33. **------------------------------------------------------------------------------
  34. ** Defines
  35. **------------------------------------------------------------------------------
  36. */
  37. #define WMAPP_UPDATEPROGRESS WM_USER+1
  38. #define WMAPP_UPDATESTATUS WM_USER+2
  39. #define PROGRESS_DIVISOR 0xFFFF
  40. /*
  41. **------------------------------------------------------------------------------
  42. ** Global function prototypes
  43. **------------------------------------------------------------------------------
  44. */
  45. // forward references to make compile work
  46. class CleanupMgrInfo;
  47. CleanupMgrInfo * GetCleanupMgrInfoPointer(HWND hDlg);
  48. /*
  49. **------------------------------------------------------------------------------
  50. ** Class declarations
  51. **------------------------------------------------------------------------------
  52. */
  53. typedef struct tag_ClientInfo
  54. {
  55. HICON hIcon;
  56. CLSID clsid;
  57. LPEMPTYVOLUMECACHE pVolumeCache;
  58. HKEY hClientKey;
  59. TCHAR szRegKeyName[MAX_PATH];
  60. LPWSTR wcsDescription;
  61. LPWSTR wcsDisplayName;
  62. LPWSTR wcsAdvancedButtonText;
  63. DWORD dwInitializeFlags;
  64. DWORD dwPriority;
  65. ULARGE_INTEGER dwUsedSpace;
  66. BOOL bShow;
  67. BOOL bSelected;
  68. } CLIENTINFO, *PCLIENTINFO;
  69. /*
  70. **------------------------------------------------------------------------------
  71. ** Class: CleanupMgrInfo
  72. ** Purpose: Stores useful info for the Disk space cleanup manager drive tab
  73. ** Notes:
  74. ** Mod Log: Created by Jason Cobb (2/97)
  75. **------------------------------------------------------------------------------
  76. */
  77. class CleanupMgrInfo {
  78. private:
  79. protected:
  80. static HINSTANCE hInstance;
  81. void init(void);
  82. void destroy(void);
  83. BOOL initializeClients(void);
  84. void deactivateClients(void);
  85. void deactivateSingleClient(PCLIENTINFO pSingleClientInfo);
  86. BOOL getSpaceUsedByClients(void);
  87. void calculateSpaceToPurge(void);
  88. HICON GetClientIcon(LPTSTR, BOOL fIconPath);
  89. public:
  90. drenum dre; // Drive letter
  91. HICON hDriveIcon; // Drive Icon
  92. TCHAR szRoot[MAX_PATH]; // Root
  93. TCHAR szVolName[MAX_PATH]; // Volume name
  94. TCHAR szFileSystem[MAX_PATH]; // File System name
  95. hardware hwHardware; // Hardware Type
  96. volumetype vtVolume; // Volume Type
  97. ULARGE_INTEGER cbDriveFree; // Free space on drive
  98. ULARGE_INTEGER cbDriveUsed; // Used space on drive
  99. ULARGE_INTEGER cbEstCleanupSpace; // Estimated space that can be cleaned
  100. ULARGE_INTEGER cbLowSpaceThreshold; // Low disk space threshold (for agressive mode)
  101. ULARGE_INTEGER cbSpaceToPurge;
  102. ULARGE_INTEGER cbProgressDivider;
  103. DWORD dwReturnCode;
  104. DWORD dwUIFlags;
  105. ULONG ulSAGEProfile; // SAGE Profile
  106. BOOL bOutOfDiskSpace; // Are we in agressive mode?
  107. BOOL bPurgeFiles; // Should we delete the files?
  108. HANDLE hAbortScanThread; // Abort Scan thread Handle
  109. HWND hAbortScanWnd;
  110. HANDLE hAbortScanEvent;
  111. DWORD dwAbortScanThreadID;
  112. HANDLE hAbortPurgeThread;
  113. HWND hAbortPurgeWnd;
  114. HANDLE hAbortPurgeEvent;
  115. DWORD dwAbortPurgeThreadID;
  116. ULARGE_INTEGER cbTotalPurgedSoFar;
  117. ULARGE_INTEGER cbCurrentClientPurgedSoFar;
  118. static void Register(HINSTANCE hInstance);
  119. static void Unregister();
  120. //
  121. //Volume Cache client information
  122. //
  123. int iNumVolumeCacheClients;
  124. PCLIENTINFO pClientInfo;
  125. //
  126. //IEmptyVolumeCacheCallBack interface
  127. //
  128. PCVOLUMECACHECALLBACK volumeCacheCallBack;
  129. LPEMPTYVOLUMECACHECALLBACK pIEmptyVolumeCacheCallBack;
  130. BOOL bAbortScan;
  131. BOOL bAbortPurge;
  132. //
  133. //Constructors
  134. //
  135. CleanupMgrInfo (void);
  136. CleanupMgrInfo (LPTSTR lpDrive, DWORD dwFlags, ULONG ulProfile);
  137. ~CleanupMgrInfo (void);
  138. //
  139. //Creation methods
  140. //
  141. BOOL isValid (void) { return dre != Drive_INV; }
  142. BOOL create (LPTSTR lpDrive, DWORD Flags);
  143. BOOL isAbortScan (void) { return bAbortScan; }
  144. BOOL purgeClients(void);
  145. }; // CleanupMgrInfo
  146. #endif DMGRINFO_H
  147. /*
  148. **------------------------------------------------------------------------------
  149. ** End of File
  150. **------------------------------------------------------------------------------
  151. */