wined3d: Pass a wined3d_device_context to wined3d_cs_emit_blt_sub_resource().
[wine/zf.git] / dlls / qmgr / qmgr.h
blobde808049ea397605a9a6a19b20be33f276a223f4
1 /*
2 * Queue Manager definitions
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
21 #ifndef __QMGR_H__
22 #define __QMGR_H__
24 #include "windef.h"
25 #define COBJMACROS
26 #include "bits.h"
27 #include "bits1_5.h"
28 #include "bits2_0.h"
29 #include "bits2_5.h"
30 #include "bits3_0.h"
32 #include <string.h>
33 #include "wine/list.h"
35 /* Background copy job vtbl and related data */
36 typedef struct
38 IBackgroundCopyJob4 IBackgroundCopyJob4_iface;
39 IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface;
40 LONG ref;
41 LPWSTR displayName;
42 LPWSTR description;
43 BG_JOB_TYPE type;
44 GUID jobId;
45 struct list files;
46 BG_JOB_PROGRESS jobProgress;
47 BG_JOB_STATE state;
48 ULONG notify_flags;
49 IBackgroundCopyCallback2 *callback;
50 BOOL callback2; /* IBackgroundCopyCallback2 is supported in addition to IBackgroundCopyCallback */
51 /* Protects file list, and progress */
52 CRITICAL_SECTION cs;
53 struct list entryFromQmgr;
54 struct
56 WCHAR *headers;
57 ULONG flags;
58 BG_AUTH_CREDENTIALS creds[BG_AUTH_TARGET_PROXY][BG_AUTH_SCHEME_PASSPORT];
59 } http_options;
60 struct
62 BG_ERROR_CONTEXT context;
63 HRESULT code;
64 IBackgroundCopyFile2 *file;
65 } error;
66 HANDLE wait;
67 HANDLE cancel;
68 HANDLE done;
69 } BackgroundCopyJobImpl;
71 /* Background copy file vtbl and related data */
72 typedef struct
74 IBackgroundCopyFile2 IBackgroundCopyFile2_iface;
75 LONG ref;
76 BG_FILE_INFO info;
77 BG_FILE_PROGRESS fileProgress;
78 WCHAR tempFileName[MAX_PATH];
79 struct list entryFromJob;
80 BackgroundCopyJobImpl *owner;
81 DWORD read_size;
82 } BackgroundCopyFileImpl;
84 /* Background copy manager vtbl and related data */
85 typedef struct
87 IBackgroundCopyManager IBackgroundCopyManager_iface;
88 /* Protects job list, job states, and jobEvent */
89 CRITICAL_SECTION cs;
90 HANDLE jobEvent;
91 struct list jobs;
92 } BackgroundCopyManagerImpl;
94 typedef struct
96 IClassFactory IClassFactory_iface;
97 } ClassFactoryImpl;
99 extern HANDLE stop_event DECLSPEC_HIDDEN;
100 extern ClassFactoryImpl BITS_ClassFactory DECLSPEC_HIDDEN;
101 extern BackgroundCopyManagerImpl globalMgr DECLSPEC_HIDDEN;
103 HRESULT BackgroundCopyManagerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN;
104 HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
105 GUID *pJobId, BackgroundCopyJobImpl **job) DECLSPEC_HIDDEN;
106 HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr,
107 IEnumBackgroundCopyJobs **enumjob) DECLSPEC_HIDDEN;
108 HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
109 LPCWSTR remoteName, LPCWSTR localName,
110 BackgroundCopyFileImpl **file) DECLSPEC_HIDDEN;
111 HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl*, IEnumBackgroundCopyFiles**) DECLSPEC_HIDDEN;
112 DWORD WINAPI fileTransfer(void *param) DECLSPEC_HIDDEN;
113 void processJob(BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN;
114 BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN;
115 BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) DECLSPEC_HIDDEN;
117 /* Little helper functions */
118 static inline WCHAR *strdupW(const WCHAR *src)
120 WCHAR *dst = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(src) + 1) * sizeof(WCHAR));
121 if (dst) lstrcpyW(dst, src);
122 return dst;
125 static inline WCHAR *co_strdupW(const WCHAR *src)
127 WCHAR *dst = CoTaskMemAlloc((lstrlenW(src) + 1) * sizeof(WCHAR));
128 if (dst) lstrcpyW(dst, src);
129 return dst;
132 static inline HRESULT return_strval(const WCHAR *str, WCHAR **ret)
134 int len;
136 if (!ret) return E_INVALIDARG;
138 len = lstrlenW(str);
139 *ret = CoTaskMemAlloc((len+1)*sizeof(WCHAR));
140 if (!*ret) return E_OUTOFMEMORY;
141 lstrcpyW(*ret, str);
142 return S_OK;
145 #endif /* __QMGR_H__ */