ReactOS 0.4.17-dev-966-gf06eace
job.c File Reference
#include <stdio.h>
#include "wine/test.h"
#include "bits.h"
#include "initguid.h"
#include "bits2_0.h"
#include "bits2_5.h"
#include "bits5_0.h"
Include dependency graph for job.c:

Go to the source code of this file.

Classes

struct  IBackgroundCopyCallback2Impl
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct IBackgroundCopyCallback2Impl IBackgroundCopyCallback2Impl
 
typedef void(* test_t) (void)
 

Functions

static IBackgroundCopyCallback2Impl * impl_from_IBackgroundCopyCallback2 (IBackgroundCopyCallback2 *iface)
 
static HRESULT WINAPI IBackgroundCopyCallback2Impl_QueryInterface (IBackgroundCopyCallback2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI IBackgroundCopyCallback2Impl_AddRef (IBackgroundCopyCallback2 *iface)
 
static ULONG WINAPI IBackgroundCopyCallback2Impl_Release (IBackgroundCopyCallback2 *iface)
 
static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobError (IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob, IBackgroundCopyError *pError)
 
static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobModification (IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob, DWORD dwReserved)
 
static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobTransferred (IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob)
 
static HRESULT WINAPI IBackgroundCopyCallback2Impl_FileTransferred (IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob, IBackgroundCopyFile *pFile)
 
static BOOL create_background_copy_callback2 (IBackgroundCopyCallback2 **copyCallback)
 
static HRESULT test_create_manager (void)
 
static void init_paths (void)
 
static BOOL setup (void)
 
static void teardown (void)
 
static BOOL check_bits20 (void)
 
static BOOL check_bits25 (void)
 
static void test_GetId (void)
 
static void test_GetType (void)
 
static void test_GetName (void)
 
static void test_AddFile (void)
 
static void test_AddFileSet (void)
 
static void test_EnumFiles (void)
 
static void test_GetProgress_preTransfer (void)
 
static void test_GetState (void)
 
static void test_ResumeEmpty (void)
 
static void makeFile (WCHAR *name, const char *contents)
 
static void compareFiles (WCHAR *n1, WCHAR *n2)
 
static void handle_job_err (void)
 
static void test_CompleteLocal (void)
 
static void test_CompleteLocalURL (void)
 
static void test_NotifyFlags (void)
 
static void test_NotifyInterface (void)
 
static void test_Cancel (void)
 
static void test_HttpOptions (void)
 
 START_TEST (job)
 

Variables

static WCHAR test_remotePathA [MAX_PATH]
 
static WCHAR test_remotePathB [MAX_PATH]
 
static WCHAR test_localPathA [MAX_PATH]
 
static WCHAR test_localPathB [MAX_PATH]
 
static IBackgroundCopyManager * test_manager
 
static IBackgroundCopyJob * test_job
 
static GUID test_jobId
 
static BG_JOB_TYPE test_type
 
static const IBackgroundCopyCallback2Vtbl copyCallback_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file job.c.

Typedef Documentation

◆ IBackgroundCopyCallback2Impl

◆ test_t

typedef void(* test_t) (void)

Definition at line 852 of file job.c.

Function Documentation

◆ check_bits20()

static BOOL check_bits20 ( void  )
static

Definition at line 248 of file job.c.

249{
251 IBackgroundCopyManager *manager;
252 IBackgroundCopyJob *job, *job3;
253
254 hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL,
255 CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
256 (void **)&manager);
257 if (hres != S_OK) return FALSE;
258
259 hres = IBackgroundCopyManager_CreateJob(manager, L"Test", test_type, &test_jobId, &job);
260 if (hres != S_OK)
261 {
262 IBackgroundCopyManager_Release(manager);
263 return FALSE;
264 }
265
266 hres = IBackgroundCopyJob_QueryInterface(job, &IID_IBackgroundCopyJob3, (void **)&job3);
267 IBackgroundCopyJob_Cancel(job);
268 IBackgroundCopyJob_Release(job);
269 if (hres != S_OK)
270 {
271 IBackgroundCopyManager_Release(manager);
272 return FALSE;
273 }
274
275 IBackgroundCopyJob_Release(job3);
276 IBackgroundCopyManager_Release(manager);
277 return TRUE;
278}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
#define L(x)
Definition: resources.c:13
#define S_OK
Definition: intsafe.h:52
HRESULT hres
Definition: protocol.c:432
static HANDLE job
Definition: process.c:79
static GUID test_jobId
Definition: job.c:39
static BG_JOB_TYPE test_type
Definition: job.c:40

Referenced by START_TEST().

◆ check_bits25()

static BOOL check_bits25 ( void  )
static

Definition at line 280 of file job.c.

281{
283 IBackgroundCopyManager *manager;
286
287 hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL,
288 CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager,
289 (void **)&manager);
290 if (hres != S_OK) return FALSE;
291
292 hres = IBackgroundCopyManager_CreateJob(manager, L"Test", test_type, &test_jobId, &job);
293 if (hres != S_OK)
294 {
295 IBackgroundCopyManager_Release(manager);
296 return FALSE;
297 }
298
299 hres = IBackgroundCopyJob_QueryInterface(job, &IID_IBackgroundCopyJobHttpOptions, (void **)&options);
300 IBackgroundCopyJob_Cancel(job);
301 IBackgroundCopyJob_Release(job);
302 if (hres != S_OK)
303 {
304 IBackgroundCopyManager_Release(manager);
305 return FALSE;
306 }
307
308 IBackgroundCopyJobHttpOptions_Release(options);
309 IBackgroundCopyManager_Release(manager);
310 return TRUE;
311}

Referenced by START_TEST().

◆ compareFiles()

static void compareFiles ( WCHAR *  n1,
WCHAR *  n2 
)
static

