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.

77 lines
2.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: volclean.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _VOLFREE_H_
  11. #define _VOLFREE_H_
  12. #include "purge.h"
  13. class CCscVolumeCleaner : public IEmptyVolumeCache2
  14. {
  15. LONG m_cRef;
  16. BOOL m_fPinned; // TRUE if this instance frees pinned files, FALSE for auto-cached files
  17. CCachePurger *m_pPurger;
  18. LPEMPTYVOLUMECACHECALLBACK m_pDiskCleaner;
  19. DWORDLONG m_dwlSpaceToFree;
  20. DWORDLONG m_dwlSpaceFreed;
  21. CCachePurgerSel m_PurgerSel;
  22. public:
  23. CCscVolumeCleaner(BOOL fPinned) : m_cRef(1), m_fPinned(fPinned), m_pPurger(NULL),
  24. m_pDiskCleaner(NULL), m_dwlSpaceToFree(0), m_dwlSpaceFreed(0)
  25. {
  26. DllAddRef();
  27. }
  28. ~CCscVolumeCleaner()
  29. {
  30. delete m_pPurger;
  31. DllRelease();
  32. }
  33. static HRESULT WINAPI CreateInstance(REFIID riid, LPVOID *ppv);
  34. static HRESULT WINAPI CreateInstance2(REFIID riid, LPVOID *ppv);
  35. // IUnknown methods
  36. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  37. STDMETHODIMP_(ULONG) AddRef();
  38. STDMETHODIMP_(ULONG) Release();
  39. // IEmptyVolumeCache methods
  40. STDMETHODIMP Initialize(HKEY hkRegKey,
  41. LPCWSTR pcwszVolume,
  42. LPWSTR *ppwszDisplayName,
  43. LPWSTR *ppwszDescription,
  44. LPDWORD pdwFlags);
  45. STDMETHODIMP GetSpaceUsed(DWORDLONG *pdwlSpaceUsed,
  46. LPEMPTYVOLUMECACHECALLBACK picb);
  47. STDMETHODIMP Purge(DWORDLONG dwlSpaceToFree,
  48. LPEMPTYVOLUMECACHECALLBACK picb);
  49. STDMETHODIMP ShowProperties(HWND hwnd);
  50. STDMETHODIMP Deactivate(LPDWORD pdwFlags);
  51. // IEmptyVolumeCache methods
  52. STDMETHODIMP InitializeEx(HKEY hkRegKey,
  53. LPCWSTR pcwszVolume,
  54. LPCWSTR pcwszKeyName,
  55. LPWSTR *ppwszDisplayName,
  56. LPWSTR *ppwszDescription,
  57. LPWSTR *ppwszBtnText,
  58. LPDWORD pdwFlags);
  59. private:
  60. BOOL ScanCallback(CCachePurger *pPurger);
  61. BOOL DeleteCallback(CCachePurger *pPurger);
  62. static BOOL CALLBACK CachePurgerCallback(CCachePurger *pPurger);
  63. static HRESULT WINAPI Create(BOOL fPinned, REFIID riid, LPVOID *ppv);
  64. };
  65. typedef CCscVolumeCleaner *PCSCVOLCLEANER;
  66. #endif // _VOLFREE_H_