49 &IID_IBackgroundCopyManager, (
void **) &manager);
52 win_skip(
"Needed Service is disabled\n");
57 IBackgroundCopyManager_Release(manager);
65 WCHAR prefix[] = {
'q',
'm',
'g',
'r', 0};
87 &IID_IBackgroundCopyManager,
106 IBackgroundCopyJob_Cancel(
test_job);
107 IBackgroundCopyJob_Release(
test_job);
118 CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
125 IBackgroundCopyManager_Release(manager);
129 hres = IBackgroundCopyJob_QueryInterface(
job, &IID_IBackgroundCopyJob3, (
void **)&job3);
130 IBackgroundCopyJob_Cancel(
job);
131 IBackgroundCopyJob_Release(
job);
134 IBackgroundCopyManager_Release(manager);
138 IBackgroundCopyJob_Release(job3);
139 IBackgroundCopyManager_Release(manager);
151 CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
158 IBackgroundCopyManager_Release(manager);
162 hres = IBackgroundCopyJob_QueryInterface(
job, &IID_IBackgroundCopyJobHttpOptions, (
void **)&
options);
163 IBackgroundCopyJob_Cancel(
job);
164 IBackgroundCopyJob_Release(
job);
167 IBackgroundCopyManager_Release(manager);
171 IBackgroundCopyJobHttpOptions_Release(
options);
172 IBackgroundCopyManager_Release(manager);
221 ok(
hres ==
S_OK,
"Second call to AddFile failed: 0x%08x\n",
hres);
228 BG_FILE_INFO files[2] =
233 hres = IBackgroundCopyJob_AddFileSet(
test_job, 2, files);
248 hres = IBackgroundCopyJob_EnumFiles(
test_job, &enumFiles);
251 res = IEnumBackgroundCopyFiles_Release(enumFiles);
252 ok(
res == 0,
"Bad ref count on release: %u\n",
res);
264 ok(
progress.BytesTotal == 0,
"Incorrect BytesTotal: %s\n",
266 ok(
progress.BytesTransferred == 0,
"Incorrect BytesTransferred: %s\n",
269 ok(
progress.FilesTransferred == 0,
"Incorrect FilesTransferred %u\n",
progress.FilesTransferred);
278 state = BG_JOB_STATE_ERROR;
281 ok(
state == BG_JOB_STATE_SUSPENDED,
"Incorrect job state: %d\n",
state);
293 state = BG_JOB_STATE_ERROR;
296 ok(
state == BG_JOB_STATE_SUSPENDED,
"Incorrect job state: %d\n",
state);
334 ok(
s1 ==
s2,
"Files differ in length\n");
341 static const int timeout_sec = 30;
360 ok(
hres ==
S_OK,
"IBackgroundCopyJob_Resume\n");
363 for (
i = 0;
i < timeout_sec; ++
i)
366 ok(
hres ==
S_OK,
"IBackgroundCopyJob_GetState\n");
367 ok(
state == BG_JOB_STATE_QUEUED ||
state == BG_JOB_STATE_CONNECTING
368 ||
state == BG_JOB_STATE_TRANSFERRING ||
state == BG_JOB_STATE_TRANSFERRED,
369 "Bad state: %d\n",
state);
370 if (
state == BG_JOB_STATE_TRANSFERRED)
375 ok(
i < timeout_sec,
"BITS jobs timed out\n");
377 ok(
hres ==
S_OK,
"IBackgroundCopyJob_Complete\n");
379 ok(
hres ==
S_OK,
"IBackgroundCopyJob_GetState\n");
380 ok(
state == BG_JOB_STATE_ACKNOWLEDGED,
"Bad state: %d\n",
state);
394 static const WCHAR prot[] = {
'f',
'i',
'l',
'e',
':',
'/',
'/', 0};
395 static const int timeout_sec = 30;
412 skip(
"Unable to allocate memory for URLs\n");
430 ok(
hres ==
S_OK,
"IBackgroundCopyJob_Resume\n");
433 for (
i = 0;
i < timeout_sec; ++
i)
436 ok(
hres ==
S_OK,
"IBackgroundCopyJob_GetState\n");
437 ok(
state == BG_JOB_STATE_QUEUED ||
state == BG_JOB_STATE_CONNECTING
438 ||
state == BG_JOB_STATE_TRANSFERRING ||
state == BG_JOB_STATE_TRANSFERRED,
439 "Bad state: %d\n",
state);
440 if (
state == BG_JOB_STATE_TRANSFERRED)
445 ok(
i < timeout_sec,
"BITS jobs timed out\n");
447 ok(
hres ==
S_OK,
"IBackgroundCopyJob_Complete\n");
449 ok(
hres ==
S_OK,
"IBackgroundCopyJob_GetState\n");
450 ok(
state == BG_JOB_STATE_ACKNOWLEDGED,
"Bad state: %d\n",
state);
473 ok(
flags == (BG_NOTIFY_JOB_ERROR | BG_NOTIFY_JOB_TRANSFERRED),
"flags 0x%08x\n",
flags);
482 hr = IBackgroundCopyJob_GetNotifyInterface(
test_job, &unk);
484 ok(unk ==
NULL,
"got %p\n", unk);
492 state = BG_JOB_STATE_ERROR;
500 state = BG_JOB_STATE_ERROR;
511 static const WCHAR urlW[] =
512 {
'h',
't',
't',
'p',
's',
':',
'/',
'/',
't',
'e',
's',
't',
'.',
'w',
'i',
'n',
'e',
'h',
'q',
'.',
'o',
'r',
'g',
'/',0};
514 {
'W',
'i',
'n',
'e',
':',
' ',
't',
'e',
's',
't',
'\r',
'\n',0};
515 static const unsigned int timeout = 30;
528 hr = IBackgroundCopyJob_QueryInterface(
test_job, &IID_IBackgroundCopyJobHttpOptions, (
void **)&
options);
550 hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(
options,
NULL);
558 orig_flags = 0xdeadbeef;
559 hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(
options, &orig_flags);
561 ok(!orig_flags,
"got 0x%08x\n", orig_flags);
563 hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(
options, 0);
567 hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(
options, &
flags);
581 ok(
state == BG_JOB_STATE_QUEUED ||
582 state == BG_JOB_STATE_CONNECTING ||
583 state == BG_JOB_STATE_TRANSFERRING ||
584 state == BG_JOB_STATE_TRANSFERRED,
"unexpected state: %u\n",
state);
586 if (
state == BG_JOB_STATE_TRANSFERRED)
break;
603 hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(
options,
NULL);
610 hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(
options, &
flags);
614 hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(
options, orig_flags);
617 IBackgroundCopyJobHttpOptions_Release(
options);
625 ok(
state == BG_JOB_STATE_ACKNOWLEDGED,
"unexpected state: %u\n",
state);
648 static const test_t tests_bits20[] = {
657 static const test_t tests_bits25[] = {
671 win_skip(
"Failed to create Manager instance, skipping tests\n");
680 ok(0,
"tests:%d: Unable to setup test\n",
i);
694 ok(0,
"tests_bits20:%d: Unable to setup test\n",
i);
703 win_skip(
"Tests need BITS 2.0 or higher\n");
713 ok(0,
"tests_bits25:%d: Unable to setup test\n",
i);
722 win_skip(
"Tests need BITS 2.5 or higher\n");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define BG_E_ERROR_INFORMATION_UNAVAILABLE
#define BG_E_INVALID_STATE
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
GLuint GLuint GLsizei GLenum type
GLubyte GLubyte GLubyte GLubyte w
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
static struct test_info tests[]
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
static void test_AddFile(void)
static BOOL check_bits20(void)
static void test_GetProgress_preTransfer(void)
static void init_paths(void)
static void test_NotifyInterface(void)
static WCHAR test_localPathA[MAX_PATH]
static void test_GetName(void)
static void teardown(void)
static void test_CompleteLocal(void)
static WCHAR test_localPathB[MAX_PATH]
static void test_EnumFiles(void)
static void test_ResumeEmpty(void)
static void test_NotifyFlags(void)
static void test_GetState(void)
static WCHAR test_remotePathA[MAX_PATH]
static void test_HttpOptions(void)
static void test_AddFileSet(void)
static WCHAR test_remotePathB[MAX_PATH]
static void makeFile(WCHAR *name, const char *contents)
static void test_GetId(void)
static void test_CompleteLocalURL(void)
static void compareFiles(WCHAR *n1, WCHAR *n2)
static BG_JOB_TYPE test_type
static void test_Cancel(void)
static IBackgroundCopyJob * test_job
static BOOL check_bits25(void)
static void test_GetType(void)
static IBackgroundCopyManager * test_manager
static const WCHAR test_displayName[]
static HRESULT test_create_manager(void)
static const char * contents
#define disable_success_count
vector< Header * > headers
static const WCHAR winetestW[]
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define HRESULT_FROM_WIN32(x)
#define ERROR_SERVICE_DISABLED