Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
be8bac15
Commit
be8bac15
authored
Feb 26, 2008
by
Roy Shea
Committed by
Alexandre Julliard
Feb 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: Implement IBackgroundCopyJob_AddFile.
parent
128654ba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
3 deletions
+111
-3
job.c
dlls/qmgr/job.c
+25
-2
qmgr.h
dlls/qmgr/qmgr.h
+6
-0
Makefile.in
dlls/qmgr/tests/Makefile.in
+1
-1
job.c
dlls/qmgr/tests/job.c
+79
-0
No files found.
dlls/qmgr/job.c
View file @
be8bac15
...
...
@@ -80,8 +80,25 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFile(
LPCWSTR
RemoteUrl
,
LPCWSTR
LocalName
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
IBackgroundCopyFile
*
pFile
;
BackgroundCopyFileImpl
*
file
;
HRESULT
res
;
/* We should return E_INVALIDARG in these cases. */
FIXME
(
"Check for valid filenames and supported protocols
\n
"
);
res
=
BackgroundCopyFileConstructor
(
RemoteUrl
,
LocalName
,
(
LPVOID
*
)
&
pFile
);
if
(
res
!=
S_OK
)
return
res
;
/* Add a reference to the file to file list */
IBackgroundCopyFile_AddRef
(
pFile
);
file
=
(
BackgroundCopyFileImpl
*
)
pFile
;
list_add_head
(
&
This
->
files
,
&
file
->
entryFromJob
);
++
This
->
jobProgress
.
FilesTotal
;
return
S_OK
;
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_EnumFiles
(
...
...
@@ -414,6 +431,12 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
}
memcpy
(
pJobId
,
&
This
->
jobId
,
sizeof
(
GUID
));
list_init
(
&
This
->
files
);
This
->
jobProgress
.
BytesTotal
=
BG_SIZE_UNKNOWN
;
This
->
jobProgress
.
BytesTransferred
=
0
;
This
->
jobProgress
.
FilesTotal
=
0
;
This
->
jobProgress
.
FilesTransferred
=
0
;
*
ppObj
=
&
This
->
lpVtbl
;
return
S_OK
;
}
dlls/qmgr/qmgr.h
View file @
be8bac15
...
...
@@ -28,6 +28,7 @@
#include "bits.h"
#include <string.h>
#include "wine/list.h"
/* Background copy job vtbl and related data */
typedef
struct
...
...
@@ -37,6 +38,8 @@ typedef struct
LPWSTR
displayName
;
BG_JOB_TYPE
type
;
GUID
jobId
;
struct
list
files
;
BG_JOB_PROGRESS
jobProgress
;
}
BackgroundCopyJobImpl
;
/* Enum background copy jobs vtbl and related data */
...
...
@@ -52,6 +55,7 @@ typedef struct
const
IBackgroundCopyFileVtbl
*
lpVtbl
;
LONG
ref
;
BG_FILE_INFO
info
;
struct
list
entryFromJob
;
}
BackgroundCopyFileImpl
;
/* Background copy manager vtbl and related data */
...
...
@@ -73,6 +77,8 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
GUID
*
pJobId
,
LPVOID
*
ppObj
);
HRESULT
EnumBackgroundCopyJobsConstructor
(
LPVOID
*
ppObj
,
IBackgroundCopyManager
*
copyManager
);
HRESULT
BackgroundCopyFileConstructor
(
LPCWSTR
remoteName
,
LPCWSTR
localName
,
LPVOID
*
ppObj
);
/* Little helper functions */
static
inline
char
*
...
...
dlls/qmgr/tests/Makefile.in
View file @
be8bac15
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
qmgr.dll
IMPORTS
=
ole32 kernel32
IMPORTS
=
ole32
user32
kernel32
CTESTS
=
\
job.c
\
...
...
dlls/qmgr/tests/job.c
View file @
be8bac15
...
...
@@ -27,11 +27,67 @@
/* Globals used by many tests */
static
const
WCHAR
test_displayName
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
0
};
static
const
WCHAR
test_remoteNameA
[]
=
{
'r'
,
'e'
,
'm'
,
'o'
,
't'
,
'e'
,
'A'
,
0
};
static
const
WCHAR
test_remoteNameB
[]
=
{
'r'
,
'e'
,
'm'
,
'o'
,
't'
,
'e'
,
'B'
,
0
};
static
const
WCHAR
test_localNameA
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'A'
,
0
};
static
const
WCHAR
test_localNameB
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'B'
,
0
};
static
WCHAR
*
test_currentDir
;
static
WCHAR
*
test_remotePathA
;
static
WCHAR
*
test_remotePathB
;
static
WCHAR
*
test_localPathA
;
static
WCHAR
*
test_localPathB
;
static
IBackgroundCopyManager
*
test_manager
;
static
IBackgroundCopyJob
*
test_job
;
static
GUID
test_jobId
;
static
BG_JOB_TYPE
test_type
;
static
BOOL
init_paths
(
void
)
{
static
const
WCHAR
format
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
DWORD
n
;
n
=
GetCurrentDirectoryW
(
0
,
NULL
);
if
(
n
==
0
)
{
skip
(
"Couldn't get current directory size
\n
"
);
return
FALSE
;
}
test_currentDir
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
*
sizeof
(
WCHAR
));
test_localPathA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
n
+
1
+
lstrlenW
(
test_localNameA
))
*
sizeof
(
WCHAR
));
test_localPathB
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
n
+
1
+
lstrlenW
(
test_localNameB
))
*
sizeof
(
WCHAR
));
test_remotePathA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
n
+
1
+
lstrlenW
(
test_remoteNameA
))
*
sizeof
(
WCHAR
));
test_remotePathB
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
n
+
1
+
lstrlenW
(
test_remoteNameB
))
*
sizeof
(
WCHAR
));
if
(
!
test_currentDir
||
!
test_localPathA
||
!
test_localPathB
||
!
test_remotePathA
||
!
test_remotePathB
)
{
skip
(
"Couldn't allocate memory for full paths
\n
"
);
return
FALSE
;
}
if
(
GetCurrentDirectoryW
(
n
,
test_currentDir
)
!=
n
-
1
)
{
skip
(
"Couldn't get current directory
\n
"
);
return
FALSE
;
}
wsprintfW
(
test_localPathA
,
format
,
test_currentDir
,
test_localNameA
);
wsprintfW
(
test_localPathB
,
format
,
test_currentDir
,
test_localNameB
);
wsprintfW
(
test_remotePathA
,
format
,
test_currentDir
,
test_remoteNameA
);
wsprintfW
(
test_remotePathB
,
format
,
test_currentDir
,
test_remoteNameB
);
return
TRUE
;
}
/* Generic test setup */
static
BOOL
setup
(
void
)
{
...
...
@@ -116,6 +172,25 @@ static void test_GetName(void)
CoTaskMemFree
(
displayName
);
}
/* Test adding a file */
static
void
test_AddFile
(
void
)
{
HRESULT
hres
;
hres
=
IBackgroundCopyJob_AddFile
(
test_job
,
test_remotePathA
,
test_localPathA
);
ok
(
hres
==
S_OK
,
"First call to AddFile failed: 0x%08x
\n
"
,
hres
);
if
(
hres
!=
S_OK
)
{
skip
(
"Unable to add first file to job
\n
"
);
return
;
}
hres
=
IBackgroundCopyJob_AddFile
(
test_job
,
test_remotePathB
,
test_localPathB
);
ok
(
hres
==
S_OK
,
"Second call to AddFile failed: 0x%08x
\n
"
,
hres
);
}
typedef
void
(
*
test_t
)(
void
);
START_TEST
(
job
)
...
...
@@ -124,10 +199,14 @@ START_TEST(job)
test_GetId
,
test_GetType
,
test_GetName
,
test_AddFile
,
0
};
const
test_t
*
test
;
if
(
!
init_paths
())
return
;
CoInitialize
(
NULL
);
for
(
test
=
tests
;
*
test
;
++
test
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment