ReactOS  0.4.14-dev-991-g696cdc6
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 */
36 typedef 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;
65  } error;
70 
71 /* Background copy file vtbl and related data */
72 typedef 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 */
85 typedef struct
86 {
88  /* Protects job list, job states, and jobEvent */
91  struct list jobs;
93 
94 typedef struct
95 {
96  IClassFactory IClassFactory_iface;
98 
102 
109  LPCWSTR remoteName, LPCWSTR localName,
115 BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) DECLSPEC_HIDDEN;
116 
117 /* Little helper functions */
118 static 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 
125 static 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 
132 static 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__ */
IBackgroundCopyJob3 IBackgroundCopyJob3_iface
Definition: qmgr.h:38
static HANDLE job
Definition: process.c:77
HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl *, IEnumBackgroundCopyFiles **) DECLSPEC_HIDDEN
Definition: enum_files.c:183
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
void processJob(BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN
Definition: job.c:1265
BG_JOB_PROGRESS jobProgress
Definition: qmgr.h:46
BackgroundCopyManagerImpl globalMgr
Definition: qmgr.c:26
CRITICAL_SECTION cs
Definition: qmgr.h:89
BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN
Definition: file.c:477
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
char displayName[]
Definition: tftpd.cpp:35
#define lstrlenW
Definition: compat.h:415
CRITICAL_SECTION cs
Definition: qmgr.h:52
HANDLE stop_event
Definition: nfs41_daemon.c:55
HRESULT code
Definition: qmgr.h:63
LPWSTR description
Definition: qmgr.h:42
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static HRESULT return_strval(const WCHAR *str, WCHAR **ret)
Definition: qmgr.h:132
WCHAR * headers
Definition: qmgr.h:56
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
IBackgroundCopyManager IBackgroundCopyManager_iface
Definition: qmgr.h:87
BG_JOB_TYPE type
Definition: qmgr.h:43
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
ClassFactoryImpl BITS_ClassFactory
Definition: factory.c:88
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
LPWSTR displayName
Definition: qmgr.h:41
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:6
IBackgroundCopyCallback2 * callback
Definition: qmgr.h:49
unsigned long DWORD
Definition: ntddk_ex.h:95
BG_ERROR_CONTEXT context
Definition: qmgr.h:62
IBackgroundCopyFile2 IBackgroundCopyFile2_iface
Definition: qmgr.h:74
HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID *pJobId, BackgroundCopyJobImpl **job) DECLSPEC_HIDDEN
Definition: job.c:1197
HANDLE stop_event DECLSPEC_HIDDEN
Definition: qmgr.h:100
int ret
IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface
Definition: qmgr.h:39
GLenum GLsizei len
Definition: glext.h:6722
Definition: _list.h:228
GLenum src
Definition: glext.h:6340
DWORD WINAPI fileTransfer(void *param) DECLSPEC_HIDDEN
Definition: qmgr.c:148
BG_FILE_PROGRESS fileProgress
Definition: qmgr.h:77
ULONG notify_flags
Definition: qmgr.h:48
HRESULT BackgroundCopyManagerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN
Definition: qmgr.c:141
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
GLenum GLenum dst
Definition: glext.h:6340
HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCopyJobs **enumjob) DECLSPEC_HIDDEN
Definition: enum_jobs.c:179
HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner, LPCWSTR remoteName, LPCWSTR localName, BackgroundCopyFileImpl **file) DECLSPEC_HIDDEN
Definition: file.c:162
static WCHAR * strdupW(const WCHAR *src)
Definition: qmgr.h:118
BackgroundCopyJobImpl * owner
Definition: qmgr.h:80
BG_FILE_INFO info
Definition: qmgr.h:76
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
CardRegion * from
Definition: spigame.cpp:19
BG_JOB_STATE state
Definition: qmgr.h:47
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) DECLSPEC_HIDDEN
Definition: job.c:30
static WCHAR * co_strdupW(const WCHAR *src)
Definition: qmgr.h:125
struct ClassFactoryImpl ClassFactoryImpl
Definition: fci.c:126
IBackgroundCopyFile2 * file
Definition: qmgr.h:64