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.

181 lines
8.3 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. UploadLibraryISAPI.h
  5. Abstract:
  6. This file contains the declaration of the support classes for accessing and
  7. modifying the configuration of theISAPI extension used by the Upload Library.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 04/28/99
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___UPLOADLIBRARY___ISAPI_H___)
  13. #define __INCLUDED___UPLOADLIBRARY___ISAPI_H___
  14. #include <MPC_utils.h>
  15. #include <MPC_logging.h>
  16. class CISAPIprovider
  17. {
  18. public:
  19. typedef std::list<MPC::wstring> PathList;
  20. typedef PathList::iterator PathIter;
  21. typedef PathList::const_iterator PathIterConst;
  22. private:
  23. MPC::wstring m_szName; // Name of the provider (DPE).
  24. PathList m_lstFinalDestinations; // List of directories where to move complete jobs for this provider.
  25. DWORD m_dwMaxJobsPerDay; // Maximum number of jobs per day (per client).
  26. DWORD m_dwMaxBytesPerDay; // Maximum number of bytes transferred per day (per client).
  27. DWORD m_dwMaxJobSize; // Size of the largest allowed job.
  28. BOOL m_fAuthenticated; // Is authentication required for posting data to this provider?
  29. DWORD m_fProcessingMode; // Status of the DPE (0=Ok, !=0 Error condition).
  30. MPC::wstring m_szLogonURL; // URL of the logon server (for PassPort....)
  31. MPC::wstring m_szProviderGUID; // GUID for the custom provider.
  32. public:
  33. CISAPIprovider();
  34. CISAPIprovider( /*[in]*/ const MPC::wstring szName );
  35. bool operator==( /*[in]*/ const MPC::wstring& rhs );
  36. HRESULT Load( /*[in]*/ MPC::RegKey& rkBase );
  37. HRESULT Save( /*[in]*/ MPC::RegKey& rkBase );
  38. HRESULT GetLocations( /*[out]*/ PathIter& itBegin, /*[out]*/ PathIter& itEnd );
  39. HRESULT NewLocation ( /*[out]*/ PathIter& itNew , /*[in] */ const MPC::wstring& szPath );
  40. HRESULT GetLocation ( /*[out]*/ PathIter& itOld , /*[out]*/ bool& fFound, /*[in] */ const MPC::wstring& szPath );
  41. HRESULT DelLocation ( /*[in] */ PathIter& itOld );
  42. HRESULT get_Name ( /*[out]*/ MPC::wstring& szName );
  43. HRESULT get_MaxJobsPerDay ( /*[out]*/ DWORD& dwMaxJobsPerDay );
  44. HRESULT get_MaxBytesPerDay( /*[out]*/ DWORD& dwMaxBytesPerDay );
  45. HRESULT get_MaxJobSize ( /*[out]*/ DWORD& dwMaxJobSize );
  46. HRESULT get_Authenticated ( /*[out]*/ BOOL& fAuthenticated );
  47. HRESULT get_ProcessingMode( /*[out]*/ DWORD& fProcessingMode );
  48. HRESULT get_LogonURL ( /*[out]*/ MPC::wstring& szLogonURL );
  49. HRESULT get_ProviderGUID ( /*[out]*/ MPC::wstring& szProviderGUID );
  50. HRESULT put_MaxJobsPerDay ( /*[in] */ DWORD dwMaxJobsPerDay );
  51. HRESULT put_MaxBytesPerDay( /*[in] */ DWORD dwMaxBytesPerDay );
  52. HRESULT put_MaxJobSize ( /*[in] */ DWORD dwMaxJobSize );
  53. HRESULT put_Authenticated ( /*[in] */ BOOL fAuthenticated );
  54. HRESULT put_ProcessingMode( /*[in] */ DWORD fProcessingMode );
  55. HRESULT put_LogonURL ( /*[in] */ const MPC::wstring& szLogonURL );
  56. HRESULT put_ProviderGUID ( /*[in] */ const MPC::wstring& szProviderGUID );
  57. };
  58. class CISAPIinstance
  59. {
  60. public:
  61. typedef std::list<MPC::wstring> PathList;
  62. typedef PathList::iterator PathIter;
  63. typedef PathList::const_iterator PathIterConst;
  64. typedef std::map<MPC::wstring,CISAPIprovider,MPC::NocaseLess> ProvMap;
  65. typedef ProvMap::iterator ProvIter;
  66. typedef ProvMap::const_iterator ProvIterConst;
  67. private:
  68. MPC::wstring m_szURL; // URL of the instance.
  69. ProvMap m_mapProviders; // Set of providers handled by the instance.
  70. PathList m_lstQueueLocations; // List of directories where to store partially sent jobs.
  71. DWORD m_dwQueueSizeMax; // Size of the queue triggering the activation of the purge engine.
  72. DWORD m_dwQueueSizeThreshold; // Size of the queue below which the purge engine stops processing old jobs.
  73. DWORD m_dwMaximumJobAge; // Maximum number of days a partially sent job can stay in the queue.
  74. DWORD m_dwMaximumPacketSize; // Maximum packet size accepted by this instance.
  75. MPC::wstring m_szLogLocation; // Location of the application log for this instance.
  76. MPC::FileLog m_flLogHandle; // Object used to write entries in the application log.
  77. public:
  78. CISAPIinstance( /*[in]*/ const MPC::wstring szURL );
  79. bool operator==( /*[in]*/ const MPC::wstring& rhs );
  80. HRESULT Load( /*[in]*/ MPC::RegKey& rkBase );
  81. HRESULT Save( /*[in]*/ MPC::RegKey& rkBase );
  82. HRESULT GetProviders( /*[out]*/ ProvIter& itBegin, /*[out]*/ ProvIter& itEnd );
  83. HRESULT NewProvider ( /*[out]*/ ProvIter& itNew , /*[in] */ const MPC::wstring& szName );
  84. HRESULT GetProvider ( /*[out]*/ ProvIter& itOld , /*[out]*/ bool& fFound, /*[in] */ const MPC::wstring& szName );
  85. HRESULT DelProvider ( /*[in] */ ProvIter& itOld );
  86. HRESULT GetLocations( /*[out]*/ PathIter& itBegin, /*[out]*/ PathIter& itEnd );
  87. HRESULT NewLocation ( /*[out]*/ PathIter& itNew , /*[in] */ const MPC::wstring& szPath );
  88. HRESULT GetLocation ( /*[out]*/ PathIter& itOld , /*[out]*/ bool& fFound, /*[in] */ const MPC::wstring& szPath );
  89. HRESULT DelLocation ( /*[in] */ PathIter& itOld );
  90. HRESULT get_URL ( /*[out]*/ MPC::wstring & szURL );
  91. HRESULT get_QueueSizeMax ( /*[out]*/ DWORD & dwQueueSizeMax );
  92. HRESULT get_QueueSizeThreshold( /*[out]*/ DWORD & dwQueueSizeThreshold );
  93. HRESULT get_MaximumJobAge ( /*[out]*/ DWORD & dwMaximumJobAge );
  94. HRESULT get_MaximumPacketSize ( /*[out]*/ DWORD & dwMaximumPacketSize );
  95. HRESULT get_LogLocation ( /*[out]*/ MPC::wstring & szLogLocation );
  96. HRESULT get_LogHandle ( /*[out]*/ MPC::FileLog*& flLogHandle );
  97. HRESULT put_QueueSizeMax ( /*[in] */ DWORD dwQueueSizeMax );
  98. HRESULT put_QueueSizeThreshold( /*[in] */ DWORD dwQueueSizeThreshold );
  99. HRESULT put_MaximumJobAge ( /*[in] */ DWORD dwMaximumJobAge );
  100. HRESULT put_MaximumPacketSize ( /*[in] */ DWORD dwMaximumPacketSize );
  101. HRESULT put_LogLocation ( /*[in] */ const MPC::wstring& szLogLocation );
  102. };
  103. class CISAPIconfig
  104. {
  105. public:
  106. typedef std::list<CISAPIinstance> List;
  107. typedef List::iterator Iter;
  108. typedef List::const_iterator IterConst;
  109. private:
  110. MPC::wstring m_szRoot; // Registry position of the tree.
  111. MPC::wstring m_szMachine; // Machine hosting the tree.
  112. List m_lstInstances;
  113. HRESULT ConnectToRegistry( /*[out]*/ MPC::RegKey& rkBase ,
  114. /*[in] */ bool fWriteAccess );
  115. public:
  116. CISAPIconfig();
  117. HRESULT SetRoot( LPCWSTR szRoot, LPCWSTR szMachine = NULL );
  118. HRESULT Install (); // It will create the root key.
  119. HRESULT Uninstall(); // It will remove the root key and all its subkeys.
  120. HRESULT Load();
  121. HRESULT Save();
  122. HRESULT GetInstances( /*[out]*/ Iter& itBegin, /*[out]*/ Iter& itEnd );
  123. HRESULT NewInstance ( /*[out]*/ Iter& itNew , /*[in] */ const MPC::wstring& szURL );
  124. HRESULT GetInstance ( /*[out]*/ Iter& itOld , /*[out]*/ bool& fFound, /*[in] */ const MPC::wstring& szURL );
  125. HRESULT DelInstance ( /*[in] */ Iter& itOld );
  126. };
  127. #endif // !defined(__INCLUDED___UPLOADLIBRARY___ISAPI_H___)