Definition at line 449 of file job.c.

450{
451 char b1[256];
452 char b2[256];
453 DWORD s1, s2;
454 HANDLE f1, f2;
455
458 ok(f1 != INVALID_HANDLE_VALUE, "CreateFile\n");
459
462 ok(f2 != INVALID_HANDLE_VALUE, "CreateFile\n");
463
464 /* Neither of these files is very big */
465 ok(ReadFile(f1, b1, sizeof b1, &s1, NULL), "ReadFile\n");
466 ok(ReadFile(f2, b2, sizeof b2, &s2, NULL), "ReadFile\n");
467
470
471 ok(s1 == s2, "Files differ in length\n");
472 ok(memcmp(b1, b2, s1) == 0, "Files differ in contents\n");
473}
#define ok(value,...)
Definition: atltest.h:57
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
unsigned long DWORD
Definition: ntddk_ex.h:95
struct S1 s1
static CRYPT_DATA_BLOB b2[]
Definition: msg.c:538
static CRYPT_DATA_BLOB b1[]
Definition: msg.c:529
int n2
Definition: dwarfget.c:147
int n1
Definition: dwarfget.c:147
#define f2(x, y, z)
Definition: sha1.c:31
#define f1(x, y, z)
Definition: sha1.c:30
PCWSTR s2
Definition: shell32_main.h:38

Referenced by test_CompleteLocal(), and test_CompleteLocalURL().

◆ create_background_copy_callback2()

static BOOL create_background_copy_callback2 ( IBackgroundCopyCallback2 **  copyCallback)
static

Definition at line 138 of file job.c.

139{
141 *copyCallback = NULL;
142
144
145 if (!obj)
146 {
147 trace("Out of memory creating IBackgroundCopyCallback2\n");
148 return FALSE;
149 }
150
151 obj->IBackgroundCopyCallback2_iface.lpVtbl = &copyCallback_vtbl;
152 obj->ref = 1;
153
154 *copyCallback = &obj->IBackgroundCopyCallback2_iface;
155
156 return TRUE;
157}
#define trace
Definition: atltest.h:70
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static const IBackgroundCopyCallback2Vtbl copyCallback_vtbl
Definition: job.c:127

Referenced by test_HttpOptions().

◆ handle_job_err()

static void handle_job_err ( void  )
static

Definition at line 476 of file job.c.

477{
480 BG_ERROR_CONTEXT errContext;
481 HRESULT errCode;
482 LPWSTR contextDesc;
483 LPWSTR errDesc;
484
485 hres = IBackgroundCopyJob_GetError(test_job, &err);
486 if (SUCCEEDED(hres)) {
487 hres = IBackgroundCopyError_GetError(err, &errContext, &errCode);
488 if (SUCCEEDED(hres)) {
489 ok(0, "Got context: %d code: %ld\n", errContext, errCode);
490 } else {
491 ok(0, "Failed to get error info: 0x%08lx\n", hres);
492 }
493
494 hres = IBackgroundCopyError_GetErrorContextDescription(err, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), &contextDesc);
495 if (SUCCEEDED(hres)) {
496 ok(0, "Got context desc: %s\n", wine_dbgstr_w(contextDesc));
497 } else {
498 ok(0, "Failed to get context desc: 0x%08lx\n", hres);
499 }
500
501 hres = IBackgroundCopyError_GetErrorDescription(err, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), &errDesc);
502 if (SUCCEEDED(hres)) {
503 ok(0, "Got error desc: %s\n", wine_dbgstr_w(errDesc));
504 } else {
505 ok(0, "Failed to get error desc: 0x%08lx\n", hres);
506 }
507 } else {
508 ok(0, "Failed to get error: 0x%08lx\n", hres);
509 }
510}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define wine_dbgstr_w
Definition: kernel32.h:34
static IBackgroundCopyJob * test_job
Definition: job.c:38
#define err(...)
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_ENGLISH
Definition: nls.h:52
#define SUBLANG_ENGLISH_US
Definition: nls.h:222
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by test_CompleteLocal(), test_CompleteLocalURL(), and test_HttpOptions().

◆ IBackgroundCopyCallback2Impl_AddRef()

static ULONG WINAPI IBackgroundCopyCallback2Impl_AddRef ( IBackgroundCopyCallback2 *  iface)
static

Definition at line 78 of file job.c.

79{
82
83 trace("IBackgroundCopyCallback2Impl_AddRef called (%p, ref = %ld)\n", This, ref);
84 return ref;
85}
#define InterlockedIncrement
Definition: armddk.h:53
static IBackgroundCopyCallback2Impl * impl_from_IBackgroundCopyCallback2(IBackgroundCopyCallback2 *iface)
Definition: job.c:47
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ IBackgroundCopyCallback2Impl_FileTransferred()

static HRESULT WINAPI IBackgroundCopyCallback2Impl_FileTransferred ( IBackgroundCopyCallback2 *  iface,
IBackgroundCopyJob *  pJob,
IBackgroundCopyFile *  pFile 
)
static

Definition at line 120 of file job.c.

121{
122 trace("IBackgroundCopyCallback2Impl_FileTransferred called (%p, %p, %p)\n", iface, pJob, pFile);
123 return S_OK;
124}
MdFileObject pFile

◆ IBackgroundCopyCallback2Impl_JobError()

static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobError ( IBackgroundCopyCallback2 *  iface,
IBackgroundCopyJob *  pJob,
IBackgroundCopyError *  pError 
)
static

Definition at line 102 of file job.c.

103{
104 trace("IBackgroundCopyCallback2Impl_JobError called (%p, %p, %p)\n", iface, pJob, pError);
105 return S_OK;
106}

◆ IBackgroundCopyCallback2Impl_JobModification()

static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobModification ( IBackgroundCopyCallback2 *  iface,
IBackgroundCopyJob *  pJob,
DWORD  dwReserved 
)
static

