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.

279 lines
9.6 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: qmgr.idl
  6. //
  7. // Description:
  8. // Declares the QMgr COM interface
  9. //
  10. //=======================================================================
  11. #ifndef DO_NO_IMPORTS
  12. import "unknwn.idl";
  13. import "ocidl.idl";
  14. import "oleidl.idl";
  15. import "oaidl.idl";
  16. import "docobj.idl";
  17. #endif
  18. cpp_quote("// Background Copy QMgr Public Interface")
  19. //various events and flags
  20. /*************Notify flags**************/
  21. cpp_quote("#define QM_NOTIFY_FILE_DONE 0x00000001")
  22. cpp_quote("#define QM_NOTIFY_JOB_DONE 0x00000002")
  23. cpp_quote("#define QM_NOTIFY_GROUP_DONE 0x00000004")
  24. cpp_quote("#define QM_NOTIFY_DISABLE_NOTIFY 0x00000040")
  25. cpp_quote("#define QM_NOTIFY_USE_PROGRESSEX 0x00000080")
  26. /*************Status flags**************/
  27. cpp_quote("#define QM_STATUS_FILE_COMPLETE 0x00000001")
  28. cpp_quote("#define QM_STATUS_FILE_INCOMPLETE 0x00000002")
  29. cpp_quote("#define QM_STATUS_JOB_COMPLETE 0x00000004")
  30. cpp_quote("#define QM_STATUS_JOB_INCOMPLETE 0x00000008")
  31. cpp_quote("#define QM_STATUS_JOB_ERROR 0x00000010")
  32. cpp_quote("#define QM_STATUS_JOB_FOREGROUND 0x00000020")
  33. cpp_quote("#define QM_STATUS_GROUP_COMPLETE 0x00000040")
  34. cpp_quote("#define QM_STATUS_GROUP_INCOMPLETE 0x00000080")
  35. cpp_quote("#define QM_STATUS_GROUP_SUSPENDED 0x00000100")
  36. cpp_quote("#define QM_STATUS_GROUP_ERROR 0x00000200")
  37. cpp_quote("#define QM_STATUS_GROUP_FOREGROUND 0x00000400")
  38. /*************Protocol flags***************/
  39. cpp_quote("#define QM_PROTOCOL_HTTP 1")
  40. cpp_quote("#define QM_PROTOCOL_FTP 2")
  41. cpp_quote("#define QM_PROTOCOL_SMB 3")
  42. cpp_quote("#define QM_PROTOCOL_CUSTOM 4")
  43. /**************Progress Flags**************/
  44. cpp_quote("#define QM_PROGRESS_PERCENT_DONE 1")
  45. cpp_quote("#define QM_PROGRESS_TIME_DONE 2")
  46. cpp_quote("#define QM_PROGRESS_SIZE_DONE 3")
  47. /**************Error Codes****************/
  48. cpp_quote("#define QM_E_INVALID_STATE 0x81001001")
  49. cpp_quote("#define QM_E_SERVICE_UNAVAILABLE 0x81001002")
  50. cpp_quote("#define QM_E_DOWNLOADER_UNAVAILABLE 0x81001003")
  51. cpp_quote("#define QM_E_ITEM_NOT_FOUND 0x81001004")
  52. #if defined(TEST_TIMES)
  53. typedef struct _BACKGROUND_COPY_TIMES
  54. {
  55. FILETIME ftCreationTime;
  56. FILETIME ftModificationTime;
  57. FILETIME ftCompletionTime;
  58. } BACKGROUND_COPY_TIMES;
  59. #endif
  60. //
  61. // =============================
  62. // Marshalled interfaces
  63. // =============================
  64. // ==============================================
  65. // IJob Interface
  66. // The IJob interface is the management layer for a file (or set of files)
  67. // to be transferred.
  68. [
  69. uuid(59f5553c-2031-4629-bb18-2645a6970947),
  70. helpstring("IBackgroundCopyJob Interface"),
  71. odl
  72. ]
  73. interface IBackgroundCopyJob1 : IUnknown
  74. {
  75. typedef struct _FILESETINFO
  76. {
  77. BSTR bstrRemoteFile;
  78. BSTR bstrLocalFile;
  79. DWORD dwSizeHint;
  80. } FILESETINFO;
  81. HRESULT CancelJob();
  82. HRESULT GetProgress([in] DWORD dwFlags, [out] DWORD *pdwProgress);
  83. HRESULT GetStatus( [out] DWORD *pdwStatus,
  84. [out] DWORD *pdwWin32Result,
  85. [out] DWORD *pdwTransportResult,
  86. [out] DWORD *pdwNumOfRetries );
  87. HRESULT AddFiles([in] ULONG cFileCount, [in, size_is(cFileCount)] FILESETINFO **ppFileSet);
  88. HRESULT GetFile([in] ULONG cFileIndex, [out] FILESETINFO *pFileInfo);
  89. HRESULT GetFileCount([out] DWORD *pdwFileCount);
  90. HRESULT SwitchToForeground();
  91. HRESULT get_JobID([out] GUID *pguidJobID); // used to a identify a job when enumerating jobs
  92. #if defined(TEST_TIMES)
  93. HRESULT GetTimes( [out,ref] BACKGROUND_COPY_TIMES *pTimes );
  94. #endif
  95. }
  96. // ==============================================
  97. // IEnumJobs Interface
  98. // This interface allows enumerating the jobs under a Group
  99. [
  100. uuid(8baeba9d-8f1c-42c4-b82c-09ae79980d25),
  101. helpstring("IEnumBackgroundCopyJobs Interface"),
  102. odl
  103. ]
  104. interface IEnumBackgroundCopyJobs1 : IUnknown
  105. {
  106. HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] GUID *rgelt, [out] ULONG *pceltFetched);
  107. HRESULT Skip([in] ULONG celt);
  108. HRESULT Reset();
  109. HRESULT Clone([out] IEnumBackgroundCopyJobs1 **ppenum);
  110. HRESULT GetCount([out] ULONG *puCount);
  111. }
  112. // ==============================================
  113. // IGroup Interface
  114. // This interface is the base unit of management for a Job or Set of Jobs
  115. [
  116. uuid(1ded80a7-53ea-424f-8a04-17fea9adc4f5),
  117. helpstring("IBackgroundCopyGroup Interface"),
  118. odl
  119. ]
  120. interface IBackgroundCopyGroup : IUnknown
  121. {
  122. typedef enum GROUPPROP {
  123. GROUPPROP_PRIORITY = 0,
  124. GROUPPROP_REMOTEUSERID = 1,
  125. GROUPPROP_REMOTEUSERPWD = 2,
  126. GROUPPROP_LOCALUSERID = 3,
  127. GROUPPROP_LOCALUSERPWD = 4,
  128. GROUPPROP_PROTOCOLFLAGS = 5,
  129. GROUPPROP_NOTIFYFLAGS = 6,
  130. GROUPPROP_NOTIFYCLSID = 7,
  131. GROUPPROP_PROGRESSSIZE = 8,
  132. GROUPPROP_PROGRESSPERCENT = 9,
  133. GROUPPROP_PROGRESSTIME = 10,
  134. GROUPPROP_DISPLAYNAME = 11,
  135. GROUPPROP_DESCRIPTION = 12
  136. } GROUPPROP;
  137. HRESULT GetProp([in] GROUPPROP propID, [out] VARIANT *pvarVal);
  138. [local] HRESULT SetProp([in] GROUPPROP propID, [in] VARIANT *pvarVal);
  139. [call_as(SetProp)] HRESULT InternalSetProp([in] GROUPPROP propID, [in] VARIANT *pvarVal);
  140. HRESULT GetProgress([in] DWORD dwFlags, [out] DWORD *pdwProgress);
  141. HRESULT GetStatus([out] DWORD *pdwStatus, [out] DWORD *pdwJobIndex);
  142. HRESULT GetJob([in] GUID jobID, [out] IBackgroundCopyJob1 **ppJob);
  143. HRESULT SuspendGroup();
  144. HRESULT ResumeGroup(); // New groups are by default suspended, when all jobs are initialized call resumegroup to enable the group
  145. HRESULT CancelGroup();
  146. HRESULT get_Size([out] DWORD *pdwSize); // gets the calculated size of the jobs in this group
  147. HRESULT get_GroupID([out] GUID *pguidGroupID); // used to identify a group when enumerating groups
  148. HRESULT CreateJob([in] GUID guidJobID, [out] IBackgroundCopyJob1 **ppJob);
  149. HRESULT EnumJobs([in] DWORD dwFlags, [out] IEnumBackgroundCopyJobs1 **ppEnumJobs);
  150. HRESULT SwitchToForeground();
  151. // end of the original interface is here
  152. HRESULT QueryNewJobInterface( [in] REFIID iid, [out, iid_is(iid)] IUnknown ** pUnk );
  153. HRESULT SetNotificationPointer( [in] REFIID iid, [in] IUnknown * pUnk );
  154. }
  155. // ==============================================
  156. // IEnumGroups Interface
  157. [
  158. uuid(d993e603-4aa4-47c5-8665-c20d39c2ba4f),
  159. helpstring("IEnumBackgroundCopyGroups Interface"),
  160. odl
  161. ]
  162. interface IEnumBackgroundCopyGroups : IUnknown
  163. {
  164. HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] GUID *rgelt, [out] ULONG *pceltFetched);
  165. HRESULT Skip([in] ULONG celt);
  166. HRESULT Reset();
  167. HRESULT Clone([out] IEnumBackgroundCopyGroups **ppenum);
  168. HRESULT GetCount([out] ULONG *puCount);
  169. }
  170. // ==============================================
  171. // IBackgroundCallback Interface
  172. // This interface is implemented by the client and is used by the queue manager to supply status and
  173. // progress information to the client.
  174. [
  175. uuid(084f6593-3800-4e08-9b59-99fa59addf82),
  176. helpstring("IBackgroundCopyCallback Interface"),
  177. odl
  178. ]
  179. interface IBackgroundCopyCallback1 : IUnknown
  180. {
  181. HRESULT OnStatus( [in] IBackgroundCopyGroup *pGroup,
  182. [in] IBackgroundCopyJob1 *pJob,
  183. [in] DWORD dwFileIndex,
  184. [in] DWORD dwStatus,
  185. [in] DWORD dwNumOfRetries,
  186. [in] DWORD dwWin32Result,
  187. [in] DWORD dwTransportResult );
  188. HRESULT OnProgress( [in] DWORD ProgressType,
  189. [in] IBackgroundCopyGroup *pGroup,
  190. [in] IBackgroundCopyJob1 *pJob,
  191. [in] DWORD dwFileIndex,
  192. [in] DWORD dwProgressValue );
  193. HRESULT OnProgressEx( [in] DWORD ProgressType,
  194. [in] IBackgroundCopyGroup *pGroup,
  195. [in] IBackgroundCopyJob1 *pJob,
  196. [in] DWORD dwFileIndex,
  197. [in] DWORD dwProgressValue,
  198. [in] DWORD dwByteArraySize,
  199. [in, size_is(dwByteArraySize)] BYTE *pByte );
  200. }
  201. [
  202. uuid(16f41c69-09f5-41d2-8cd8-3c08c47bc8a8), // IID_IQMgr
  203. helpstring("Background Copy QMgr interface"),
  204. odl
  205. ]
  206. interface IBackgroundCopyQMgr : IUnknown
  207. {
  208. HRESULT CreateGroup([in] GUID guidGroupID, [out] IBackgroundCopyGroup **ppGroup);
  209. HRESULT GetGroup([in] GUID groupID, [out] IBackgroundCopyGroup **ppGroup);
  210. HRESULT EnumGroups([in] DWORD dwFlags, [out] IEnumBackgroundCopyGroups **ppEnumGroups);
  211. }
  212. //---------------------------------------------------------------------------
  213. [
  214. uuid(f5b26dcb-b37e-4d7c-ae7a-1cb3fbeb183e),
  215. helpstring("Microsoft Background Copy Queue Manager 1.0"),
  216. lcid(0x0000),
  217. version(1.0)
  218. ]
  219. library BackgroundCopyQMgr
  220. {
  221. //-------------------------------------------------------------
  222. // QMgr
  223. //-------------------------------------------------------------
  224. [
  225. uuid(69AD4AEE-51BE-439b-A92C-86AE490E8B30),
  226. helpstring("Background Copy QMgr Class")
  227. ]
  228. coclass BackgroundCopyQMgr
  229. {
  230. [default] interface IBackgroundCopyQMgr;
  231. };
  232. }