| 1 | #pragma once |
| 2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 3 | |
| 4 | |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
| 9 | typedef HRESULT (WINAPI *LPAUTHENTICATION_ROUTINE)( |
| 10 | __in LPVOID pVoid, |
| 11 | __in HINTERNET hUrl, |
| 12 | __in long lHttpCode, |
| 13 | __out BOOL* pfRetrySend, |
| 14 | __out BOOL* pfRetry |
| 15 | ); |
| 16 | |
| 17 | typedef int (WINAPI *LPCANCEL_ROUTINE)( |
| 18 | __in HRESULT hrError, |
| 19 | __in_z_opt LPCWSTR wzError, |
| 20 | __in BOOL fAllowRetry, |
| 21 | __in_opt LPVOID pvContext |
| 22 | ); |
| 23 | |
| 24 | // structs |
| 25 | typedef struct _DOWNLOAD_SOURCE |
| 26 | { |
| 27 | LPWSTR sczUrl; |
| 28 | LPWSTR sczUser; |
| 29 | LPWSTR sczPassword; |
| 30 | LPWSTR sczAuthorizationHeader; |
| 31 | } DOWNLOAD_SOURCE; |
| 32 | |
| 33 | typedef struct _DOWNLOAD_CACHE_CALLBACK |
| 34 | { |
| 35 | LPPROGRESS_ROUTINE pfnProgress; |
| 36 | LPCANCEL_ROUTINE pfnCancel; |
| 37 | LPVOID pv; |
| 38 | } DOWNLOAD_CACHE_CALLBACK; |
| 39 | |
| 40 | typedef struct _DOWNLOAD_AUTHENTICATION_CALLBACK |
| 41 | { |
| 42 | LPAUTHENTICATION_ROUTINE pfnAuthenticate; |
| 43 | LPVOID pv; |
| 44 | } DOWNLOAD_AUTHENTICATION_CALLBACK; |
| 45 | |
| 46 | |
| 47 | // functions |
| 48 | |
| 49 | HRESULT DAPI DownloadUrl( |
| 50 | __in DOWNLOAD_SOURCE* pDownloadSource, |
| 51 | __in DWORD64 dw64AuthoredDownloadSize, |
| 52 | __in LPCWSTR wzDestinationPath, |
| 53 | __in_opt DOWNLOAD_CACHE_CALLBACK* pCache, |
| 54 | __in_opt DOWNLOAD_AUTHENTICATION_CALLBACK* pAuthenticate |
| 55 | ); |
| 56 | |
| 57 | |
| 58 | #ifdef __cplusplus |
| 59 | } |
| 60 | #endif |