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.

234 lines
7.6 KiB

  1. /************************************************************************
  2. Copyright (c) 2000 - 2000 Microsoft Corporation
  3. Module Name :
  4. drizcpat.h
  5. Abstract :
  6. Compatibility wrapper against the old AU bits.
  7. Author :
  8. Revision History :
  9. ***********************************************************************/
  10. #pragma once
  11. #if !defined(___DRIZCPAT_H___)
  12. #define ___DRIZCPAT_H___
  13. #include "qmgrlib.h"
  14. #include "qmgr.h"
  15. class COldJobInterface : public IBackgroundCopyJob1
  16. {
  17. public:
  18. // IUnknown Methods
  19. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
  20. ULONG _stdcall AddRef(void);
  21. ULONG _stdcall Release(void);
  22. // IBackgroundCopyJob1 methods
  23. STDMETHOD(AddFilesInternal)( ULONG cFileCount, FILESETINFO **ppFileSet );
  24. STDMETHOD(AddFiles)( ULONG cFileCount, FILESETINFO **ppFileSet )
  25. { EXTERNAL_FUNC_WRAP( AddFilesInternal( cFileCount, ppFileSet ) ) }
  26. STDMETHOD(GetFileCountInternal)( DWORD *pCount );
  27. STDMETHOD(GetFileCount)( DWORD *pCount )
  28. { EXTERNAL_FUNC_WRAP( GetFileCountInternal( pCount ) ) }
  29. STDMETHOD(GetFileInternal)( ULONG cFileIndex, FILESETINFO *pFileInfo );
  30. STDMETHOD(GetFile)( ULONG cFileIndex, FILESETINFO *pFileInfo )
  31. { EXTERNAL_FUNC_WRAP( GetFileInternal( cFileIndex, pFileInfo ) ) }
  32. STDMETHOD(CancelJobInternal)();
  33. STDMETHOD(CancelJob)()
  34. { EXTERNAL_FUNC_WRAP( CancelJobInternal( ) ) }
  35. STDMETHOD(get_JobIDInternal)(GUID *pId);
  36. STDMETHOD(get_JobID)(GUID *pId)
  37. { EXTERNAL_FUNC_WRAP( get_JobIDInternal( pId ) ) }
  38. STDMETHOD(GetProgressInternal)(DWORD flags, DWORD *pProgress);
  39. STDMETHOD(GetProgress)(DWORD flags, DWORD *pProgress)
  40. { EXTERNAL_FUNC_WRAP( GetProgressInternal( flags, pProgress ) ) }
  41. STDMETHOD(SwitchToForegroundInternal)();
  42. STDMETHOD(SwitchToForeground)()
  43. { EXTERNAL_FUNC_WRAP( SwitchToForegroundInternal( ) ) }
  44. STDMETHOD(GetStatusInternal)(DWORD *pdwStatus,DWORD *pdwWin32Result, DWORD *pdwTransportResult, DWORD *pdwNumOfRetries );
  45. STDMETHOD(GetStatus)(DWORD *pdwStatus,DWORD *pdwWin32Result, DWORD *pdwTransportResult, DWORD *pdwNumOfRetries )
  46. { EXTERNAL_FUNC_WRAP( GetStatusInternal( pdwStatus, pdwWin32Result, pdwTransportResult, pdwNumOfRetries ) ) }
  47. GUID GetOldJobId()
  48. {
  49. return m_OldJobGuid;
  50. }
  51. COldJobInterface( GUID JobGuid, CJob *pJob );
  52. ~COldJobInterface();
  53. void Serialize( HANDLE hFile );
  54. static COldJobInterface *Unserialize(
  55. HANDLE hFile,
  56. CJob* Job
  57. );
  58. void SetInterfaceClass(
  59. CJob *pVal
  60. )
  61. {
  62. m_pJob = pVal;
  63. }
  64. private:
  65. long m_refs;
  66. long m_ServiceInstance;
  67. const GUID m_OldJobGuid;
  68. CJob * m_pJob;
  69. CJobExternal * const m_pJobExternal;
  70. };
  71. class COldGroupInterface : public IBackgroundCopyGroup
  72. {
  73. public:
  74. // IUnknown Methods
  75. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
  76. ULONG _stdcall AddRef(void);
  77. ULONG _stdcall Release(void);
  78. // IBackgroundCopyGroup methods
  79. STDMETHOD(GetPropInternal)( GROUPPROP property, VARIANT * pVal );
  80. STDMETHOD(GetProp)( GROUPPROP property, VARIANT * pVal )
  81. { EXTERNAL_FUNC_WRAP( GetPropInternal( property, pVal ) ) }
  82. STDMETHOD(SetPropInternal)( GROUPPROP property, VARIANT *pvarVal );
  83. STDMETHOD(SetProp)( GROUPPROP property, VARIANT *pvarVal )
  84. { EXTERNAL_FUNC_WRAP( SetPropInternal( property, pvarVal ) ) }
  85. STDMETHOD(GetProgressInternal)( DWORD flags, DWORD * pProgress );
  86. STDMETHOD(GetProgress)( DWORD flags, DWORD * pProgress )
  87. { EXTERNAL_FUNC_WRAP( GetProgressInternal( flags, pProgress ) ) }
  88. STDMETHOD(GetStatusInternal)( DWORD *pdwStatus, DWORD *pdwJobIndex );
  89. STDMETHOD(GetStatus)( DWORD *pdwStatus, DWORD *pdwJobIndex )
  90. { EXTERNAL_FUNC_WRAP( GetStatusInternal( pdwStatus, pdwJobIndex ) ) }
  91. STDMETHOD(GetJobInternal)( GUID jobID, IBackgroundCopyJob1 **ppJob );
  92. STDMETHOD(GetJob)( GUID jobID, IBackgroundCopyJob1 **ppJob )
  93. { EXTERNAL_FUNC_WRAP( GetJobInternal( jobID, ppJob ) ) }
  94. STDMETHOD(SuspendGroupInternal)();
  95. STDMETHOD(SuspendGroup)()
  96. { EXTERNAL_FUNC_WRAP( SuspendGroupInternal() ) }
  97. STDMETHOD(ResumeGroupInternal)();
  98. STDMETHOD(ResumeGroup)()
  99. { EXTERNAL_FUNC_WRAP( ResumeGroupInternal() ) }
  100. STDMETHOD(CancelGroupInternal)();
  101. STDMETHOD(CancelGroup)()
  102. { EXTERNAL_FUNC_WRAP( CancelGroupInternal() ) }
  103. STDMETHOD(get_SizeInternal)( DWORD *pdwSize );
  104. STDMETHOD(get_Size)( DWORD *pdwSize )
  105. { EXTERNAL_FUNC_WRAP( get_SizeInternal( pdwSize ) ) }
  106. STDMETHOD(get_GroupIDInternal)( GUID *pguidGroupID );
  107. STDMETHOD(get_GroupID)( GUID *pguidGroupID )
  108. { EXTERNAL_FUNC_WRAP( get_GroupIDInternal( pguidGroupID ) ) }
  109. STDMETHOD(CreateJobInternal)( GUID guidJobID, IBackgroundCopyJob1 **ppJob );
  110. STDMETHOD(CreateJob)( GUID guidJobID, IBackgroundCopyJob1 **ppJob )
  111. { EXTERNAL_FUNC_WRAP( CreateJobInternal( guidJobID, ppJob ) ) }
  112. STDMETHOD(EnumJobsInternal)( DWORD dwFlags, IEnumBackgroundCopyJobs1 **ppEnumJobs );
  113. STDMETHOD(EnumJobs)( DWORD dwFlags, IEnumBackgroundCopyJobs1 **ppEnumJobs )
  114. { EXTERNAL_FUNC_WRAP( EnumJobsInternal( dwFlags, ppEnumJobs ) ) }
  115. STDMETHOD(SwitchToForegroundInternal)();
  116. STDMETHOD(SwitchToForeground)()
  117. { EXTERNAL_FUNC_WRAP( SwitchToForegroundInternal() ) }
  118. // extensions to IBackgroundCopyGroup, not in original Mars interface
  119. STDMETHOD(QueryNewJobInterface)( REFIID iid, IUnknown ** pUnk );
  120. STDMETHOD(SetNotificationPointer)( REFIID iid, IUnknown * pUnk );
  121. COldGroupInterface( CJob *pJob );
  122. ~COldGroupInterface();
  123. void Serialize( HANDLE hFile );
  124. static COldGroupInterface *UnSerialize(HANDLE hFile, CJob* Job);
  125. IBackgroundCopyCallback1 * GetNotificationPointer();
  126. void SetInterfaceClass(
  127. CJob *pVal
  128. )
  129. {
  130. m_pJob = pVal;
  131. }
  132. private:
  133. long m_refs;
  134. long m_ServiceInstance;
  135. CJob * m_pJob;
  136. CJobExternal * const m_pJobExternal;
  137. IBackgroundCopyCallback1 * m_NotifyPointer;
  138. GUID m_NotifyClsid;
  139. };
  140. class COldQmgrInterface : public IBackgroundCopyQMgr,
  141. public IClassFactory
  142. {
  143. public:
  144. // IUnknown Methods
  145. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
  146. ULONG _stdcall AddRef(void);
  147. ULONG _stdcall Release(void);
  148. // IClassFactory
  149. STDMETHOD(CreateInstance)( IUnknown * pUnkOuter, REFIID riid, void ** ppvObject );
  150. STDMETHOD(LockServer)( BOOL fLock );
  151. // IBackgroundCopyQmgr
  152. STDMETHOD(CreateGroupInternal)(GUID id, IBackgroundCopyGroup **ppGroup);
  153. STDMETHOD(CreateGroup)(GUID id, IBackgroundCopyGroup **ppGroup)
  154. { EXTERNAL_FUNC_WRAP( CreateGroupInternal( id, ppGroup ) ) }
  155. STDMETHOD(GetGroupInternal)(GUID id, IBackgroundCopyGroup ** ppGroup);
  156. STDMETHOD(GetGroup)(GUID id, IBackgroundCopyGroup ** ppGroup)
  157. { EXTERNAL_FUNC_WRAP( GetGroupInternal( id, ppGroup ) ) }
  158. STDMETHOD(EnumGroupsInternal)(DWORD flags, IEnumBackgroundCopyGroups **ppEnum );
  159. STDMETHOD(EnumGroups)(DWORD flags, IEnumBackgroundCopyGroups **ppEnum )
  160. { EXTERNAL_FUNC_WRAP( EnumGroupsInternal( flags, ppEnum ) ) }
  161. // other methods
  162. COldQmgrInterface();
  163. void SetInterfaceClass(
  164. CJobManager *pVal
  165. )
  166. {
  167. m_pJobManager = pVal;
  168. }
  169. private:
  170. long m_refs;
  171. long m_ServiceInstance;
  172. CJobManager *m_pJobManager;
  173. };
  174. class CEnumOldGroups : public CEnumItem<IEnumBackgroundCopyGroups,GUID>
  175. {
  176. public:
  177. CEnumOldGroups();
  178. };
  179. class CEnumOldJobs : public CEnumItem<IEnumBackgroundCopyJobs1,GUID>
  180. {
  181. public:
  182. CEnumOldJobs();
  183. };
  184. #endif //__DRIZCPAT_H__