1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use shared::basetsd::UINT64;
7 use shared::rpcndr::byte;
8 use um::bits::{IBackgroundCopyJob, IBackgroundCopyJobVtbl};
9 use um::winnt::{HRESULT, LPCWSTR, LPWSTR};
10 STRUCT!{struct BG_JOB_REPLY_PROGRESS {
11     BytesTotal: UINT64,
12     BytesTransferred: UINT64,
13 }}
14 ENUM!{enum BG_AUTH_TARGET {
15     BG_AUTH_TARGET_SERVER = 1,
16     BG_AUTH_TARGET_PROXY = BG_AUTH_TARGET_SERVER + 1,
17 }}
18 ENUM!{enum BG_AUTH_SCHEME {
19     BG_AUTH_SCHEME_BASIC = 1,
20     BG_AUTH_SCHEME_DIGEST = BG_AUTH_SCHEME_BASIC + 1,
21     BG_AUTH_SCHEME_NTLM = BG_AUTH_SCHEME_DIGEST + 1,
22     BG_AUTH_SCHEME_NEGOTIATE = BG_AUTH_SCHEME_NTLM + 1,
23     BG_AUTH_SCHEME_PASSPORT = BG_AUTH_SCHEME_NEGOTIATE + 1,
24 }}
25 STRUCT!{struct BG_BASIC_CREDENTIALS {
26     UserName: LPWSTR,
27     Password: LPWSTR,
28 }}
29 UNION!{union BG_AUTH_CREDENTIALS_UNION {
30     [usize; 2],
31     Basic Basic_mut: BG_BASIC_CREDENTIALS,
32 }}
33 STRUCT!{struct BG_AUTH_CREDENTIALS {
34     Target: BG_AUTH_TARGET,
35     Scheme: BG_AUTH_SCHEME,
36     Credentials: BG_AUTH_CREDENTIALS_UNION,
37 }}
38 pub type PBG_AUTH_CREDENTIALS = *mut BG_AUTH_CREDENTIALS;
39 RIDL!{#[uuid(0x54b50739, 0x686f, 0x45eb, 0x9d, 0xff, 0xd6, 0xa9, 0xa0, 0xfa, 0xa9, 0xaf)]
40 interface IBackgroundCopyJob2(IBackgroundCopyJob2Vtbl):
41     IBackgroundCopyJob(IBackgroundCopyJobVtbl) {
42     fn SetNotifyCmdLine(
43         Program: LPCWSTR,
44         Parameters: LPCWSTR,
45     ) -> HRESULT,
46     fn GetNotifyCmdLine(
47         pProgram: *mut LPWSTR,
48         pParameters: *mut LPWSTR,
49     ) -> HRESULT,
50     fn GetReplyProgress(
51         pProgress: *mut BG_JOB_REPLY_PROGRESS,
52     ) -> HRESULT,
53     fn GetReplyData(
54         ppBuffer: *mut *mut byte,
55         pLength: *mut UINT64,
56     ) -> HRESULT,
57     fn SetReplyFileName(
58         ReplyFileName: LPCWSTR,
59     ) -> HRESULT,
60     fn GetReplyFileName(
61         pReplyFileName: *mut LPWSTR,
62     ) -> HRESULT,
63     fn SetCredentials(
64         credentials: *mut BG_AUTH_CREDENTIALS,
65     ) -> HRESULT,
66     fn RemoveCredentials(
67         Target: BG_AUTH_TARGET,
68         Scheme: BG_AUTH_SCHEME,
69     ) -> HRESULT,
70 }}
71