ReactOS 0.4.17-dev-966-gf06eace
qmgr.h File Reference
#include "windef.h"
#include "bits.h"
#include "bits1_5.h"
#include "bits2_0.h"
#include "bits2_5.h"
#include "bits3_0.h"
#include <string.h>
#include "wine/list.h"
Include dependency graph for qmgr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BackgroundCopyJobImpl
 
struct  BackgroundCopyFileImpl
 
struct  BackgroundCopyManagerImpl
 
struct  ClassFactoryImpl
 

Macros

#define COBJMACROS
 

Functions

HRESULT BackgroundCopyManagerConstructor (LPVOID *ppObj)
 
HRESULT BackgroundCopyJobConstructor (LPCWSTR displayName, BG_JOB_TYPE type, GUID *pJobId, BackgroundCopyJobImpl **job)
 
HRESULT enum_copy_job_create (BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCopyJobs **enumjob)
 
HRESULT BackgroundCopyFileConstructor (BackgroundCopyJobImpl *owner, LPCWSTR remoteName, LPCWSTR localName, BackgroundCopyFileImpl **file)
 
HRESULT EnumBackgroundCopyFilesConstructor (BackgroundCopyJobImpl *, IEnumBackgroundCopyFiles **)
 
DWORD WINAPI fileTransfer (void *param)
 
void processJob (BackgroundCopyJobImpl *job)
 
BOOL processFile (BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job)
 
BOOL transitionJobState (BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to)
 
static WCHAR * co_strdupW (const WCHAR *src)
 
static HRESULT return_strval (const WCHAR *str, WCHAR **ret)
 

Variables

HANDLE stop_event
 
ClassFactoryImpl BITS_ClassFactory
 
BackgroundCopyManagerImpl globalMgr
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 25 of file qmgr.h.

Function Documentation

◆ BackgroundCopyFileConstructor()

HRESULT BackgroundCopyFileConstructor ( BackgroundCopyJobImpl *  owner,
LPCWSTR  remoteName,
LPCWSTR  localName,
BackgroundCopyFileImpl **  file 
)

Definition at line 162 of file file.c.

165{
167
168 TRACE("(%s, %s, %p)\n", debugstr_w(remoteName), debugstr_w(localName), file);
169
170 This = calloc(1, sizeof(*This));
171 if (!This)
172 return E_OUTOFMEMORY;
173
174 This->info.RemoteName = wcsdup(remoteName);
175 if (!This->info.RemoteName)
176 {
177 free(This);
178 return E_OUTOFMEMORY;
179 }
180
181 This->info.LocalName = wcsdup(localName);
182 if (!This->info.LocalName)
183 {
184 free(This->info.RemoteName);
185 free(This);
186 return E_OUTOFMEMORY;
187 }
188
189 This->IBackgroundCopyFile2_iface.lpVtbl = &BackgroundCopyFile2Vtbl;
190 This->ref = 1;
191 This->fileProgress.BytesTotal = BG_SIZE_UNKNOWN;
192 This->owner = owner;
193 IBackgroundCopyJob4_AddRef(&owner->IBackgroundCopyJob4_iface);
194
195 *file = This;
196 return S_OK;
197}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
static const IBackgroundCopyFile2Vtbl BackgroundCopyFile2Vtbl
Definition: file.c:150
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4
IBackgroundCopyJob4 IBackgroundCopyJob4_iface
Definition: qmgr.h:38
Definition: fci.c:123

Referenced by BackgroundCopyJob_AddFileSet().

◆ BackgroundCopyJobConstructor()

HRESULT BackgroundCopyJobConstructor ( LPCWSTR  displayName,
BG_JOB_TYPE  type,
GUID *  pJobId,
BackgroundCopyJobImpl **  job 
)

Definition at line 1135 of file job.c.

