| 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 |
//! This module defines the DAV specific functions that are exposed to the user |
| 7 |
use shared::minwindef::{BOOL, DWORD, LPDWORD, PBYTE, PULONG, ULONG}; |
| 8 |
use um::winnt::{HANDLE, LPCWSTR, LPWSTR, PVOID, PWSTR}; |
| 9 |
pub type OPAQUE_HANDLE = DWORD; |
| 10 |
STRUCT!{struct DAV_CALLBACK_AUTH_BLOB { |
| 11 |
pBuffer: PVOID, |
| 12 |
ulSize: ULONG, |
| 13 |
ulType: ULONG, |
| 14 |
}} |
| 15 |
pub type PDAV_CALLBACK_AUTH_BLOB = *mut DAV_CALLBACK_AUTH_BLOB; |
| 16 |
STRUCT!{struct DAV_CALLBACK_AUTH_UNP { |
| 17 |
pszUserName: LPWSTR, |
| 18 |
ulUserNameLength: ULONG, |
| 19 |
pszPassword: LPWSTR, |
| 20 |
ulPasswordLength: ULONG, |
| 21 |
}} |
| 22 |
pub type PDAV_CALLBACK_AUTH_UNP = *mut DAV_CALLBACK_AUTH_UNP; |
| 23 |
STRUCT!{struct DAV_CALLBACK_CRED { |
| 24 |
AuthBlob: DAV_CALLBACK_AUTH_BLOB, |
| 25 |
UNPBlob: DAV_CALLBACK_AUTH_UNP, |
| 26 |
bAuthBlobValid: BOOL, |
| 27 |
bSave: BOOL, |
| 28 |
}} |
| 29 |
pub type PDAV_CALLBACK_CRED = *mut DAV_CALLBACK_CRED; |
| 30 |
pub const DAV_AUTHN_SCHEME_BASIC: DWORD = 0x00000001; |
| 31 |
pub const DAV_AUTHN_SCHEME_NTLM: DWORD = 0x00000002; |
| 32 |
pub const DAV_AUTHN_SCHEME_PASSPORT: DWORD = 0x00000004; |
| 33 |
pub const DAV_AUTHN_SCHEME_DIGEST: DWORD = 0x00000008; |
| 34 |
pub const DAV_AUTHN_SCHEME_NEGOTIATE: DWORD = 0x00000010; |
| 35 |
pub const DAV_AUTHN_SCHEME_CERT: DWORD = 0x00010000; |
| 36 |
pub const DAV_AUTHN_SCHEME_FBA: DWORD = 0x00100000; |
| 37 |
ENUM!{enum AUTHNEXTSTEP { |
| 38 |
DefaultBehavior, |
| 39 |
RetryRequest, |
| 40 |
CancelRequest, |
| 41 |
}} |
| 42 |
FN!{stdcall PFNDAVAUTHCALLBACK_FREECRED( |
| 43 |
pbuffer: PVOID, |
| 44 |
) -> DWORD} |
| 45 |
FN!{stdcall PFNDAVAUTHCALLBACK( |
| 46 |
lpwzServerName: LPWSTR, |
| 47 |
lpwzRemoteName: LPWSTR, |
| 48 |
dwAuthScheme: DWORD, |
| 49 |
dwFlags: DWORD, |
| 50 |
pCallbackCred: PDAV_CALLBACK_CRED, |
| 51 |
NextStep: *mut AUTHNEXTSTEP, |
| 52 |
pFreeCred: *mut PFNDAVAUTHCALLBACK_FREECRED, |
| 53 |
) -> DWORD} |
| 54 |
extern "system" { |
| 55 |
pub fn DavAddConnection( |
| 56 |
ConnectionHandle: *mut HANDLE, |
| 57 |
RemoteName: LPCWSTR, |
| 58 |
UserName: LPCWSTR, |
| 59 |
Password: LPCWSTR, |
| 60 |
ClientCert: PBYTE, |
| 61 |
CertSize: DWORD, |
| 62 |
) -> DWORD; |
| 63 |
pub fn DavDeleteConnection( |
| 64 |
ConnectionHandle: HANDLE, |
| 65 |
) -> DWORD; |
| 66 |
pub fn DavGetUNCFromHTTPPath( |
| 67 |
HttpPath: LPCWSTR, |
| 68 |
UncPath: LPWSTR, |
| 69 |
lpSize: LPDWORD, |
| 70 |
) -> DWORD; |
| 71 |
pub fn DavGetHTTPFromUNCPath( |
| 72 |
UncPath: LPCWSTR, |
| 73 |
HttpPath: LPWSTR, |
| 74 |
lpSize: LPDWORD, |
| 75 |
) -> DWORD; |
| 76 |
pub fn DavGetTheLockOwnerOfTheFile( |
| 77 |
FileName: LPCWSTR, |
| 78 |
LockOwnerName: PWSTR, |
| 79 |
LockOwnerNameLengthInBytes: PULONG, |
| 80 |
) -> DWORD; |
| 81 |
pub fn DavGetExtendedError( |
| 82 |
hFile: HANDLE, |
| 83 |
ExtError: *mut DWORD, |
| 84 |
ExtErrorString: LPWSTR, |
| 85 |
cChSize: *mut DWORD, |
| 86 |
) -> DWORD; |
| 87 |
pub fn DavFlushFile( |
| 88 |
hFile: HANDLE, |
| 89 |
) -> DWORD; |
| 90 |
pub fn DavInvalidateCache( |
| 91 |
URLName: LPWSTR, |
| 92 |
) -> DWORD; |
| 93 |
pub fn DavCancelConnectionsToServer( |
| 94 |
URLName: LPWSTR, |
| 95 |
fForce: BOOL, |
| 96 |
) -> DWORD; |
| 97 |
pub fn DavRegisterAuthCallback( |
| 98 |
CallBack: PFNDAVAUTHCALLBACK, |
| 99 |
Version: ULONG, |
| 100 |
) -> OPAQUE_HANDLE; |
| 101 |
pub fn DavUnregisterAuthCallback( |
| 102 |
hCallback: OPAQUE_HANDLE, |
| 103 |
); |
| 104 |
} |