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
d4edda8c
Commit
d4edda8c
authored
Jan 18, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: COM cleanup for IBackgroundCopyFile interface.
parent
175039e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
30 deletions
+37
-30
enum_files.c
dlls/qmgr/enum_files.c
+2
-2
file.c
dlls/qmgr/file.c
+31
-22
job.c
dlls/qmgr/job.c
+2
-4
qmgr.h
dlls/qmgr/qmgr.h
+2
-2
No files found.
dlls/qmgr/enum_files.c
View file @
d4edda8c
...
...
@@ -202,8 +202,8 @@ HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl *job, IEnumBack
i
=
0
;
LIST_FOR_EACH_ENTRY
(
file
,
&
job
->
files
,
BackgroundCopyFileImpl
,
entryFromJob
)
{
file
->
lpVtbl
->
AddRef
((
IBackgroundCopyFile
*
)
fil
e
);
This
->
files
[
i
]
=
(
IBackgroundCopyFile
*
)
fil
e
;
IBackgroundCopyFile_AddRef
(
&
file
->
IBackgroundCopyFile_ifac
e
);
This
->
files
[
i
]
=
&
file
->
IBackgroundCopyFile_ifac
e
;
++
i
;
}
LeaveCriticalSection
(
&
job
->
cs
);
...
...
dlls/qmgr/file.c
View file @
d4edda8c
...
...
@@ -35,6 +35,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
qmgr
);
static
inline
BackgroundCopyFileImpl
*
impl_from_IBackgroundCopyFile
(
IBackgroundCopyFile
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
BackgroundCopyFileImpl
,
IBackgroundCopyFile_iface
);
}
static
void
BackgroundCopyFileDestructor
(
BackgroundCopyFileImpl
*
This
)
{
IBackgroundCopyJob2_Release
(
&
This
->
owner
->
IBackgroundCopyJob2_iface
);
...
...
@@ -43,38 +48,43 @@ static void BackgroundCopyFileDestructor(BackgroundCopyFileImpl *This)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
ULONG
WINAPI
BITS_IBackgroundCopyFile_AddRef
(
IBackgroundCopyFile
*
iface
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
BITS_IBackgroundCopyFile_QueryInterface
(
IBackgroundCopyFile
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
void
**
obj
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
BackgroundCopyFileImpl
*
This
=
impl_from_IBackgroundCopyFile
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IBackgroundCopyFile
))
{
*
ppvObject
=
&
This
->
lpVtbl
;
BITS_
IBackgroundCopyFile_AddRef
(
iface
);
*
obj
=
iface
;
IBackgroundCopyFile_AddRef
(
iface
);
return
S_OK
;
}
*
ppvObject
=
NULL
;
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
BITS_IBackgroundCopyFile_AddRef
(
IBackgroundCopyFile
*
iface
)
{
BackgroundCopyFileImpl
*
This
=
impl_from_IBackgroundCopyFile
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
BITS_IBackgroundCopyFile_Release
(
IBackgroundCopyFile
*
iface
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
BackgroundCopyFileImpl
*
This
=
impl_from_IBackgroundCopyFile
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
BackgroundCopyFileDestructor
(
This
);
...
...
@@ -86,7 +96,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetRemoteName(
IBackgroundCopyFile
*
iface
,
LPWSTR
*
pVal
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
BackgroundCopyFileImpl
*
This
=
impl_from_IBackgroundCopyFile
(
iface
)
;
int
n
=
(
lstrlenW
(
This
->
info
.
RemoteName
)
+
1
)
*
sizeof
(
WCHAR
);
*
pVal
=
CoTaskMemAlloc
(
n
);
...
...
@@ -101,7 +111,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetLocalName(
IBackgroundCopyFile
*
iface
,
LPWSTR
*
pVal
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
BackgroundCopyFileImpl
*
This
=
impl_from_IBackgroundCopyFile
(
iface
)
;
int
n
=
(
lstrlenW
(
This
->
info
.
LocalName
)
+
1
)
*
sizeof
(
WCHAR
);
*
pVal
=
CoTaskMemAlloc
(
n
);
...
...
@@ -116,7 +126,7 @@ static HRESULT WINAPI BITS_IBackgroundCopyFile_GetProgress(
IBackgroundCopyFile
*
iface
,
BG_FILE_PROGRESS
*
pVal
)
{
BackgroundCopyFileImpl
*
This
=
(
BackgroundCopyFileImpl
*
)
iface
;
BackgroundCopyFileImpl
*
This
=
impl_from_IBackgroundCopyFile
(
iface
)
;
EnterCriticalSection
(
&
This
->
owner
->
cs
);
pVal
->
BytesTotal
=
This
->
fileProgress
.
BytesTotal
;
...
...
@@ -139,13 +149,12 @@ static const IBackgroundCopyFileVtbl BITS_IBackgroundCopyFile_Vtbl =
HRESULT
BackgroundCopyFileConstructor
(
BackgroundCopyJobImpl
*
owner
,
LPCWSTR
remoteName
,
LPCWSTR
localName
,
LPVOID
*
ppObj
)
BackgroundCopyFileImpl
**
file
)
{
BackgroundCopyFileImpl
*
This
;
int
n
;
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_w
(
remoteName
),
debugstr_w
(
localName
),
ppObj
);
TRACE
(
"(%s, %s, %p)
\n
"
,
debugstr_w
(
remoteName
),
debugstr_w
(
localName
),
file
);
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
*
This
);
if
(
!
This
)
...
...
@@ -170,7 +179,7 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
}
memcpy
(
This
->
info
.
LocalName
,
localName
,
n
);
This
->
lpVtbl
=
&
BITS_IBackgroundCopyFile_Vtbl
;
This
->
IBackgroundCopyFile_iface
.
lpVtbl
=
&
BITS_IBackgroundCopyFile_Vtbl
;
This
->
ref
=
1
;
This
->
fileProgress
.
BytesTotal
=
BG_SIZE_UNKNOWN
;
...
...
@@ -179,7 +188,7 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
This
->
owner
=
owner
;
IBackgroundCopyJob2_AddRef
(
&
owner
->
IBackgroundCopyJob2_iface
);
*
ppObj
=
&
This
->
lpVtbl
;
*
file
=
This
;
return
S_OK
;
}
...
...
@@ -236,7 +245,7 @@ static ULONG WINAPI DLBindStatusCallback_Release(IBindStatusCallback *iface)
if
(
ref
==
0
)
{
IBackgroundCopyFile_Release
(
(
IBackgroundCopyFile
*
)
This
->
fil
e
);
IBackgroundCopyFile_Release
(
&
This
->
file
->
IBackgroundCopyFile_ifac
e
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -365,7 +374,7 @@ static DLBindStatusCallback *DLBindStatusCallbackConstructor(
return
NULL
;
This
->
IBindStatusCallback_iface
.
lpVtbl
=
&
DLBindStatusCallback_Vtbl
;
IBackgroundCopyFile_AddRef
(
(
IBackgroundCopyFile
*
)
fil
e
);
IBackgroundCopyFile_AddRef
(
&
file
->
IBackgroundCopyFile_ifac
e
);
This
->
file
=
file
;
This
->
ref
=
1
;
return
This
;
...
...
dlls/qmgr/job.c
View file @
d4edda8c
...
...
@@ -106,20 +106,18 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_AddFile(
LPCWSTR
LocalName
)
{
BackgroundCopyJobImpl
*
This
=
impl_from_IBackgroundCopyJob2
(
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
(
This
,
RemoteUrl
,
LocalName
,
(
LPVOID
*
)
&
pF
ile
);
res
=
BackgroundCopyFileConstructor
(
This
,
RemoteUrl
,
LocalName
,
&
f
ile
);
if
(
res
!=
S_OK
)
return
res
;
/* Add a reference to the file to file list */
IBackgroundCopyFile_AddRef
(
pFile
);
file
=
(
BackgroundCopyFileImpl
*
)
pFile
;
IBackgroundCopyFile_AddRef
(
&
file
->
IBackgroundCopyFile_iface
);
EnterCriticalSection
(
&
This
->
cs
);
list_add_head
(
&
This
->
files
,
&
file
->
entryFromJob
);
This
->
jobProgress
.
BytesTotal
=
BG_SIZE_UNKNOWN
;
...
...
dlls/qmgr/qmgr.h
View file @
d4edda8c
...
...
@@ -49,7 +49,7 @@ typedef struct
/* Background copy file vtbl and related data */
typedef
struct
{
const
IBackgroundCopyFileVtbl
*
lpVtbl
;
IBackgroundCopyFile
IBackgroundCopyFile_iface
;
LONG
ref
;
BG_FILE_INFO
info
;
BG_FILE_PROGRESS
fileProgress
;
...
...
@@ -84,7 +84,7 @@ HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr,
IEnumBackgroundCopyJobs
**
enumjob
)
DECLSPEC_HIDDEN
;
HRESULT
BackgroundCopyFileConstructor
(
BackgroundCopyJobImpl
*
owner
,
LPCWSTR
remoteName
,
LPCWSTR
localName
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
BackgroundCopyFileImpl
**
file
)
DECLSPEC_HIDDEN
;
HRESULT
EnumBackgroundCopyFilesConstructor
(
BackgroundCopyJobImpl
*
,
IEnumBackgroundCopyFiles
**
)
DECLSPEC_HIDDEN
;
DWORD
WINAPI
fileTransfer
(
void
*
param
)
DECLSPEC_HIDDEN
;
void
processJob
(
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