1136{
1137 HRESULT hr;
1139
1140 TRACE("(%s,%d,%p)\n", debugstr_w(displayName), type, job);
1141
1142 This = malloc(sizeof(*This));
1143 if (!This)
1144 return E_OUTOFMEMORY;
1145
1146 This->IBackgroundCopyJob4_iface.lpVtbl = &BackgroundCopyJobVtbl;
1147 This->IBackgroundCopyJobHttpOptions_iface.lpVtbl = &http_options_vtbl;
1149 This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BackgroundCopyJobImpl.cs");
1150
1151 This->ref = 1;
1152 This->type = type;
1153
1154 This->displayName = wcsdup(displayName);
1155 if (!This->displayName)
1156 {
1157 This->cs.DebugInfo->Spare[0] = 0;
1159 free(This);
1160 return E_OUTOFMEMORY;
1161 }
1162
1163 hr = CoCreateGuid(&This->jobId);
1164 if (FAILED(hr))
1165 {
1166 This->cs.DebugInfo->Spare[0] = 0;
1168 free(This->displayName);
1169 free(This);
1170 return hr;
1171 }
1172 *job_id = This->jobId;
1173
1174 list_init(&This->files);
1175 This->jobProgress.BytesTotal = 0;
1176 This->jobProgress.BytesTransferred = 0;
1177 This->jobProgress.FilesTotal = 0;
1178 This->jobProgress.FilesTransferred = 0;
1179
1180 This->state = BG_JOB_STATE_SUSPENDED;
1181 This->description = NULL;
1182 This->notify_flags = BG_NOTIFY_JOB_ERROR | BG_NOTIFY_JOB_TRANSFERRED;
1183 This->callback = NULL;
1184 This->callback2 = FALSE;
1185
1186 This->error.context = 0;
1187 This->error.code = S_OK;
1188 This->error.file = NULL;
1189
1190 memset(&This->http_options, 0, sizeof(This->http_options));
1191
1192 This->wait = CreateEventW(NULL, FALSE, FALSE, NULL);
1193 This->cancel = CreateEventW(NULL, FALSE, FALSE, NULL);
1194 This->done = CreateEventW(NULL, FALSE, FALSE, NULL);
1195
1196 *job = This;
1197
1198 TRACE("created job %s:%p\n", debugstr_guid(&This->jobId), This);
1199
1200 return S_OK;
1201}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
HRESULT WINAPI CoCreateGuid(GUID *guid)
Definition: combase.c:1016
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
static const IBackgroundCopyJob4Vtbl BackgroundCopyJobVtbl
Definition: job.c:913
static const IBackgroundCopyJobHttpOptionsVtbl http_options_vtbl
Definition: job.c:1120
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
static HANDLE job
Definition: process.c:79
#define memset(x, y, z)
Definition: compat.h:39
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
char displayName[]
Definition: tftpd.cpp:35
#define DWORD_PTR
Definition: treelist.c:76
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156

Referenced by BackgroundCopyManager_CreateJob().

◆ BackgroundCopyManagerConstructor()

HRESULT BackgroundCopyManagerConstructor ( LPVOID *  ppObj)

Definition at line 141 of file qmgr.c.

142{
143 TRACE("(%p)\n", ppObj);
144 *ppObj = &globalMgr;
145 return S_OK;
146}
BackgroundCopyManagerImpl globalMgr
Definition: qmgr.c:26

Referenced by BITS_IClassFactory_CreateInstance().

◆ co_strdupW()

static WCHAR * co_strdupW ( const WCHAR *  src)
inlinestatic

Definition at line 118 of file qmgr.h.

119{
120 WCHAR *dst = CoTaskMemAlloc((lstrlenW(src) + 1) * sizeof(WCHAR));
121 if (dst) lstrcpyW(dst, src);
122 return dst;
123}
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
short WCHAR
Definition: pedump.c:58

◆ enum_copy_job_create()

HRESULT enum_copy_job_create ( BackgroundCopyManagerImpl *  qmgr,
IEnumBackgroundCopyJobs **  enumjob 
)

Definition at line 177 of file enum_jobs.c.

