ReactOS 0.4.15-dev-8109-gd7be748
qmgr.h
Go to the documentation of this file.
1/*
2 * Queue Manager definitions
3 *
4 * Copyright 2007 Google (Roy Shea)
5 *
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.
10 *
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.
15 *
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
19 */
20
21#ifndef __QMGR_H__
22#define __QMGR_H__
23
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"
31
32#include <string.h>
33#include "wine/list.h"
34
35/* Background copy job vtbl and related data */
36typedef struct
37{
43 BG_JOB_TYPE type;
45 struct list files;
46 BG_JOB_PROGRESS jobProgress;
47 BG_JOB_STATE state;
50 BOOL callback2; /* IBackgroundCopyCallback2 is supported in addition to IBackgroundCopyCallback */
51 /* Protects file list, and progress */
53 struct list entryFromQmgr;
54 struct
55 {
58 BG_AUTH_CREDENTIALS creds[BG_AUTH_TARGET_PROXY][BG_AUTH_SCHEME_PASSPORT];
59 } http_options;
60 struct
61 {
62 BG_ERROR_CONTEXT context;
70
71/* Background copy file vtbl and related data */
72typedef struct
73{
76 BG_FILE_INFO info;
77 BG_FILE_PROGRESS fileProgress;
78 WCHAR tempFileName[MAX_PATH];
79 struct list entryFromJob;
83
84/* Background copy manager vtbl and related data */
85typedef struct
86{
88 /* Protects job list, job states, and jobEvent */
91 struct list jobs;
93
94typedef struct
95{
96 IClassFactory IClassFactory_iface;
98
102
109 LPCWSTR remoteName, LPCWSTR localName,
116
117/* Little helper functions */
118static inline WCHAR *strdupW(const WCHAR *src)
119{
120 WCHAR *dst = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(src) + 1) * sizeof(WCHAR));
121 if (dst) lstrcpyW(dst, src);
122 return dst;
123}
124
125static inline WCHAR *co_strdupW(const WCHAR *src)
126{
127 WCHAR *dst = CoTaskMemAlloc((lstrlenW(src) + 1) * sizeof(WCHAR));
128 if (dst) lstrcpyW(dst, src);
129 return dst;
130}
131
132static inline HRESULT return_strval(const WCHAR *str, WCHAR **ret)
133{
134 int len;
135
136 if (!ret) return E_INVALIDARG;
137
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;
143}
144
145#endif /* __QMGR_H__ */
Definition: list.h:37
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
BackgroundCopyManagerImpl globalMgr
Definition: qmgr.c:26
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define S_OK
Definition: intsafe.h:52
#define error(str)
Definition: mkdosfs.c:1605
static HANDLE job
Definition: process.c:77
HANDLE stop_event
Definition: nfs41_daemon.c:55
long LONG
Definition: pedump.c:60
ClassFactoryImpl BITS_ClassFactory
Definition: factory.c:88
static HRESULT return_strval(const WCHAR *str, WCHAR **ret)
Definition: qmgr.h:132
DWORD WINAPI fileTransfer(void *param) DECLSPEC_HIDDEN
Definition: qmgr.c:148
HANDLE stop_event DECLSPEC_HIDDEN
Definition: qmgr.h:100
HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner, LPCWSTR remoteName, LPCWSTR localName, BackgroundCopyFileImpl **file) DECLSPEC_HIDDEN
Definition: file.c:162
HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl *, IEnumBackgroundCopyFiles **) DECLSPEC_HIDDEN
Definition: enum_files.c:183
void processJob(BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN
Definition: job.c:1265
static WCHAR * co_strdupW(const WCHAR *src)
Definition: qmgr.h:125
BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) DECLSPEC_HIDDEN
Definition: job.c:30
BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN
Definition: file.c:477
HRESULT BackgroundCopyManagerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN
Definition: qmgr.c:141
static WCHAR * strdupW(const WCHAR *src)
Definition: qmgr.h:118
HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCopyJobs **enumjob) DECLSPEC_HIDDEN
Definition: enum_jobs.c:179
HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID *pJobId, BackgroundCopyJobImpl **job) DECLSPEC_HIDDEN
Definition: job.c:1197
const WCHAR * str
CardRegion * from
Definition: spigame.cpp:19
BG_FILE_PROGRESS fileProgress
Definition: qmgr.h:77
BG_FILE_INFO info
Definition: qmgr.h:76
BackgroundCopyJobImpl * owner
Definition: qmgr.h:80
IBackgroundCopyFile2 IBackgroundCopyFile2_iface
Definition: qmgr.h:74
IBackgroundCopyFile2 * file
Definition: qmgr.h:64
BG_ERROR_CONTEXT context
Definition: qmgr.h:62
IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface
Definition: qmgr.h:39
LPWSTR displayName
Definition: qmgr.h:41
IBackgroundCopyJob3 IBackgroundCopyJob3_iface
Definition: qmgr.h:38
BG_JOB_PROGRESS jobProgress
Definition: qmgr.h:46
BG_JOB_STATE state
Definition: qmgr.h:47
WCHAR * headers
Definition: qmgr.h:56
ULONG notify_flags
Definition: qmgr.h:48
CRITICAL_SECTION cs
Definition: qmgr.h:52
LPWSTR description
Definition: qmgr.h:42
IBackgroundCopyCallback2 * callback
Definition: qmgr.h:49
BG_JOB_TYPE type
Definition: qmgr.h:43
HRESULT code
Definition: qmgr.h:63
IBackgroundCopyManager IBackgroundCopyManager_iface
Definition: qmgr.h:87
CRITICAL_SECTION cs
Definition: qmgr.h:89
Definition: fci.c:127
char displayName[]
Definition: tftpd.cpp:35
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185