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
a7449dbf
Commit
a7449dbf
authored
Jan 17, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: COM cleanup of IBackgroundCopyJob2 interface.
parent
62b4f31d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
45 deletions
+52
-45
enum_files.c
dlls/qmgr/enum_files.c
+3
-4
enum_jobs.c
dlls/qmgr/enum_jobs.c
+3
-3
file.c
dlls/qmgr/file.c
+2
-2
job.c
dlls/qmgr/job.c
+37
-27
qmgr.c
dlls/qmgr/qmgr.c
+4
-5
qmgr.h
dlls/qmgr/qmgr.h
+3
-4
No files found.
dlls/qmgr/enum_files.c
View file @
a7449dbf
...
...
@@ -167,14 +167,13 @@ static const IEnumBackgroundCopyFilesVtbl BITS_IEnumBackgroundCopyFiles_Vtbl =
BITS_IEnumBackgroundCopyFiles_GetCount
};
HRESULT
EnumBackgroundCopyFilesConstructor
(
LPVOID
*
ppObj
,
IBackgroundCopyJob2
*
iCopyJob
)
HRESULT
EnumBackgroundCopyFilesConstructor
(
BackgroundCopyJobImpl
*
job
,
IEnumBackgroundCopyFiles
**
enum_files
)
{
EnumBackgroundCopyFilesImpl
*
This
;
BackgroundCopyFileImpl
*
file
;
BackgroundCopyJobImpl
*
job
=
(
BackgroundCopyJobImpl
*
)
iCopyJob
;
ULONG
i
;
TRACE
(
"%p, %p)
\n
"
,
ppObj
,
job
);
TRACE
(
"%p, %p)
\n
"
,
job
,
enum_files
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
This
);
if
(
!
This
)
...
...
@@ -209,6 +208,6 @@ HRESULT EnumBackgroundCopyFilesConstructor(LPVOID *ppObj, IBackgroundCopyJob2 *i
}
LeaveCriticalSection
(
&
job
->
cs
);
*
ppObj
=
&
This
->
IEnumBackgroundCopyFiles_iface
;
*
enum_files
=
&
This
->
IEnumBackgroundCopyFiles_iface
;
return
S_OK
;
}
dlls/qmgr/enum_jobs.c
View file @
a7449dbf
...
...
@@ -200,9 +200,9 @@ HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCop
i
=
0
;
LIST_FOR_EACH_ENTRY
(
job
,
&
qmgr
->
jobs
,
BackgroundCopyJobImpl
,
entryFromQmgr
)
{
IBackgroundCopyJob
*
iJob
=
(
IBackgroundCopyJob
*
)
job
;
IBackgroundCopyJob_AddRef
(
iJob
);
This
->
jobs
[
i
++
]
=
iJob
;
IBackgroundCopyJob
*
job_iface
=
(
IBackgroundCopyJob
*
)
&
job
->
IBackgroundCopyJob2_iface
;
IBackgroundCopyJob_AddRef
(
job_iface
);
This
->
jobs
[
i
++
]
=
job_iface
;
}
LeaveCriticalSection
(
&
qmgr
->
cs
);
...
...
dlls/qmgr/file.c
View file @
a7449dbf
...
...
@@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
static
void
BackgroundCopyFileDestructor
(
BackgroundCopyFileImpl
*
This
)
{
IBackgroundCopyJob
_Release
((
IBackgroundCopyJob
*
)
This
->
owner
);
IBackgroundCopyJob
2_Release
(
&
This
->
owner
->
IBackgroundCopyJob2_iface
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
info
.
LocalName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
info
.
RemoteName
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -177,7 +177,7 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
This
->
fileProgress
.
BytesTransferred
=
0
;
This
->
fileProgress
.
Completed
=
FALSE
;
This
->
owner
=
owner
;
IBackgroundCopyJob
_AddRef
((
IBackgroundCopyJob
*
)
owner
);
IBackgroundCopyJob
2_AddRef
(
&
owner
->
IBackgroundCopyJob2_iface
);
*
ppObj
=
&
This
->
lpVtbl
;
return
S_OK
;
...
...
dlls/qmgr/job.c
View file @
a7449dbf
...
...
@@ -36,36 +36,46 @@ static void BackgroundCopyJobDestructor(BackgroundCopyJobImpl *This)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
ULONG
WINAPI
BITS_IBackgroundCopyJob_AddRef
(
IBackgroundCopyJob2
*
iface
)
static
inline
BackgroundCopyJobImpl
*
impl_from_IBackgroundCopyJob2
(
IBackgroundCopyJob2
*
iface
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
return
CONTAINING_RECORD
(
iface
,
BackgroundCopyJobImpl
,
IBackgroundCopyJob2_iface
);
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_QueryInterface
(
IBackgroundCopyJob2
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObject
)
IBackgroundCopyJob2
*
iface
,
REFIID
riid
,
void
**
obj
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
TRACE
(
"IID: %s
\n
"
,
debugstr_guid
(
riid
));
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IBackgroundCopyJob
)
||
IsEqualGUID
(
riid
,
&
IID_IBackgroundCopyJob2
))
{
*
ppvObject
=
&
This
->
lpVtbl
;
BITS_IBackgroundCopyJob
_AddRef
(
iface
);
*
obj
=
iface
;
IBackgroundCopyJob2
_AddRef
(
iface
);
return
S_OK
;
}
*
ppvObject
=
NULL
;
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
BITS_IBackgroundCopyJob_AddRef
(
IBackgroundCopyJob2
*
iface
)
{
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
BITS_IBackgroundCopyJob_Release
(
IBackgroundCopyJob2
*
iface
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
BackgroundCopyJobDestructor
(
This
);
...
...
@@ -95,7 +105,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFile(
LPCWSTR
RemoteUrl
,
LPCWSTR
LocalName
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
IBackgroundCopyFile
*
pFile
;
BackgroundCopyFileImpl
*
file
;
HRESULT
res
;
...
...
@@ -121,10 +131,11 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFile(
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_EnumFiles
(
IBackgroundCopyJob2
*
iface
,
IEnumBackgroundCopyFiles
**
ppEnum
)
IEnumBackgroundCopyFiles
**
enum_files
)
{
TRACE
(
"
\n
"
);
return
EnumBackgroundCopyFilesConstructor
((
LPVOID
*
)
ppEnum
,
iface
);
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
enum_files
);
return
EnumBackgroundCopyFilesConstructor
(
This
,
enum_files
);
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_Suspend
(
...
...
@@ -137,7 +148,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_Suspend(
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_Resume
(
IBackgroundCopyJob2
*
iface
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
HRESULT
rv
=
S_OK
;
EnterCriticalSection
(
&
globalMgr
.
cs
);
...
...
@@ -171,7 +182,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_Cancel(
static
HRESULT
WINAPI
BITS_IBackgroundCopyJob_Complete
(
IBackgroundCopyJob2
*
iface
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
HRESULT
rv
=
S_OK
;
EnterCriticalSection
(
&
This
->
cs
);
...
...
@@ -214,7 +225,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetId(
IBackgroundCopyJob2
*
iface
,
GUID
*
pVal
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
*
pVal
=
This
->
jobId
;
return
S_OK
;
}
...
...
@@ -223,7 +234,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetType(
IBackgroundCopyJob2
*
iface
,
BG_JOB_TYPE
*
pVal
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
if
(
!
pVal
)
return
E_INVALIDARG
;
...
...
@@ -236,7 +247,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress(
IBackgroundCopyJob2
*
iface
,
BG_JOB_PROGRESS
*
pVal
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
if
(
!
pVal
)
return
E_INVALIDARG
;
...
...
@@ -263,7 +274,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetState(
IBackgroundCopyJob2
*
iface
,
BG_JOB_STATE
*
pVal
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
if
(
!
pVal
)
return
E_INVALIDARG
;
...
...
@@ -301,7 +312,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetDisplayName(
IBackgroundCopyJob2
*
iface
,
LPWSTR
*
pVal
)
{
BackgroundCopyJobImpl
*
This
=
(
BackgroundCopyJobImpl
*
)
iface
;
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
iface
)
;
int
n
;
if
(
!
pVal
)
...
...
@@ -563,20 +574,19 @@ static const IBackgroundCopyJob2Vtbl BITS_IBackgroundCopyJob_Vtbl =
BITS_IBackgroundCopyJob_RemoveCredentials
};
HRESULT
BackgroundCopyJobConstructor
(
LPCWSTR
displayName
,
BG_JOB_TYPE
type
,
GUID
*
pJobId
,
LPVOID
*
ppObj
)
HRESULT
BackgroundCopyJobConstructor
(
LPCWSTR
displayName
,
BG_JOB_TYPE
type
,
GUID
*
job_id
,
BackgroundCopyJobImpl
**
job
)
{
HRESULT
hr
;
BackgroundCopyJobImpl
*
This
;
int
n
;
TRACE
(
"(%s,%d,%p)
\n
"
,
debugstr_w
(
displayName
),
type
,
ppObj
);
TRACE
(
"(%s,%d,%p)
\n
"
,
debugstr_w
(
displayName
),
type
,
job
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
This
);
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
BITS_IBackgroundCopyJob_Vtbl
;
This
->
IBackgroundCopyJob2_iface
.
lpVtbl
=
&
BITS_IBackgroundCopyJob_Vtbl
;
InitializeCriticalSection
(
&
This
->
cs
);
This
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": BackgroundCopyJobImpl.cs"
);
...
...
@@ -603,7 +613,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
hr
;
}
*
pJobI
d
=
This
->
jobId
;
*
job_i
d
=
This
->
jobId
;
list_init
(
&
This
->
files
);
This
->
jobProgress
.
BytesTotal
=
0
;
...
...
@@ -613,7 +623,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type,
This
->
state
=
BG_JOB_STATE_SUSPENDED
;
*
ppObj
=
&
This
->
lpVtbl
;
*
job
=
This
;
return
S_OK
;
}
...
...
dlls/qmgr/qmgr.c
View file @
a7449dbf
...
...
@@ -60,14 +60,13 @@ static HRESULT WINAPI BITS_IBackgroundCopyManager_CreateJob(IBackgroundCopyManag
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
BackgroundCopyJobConstructor
(
DisplayName
,
Type
,
pJobId
,
(
LPVOID
*
)
ppJob
);
hres
=
BackgroundCopyJobConstructor
(
DisplayName
,
Type
,
pJobId
,
&
job
);
if
(
FAILED
(
hres
))
return
hres
;
/* Add a reference to the job to job list */
*
ppJob
=
(
IBackgroundCopyJob
*
)
&
job
->
IBackgroundCopyJob2_iface
;
IBackgroundCopyJob_AddRef
(
*
ppJob
);
job
=
(
BackgroundCopyJobImpl
*
)
*
ppJob
;
EnterCriticalSection
(
&
globalMgr
.
cs
);
list_add_head
(
&
globalMgr
.
jobs
,
&
job
->
entryFromQmgr
);
LeaveCriticalSection
(
&
globalMgr
.
cs
);
...
...
@@ -141,7 +140,7 @@ DWORD WINAPI fileTransfer(void *param)
LIST_FOR_EACH_ENTRY_SAFE
(
job
,
jobCur
,
&
qmgr
->
jobs
,
BackgroundCopyJobImpl
,
entryFromQmgr
)
{
list_remove
(
&
job
->
entryFromQmgr
);
IBackgroundCopyJob
_Release
((
IBackgroundCopyJob
*
)
job
);
IBackgroundCopyJob
2_Release
(
&
job
->
IBackgroundCopyJob2_iface
);
}
return
0
;
}
...
...
@@ -156,7 +155,7 @@ DWORD WINAPI fileTransfer(void *param)
if
(
job
->
state
==
BG_JOB_STATE_ACKNOWLEDGED
||
job
->
state
==
BG_JOB_STATE_CANCELLED
)
{
list_remove
(
&
job
->
entryFromQmgr
);
IBackgroundCopyJob
_Release
((
IBackgroundCopyJob
*
)
job
);
IBackgroundCopyJob
2_Release
(
&
job
->
IBackgroundCopyJob2_iface
);
}
else
if
(
job
->
state
==
BG_JOB_STATE_QUEUED
)
{
...
...
dlls/qmgr/qmgr.h
View file @
a7449dbf
...
...
@@ -33,7 +33,7 @@
/* Background copy job vtbl and related data */
typedef
struct
{
const
IBackgroundCopyJob2Vtbl
*
lpVtbl
;
IBackgroundCopyJob2
IBackgroundCopyJob2_iface
;
LONG
ref
;
LPWSTR
displayName
;
BG_JOB_TYPE
type
;
...
...
@@ -79,14 +79,13 @@ extern BackgroundCopyManagerImpl globalMgr DECLSPEC_HIDDEN;
HRESULT
BackgroundCopyManagerConstructor
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
BackgroundCopyJobConstructor
(
LPCWSTR
displayName
,
BG_JOB_TYPE
type
,
GUID
*
pJobId
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
GUID
*
pJobId
,
BackgroundCopyJobImpl
**
job
)
DECLSPEC_HIDDEN
;
HRESULT
enum_copy_job_create
(
BackgroundCopyManagerImpl
*
qmgr
,
IEnumBackgroundCopyJobs
**
enumjob
)
DECLSPEC_HIDDEN
;
HRESULT
BackgroundCopyFileConstructor
(
BackgroundCopyJobImpl
*
owner
,
LPCWSTR
remoteName
,
LPCWSTR
localName
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
EnumBackgroundCopyFilesConstructor
(
LPVOID
*
ppObj
,
IBackgroundCopyJob2
*
copyJob
)
DECLSPEC_HIDDEN
;
HRESULT
EnumBackgroundCopyFilesConstructor
(
BackgroundCopyJobImpl
*
,
IEnumBackgroundCopyFiles
**
)
DECLSPEC_HIDDEN
;
DWORD
WINAPI
fileTransfer
(
void
*
param
)
DECLSPEC_HIDDEN
;
void
processJob
(
BackgroundCopyJobImpl
*
job
)
DECLSPEC_HIDDEN
;
BOOL
processFile
(
BackgroundCopyFileImpl
*
file
,
BackgroundCopyJobImpl
*
job
)
DECLSPEC_HIDDEN
;
...
...
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