Definition at line 108 of file job.c.

109{
110 trace("IBackgroundCopyCallback2Impl_JobModification called (%p, %p)\n", iface, pJob);
111 return S_OK;
112}

◆ IBackgroundCopyCallback2Impl_JobTransferred()

static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobTransferred ( IBackgroundCopyCallback2 *  iface,
IBackgroundCopyJob *  pJob 
)
static

Definition at line 114 of file job.c.

115{
116 trace("IBackgroundCopyCallback2Impl_JobTransferred called (%p, %p)\n", iface, pJob);
117 return S_OK;
118}

◆ IBackgroundCopyCallback2Impl_QueryInterface()

static HRESULT WINAPI IBackgroundCopyCallback2Impl_QueryInterface ( IBackgroundCopyCallback2 *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 52 of file job.c.

53{
55
56 if (!ppv)
57 {
58 return E_INVALIDARG;
59 }
60
61 *ppv = NULL;
62
64 IsEqualIID(riid, &IID_IBackgroundCopyCallback) ||
65 IsEqualIID(riid, &IID_IBackgroundCopyCallback2))
66 {
67 *ppv = &This->IBackgroundCopyCallback2_iface;
68 }
69 else
70 {
71 return E_NOINTERFACE;
72 }
73
74 IUnknown_AddRef((IUnknown*)*ppv);
75 return S_OK;
76}
const GUID IID_IUnknown
#define E_INVALIDARG
Definition: ddrawi.h:101
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ IBackgroundCopyCallback2Impl_Release()

static ULONG WINAPI IBackgroundCopyCallback2Impl_Release ( IBackgroundCopyCallback2 *  iface)
static

Definition at line 87 of file job.c.

88{
91
92 trace("IBackgroundCopyCallback2Impl_Release called (%p, ref = %ld)\n", This, ref);
93
94 if (ref == 0)
95 {
97 }
98
99 return ref;
100}
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:735

◆ impl_from_IBackgroundCopyCallback2()

static IBackgroundCopyCallback2Impl * impl_from_IBackgroundCopyCallback2 ( IBackgroundCopyCallback2 *  iface)
inlinestatic

Definition at line 47 of file job.c.

48{
49 return CONTAINING_RECORD(iface, IBackgroundCopyCallback2Impl, IBackgroundCopyCallback2_iface);
50}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by IBackgroundCopyCallback2Impl_AddRef(), IBackgroundCopyCallback2Impl_QueryInterface(), and IBackgroundCopyCallback2Impl_Release().

◆ init_paths()

static void init_paths ( void  )
static

Definition at line 179 of file job.c.

180{
181 WCHAR tmpDir[MAX_PATH];
182 WCHAR prefix[] = L"qmgr";
183
184 GetTempPathW(MAX_PATH, tmpDir);
185
190}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
static WCHAR test_localPathA[MAX_PATH]
Definition: job.c:35
static WCHAR test_localPathB[MAX_PATH]
Definition: job.c:36
static WCHAR test_remotePathA[MAX_PATH]
Definition: job.c:33
static WCHAR test_remotePathB[MAX_PATH]
Definition: job.c:34
short WCHAR
Definition: pedump.c:58
Character const *const prefix
Definition: tempnam.cpp:195

Referenced by START_TEST().

◆ makeFile()

static void makeFile ( WCHAR *  name,
const char *  contents 
)
static

Definition at line 436 of file job.c.

437{
438 HANDLE file;
440
444 ok(file != INVALID_HANDLE_VALUE, "CreateFile\n");
445 ok(WriteFile(file, contents, len, &w, NULL), "WriteFile\n");
447}
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
GLenum GLsizei len
Definition: glext.h:6722
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define CREATE_ALWAYS
Definition: disk.h:72
static const char * contents
Definition: parser.c:511
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:123
Definition: name.c:39

Referenced by test_CompleteLocal(), and test_CompleteLocalURL().

◆ setup()

static BOOL setup ( void  )
static

Definition at line 193 of file job.c.

194{
196 IBackgroundCopyJob5* test_job_5;
197 BITS_JOB_PROPERTY_VALUE prop_val;
198
200 test_job = NULL;
201 memset(&test_jobId, 0, sizeof test_jobId);
202 test_type = BG_JOB_TYPE_DOWNLOAD;
203
204 hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL,
205 CLSCTX_LOCAL_SERVER,
206 &IID_IBackgroundCopyManager,
207 (void **) &test_manager);
208 if(hres != S_OK)
209 return FALSE;
210
211 hres = IBackgroundCopyManager_CreateJob(test_manager, L"Test", test_type, &test_jobId, &test_job);
212 if(hres != S_OK)
213 {
214 IBackgroundCopyManager_Release(test_manager);
215 return FALSE;
216 }
217
218 /* The Wine TestBot Windows 10 VMs disable Windows Update by putting
219 the network connection in metered mode.
220
221 Unfortunately, this will make BITS jobs fail, since the default transfer policy
222 on Windows 10 prevents BITs job from running over a metered network
223
224 To allow these tests in this file to run on the testbot, we
225 set the BITS_JOB_PROPERTY_ID_COST_FLAGS property to BITS_COST_STATE_TRANSFER_ALWAYS,
226 ensuring that BITS will still try to run the job on a metered network */
227 prop_val.Dword = BITS_COST_STATE_TRANSFER_ALWAYS;
228 hres = IBackgroundCopyJob_QueryInterface(test_job, &IID_IBackgroundCopyJob5, (void **)&test_job_5);
229 /* BackgroundCopyJob5 was added in Windows 8, so this may not exist. The metered connection
230 workaround is only applied on Windows 10, so it's fine if this fails. */
231 if (SUCCEEDED(hres)) {
232 hres = IBackgroundCopyJob5_SetProperty(test_job_5, BITS_JOB_PROPERTY_ID_COST_FLAGS, prop_val);
233 ok(hres == S_OK, "Failed to set the cost flags: %08lx\n", hres);
234 IBackgroundCopyJob5_Release(test_job_5);
235 }
236
237 return TRUE;
238}
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( job  )