178{
181 ULONG i;
182
183 TRACE("%p, %p)\n", qmgr, enumjob);
184
185 This = malloc(sizeof(*This));
186 if (!This)
187 return E_OUTOFMEMORY;
188 This->IEnumBackgroundCopyJobs_iface.lpVtbl = &EnumBackgroundCopyJobsVtbl;
189 This->ref = 1;
190
191 /* Create array of jobs */
192 This->indexJobs = 0;
193
194 EnterCriticalSection(&qmgr->cs);
195 This->numJobs = list_count(&qmgr->jobs);
196
197 if (0 < This->numJobs)
198 {
199 This->jobs = malloc(This->numJobs * sizeof *This->jobs);
200 if (!This->jobs)
201 {
202 LeaveCriticalSection(&qmgr->cs);
203 free(This);
204 return E_OUTOFMEMORY;
205 }
206 }
207 else
208 This->jobs = NULL;
209
210 i = 0;
211 LIST_FOR_EACH_ENTRY(job, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
212 {
213 IBackgroundCopyJob4_AddRef(&job->IBackgroundCopyJob4_iface);
214 This->jobs[i++] = &job->IBackgroundCopyJob4_iface;
215 }
216 LeaveCriticalSection(&qmgr->cs);
217
218 *enumjob = &This->IEnumBackgroundCopyJobs_iface;
219 return S_OK;
220}
static const IEnumBackgroundCopyJobsVtbl EnumBackgroundCopyJobsVtbl
Definition: enum_jobs.c:165
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:157
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
struct list jobs
Definition: qmgr.h:91
CRITICAL_SECTION cs
Definition: qmgr.h:89
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by BackgroundCopyManager_EnumJobs().

◆ EnumBackgroundCopyFilesConstructor()

HRESULT EnumBackgroundCopyFilesConstructor ( BackgroundCopyJobImpl *  job,
IEnumBackgroundCopyFiles **  enum_files 
)

Definition at line 183 of file enum_files.c.

184{
187 ULONG i;
188
189 TRACE("%p, %p)\n", job, enum_files);
190
191 This = malloc(sizeof(*This));
192 if (!This)
193 return E_OUTOFMEMORY;
194
195 This->IEnumBackgroundCopyFiles_iface.lpVtbl = &EnumBackgroundCopyFilesVtbl;
196 This->ref = 1;
197
198 /* Create array of files */
199 This->indexFiles = 0;
201 This->numFiles = list_count(&job->files);
202 This->files = NULL;
203 if (This->numFiles > 0)
204 {
205 This->files = malloc(This->numFiles * sizeof This->files[0]);
206 if (!This->files)
207 {
209 free(This);
210 return E_OUTOFMEMORY;
211 }
212 }
213
214 i = 0;
215 LIST_FOR_EACH_ENTRY(file, &job->files, BackgroundCopyFileImpl, entryFromJob)
216 {
217 IBackgroundCopyFile2_AddRef(&file->IBackgroundCopyFile2_iface);
218 This->files[i] = &file->IBackgroundCopyFile2_iface;
219 ++i;
220 }
222
223 *enum_files = &This->IEnumBackgroundCopyFiles_iface;
224 return S_OK;
225}
static const IEnumBackgroundCopyFilesVtbl EnumBackgroundCopyFilesVtbl
Definition: enum_files.c:171

Referenced by BackgroundCopyJob_EnumFiles().

◆ fileTransfer()

DWORD WINAPI fileTransfer ( void *  param)

Definition at line 148 of file qmgr.c.

149{
151 HANDLE events[2];
152
153 events[0] = stop_event;
154 events[1] = qmgr->jobEvent;
155
156 for (;;)
157 {
158 BackgroundCopyJobImpl *job, *jobCur;
159 BOOL haveJob = FALSE;
160
161 /* Check if it's the stop_event */
163 {
164 LIST_FOR_EACH_ENTRY_SAFE(job, jobCur, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
165 {
166 list_remove(&job->entryFromQmgr);
167 IBackgroundCopyJob4_Release(&job->IBackgroundCopyJob4_iface);
168 }
169 return 0;
170 }
171
172 /* Note that other threads may add files to the job list, but only
173 this thread ever deletes them so we don't need to worry about jobs
174 magically disappearing from the list. */
175 EnterCriticalSection(&qmgr->cs);
176
177 LIST_FOR_EACH_ENTRY_SAFE(job, jobCur, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
178 {
179 if (job->state == BG_JOB_STATE_ACKNOWLEDGED || job->state == BG_JOB_STATE_CANCELLED)
180 {
181 list_remove(&job->entryFromQmgr);
182 IBackgroundCopyJob4_Release(&job->IBackgroundCopyJob4_iface);
183 }
184 else if (job->state == BG_JOB_STATE_QUEUED)
185 {
186 haveJob = TRUE;
187 break;
188 }
189 else if (job->state == BG_JOB_STATE_CONNECTING
190 || job->state == BG_JOB_STATE_TRANSFERRING)
191 {
192 ERR("Invalid state for job %p: %d\n", job, job->state);
193 }
194 }
195
196 if (!haveJob)
197 ResetEvent(qmgr->jobEvent);
198
199 LeaveCriticalSection(&qmgr->cs);
200
201 if (haveJob)
203 }
204}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define ERR(fmt,...)
Definition: precomp.h:57
#define TRUE
Definition: types.h:120
void processJob(BackgroundCopyJobImpl *job)
Definition: job.c:1203
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE events[2]
Definition: event.c:4
HANDLE stop_event
Definition: nfs41_daemon.c:55
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
Definition: synch.c:151
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:650
#define WAIT_OBJECT_0
Definition: winbase.h:383

Referenced by ServiceMain().

◆ processFile()

BOOL processFile ( BackgroundCopyFileImpl *  file,
BackgroundCopyJobImpl *  job 
)

Definition at line 471 of file file.c.

472{
473 WCHAR tmpDir[MAX_PATH], tmpName[MAX_PATH];
476 BOOL ret;
477
478 if (!GetTempPathW(MAX_PATH, tmpDir))
479 {
480 ERR("Couldn't create temp file name: %ld\n", GetLastError());
481 /* Guessing on what state this should give us */
482 transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSIENT_ERROR);
483 return FALSE;
484 }
485
486 if (!GetTempFileNameW(tmpDir, L"BIT", 0, tmpName))
487 {
488 ERR("Couldn't create temp file: %ld\n", GetLastError());
489 /* Guessing on what state this should give us */
490 transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSIENT_ERROR);
491 return FALSE;
492 }
493
495 file->fileProgress.BytesTotal = BG_SIZE_UNKNOWN;
496 file->fileProgress.BytesTransferred = 0;
497 file->fileProgress.Completed = FALSE;
499
500 TRACE("Transferring: %s -> %s -> %s\n",
501 debugstr_w(file->info.RemoteName),
502 debugstr_w(tmpName),
503 debugstr_w(file->info.LocalName));
504
505 uc.dwStructSize = sizeof(uc);
506 uc.nScheme = 0;
507 uc.lpszScheme = NULL;
508 uc.dwSchemeLength = 0;
509 uc.lpszUserName = NULL;
510 uc.dwUserNameLength = 0;
511 uc.lpszPassword = NULL;
512 uc.dwPasswordLength = 0;
513 uc.lpszHostName = host;
515 uc.nPort = 0;
516 uc.lpszUrlPath = NULL;
517 uc.dwUrlPathLength = ~0u;
518 uc.lpszExtraInfo = NULL;
519 uc.dwExtraInfoLength = 0;
520 ret = WinHttpCrackUrl(file->info.RemoteName, 0, 0, &uc);
521 if (!ret)
522 {
523 TRACE("WinHttpCrackUrl failed, trying local file copy\n");
524 if (!transfer_file_local(file, tmpName)) WARN("local transfer failed\n");
525 }
526 else if (!transfer_file_http(file, &uc, tmpName)) WARN("HTTP transfer failed\n");
527
528 if (transitionJobState(job, BG_JOB_STATE_CONNECTING, BG_JOB_STATE_QUEUED) ||
529 transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_QUEUED))
530 {
531 lstrcpyW(file->tempFileName, tmpName);
532
534 file->fileProgress.Completed = TRUE;
535 job->jobProgress.FilesTransferred++;
537
538 return TRUE;
539 }
540 else
541 {
542 DeleteFileW(tmpName);
543 return FALSE;
544 }
545}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define WARN(fmt,...)
Definition: precomp.h:61
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
static BOOL transfer_file_local(BackgroundCopyFileImpl *file, const WCHAR *tmpname)
Definition: file.c:448
static BOOL transfer_file_http(BackgroundCopyFileImpl *file, URL_COMPONENTSW *uc, const WCHAR *tmpfile)
Definition: file.c:362
BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to)
Definition: job.c:30
BOOL WINAPI WinHttpCrackUrl(const WCHAR *url, DWORD len, DWORD flags, URL_COMPONENTSW *uc)
Definition: url.c:173
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
DWORD dwStructSize
Definition: wininet.h:211
DWORD dwUrlPathLength
Definition: wininet.h:223
DWORD dwExtraInfoLength
Definition: wininet.h:225
LPWSTR lpszPassword
Definition: wininet.h:220
LPWSTR lpszHostName
Definition: wininet.h:215
DWORD dwUserNameLength
Definition: wininet.h:219
DWORD dwHostNameLength
Definition: wininet.h:216
INTERNET_SCHEME nScheme
Definition: wininet.h:214
LPWSTR lpszScheme
Definition: wininet.h:212
LPWSTR lpszUserName
Definition: wininet.h:218
LPWSTR lpszUrlPath
Definition: wininet.h:222
LPWSTR lpszExtraInfo
Definition: wininet.h:224
DWORD dwPasswordLength
Definition: wininet.h:221
INTERNET_PORT nPort
Definition: wininet.h:217
DWORD dwSchemeLength
Definition: wininet.h:213
Definition: txthost.c:37
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by processJob().

◆ processJob()

void processJob ( BackgroundCopyJobImpl *  job)

Definition at line 1203 of file job.c.

1204{
1205 for (;;)
1206 {
1208 BOOL done = TRUE;
1209
1211 LIST_FOR_EACH_ENTRY(file, &job->files, BackgroundCopyFileImpl, entryFromJob)
1212 if (!file->fileProgress.Completed)
1213 {
1214 done = FALSE;
1215 break;
1216 }
1218 if (done)
1219 {
1220 transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSFERRED);
1221 if (job->callback && (job->notify_flags & BG_NOTIFY_JOB_TRANSFERRED))
1222 {
1223 TRACE("Calling JobTransferred -->\n");
1224 IBackgroundCopyCallback2_JobTransferred(job->callback, (IBackgroundCopyJob*)&job->IBackgroundCopyJob4_iface);
1225 TRACE("Called JobTransferred <--\n");
1226 }
1227 return;
1228 }
1229
1230 if (!processFile(file, job))
1231 return;
1232 }
1233}
BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job)
Definition: file.c:471

Referenced by fileTransfer().

◆ return_strval()

static HRESULT return_strval ( const WCHAR *  str,
WCHAR **  ret 
)
inlinestatic

Definition at line 125 of file qmgr.h.

126{
127 int len;
128
129 if (!ret) return E_INVALIDARG;
130
131 len = lstrlenW(str);
132 *ret = CoTaskMemAlloc((len+1)*sizeof(WCHAR));
133 if (!*ret) return E_OUTOFMEMORY;
134 lstrcpyW(*ret, str);
135 return S_OK;
136}
#define E_INVALIDARG
Definition: ddrawi.h:101
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str

Referenced by BackgroundCopyFile_GetLocalName(), BackgroundCopyFile_GetRemoteName(), BackgroundCopyJob_GetDescription(), and BackgroundCopyJob_GetDisplayName().

◆ transitionJobState()

BOOL transitionJobState ( BackgroundCopyJobImpl *  job,
BG_JOB_STATE  from,
BG_JOB_STATE  to 
)

Definition at line 30 of file job.c.

31{
32 BOOL ret = FALSE;
33
35 if (job->state == from)
36 {
37 job->state = to;
38 ret = TRUE;
39 }
41 return ret;
42}
CardRegion * from
Definition: spigame.cpp:19

Referenced by processFile(), processJob(), progress_callback_http(), transfer_file_http(), transfer_file_local(), and wait_for_completion().

Variable Documentation

◆ BITS_ClassFactory

ClassFactoryImpl BITS_ClassFactory
extern

Definition at line 88 of file factory.c.

Referenced by BITS_IClassFactory_QueryInterface(), and StartCount().

◆ globalMgr

◆ stop_event