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.

89 lines
2.4 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. Wrapper.h
  5. Abstract:
  6. This file contains the declaration of the COM wrapper classes,
  7. used for interfacing with the Custom Providers.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 04/25/2000
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___ULSERVER___WRAPPER_H___)
  13. #define __INCLUDED___ULSERVER___WRAPPER_H___
  14. #include <UploadServerCustom.h>
  15. class MPCServer;
  16. class MPCClient;
  17. class MPCSession;
  18. template <class Base> class CComUnknown : public Base
  19. {
  20. public:
  21. STDMETHOD_(ULONG, AddRef )() { return 2; }
  22. STDMETHOD_(ULONG, Release)() { return 1; }
  23. STDMETHOD(QueryInterface)( REFIID iid, void* *ppvObject )
  24. {
  25. if(ppvObject == NULL) return E_POINTER;
  26. if(IsEqualGUID( iid, IID_IUnknown ) ||
  27. IsEqualGUID( iid, __uuidof(Base) ) )
  28. {
  29. *ppvObject = this;
  30. return S_OK;
  31. }
  32. return E_NOINTERFACE;
  33. }
  34. };
  35. class MPCServerCOMWrapper : public CComUnknown<IULServer>
  36. {
  37. MPCServer* m_mpcsServer;
  38. public:
  39. MPCServerCOMWrapper( /*[in]*/ MPCServer* mpcsServer );
  40. virtual ~MPCServerCOMWrapper();
  41. // IULServer
  42. STDMETHOD(GetRequestVariable)( /*[in]*/ BSTR bstrName, /*[out]*/ BSTR *pbstrVal );
  43. STDMETHOD(AbortTransfer )( );
  44. STDMETHOD(CompleteTransfer)( /*[in]*/ IStream* data );
  45. };
  46. class MPCSessionCOMWrapper : public CComUnknown<IULSession>
  47. {
  48. MPCSession* m_mpcsSession;
  49. public:
  50. MPCSessionCOMWrapper( /*[in]*/ MPCSession* mpcsSession );
  51. virtual ~MPCSessionCOMWrapper();
  52. // IULSession
  53. STDMETHOD(get_Client )( /*[out]*/ BSTR *pVal );
  54. STDMETHOD(get_Command )( /*[out]*/ DWORD *pVal );
  55. STDMETHOD(get_ProviderID )( /*[out]*/ BSTR *pVal );
  56. STDMETHOD(get_Username )( /*[out]*/ BSTR *pVal );
  57. STDMETHOD(get_JobID )( /*[out]*/ BSTR *pVal );
  58. STDMETHOD(get_SizeAvailable)( /*[out]*/ DWORD *pVal );
  59. STDMETHOD(get_SizeTotal )( /*[out]*/ DWORD *pVal );
  60. STDMETHOD(get_SizeOriginal )( /*[out]*/ DWORD *pVal );
  61. STDMETHOD(get_Data )( /*[out]*/ IStream* *pStm );
  62. STDMETHOD(get_ProviderData )( /*[out]*/ DWORD *pVal );
  63. STDMETHOD(put_ProviderData )( /*[in]*/ DWORD newVal );
  64. };
  65. #endif // !defined(__INCLUDED___ULSERVER___SERVER_H___)