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.

110 lines
4.1 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. Session.h
  5. Abstract:
  6. This file contains the declaration of the MPCSession class,
  7. that describes the state of a transfer.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 04/20/99
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___ULSERVER___SESSION_H___)
  13. #define __INCLUDED___ULSERVER___SESSION_H___
  14. #include <Wrapper.h>
  15. #define SESSION_CONST__IMG_FORMAT L"-%08x.img"
  16. #define SESSION_CONST__IMG_EXTENSION L".img"
  17. class MPCSession : public MPCPersist
  18. {
  19. friend class MPCSessionCOMWrapper;
  20. ////////////////////
  21. MPCSessionCOMWrapper m_SelfCOM;
  22. MPCClient* m_mpccParent;
  23. DWORD m_dwID;
  24. MPC::wstring m_szJobID;
  25. MPC::wstring m_szProviderID;
  26. MPC::wstring m_szUsername;
  27. DWORD m_dwTotalSize;
  28. DWORD m_dwOriginalSize;
  29. DWORD m_dwCRC;
  30. bool m_fCompressed;
  31. DWORD m_dwCurrentSize;
  32. SYSTEMTIME m_stLastModified;
  33. bool m_fCommitted;
  34. DWORD m_dwProviderData;
  35. mutable bool m_fDirty;
  36. //////////////////////////////////////////////////////////////////
  37. private:
  38. MPCSession& operator=( /*[in]*/ const MPCSession& sess );
  39. public:
  40. MPCSession( /*[in]*/ MPCClient* mpccParent );
  41. MPCSession( /*[in]*/ MPCClient* mpccParent, /*[in]*/ const UploadLibrary::ClientRequest_OpenSession& crosReq, /*[in]*/ DWORD dwID );
  42. MPCSession( /*[in]*/ const MPCSession& sess );
  43. virtual ~MPCSession();
  44. MPCClient* GetClient();
  45. IULSession* COM();
  46. /////////////////////////////////////////////
  47. virtual bool IsDirty() const;
  48. virtual HRESULT Load( /*[in]*/ MPC::Serializer& streamIn );
  49. virtual HRESULT Save( /*[in]*/ MPC::Serializer& streamOut ) const;
  50. bool operator==( /*[in]*/ const MPC::wstring& rhs );
  51. bool MatchRequest( /*[in]*/ const UploadLibrary::ClientRequest_OpenSession& crosReq );
  52. bool get_Committed( ) const;
  53. HRESULT put_Committed( /*[in]*/ bool fState, /*[in]*/ bool fMove );
  54. void get_JobID ( MPC::wstring& szJobID ) const;
  55. void get_LastModified( SYSTEMTIME& stLastModified ) const;
  56. void get_LastModified( double& dblLastModified ) const;
  57. void get_CurrentSize ( DWORD& dwCurrentSize ) const;
  58. void get_TotalSize ( DWORD& dwTotalSize ) const;
  59. /////////////////////////////////////////////
  60. HRESULT GetProvider( /*[out]*/ CISAPIprovider*& isapiProvider, /*[out]*/ bool& fFound );
  61. HRESULT SelectFinalLocation( /*[in]*/ CISAPIprovider* isapiProvider, /*[out]*/ MPC::wstring& szFileDst, /*[out]*/ bool& fFound );
  62. HRESULT MoveToFinalLocation( /*[in] */ const MPC::wstring& szFileDst );
  63. /////////////////////////////////////////////
  64. HRESULT GetFileName( /*[out]*/ MPC::wstring& szFile );
  65. HRESULT RemoveFile ( );
  66. HRESULT OpenFile ( /*[out]*/ HANDLE& hfFile , /*[in] */ DWORD dwMinimumFreeSpace = 0, bool fSeek = true );
  67. HRESULT Validate ( /*[in] */ bool fCheckFile, /*[out]*/ bool& fPassed );
  68. HRESULT CheckUser ( /*[in] */ const MPC::wstring& szUser , /*[out]*/ bool& fMatch );
  69. HRESULT CompareCRC ( /*[out]*/ bool& fMatch );
  70. HRESULT AppendData( /*[in]*/ MPC::Serializer& streamConn, /*[in]*/ DWORD dwSize );
  71. };
  72. #endif // !defined(__INCLUDED___ULSERVER___SESSION_H___)