2 * Background Intelligent Transfer Service (BITS) interface
4 * Copyright 2007 Google (Roy Shea)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 cpp_quote
("#include \"bitsmsg.h\"")
27 cpp_quote
("#define BG_SIZE_UNKNOWN (UINT64)(-1)")
28 cpp_quote
("#define BG_NOTIFY_JOB_TRANSFERRED 0x0001")
29 cpp_quote
("#define BG_NOTIFY_JOB_ERROR 0x0002")
30 cpp_quote
("#define BG_NOTIFY_DISABLE 0x0004")
31 cpp_quote
("#define BG_NOTIFY_JOB_MODIFICATION 0x0008")
34 #define BG_ENUM_SIZEIS
(maxcount
) maxcount
35 #define BG_ENUM_LENGTHIS
(maxcount
,lengthptr
) lengthptr ?
*lengthptr
: maxcount
38 uuid(01b7bd23
-fb88
-4a77
-8490-5891d3e4653a
),
41 interface IBackgroundCopyFile
: IUnknown
43 typedef struct _BG_FILE_PROGRESS
{
45 UINT64 BytesTransferred
;
49 HRESULT GetRemoteName
(
58 [out] BG_FILE_PROGRESS
*pVal
64 uuid(ca51e165
-c365
-424c
-8d41
-24aaa4ff3c40
),
67 interface IEnumBackgroundCopyFiles
: IUnknown
71 [out,size_is(BG_ENUM_SIZEIS
(celt
)),length_is(BG_ENUM_LENGTHIS
(celt
,pceltFetched
))] IBackgroundCopyFile
**rgelt
,
72 [in,out,unique] ULONG
*pceltFetched
82 [out] IEnumBackgroundCopyFiles
**ppenum
92 uuid(19c613a0
-fcb8
-4f28
-81ae
-897c3d078f81
),
95 interface IBackgroundCopyError
: IUnknown
98 BG_ERROR_CONTEXT_NONE
= 0,
99 BG_ERROR_CONTEXT_UNKNOWN
= 1,
100 BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER
= 2,
101 BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION
=3,
102 BG_ERROR_CONTEXT_LOCAL_FILE
= 4,
103 BG_ERROR_CONTEXT_REMOTE_FILE
= 5,
104 BG_ERROR_CONTEXT_GENERAL_TRANSPORT
= 6,
105 BG_ERROR_CONTEXT_REMOTE_APPLICATION
=7,
109 [out,ref] BG_ERROR_CONTEXT
*pContext
,
110 [out,ref] HRESULT *pCode
114 [out] IBackgroundCopyFile
**pVal
117 HRESULT GetErrorDescription
(
118 [in] DWORD LanguageId
,
119 [out,ref] LPWSTR
*pErrorDescription
122 HRESULT GetErrorContextDescription
(
123 [in] DWORD LanguageId
,
124 [out,ref] LPWSTR
*pContextDescription
128 [out,ref] LPWSTR
*pProtocol
135 uuid(37668d37
-507e-4160-9316-26306d150b12
),
138 interface IBackgroundCopyJob
: IUnknown
140 typedef struct _BG_FILE_INFO
{
145 typedef struct _BG_JOB_PROGRESS
{
147 UINT64 BytesTransferred
;
149 ULONG FilesTransferred
;
152 typedef struct _BG_JOB_TIMES
{
153 FILETIME CreationTime
;
154 FILETIME ModificationTime
;
155 FILETIME TransferCompletionTime
;
159 BG_JOB_PRIORITY_FOREGROUND
= 0,
160 BG_JOB_PRIORITY_HIGH
= 1,
161 BG_JOB_PRIORITY_NORMAL
= 2,
162 BG_JOB_PRIORITY_LOW
= 3
166 BG_JOB_STATE_QUEUED
= 0,
167 BG_JOB_STATE_CONNECTING
= 1,
168 BG_JOB_STATE_TRANSFERRING
= 2,
169 BG_JOB_STATE_SUSPENDED
= 3,
170 BG_JOB_STATE_ERROR
= 4,
171 BG_JOB_STATE_TRANSIENT_ERROR
= 5,
172 BG_JOB_STATE_TRANSFERRED
= 6,
173 BG_JOB_STATE_ACKNOWLEDGED
= 7,
174 BG_JOB_STATE_CANCELLED
= 8
178 BG_JOB_TYPE_DOWNLOAD
= 0,
179 BG_JOB_TYPE_UPLOAD
= 1,
180 BG_JOB_TYPE_UPLOAD_REPLY
= 2
184 BG_JOB_PROXY_USAGE_PRECONFIG
,
185 BG_JOB_PROXY_USAGE_NO_PROXY
,
186 BG_JOB_PROXY_USAGE_OVERRIDE
,
187 BG_JOB_PROXY_USAGE_AUTODETECT
188 } BG_JOB_PROXY_USAGE
;
192 [in] ULONG cFileCount
,
193 [in,size_is(cFileCount
)] BG_FILE_INFO
*pFileSet
197 [in] LPCWSTR RemoteUrl
,
198 [in] LPCWSTR LocalName
202 [out] IEnumBackgroundCopyFiles
**pEnum
218 [out] BG_JOB_TYPE
*pVal
222 [out] BG_JOB_PROGRESS
*pVal
226 [out] BG_JOB_TIMES
*pVal
230 [out] BG_JOB_STATE
*pVal
234 [out] IBackgroundCopyError
**ppError
241 HRESULT SetDisplayName
(
245 HRESULT GetDisplayName
(
249 HRESULT SetDescription
(
253 HRESULT GetDescription
(
258 [in] BG_JOB_PRIORITY Val
262 [out] BG_JOB_PRIORITY
*pVal
265 HRESULT SetNotifyFlags
(
269 HRESULT GetNotifyFlags
(
273 HRESULT SetNotifyInterface
(
277 HRESULT GetNotifyInterface
(
278 [out] IUnknown
** pVal
281 HRESULT SetMinimumRetryDelay
(
285 HRESULT GetMinimumRetryDelay
(
289 HRESULT SetNoProgressTimeout
(
293 HRESULT GetNoProgressTimeout
(
297 HRESULT GetErrorCount
(
301 HRESULT SetProxySettings
(
302 [in] BG_JOB_PROXY_USAGE ProxyUsage
,
303 [in,string,unique] const WCHAR
*ProxyList
,
304 [in,string,unique] const WCHAR
*ProxyBypassList
307 HRESULT GetProxySettings
(
308 [out] BG_JOB_PROXY_USAGE
*pProxyUsage
,
309 [out] LPWSTR
*pProxyList
,
310 [out] LPWSTR
*pProxyBypassList
313 HRESULT TakeOwnership
();
317 uuid(1af4f612
-3b71
-466f
-8f58
-7b6f73ac57ad
),
320 interface IEnumBackgroundCopyJobs
: IUnknown
324 [out,size_is(BG_ENUM_SIZEIS
(celt
)),length_is(BG_ENUM_LENGTHIS
(celt
,pceltFetched
))] IBackgroundCopyJob
**rgelt
,
325 [in,out,unique] ULONG
*pceltFetched
335 [out] IEnumBackgroundCopyJobs
**ppenum
345 uuid(97ea99c7
-0186-4ad4
-8df9
-c5b4e0ed6b22
),
348 interface IBackgroundCopyCallback
: IUnknown
350 HRESULT JobTransferred
(
351 [in] IBackgroundCopyJob
*pJob
355 [in] IBackgroundCopyJob
*pJob
,
356 [in] IBackgroundCopyError
*pError
359 HRESULT JobModification
(
360 [in] IBackgroundCopyJob
*pJob
,
361 [in] DWORD dwReserved
366 uuid(5ce34c0d
-0dc9
-4c1f
-897c
-daa1b78cee7c
),
369 interface IBackgroundCopyManager
: IUnknown
371 cpp_quote
("#define BG_JOB_ENUM_ALL_USERS 0x0001")
374 [in] LPCWSTR DisplayName
,
375 [in] BG_JOB_TYPE Type
,
377 [out] IBackgroundCopyJob
**ppJob
382 [out] IBackgroundCopyJob
**ppJob
387 [out] IEnumBackgroundCopyJobs
**ppEnum
389 HRESULT GetErrorDescription
(
390 [in] HRESULT hResult,
391 [in] DWORD LanguageId
,
392 [out] LPWSTR
*pErrorDescription
);
397 uuid(1deeb74f
-7915-4560-b558
-918c83f176a6
),
400 library BackgroundCopyManager
403 uuid(4991d34b
-80a1
-4291-83b6
-3328366b9097
),
405 coclass BackgroundCopyManager
407 [default] interface IBackgroundCopyManager
;
410 interface IBackgroundCopyCallback
;