// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 > or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT >, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
use shared::basetsd::UINT64;
use shared::guiddef::{GUID, REFGUID};
use shared::minwindef::{BOOL, DWORD, FILETIME, ULONG};
use um::unknwnbase::{IUnknown, IUnknownVtbl};
use um::winnt::{HRESULT, LPCWSTR, LPWSTR, WCHAR};
RIDL!{
#[ uuid(
0 x4991d34b,
0 x80a1,
0 x4291,
0 x83,
0 xb6,
0 x33,
0 x28,
0 x36,
0 x6b,
0 x90,
0 x97)]
class BackgroundCopyManager;}
pub const BG_SIZE_UNKNOWN: UINT64 = -
1 i64
as u64;
STRUCT !{
struct BG_FILE_PROGRESS {
BytesTotal: UINT64,
BytesTransferred: UINT64,
Completed: BOOL,
}}
RIDL!{
#[ uuid(
0 x01b7bd23,
0 xfb88,
0 x4a77,
0 x84,
0 x90,
0 x58,
0 x91,
0 xd3,
0 xe4,
0 x65,
0 x3a)]
interface IBackgroundCopyFile(IBackgroundCopyFileVtbl): IUnknown(IUnknownVtbl) {
fn GetRemoteName(
pVal: *
mut LPWSTR,
) -> HRESULT,
fn GetLocalName(
pVal: *
mut LPWSTR,
) -> HRESULT,
fn GetProgress(
pVal: *
mut BG_FILE_PROGRESS,
) -> HRESULT,
}}
RIDL!{
#[ uuid(
0 xca51e165,
0 xc365,
0 x424c,
0 x8d,
0 x41,
0 x24,
0 xaa,
0 xa4,
0 xff,
0 x3c,
0 x40)]
interface IEnumBackgroundCopyFiles(IEnumBackgroundCopyFilesVtbl): IUnknown(IUnknow
nVtbl) {
fn Next(
celt: ULONG,
rgelt: *mut *mut IBackgroundCopyFile,
pceltFetched: *mut ULONG,
) -> HRESULT,
fn Skip(
celt: ULONG,
) -> HRESULT,
fn Reset() -> HRESULT,
fn Clone(
ppenum: *mut *mut IEnumBackgroundCopyFiles,
) -> HRESULT,
fn GetCount(
puCount: *mut ULONG,
) -> HRESULT,
}}
ENUM !{enum BG_ERROR_CONTEXT {
BG_ERROR_CONTEXT_NONE = 0 ,
BG_ERROR_CONTEXT_UNKNOWN = 1 ,
BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER = 2 ,
BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION = 3 ,
BG_ERROR_CONTEXT_LOCAL_FILE = 4 ,
BG_ERROR_CONTEXT_REMOTE_FILE = 5 ,
BG_ERROR_CONTEXT_GENERAL_TRANSPORT = 6 ,
BG_ERROR_CONTEXT_REMOTE_APPLICATION = 7 ,
}}
RIDL!{#[ uuid(0 x19c613a0, 0 xfcb8, 0 x4f28, 0 x81, 0 xae, 0 x89, 0 x7c, 0 x3d, 0 x07, 0 x8f, 0 x81)]
interface IBackgroundCopyError(IBackgroundCopyErrorVtbl): IUnknown(IUnknownVtbl) {
fn GetError(
pContext: *mut BG_ERROR_CONTEXT,
pCode: *mut HRESULT,
) -> HRESULT,
fn GetFile(
pVal: *mut *mut IBackgroundCopyFile,
) -> HRESULT,
fn GetErrorDescription(
LanguageId: DWORD,
pErrorDescription: *mut LPWSTR,
) -> HRESULT,
fn GetErrorContextDescription(
LanguageId: DWORD,
pContextDescription: *mut LPWSTR,
) -> HRESULT,
fn GetProtocol(
pProtocol: *mut LPWSTR,
) -> HRESULT,
}}
STRUCT !{struct BG_FILE_INFO {
RemoteName: LPWSTR,
LocalName: LPWSTR,
}}
STRUCT !{struct BG_JOB_PROGRESS {
BytesTotal: UINT64,
BytesTransferred: UINT64,
FilesTotal: ULONG,
FilesTransferred: ULONG,
}}
STRUCT !{struct BG_JOB_TIMES {
CreationTime: FILETIME,
ModificationTime: FILETIME,
TransferCompletionTime: FILETIME,
}}
ENUM !{enum BG_JOB_PRIORITY {
BG_JOB_PRIORITY_FOREGROUND = 0 ,
BG_JOB_PRIORITY_HIGH = BG_JOB_PRIORITY_FOREGROUND + 1 ,
BG_JOB_PRIORITY_NORMAL = BG_JOB_PRIORITY_HIGH + 1 ,
BG_JOB_PRIORITY_LOW = BG_JOB_PRIORITY_NORMAL + 1 ,
}}
ENUM !{enum BG_JOB_STATE {
BG_JOB_STATE_QUEUED = 0 ,
BG_JOB_STATE_CONNECTING = BG_JOB_STATE_QUEUED + 1 ,
BG_JOB_STATE_TRANSFERRING = BG_JOB_STATE_CONNECTING + 1 ,
BG_JOB_STATE_SUSPENDED = BG_JOB_STATE_TRANSFERRING + 1 ,
BG_JOB_STATE_ERROR = BG_JOB_STATE_SUSPENDED + 1 ,
BG_JOB_STATE_TRANSIENT_ERROR = BG_JOB_STATE_ERROR + 1 ,
BG_JOB_STATE_TRANSFERRED = BG_JOB_STATE_TRANSIENT_ERROR + 1 ,
BG_JOB_STATE_ACKNOWLEDGED = BG_JOB_STATE_TRANSFERRED + 1 ,
BG_JOB_STATE_CANCELLED = BG_JOB_STATE_ACKNOWLEDGED + 1 ,
}}
ENUM !{enum BG_JOB_TYPE {
BG_JOB_TYPE_DOWNLOAD = 0 ,
BG_JOB_TYPE_UPLOAD = BG_JOB_TYPE_DOWNLOAD + 1 ,
BG_JOB_TYPE_UPLOAD_REPLY = BG_JOB_TYPE_UPLOAD + 1 ,
}}
ENUM !{enum BG_JOB_PROXY_USAGE {
BG_JOB_PROXY_USAGE_PRECONFIG = 0 ,
BG_JOB_PROXY_USAGE_NO_PROXY = BG_JOB_PROXY_USAGE_PRECONFIG + 1 ,
BG_JOB_PROXY_USAGE_OVERRIDE = BG_JOB_PROXY_USAGE_NO_PROXY + 1 ,
BG_JOB_PROXY_USAGE_AUTODETECT = BG_JOB_PROXY_USAGE_OVERRIDE + 1 ,
}}
RIDL!{#[ uuid(0 x37668d37, 0 x507e, 0 x4160, 0 x93, 0 x16, 0 x26, 0 x30, 0 x6d, 0 x15, 0 x0b, 0 x12)]
interface IBackgroundCopyJob(IBackgroundCopyJobVtbl): IUnknown(IUnknownVtbl) {
fn AddFileSet(
cFileCount: ULONG,
pFileSet: *mut BG_FILE_INFO,
) -> HRESULT,
fn AddFile(
RemoteUrl: LPCWSTR,
LocalName: LPCWSTR,
) -> HRESULT,
fn EnumFiles(
pErrorDescription: *mut *mut IEnumBackgroundCopyFiles,
) -> HRESULT,
fn Suspend() -> HRESULT,
fn Resume() -> HRESULT,
fn Cancel() -> HRESULT,
fn Complete() -> HRESULT,
fn GetId(
pVal: *mut GUID,
) -> HRESULT,
fn GetType(
pVal: *mut BG_JOB_TYPE,
) -> HRESULT,
fn GetProgress(
pVal: *mut BG_JOB_PROGRESS,
) -> HRESULT,
fn GetTimes(
pVal: *mut BG_JOB_TIMES,
) -> HRESULT,
fn GetState(
pVal: *mut BG_JOB_STATE,
) -> HRESULT,
fn GetError(
ppError: *mut *mut IBackgroundCopyError,
) -> HRESULT,
fn GetOwner(
pVal: *mut LPWSTR,
) -> HRESULT,
fn SetDisplayName(
Val: LPCWSTR,
) -> HRESULT,
fn GetDisplayName(
pVal: *mut LPWSTR,
) -> HRESULT,
fn SetDescription(
Val: LPCWSTR,
) -> HRESULT,
fn GetDescription(
pVal: *mut LPWSTR,
) -> HRESULT,
fn SetPriority(
Val: BG_JOB_PRIORITY,
) -> HRESULT,
fn GetPriority(
pVal: *mut BG_JOB_PRIORITY,
) -> HRESULT,
fn SetNotifyFlags(
Val: ULONG,
) -> HRESULT,
fn GetNotifyFlags(
pVal: *mut ULONG,
) -> HRESULT,
fn SetNotifyInterface(
Val: *mut IUnknown,
) -> HRESULT,
fn GetNotifyInterface(
pVal: *mut *mut IUnknown,
) -> HRESULT,
fn SetMinimumRetryDelay(
Seconds: ULONG,
) -> HRESULT,
fn GetMinimumRetryDelay(
Seconds: *mut ULONG,
) -> HRESULT,
fn SetNoProgressTimeout(
Seconds: ULONG,
) -> HRESULT,
fn GetNoProgressTimeout(
Seconds: *mut ULONG,
) -> HRESULT,
fn GetErrorCount(
Errors: *mut ULONG,
) -> HRESULT,
fn SetProxySettings(
ProxyUsage: BG_JOB_PROXY_USAGE,
ProxyList: *const WCHAR,
ProxyBypassList: *const WCHAR,
) -> HRESULT,
fn GetProxySettings(
pProxyUsage: *mut BG_JOB_PROXY_USAGE,
pProxyList: *mut LPWSTR,
pProxyBypassListpProxyList: *mut LPWSTR,
) -> HRESULT,
fn TakeOwnership() -> HRESULT,
}}
RIDL!{#[ uuid(0 x1af4f612, 0 x3b71, 0 x466f, 0 x8f, 0 x58, 0 x7b, 0 x6f, 0 x73, 0 xac, 0 x57, 0 xad)]
interface IEnumBackgroundCopyJobs(IEnumBackgroundCopyJobsVtbl): IUnknown(IUnknownVtbl) {
fn Next(
celt: ULONG,
rgelt: *mut *mut IBackgroundCopyJob,
pceltFetched: *mut ULONG,
) -> HRESULT,
fn Skip(
celt: ULONG,
) -> HRESULT,
fn Reset() -> HRESULT,
fn Clone(
ppenum: *mut *mut IEnumBackgroundCopyJobs,
) -> HRESULT,
fn GetCount(
puCount: *mut ULONG,
) -> HRESULT,
}}
pub const BG_NOTIFY_JOB_TRANSFERRED: DWORD = 0 x0001;
pub const BG_NOTIFY_JOB_ERROR: DWORD = 0 x0002;
pub const BG_NOTIFY_DISABLE: DWORD = 0 x0004;
pub const BG_NOTIFY_JOB_MODIFICATION: DWORD = 0 x0008;
pub const BG_NOTIFY_FILE_TRANSFERRED: DWORD = 0 x0010;
pub const BG_NOTIFY_FILE_RANGES_TRANSFERRED: DWORD = 0 x0020;
RIDL!{#[ uuid(0 x97ea99c7, 0 x0186, 0 x4ad4, 0 x8d, 0 xf9, 0 xc5, 0 xb4, 0 xe0, 0 xed, 0 x6b, 0 x22)]
interface IBackgroundCopyCallback(IBackgroundCopyCallbackVtbl): IUnknown(IUnknownVtbl) {
fn JobTransferred(
pJob: *mut IBackgroundCopyJob,
) -> HRESULT,
fn JobError(
pJob: *mut IBackgroundCopyJob,
pError: *mut IBackgroundCopyError,
) -> HRESULT,
fn JobModification(
pJob: *mut IBackgroundCopyJob,
dwReserved: DWORD,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 xca29d251, 0 xb4bb, 0 x4679, 0 xa3, 0 xd9, 0 xae, 0 x80, 0 x06, 0 x11, 0 x9d, 0 x54)]
interface AsyncIBackgroundCopyCallback(AsyncIBackgroundCopyCallbackVtbl): IUnknown(IUnknownVtbl) {
fn Begin_JobTransferred(
pJob: *mut IBackgroundCopyJob,
) -> HRESULT,
fn Finish_JobTransferred() -> HRESULT,
fn Begin_JobError(
pJob: *mut IBackgroundCopyJob,
pError: *mut IBackgroundCopyError,
) -> HRESULT,
fn Finish_JobError() -> HRESULT,
fn Begin_JobModification(
pJob: *mut IBackgroundCopyJob,
dwReserved: DWORD,
) -> HRESULT,
fn Finish_JobModification() -> HRESULT,
}}
pub const BG_JOB_ENUM_ALL_USERS: DWORD = 0 x0001;
RIDL!{#[ uuid(0 x5ce34c0d, 0 x0dc9, 0 x4c1f, 0 x89, 0 x7c, 0 xda, 0 xa1, 0 xb7, 0 x8c, 0 xee, 0 x7c)]
interface IBackgroundCopyManager(IBackgroundCopyManagerVtbl): IUnknown(IUnknownVtbl) {
fn CreateJob(
DisplayName: LPCWSTR,
Type : BG_JOB_TYPE,
pJobId: *mut GUID,
ppJob: *mut *mut IBackgroundCopyJob,
) -> HRESULT,
fn GetJob(
jobID: REFGUID,
ppJob: *mut *mut IBackgroundCopyJob,
) -> HRESULT,
fn EnumJobs(
dwFlags: DWORD,
ppEnum: *mut *mut IEnumBackgroundCopyJobs,
) -> HRESULT,
fn GetErrorDescription(
hResult: HRESULT,
LanguageId: DWORD,
pErrorDescription: *mut LPWSTR,
) -> HRESULT,
}}
Messung V0.5 in Prozent C=98 H=100 G=98
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-18)
¤
*© Formatika GbR, Deutschland