Definition at line 854 of file job.c.

855{
856 static const test_t tests[] = {
865 0
866 };
867 static const test_t tests_bits20[] = {
873 test_Cancel, /* must be last */
874 0
875 };
876 static const test_t tests_bits25[] = {
878 0
879 };
880 const test_t *test;
881 int i;
883
884 init_paths();
885
886 /* CoInitializeEx and CoInitializeSecurity with RPC_C_IMP_LEVEL_IMPERSONATE
887 * are required to set the job transfer policy
888 */
890 if (FAILED(hres)) {
891 ok(0, "CoInitializeEx failed: %0lx\n", hres);
892 return;
893 }
894
898 NULL, EOAC_NONE, 0);
899 if (FAILED(hres)) {
900 ok(0, "CoInitializeSecurity failed: %0lx\n", hres);
901 return;
902 }
903
905 {
907 win_skip("Failed to create Manager instance, skipping tests\n");
908 return;
909 }
910
911 for (test = tests, i = 0; *test; ++test, ++i)
912 {
913 /* Keep state separate between tests. */
914 if (!setup())
915 {
916 ok(0, "tests:%d: Unable to setup test\n", i);
917 break;
918 }
919 (*test)();
920 teardown();
921 }
922
923 if (check_bits20())
924 {
925 for (test = tests_bits20, i = 0; *test; ++test, ++i)
926 {
927 /* Keep state separate between tests. */
928 if (!setup())
929 {
930 ok(0, "tests_bits20:%d: Unable to setup test\n", i);
931 break;
932 }
933 (*test)();
934 teardown();
935 }
936 }
937 else
938 {
939 win_skip("Tests need BITS 2.0 or higher\n");
940 }
941
942 if (check_bits25())
943 {
944 for (test = tests_bits25, i = 0; *test; ++test, ++i)
945 {
946 /* Keep state separate between tests. */
947 if (!setup())
948 {
949 ok(0, "tests_bits25:%d: Unable to setup test\n", i);
950 break;
951 }
952 (*test)();
953 teardown();
954 }
955 }
956 else
957 {
958 win_skip("Tests need BITS 2.5 or higher\n");
959 }
960
962}
HRESULT WINAPI CoInitializeSecurity(PSECURITY_DESCRIPTOR sd, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE *asAuthSvc, void *reserved1, DWORD authn_level, DWORD imp_level, void *reserved2, DWORD capabilities, void *reserved3)
Definition: combase.c:1163
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
Definition: combase.c:2803
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
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
#define FAILED(hr)
Definition: intsafe.h:51
#define win_skip
Definition: minitest.h:67
static struct test_info tests[]
static void test_AddFile(void)
Definition: job.c:348
static BOOL check_bits20(void)
Definition: job.c:248
static void test_GetProgress_preTransfer(void)
Definition: job.c:393
static void init_paths(void)
Definition: job.c:179
static void test_NotifyInterface(void)
Definition: job.c:668
static void test_GetName(void)
Definition: job.c:336
static void teardown(void)
Definition: job.c:241
static void test_CompleteLocal(void)
Definition: job.c:513
static void test_EnumFiles(void)
Definition: job.c:375
static void test_ResumeEmpty(void)
Definition: job.c:422
static void test_NotifyFlags(void)
Definition: job.c:656
static void test_GetState(void)
Definition: job.c:410
static void test_HttpOptions(void)
Definition: job.c:701
static void test_AddFileSet(void)
Definition: job.c:362
static void test_GetId(void)
Definition: job.c:314
static BOOL setup(void)
Definition: job.c:193
static void test_CompleteLocalURL(void)
Definition: job.c:575
static void test_Cancel(void)
Definition: job.c:679
static BOOL check_bits25(void)
Definition: job.c:280
static void test_GetType(void)
Definition: job.c:325
static HRESULT test_create_manager(void)
Definition: job.c:159
void(* test_t)(void)
Definition: job.c:852
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:279
#define test
Definition: rosglue.h:37
#define RPC_C_IMP_LEVEL_IMPERSONATE
Definition: rpcdce.h:176
#define RPC_C_AUTHN_LEVEL_CONNECT
Definition: rpcdce.h:147

◆ teardown()

static void teardown ( void  )
static

Definition at line 241 of file job.c.

242{
243 IBackgroundCopyJob_Cancel(test_job);
244 IBackgroundCopyJob_Release(test_job);
245 IBackgroundCopyManager_Release(test_manager);
246}

Referenced by START_TEST().

◆ test_AddFile()

static void test_AddFile ( void  )
static

Definition at line 348 of file job.c.

