Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
111e6929
Commit
111e6929
authored
Feb 22, 2008
by
Roy Shea
Committed by
Alexandre Julliard
Feb 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: Implement IBackgroundCopyManager_CreateJob with test.
parent
fee94bbc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
2 deletions
+85
-2
job.c
dlls/qmgr/job.c
+40
-0
qmgr.c
dlls/qmgr/qmgr.c
+3
-2
qmgr.h
dlls/qmgr/qmgr.h
+5
-0
qmgr.c
dlls/qmgr/tests/qmgr.c
+37
-0
No files found.
dlls/qmgr/job.c
View file @
111e6929
...
...
@@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
static
void
BackgroundCopyJobDestructor
(
BackgroundCopyJobImpl
*
This
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
displayName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -361,3 +362,42 @@ static const IBackgroundCopyJobVtbl BITS_IBackgroundCopyJob_Vtbl =
BITS_IBackgroundCopyJob_GetProxySettings
,
BITS_IBackgroundCopyJob_TakeOwnership
,
};
HRESULT
BackgroundCopyJobConstructor
(
LPCWSTR
displayName
,
BG_JOB_TYPE
type
,
GUID
*
pJobId
,
LPVOID
*
ppObj
)
{
HRESULT
hr
;
BackgroundCopyJobImpl
*
This
;
int
n
;
TRACE
(
"(%s,%d,%p)
\n
"
,
debugstr_w
(
displayName
),
type
,
ppObj
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
This
);
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
BITS_IBackgroundCopyJob_Vtbl
;
This
->
ref
=
1
;
This
->
type
=
type
;
n
=
(
lstrlenW
(
displayName
)
+
1
)
*
sizeof
*
displayName
;
This
->
displayName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
n
);
if
(
!
This
->
displayName
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
}
memcpy
(
This
->
displayName
,
displayName
,
n
);
hr
=
CoCreateGuid
(
&
This
->
jobId
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
displayName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
memcpy
(
pJobId
,
&
This
->
jobId
,
sizeof
(
GUID
));
*
ppObj
=
&
This
->
lpVtbl
;
return
S_OK
;
}
dlls/qmgr/qmgr.c
View file @
111e6929
...
...
@@ -91,8 +91,9 @@ static HRESULT WINAPI BITS_IBackgroundCopyManager_CreateJob(
GUID
*
pJobId
,
IBackgroundCopyJob
**
ppJob
)
{
FIXME
(
"Not implemented
\n
"
);
return
E_NOTIMPL
;
TRACE
(
"
\n
"
);
return
BackgroundCopyJobConstructor
(
DisplayName
,
Type
,
pJobId
,
(
LPVOID
*
)
ppJob
);
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyManager_GetJob
(
...
...
dlls/qmgr/qmgr.h
View file @
111e6929
...
...
@@ -34,6 +34,9 @@ typedef struct
{
const
IBackgroundCopyJobVtbl
*
lpVtbl
;
LONG
ref
;
LPWSTR
displayName
;
BG_JOB_TYPE
type
;
GUID
jobId
;
}
BackgroundCopyJobImpl
;
/* Background copy manager vtbl and related data */
...
...
@@ -51,6 +54,8 @@ typedef struct
extern
ClassFactoryImpl
BITS_ClassFactory
;
HRESULT
BackgroundCopyManagerConstructor
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
);
HRESULT
BackgroundCopyJobConstructor
(
LPCWSTR
displayName
,
BG_JOB_TYPE
type
,
GUID
*
pJobId
,
LPVOID
*
ppObj
);
/* Little helper functions */
static
inline
char
*
...
...
dlls/qmgr/tests/qmgr.c
View file @
111e6929
...
...
@@ -48,9 +48,46 @@ test_CreateInstance(void)
}
static
void
test_CreateJob
(
void
)
{
/* Job information */
static
const
WCHAR
copyNameW
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
0
};
IBackgroundCopyJob
*
job
=
NULL
;
GUID
tmpId
;
HRESULT
hres
;
ULONG
res
;
IBackgroundCopyManager
*
manager
=
NULL
;
/* Setup */
hres
=
CoCreateInstance
(
&
CLSID_BackgroundCopyManager
,
NULL
,
CLSCTX_LOCAL_SERVER
,
&
IID_IBackgroundCopyManager
,
(
void
**
)
&
manager
);
if
(
hres
!=
S_OK
)
{
skip
(
"Unable to create bits instance required for test.
\n
"
);
return
;
}
/* Create bits job */
hres
=
IBackgroundCopyManager_CreateJob
(
manager
,
copyNameW
,
BG_JOB_TYPE_DOWNLOAD
,
&
tmpId
,
&
job
);
ok
(
hres
==
S_OK
,
"CreateJob failed: %08x
\n
"
,
hres
);
if
(
hres
!=
S_OK
)
skip
(
"Unable to create bits job.
\n
"
);
else
{
res
=
IBackgroundCopyJob_Release
(
job
);
ok
(
res
==
0
,
"Bad ref count on release: %u
\n
"
,
res
);
}
IBackgroundCopyManager_Release
(
manager
);
}
START_TEST
(
qmgr
)
{
CoInitialize
(
NULL
);
test_CreateInstance
();
test_CreateJob
();
CoUninitialize
();
}
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