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.

83 lines
2.7 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. PurgeEngine.h
  5. Abstract:
  6. This file contains the declaration of the MPCPurgeEngine class,
  7. that controls the cleaning of the temporary directories.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 07/12/99
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___ULSERVER___PURGEENGINE_H___)
  13. #define __INCLUDED___ULSERVER___PURGEENGINE_H___
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif // _MSC_VER > 1000
  17. struct MPCPurge_SessionSummary // Hungarian: pss
  18. {
  19. MPC::wstring m_szJobID;
  20. double m_dblLastModified;
  21. DWORD m_dwCurrentSize;
  22. };
  23. struct MPCPurge_ClientSummary // Hungarian: pcs
  24. {
  25. typedef std::list<MPCPurge_SessionSummary> List;
  26. typedef List::iterator Iter;
  27. typedef List::const_iterator IterConst;
  28. MPC::wstring m_szPath;
  29. List m_lstSessions;
  30. DWORD m_dwFileSize;
  31. double m_dblLastModified;
  32. MPCPurge_ClientSummary( /*[in]*/ const MPC::wstring& szPath );
  33. bool GetOldestSession( /*[out]*/ Iter& itSession );
  34. };
  35. class MPCPurgeEngine
  36. {
  37. typedef std::list<MPCPurge_ClientSummary> List;
  38. typedef List::iterator Iter;
  39. typedef List::const_iterator IterConst;
  40. MPC::wstring m_szURL;
  41. MPCServer* m_mpcsServer;
  42. DWORD m_dwQueueSizeMax;
  43. DWORD m_dwQueueSizeThreshold;
  44. DWORD m_dwMaximumJobAge;
  45. double m_dblMaximumJobAge;
  46. List m_lstClients;
  47. HRESULT AnalyzeFolders ( /*[in]*/ MPC::FileSystemObject* fso, /*[in/out]*/ DWORD& dwTotalSize );
  48. HRESULT AddClient ( /*[in]*/ const MPC::wstring& szPath, /*[in/out]*/ DWORD& dwTotalSize );
  49. HRESULT RemoveOldJobs ( /*[in/out]*/ DWORD& dwTotalSize );
  50. HRESULT RemoveOldestJob ( /*[in/out]*/ DWORD& dwTotalSize );
  51. HRESULT RemoveEmptyClients( /*[in/out]*/ DWORD& dwTotalSize );
  52. HRESULT RemoveSession ( /*[in]*/ MPCClient& mpccClient ,
  53. /*[in/out]*/ bool& fInitialized ,
  54. /*[in]*/ Iter itClient ,
  55. /*[in]*/ MPCPurge_ClientSummary::Iter& itSession ,
  56. /*[in/out]*/ DWORD& dwTotalSize );
  57. public:
  58. HRESULT Process();
  59. };
  60. #endif // !defined(__INCLUDED___ULSERVER___PURGEENGINE_H___)