349{
351
352 hres = IBackgroundCopyJob_AddFile(test_job, test_remotePathA,
354 ok(hres == S_OK, "First call to AddFile failed: 0x%08lx\n", hres);
355
356 hres = IBackgroundCopyJob_AddFile(test_job, test_remotePathB,
358 ok(hres == S_OK, "Second call to AddFile failed: 0x%08lx\n", hres);
359}

Referenced by START_TEST().

◆ test_AddFileSet()

static void test_AddFileSet ( void  )
static

Definition at line 362 of file job.c.

363{
365 BG_FILE_INFO files[2] =
366 {
369 };
370 hres = IBackgroundCopyJob_AddFileSet(test_job, 2, files);
371 ok(hres == S_OK, "AddFileSet failed: 0x%08lx\n", hres);
372}

Referenced by START_TEST().

◆ test_Cancel()

static void test_Cancel ( void  )
static

Definition at line 679 of file job.c.

680{
681 HRESULT hr;
682 BG_JOB_STATE state;
683
684 state = BG_JOB_STATE_ERROR;
685 hr = IBackgroundCopyJob_GetState(test_job, &state);
686 ok(hr == S_OK, "got 0x%08lx\n", hr);
687 ok(state != BG_JOB_STATE_CANCELLED, "got %u\n", state);
688
689 hr = IBackgroundCopyJob_Cancel(test_job);
690 ok(hr == S_OK, "got 0x%08lx\n", hr);
691
692 state = BG_JOB_STATE_ERROR;
693 hr = IBackgroundCopyJob_GetState(test_job, &state);
694 ok(hr == S_OK, "got 0x%08lx\n", hr);
695 ok(state == BG_JOB_STATE_CANCELLED, "got %u\n", state);
696
697 hr = IBackgroundCopyJob_Cancel(test_job);
698 ok(hr == BG_E_INVALID_STATE, "got 0x%08lx\n", hr);
699}
static int state
Definition: maze.c:121
#define BG_E_INVALID_STATE
Definition: bitsmsg.h:39
HRESULT hr
Definition: delayimp.cpp:582

Referenced by START_TEST().

◆ test_CompleteLocal()

static void test_CompleteLocal ( void  )
static

Definition at line 513 of file job.c.

514{
515 static const int timeout_sec = 30;
517 BG_JOB_STATE state;
518 int i;
519
522 makeFile(test_remotePathA, "This is a WINE test file for BITS\n");
523 makeFile(test_remotePathB, "This is another WINE test file for BITS\n");
524
525 hres = IBackgroundCopyJob_AddFile(test_job, test_remotePathA,
527 ok(hres == S_OK, "got 0x%08lx\n", hres);
528
529 hres = IBackgroundCopyJob_AddFile(test_job, test_remotePathB,
531 ok(hres == S_OK, "got 0x%08lx\n", hres);
532
533 hres = IBackgroundCopyJob_Resume(test_job);
534 ok(hres == S_OK, "IBackgroundCopyJob_Resume\n");
535
536 for (i = 0; i < timeout_sec; ++i)
537 {
538 hres = IBackgroundCopyJob_GetState(test_job, &state);
539 ok(hres == S_OK, "IBackgroundCopyJob_GetState\n");
540 ok(state == BG_JOB_STATE_QUEUED || state == BG_JOB_STATE_CONNECTING
541 || state == BG_JOB_STATE_TRANSFERRING || state == BG_JOB_STATE_TRANSFERRED
542 || state == BG_JOB_STATE_TRANSIENT_ERROR,
543 "Bad state: %d\n", state);
544
545 if (state == BG_JOB_STATE_TRANSIENT_ERROR) {
546 hres = IBackgroundCopyJob_Resume(test_job);
547 ok(hres == S_OK, "IBackgroundCopyJob_Resume\n");
548 }
549
550 if (state == BG_JOB_STATE_TRANSFERRED)
551 break;
552 Sleep(1000);
553 }
554
555 if (state == BG_JOB_STATE_ERROR || state == BG_JOB_STATE_TRANSIENT_ERROR)
557
558 ok(i < timeout_sec, "BITS jobs timed out\n");
559 hres = IBackgroundCopyJob_Complete(test_job);
560 ok(hres == S_OK, "IBackgroundCopyJob_Complete\n");
561 hres = IBackgroundCopyJob_GetState(test_job, &state);
562 ok(hres == S_OK, "IBackgroundCopyJob_GetState\n");
563 ok(state == BG_JOB_STATE_ACKNOWLEDGED, "Bad state: %d\n", state);
564
567
568 ok(DeleteFileW(test_remotePathA), "DeleteFile\n");
569 ok(DeleteFileW(test_remotePathB), "DeleteFile\n");
572}
static void handle_job_err(void)
Definition: job.c:476
static void makeFile(WCHAR *name, const char *contents)
Definition: job.c:436
static void compareFiles(WCHAR *n1, WCHAR *n2)
Definition: job.c:449
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:726

Referenced by START_TEST().

◆ test_CompleteLocalURL()

static void test_CompleteLocalURL ( void  )
static

Definition at line 575 of file job.c.

576{
577 static const int timeout_sec = 30;
578 WCHAR *urlA, *urlB;
580 BG_JOB_STATE state;
581 int i;
582
585 makeFile(test_remotePathA, "This is a WINE test file for BITS\n");
586 makeFile(test_remotePathB, "This is another WINE test file for BITS\n");
587
588 urlA = HeapAlloc(GetProcessHeap(), 0,
589 (7 + lstrlenW(test_remotePathA) + 1) * sizeof urlA[0]);
590 urlB = HeapAlloc(GetProcessHeap(), 0,
591 (7 + lstrlenW(test_remotePathB) + 1) * sizeof urlB[0]);
592 if (!urlA || !urlB)
593 {
594 skip("Unable to allocate memory for URLs\n");
595 HeapFree(GetProcessHeap(), 0, urlA);
596 HeapFree(GetProcessHeap(), 0, urlB);
597 return;
598 }
599
600 lstrcpyW(urlA, L"file://");
602 lstrcpyW(urlB, L"file://");
604
605 hres = IBackgroundCopyJob_AddFile(test_job, urlA, test_localPathA);
606 ok(hres == S_OK, "got 0x%08lx\n", hres);
607
608 hres = IBackgroundCopyJob_AddFile(test_job, urlB, test_localPathB);
609 ok(hres == S_OK, "got 0x%08lx\n", hres);
610
611 hres = IBackgroundCopyJob_Resume(test_job);
612 ok(hres == S_OK, "IBackgroundCopyJob_Resume\n");
613
614 for (i = 0; i < timeout_sec; ++i)
615 {
616 hres = IBackgroundCopyJob_GetState(test_job, &state);
617 ok(hres == S_OK, "IBackgroundCopyJob_GetState\n");
618 ok(state == BG_JOB_STATE_QUEUED || state == BG_JOB_STATE_CONNECTING
619 || state == BG_JOB_STATE_TRANSFERRING || state == BG_JOB_STATE_TRANSFERRED
620 || state == BG_JOB_STATE_TRANSIENT_ERROR,
621 "Bad state: %d\n", state);
622
623 if (state == BG_JOB_STATE_TRANSIENT_ERROR) {
624 hres = IBackgroundCopyJob_Resume(test_job);
625 ok(hres == S_OK, "IBackgroundCopyJob_Resume\n");
626 }
627
628 if (state == BG_JOB_STATE_TRANSFERRED)
629 break;
630 Sleep(1000);
631 }
632
633 if (state == BG_JOB_STATE_ERROR || state == BG_JOB_STATE_TRANSIENT_ERROR)
635
636
637 ok(i < timeout_sec, "BITS jobs timed out\n");
638 hres = IBackgroundCopyJob_Complete(test_job);
639 ok(hres == S_OK, "IBackgroundCopyJob_Complete\n");
640 hres = IBackgroundCopyJob_GetState(test_job, &state);
641 ok(hres == S_OK, "IBackgroundCopyJob_GetState\n");
642 ok(state == BG_JOB_STATE_ACKNOWLEDGED, "Bad state: %d\n", state);
643
646
647 ok(DeleteFileW(test_remotePathA), "DeleteFile\n");
648 ok(DeleteFileW(test_remotePathB), "DeleteFile\n");
651
652 HeapFree(GetProcessHeap(), 0, urlA);
653 HeapFree(GetProcessHeap(), 0, urlB);
654}
#define skip(...)
Definition: atltest.h:64
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

Referenced by START_TEST().

◆ test_create_manager()

static HRESULT test_create_manager ( void  )
static

Definition at line 159 of file job.c.

160{
162 IBackgroundCopyManager *manager = NULL;
163
164 /* Creating BITS instance */
165 hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL, CLSCTX_LOCAL_SERVER,
166 &IID_IBackgroundCopyManager, (void **) &manager);
167
169 win_skip("Needed Service is disabled\n");
170 return hres;
171 }
172
173 if (hres == S_OK)
174 IBackgroundCopyManager_Release(manager);
175
176 return hres;
177}
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define ERROR_SERVICE_DISABLED
Definition: winerror.h:933

Referenced by START_TEST().

◆ test_EnumFiles()

static void test_EnumFiles ( void  )
static

Definition at line 375 of file job.c.

376{
378 IEnumBackgroundCopyFiles *enumFiles;
379 ULONG res;
380
381 hres = IBackgroundCopyJob_AddFile(test_job, test_remotePathA,
383 ok(hres == S_OK, "got 0x%08lx\n", hres);
384
385 hres = IBackgroundCopyJob_EnumFiles(test_job, &enumFiles);
386 ok(hres == S_OK, "EnumFiles failed: 0x%08lx\n", hres);
387
388 res = IEnumBackgroundCopyFiles_Release(enumFiles);
389 ok(res == 0, "Bad ref count on release: %lu\n", res);
390}
GLuint res
Definition: glext.h:9613

Referenced by START_TEST().

◆ test_GetId()

static void test_GetId ( void  )
static

Definition at line 314 of file job.c.

315{
317 GUID tmpId;
318
319 hres = IBackgroundCopyJob_GetId(test_job, &tmpId);
320 ok(hres == S_OK, "GetId failed: %08lx\n", hres);
321 ok(memcmp(&tmpId, &test_jobId, sizeof tmpId) == 0, "Got incorrect GUID\n");
322}

Referenced by START_TEST().

◆ test_GetName()

static void test_GetName ( void  )
static

Definition at line 336 of file job.c.

337{
340
341 hres = IBackgroundCopyJob_GetDisplayName(test_job, &displayName);
342 ok(hres == S_OK, "GetName failed: %08lx\n", hres);
343 ok(lstrcmpW(displayName, L"Test") == 0, "Got incorrect type\n");
345}
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
char displayName[]
Definition: tftpd.cpp:35

Referenced by START_TEST().

◆ test_GetProgress_preTransfer()

static void test_GetProgress_preTransfer ( void  )
static

Definition at line 393 of file job.c.

394{
396 BG_JOB_PROGRESS progress;
397
398 hres = IBackgroundCopyJob_GetProgress(test_job, &progress);
399 ok(hres == S_OK, "GetProgress failed: 0x%08lx\n", hres);
400
401 ok(progress.BytesTotal == 0, "Incorrect BytesTotal: %s\n",
402 wine_dbgstr_longlong(progress.BytesTotal));
403 ok(progress.BytesTransferred == 0, "Incorrect BytesTransferred: %s\n",
404 wine_dbgstr_longlong(progress.BytesTransferred));
405 ok(progress.FilesTotal == 0, "Incorrect FilesTotal: %lu\n", progress.FilesTotal);
406 ok(progress.FilesTransferred == 0, "Incorrect FilesTransferred %lu\n", progress.FilesTransferred);
407}
cd_progress_ptr progress
Definition: cdjpeg.h:152
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49

Referenced by START_TEST().

◆ test_GetState()

static void test_GetState ( void  )
static

Definition at line 410 of file job.c.

411{
413 BG_JOB_STATE state;
414
415 state = BG_JOB_STATE_ERROR;
416 hres = IBackgroundCopyJob_GetState(test_job, &state);
417 ok(hres == S_OK, "GetState failed: 0x%08lx\n", hres);
418 ok(state == BG_JOB_STATE_SUSPENDED, "Incorrect job state: %d\n", state);
419}

Referenced by START_TEST().

◆ test_GetType()

static void test_GetType ( void  )
static

Definition at line 325 of file job.c.

326{
328 BG_JOB_TYPE type;
329
330 hres = IBackgroundCopyJob_GetType(test_job, &type);
331 ok(hres == S_OK, "GetType failed: %08lx\n", hres);
332 ok(type == test_type, "Got incorrect type\n");
333}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by START_TEST().

◆ test_HttpOptions()

static void test_HttpOptions ( void  )
static

Definition at line 701 of file job.c.

702{
703 static const WCHAR winetestW[] = L"Wine: test\r\n";
704 static const unsigned int timeout = 30;
705 HRESULT hr;
708 BG_JOB_STATE state;
709 unsigned int i;
710 WCHAR *headers;
711 ULONG flags, orig_flags;
712 IBackgroundCopyCallback2 *copyCallback;
713 IUnknown *copyCallbackUnknown;
714
715 ok(create_background_copy_callback2(&copyCallback) == TRUE, "create_background_copy_callback2 failed\n");
716
717 hr = IBackgroundCopyCallback2_QueryInterface(copyCallback, &IID_IUnknown, (LPVOID*)&copyCallbackUnknown);
718 ok(hr == S_OK,"IBackgroundCopyCallback_QueryInterface(IID_IUnknown) failed: %08lx\n", hr);
719
720 hr = IBackgroundCopyJob_SetNotifyInterface(test_job, copyCallbackUnknown);
721 ok(hr == S_OK,"IBackgroundCopyCallback_SetNotifyInterface failed: %08lx\n", hr);
722
723 hr = IBackgroundCopyJob_SetNotifyFlags(test_job, BG_NOTIFY_JOB_TRANSFERRED | BG_NOTIFY_JOB_ERROR | BG_NOTIFY_DISABLE | BG_NOTIFY_JOB_MODIFICATION | BG_NOTIFY_FILE_TRANSFERRED);
724 ok(hr == S_OK,"IBackgroundCopyCallback_SetNotifyFlags failed: %08lx\n", hr);
725
726
728 hr = IBackgroundCopyJob_AddFile(test_job, L"http://test.winehq.org/", test_localPathA);
729 ok(hr == S_OK, "got 0x%08lx\n", hr);
730
731 hr = IBackgroundCopyJob_QueryInterface(test_job, &IID_IBackgroundCopyJobHttpOptions, (void **)&options);
732 ok(hr == S_OK, "got 0x%08lx\n", hr);
733
734 if (options)
735 {
736 headers = (WCHAR *)0xdeadbeef;
737 hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers);
738 ok(hr == S_FALSE, "got 0x%08lx\n", hr);
739 ok(headers == NULL, "got %p\n", headers);
740
741 hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, winetestW);
742 ok(hr == S_OK, "got 0x%08lx\n", hr);
743
744 headers = (WCHAR *)0xdeadbeef;
745 hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers);
746 ok(hr == S_OK, "got 0x%08lx\n", hr);
747 if (hr == S_OK)
748 {
751 }
752
753 hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, NULL);
754 ok(hr == S_OK, "got 0x%08lx\n", hr);
755
756 headers = (WCHAR *)0xdeadbeef;
757 hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers);
758 ok(hr == S_FALSE, "got 0x%08lx\n", hr);
759 ok(headers == NULL, "got %p\n", headers);
760
761 orig_flags = 0xdeadbeef;
762 hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &orig_flags);
763 ok(hr == S_OK, "got 0x%08lx\n", hr);
764 ok(!orig_flags, "got 0x%08lx\n", orig_flags);
765
766 hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(options, 0);
767 ok(hr == S_OK, "got 0x%08lx\n", hr);
768
769 flags = 0xdeadbeef;
770 hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &flags);
771 ok(hr == S_OK, "got 0x%08lx\n", hr);
772 ok(!flags, "got 0x%08lx\n", flags);
773 }
774
775 hr = IBackgroundCopyJob_Resume(test_job);
776 ok(hr == S_OK, "got 0x%08lx\n", hr);
777
778 for (i = 0; i < timeout; i++)
779 {
780 hr = IBackgroundCopyJob_GetState(test_job, &state);
781 ok(hr == S_OK, "got 0x%08lx\n", hr);
782
783 ok(state == BG_JOB_STATE_QUEUED ||
784 state == BG_JOB_STATE_CONNECTING ||
785 state == BG_JOB_STATE_TRANSFERRING ||
786 state == BG_JOB_STATE_TRANSFERRED ||
787 state == BG_JOB_STATE_TRANSIENT_ERROR, "unexpected state: %u\n", state);
788
789 if (state == BG_JOB_STATE_TRANSIENT_ERROR) {
790 hr = IBackgroundCopyJob_Resume(test_job);
791 ok(hr == S_OK, "IBackgroundCopyJob_Resume\n");
792 }
793
794 if (state == BG_JOB_STATE_TRANSFERRED) break;
795 Sleep(1000);
796 }
797
798 if (state == BG_JOB_STATE_ERROR || state == BG_JOB_STATE_TRANSIENT_ERROR)
800
801
802 ok(i < timeout, "BITS job timed out\n");
803 if (i < timeout)
804 {
805 hr = IBackgroundCopyJob_GetError(test_job, &error);
806 ok(hr == BG_E_ERROR_INFORMATION_UNAVAILABLE, "got 0x%08lx\n", hr);
807 }
808
809 if (options)
810 {
811 headers = (WCHAR *)0xdeadbeef;
812 hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers);
813 ok(hr == S_FALSE, "got 0x%08lx\n", hr);
814 ok(headers == NULL, "got %p\n", headers);
815
816 hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, NULL);
817 ok(hr == S_OK, "got 0x%08lx\n", hr);
818
819 hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers);
820 ok(hr == S_FALSE, "got 0x%08lx\n", hr);
821
822 flags = 0xdeadbeef;
823 hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &flags);
824 ok(hr == S_OK, "got 0x%08lx\n", hr);
825 ok(!flags, "got 0x%08lx\n", flags);
826
827 hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(options, orig_flags);
828 ok(hr == S_OK, "got 0x%08lx\n", hr);
829
830 IBackgroundCopyJobHttpOptions_Release(options);
831 }
832
833 hr = IBackgroundCopyJob_Complete(test_job);
834 ok(hr == S_OK, "got 0x%08lx\n", hr);
835
836 hr = IBackgroundCopyJob_GetState(test_job, &state);
837 ok(hr == S_OK, "got 0x%08lx\n", hr);
838 ok(state == BG_JOB_STATE_ACKNOWLEDGED, "unexpected state: %u\n", state);
839
840 hr = IBackgroundCopyJob_Complete(test_job);
841 ok(hr == BG_E_INVALID_STATE, "got 0x%08lx\n", hr);
842
844
845 hr = IBackgroundCopyJob_SetNotifyInterface(test_job, NULL);
846 ok(hr == BG_E_INVALID_STATE, "got 0x%08lx\n", hr);
847
848 IUnknown_Release(copyCallbackUnknown);
849 IBackgroundCopyCallback2_Release(copyCallback);
850}
#define BG_E_ERROR_INFORMATION_UNAVAILABLE
Definition: bitsmsg.h:45
GLbitfield flags
Definition: glext.h:7161
#define error(str)
Definition: mkdosfs.c:1605
static BOOL create_background_copy_callback2(IBackgroundCopyCallback2 **copyCallback)
Definition: job.c:138
vector< Header * > headers
Definition: sdkparse.cpp:39
static const WCHAR winetestW[]
Definition: shelldispatch.c:47
Definition: dhcpd.h:248
#define S_FALSE
Definition: winerror.h:3451

Referenced by START_TEST().

◆ test_NotifyFlags()

static void test_NotifyFlags ( void  )
static

Definition at line 656 of file job.c.

657{
658 ULONG flags;
659 HRESULT hr;
660
661 /* check default flags */
662 flags = 0;
663 hr = IBackgroundCopyJob_GetNotifyFlags(test_job, &flags);
664 ok(hr == S_OK, "got 0x%08lx\n", hr);
665 ok(flags == (BG_NOTIFY_JOB_ERROR | BG_NOTIFY_JOB_TRANSFERRED), "flags 0x%08lx\n", flags);
666}

Referenced by START_TEST().

◆ test_NotifyInterface()

static void test_NotifyInterface ( void  )
static

Definition at line 668 of file job.c.

669{
670 HRESULT hr;
671 IUnknown *unk;
672
673 unk = (IUnknown*)0xdeadbeef;
674 hr = IBackgroundCopyJob_GetNotifyInterface(test_job, &unk);
675 ok(hr == S_OK, "got 0x%08lx\n", hr);
676 ok(unk == NULL, "got %p\n", unk);
677}

Referenced by START_TEST().

◆ test_ResumeEmpty()

static void test_ResumeEmpty ( void  )
static

Definition at line 422 of file job.c.

423{
425 BG_JOB_STATE state;
426
427 hres = IBackgroundCopyJob_Resume(test_job);
428 ok(hres == BG_E_EMPTY, "Resume failed to return BG_E_EMPTY error: 0x%08lx\n", hres);
429
430 state = BG_JOB_STATE_ERROR;
431 hres = IBackgroundCopyJob_GetState(test_job, &state);
432 ok(hres == S_OK, "got 0x%08lx\n", hres);
433 ok(state == BG_JOB_STATE_SUSPENDED, "Incorrect job state: %d\n", state);
434}
#define BG_E_EMPTY
Definition: bitsmsg.h:40

Referenced by START_TEST().

Variable Documentation

◆ copyCallback_vtbl

const IBackgroundCopyCallback2Vtbl copyCallback_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobError(IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob, IBackgroundCopyError *pError)
Definition: job.c:102
static ULONG WINAPI IBackgroundCopyCallback2Impl_Release(IBackgroundCopyCallback2 *iface)
Definition: job.c:87
static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobModification(IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob, DWORD dwReserved)
Definition: job.c:108
static HRESULT WINAPI IBackgroundCopyCallback2Impl_JobTransferred(IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob)
Definition: job.c:114
static HRESULT WINAPI IBackgroundCopyCallback2Impl_QueryInterface(IBackgroundCopyCallback2 *iface, REFIID riid, void **ppv)
Definition: job.c:52
static HRESULT WINAPI IBackgroundCopyCallback2Impl_FileTransferred(IBackgroundCopyCallback2 *iface, IBackgroundCopyJob *pJob, IBackgroundCopyFile *pFile)
Definition: job.c:120
static ULONG WINAPI IBackgroundCopyCallback2Impl_AddRef(IBackgroundCopyCallback2 *iface)
Definition: job.c:78

Definition at line 127 of file job.c.

Referenced by create_background_copy_callback2().

◆ test_job

◆ test_jobId

GUID test_jobId
static

Definition at line 39 of file job.c.

Referenced by check_bits20(), check_bits25(), setup(), and test_GetId().

◆ test_localPathA

◆ test_localPathB

WCHAR test_localPathB[MAX_PATH]
static

◆ test_manager

Definition at line 37 of file job.c.

◆ test_remotePathA

WCHAR test_remotePathA[MAX_PATH]
static

◆ test_remotePathB

WCHAR test_remotePathB[MAX_PATH]
static

◆ test_type

BG_JOB_TYPE test_type ( void  )
static

Definition at line 40 of file job.c.

Referenced by check_bits20(), check_bits25(), setup(), test_GetType(), and test_ICInfo().