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
b74af4aa
Commit
b74af4aa
authored
Dec 06, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Use ifaces instead of vtbl pointers in DownloadBSC.
parent
d98e2103
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
35 deletions
+34
-35
download.c
dlls/urlmon/download.c
+34
-35
No files found.
dlls/urlmon/download.c
View file @
b74af4aa
...
...
@@ -22,8 +22,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
typedef
struct
{
const
IBindStatusCallbackVtbl
*
lpBindStatusCallbackVtbl
;
const
IServiceProviderVtbl
*
lpServiceProviderVtbl
;
IBindStatusCallback
IBindStatusCallback_iface
;
IServiceProvider
IServiceProvider_iface
;
LONG
ref
;
...
...
@@ -32,27 +32,32 @@ typedef struct {
LPWSTR
cache_file
;
}
DownloadBSC
;
#define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
static
inline
DownloadBSC
*
impl_from_IBindStatusCallback
(
IBindStatusCallback
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
DownloadBSC
,
IBindStatusCallback_iface
);
}
#define STATUSCLB_THIS(iface) DEFINE_THIS(DownloadBSC, BindStatusCallback, iface)
static
inline
DownloadBSC
*
impl_from_IServiceProvider
(
IServiceProvider
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
DownloadBSC
,
IServiceProvider_iface
);
}
static
HRESULT
WINAPI
DownloadBSC_QueryInterface
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
STATUSCLB
(
This
)
;
*
ppv
=
&
This
->
IBindStatusCallback_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IBindStatusCallback
,
riid
))
{
TRACE
(
"(%p)->(IID_IBindStatusCallback, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
STATUSCLB
(
This
)
;
*
ppv
=
&
This
->
IBindStatusCallback_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
{
TRACE
(
"(%p)->(IID_IServiceProvider, %p)
\n
"
,
This
,
ppv
);
*
ppv
=
SERVPROV
(
This
)
;
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
if
(
*
ppv
)
{
...
...
@@ -66,7 +71,7 @@ static HRESULT WINAPI DownloadBSC_QueryInterface(IBindStatusCallback *iface,
static
ULONG
WINAPI
DownloadBSC_AddRef
(
IBindStatusCallback
*
iface
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref = %d
\n
"
,
This
,
ref
);
...
...
@@ -76,7 +81,7 @@ static ULONG WINAPI DownloadBSC_AddRef(IBindStatusCallback *iface)
static
ULONG
WINAPI
DownloadBSC_Release
(
IBindStatusCallback
*
iface
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref = %d
\n
"
,
This
,
ref
);
...
...
@@ -95,7 +100,7 @@ static ULONG WINAPI DownloadBSC_Release(IBindStatusCallback *iface)
static
HRESULT
WINAPI
DownloadBSC_OnStartBinding
(
IBindStatusCallback
*
iface
,
DWORD
dwReserved
,
IBinding
*
pbind
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
TRACE
(
"(%p)->(%d %p)
\n
"
,
This
,
dwReserved
,
pbind
);
...
...
@@ -107,14 +112,14 @@ static HRESULT WINAPI DownloadBSC_OnStartBinding(IBindStatusCallback *iface,
static
HRESULT
WINAPI
DownloadBSC_GetPriority
(
IBindStatusCallback
*
iface
,
LONG
*
pnPriority
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pnPriority
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
DownloadBSC_OnLowResource
(
IBindStatusCallback
*
iface
,
DWORD
reserved
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
FIXME
(
"(%p)->(%d)
\n
"
,
This
,
reserved
);
return
E_NOTIMPL
;
}
...
...
@@ -133,7 +138,7 @@ static HRESULT on_progress(DownloadBSC *This, ULONG progress, ULONG progress_max
static
HRESULT
WINAPI
DownloadBSC_OnProgress
(
IBindStatusCallback
*
iface
,
ULONG
ulProgress
,
ULONG
ulProgressMax
,
ULONG
ulStatusCode
,
LPCWSTR
szStatusText
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
HRESULT
hres
=
S_OK
;
TRACE
(
"%p)->(%u %u %u %s)
\n
"
,
This
,
ulProgress
,
ulProgressMax
,
ulStatusCode
,
...
...
@@ -167,7 +172,7 @@ static HRESULT WINAPI DownloadBSC_OnProgress(IBindStatusCallback *iface, ULONG u
static
HRESULT
WINAPI
DownloadBSC_OnStopBinding
(
IBindStatusCallback
*
iface
,
HRESULT
hresult
,
LPCWSTR
szError
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
TRACE
(
"(%p)->(%08x %s)
\n
"
,
This
,
hresult
,
debugstr_w
(
szError
));
...
...
@@ -192,7 +197,7 @@ static HRESULT WINAPI DownloadBSC_OnStopBinding(IBindStatusCallback *iface,
static
HRESULT
WINAPI
DownloadBSC_GetBindInfo
(
IBindStatusCallback
*
iface
,
DWORD
*
grfBINDF
,
BINDINFO
*
pbindinfo
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
DWORD
bindf
=
0
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
grfBINDF
,
pbindinfo
);
...
...
@@ -216,7 +221,7 @@ static HRESULT WINAPI DownloadBSC_GetBindInfo(IBindStatusCallback *iface,
static
HRESULT
WINAPI
DownloadBSC_OnDataAvailable
(
IBindStatusCallback
*
iface
,
DWORD
grfBSCF
,
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
TRACE
(
"(%p)->(%08x %d %p %p)
\n
"
,
This
,
grfBSCF
,
dwSize
,
pformatetc
,
pstgmed
);
...
...
@@ -226,13 +231,11 @@ static HRESULT WINAPI DownloadBSC_OnDataAvailable(IBindStatusCallback *iface,
static
HRESULT
WINAPI
DownloadBSC_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
IUnknown
*
punk
)
{
DownloadBSC
*
This
=
STATUSCLB_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IBindStatusCallback
(
iface
);
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
punk
);
return
E_NOTIMPL
;
}
#undef STATUSCLB_THIS
static
const
IBindStatusCallbackVtbl
BindStatusCallbackVtbl
=
{
DownloadBSC_QueryInterface
,
DownloadBSC_AddRef
,
...
...
@@ -247,31 +250,29 @@ static const IBindStatusCallbackVtbl BindStatusCallbackVtbl = {
DownloadBSC_OnObjectAvailable
};
#define SERVPROV_THIS(iface) DEFINE_THIS(DownloadBSC, ServiceProvider, iface)
static
HRESULT
WINAPI
DwlServiceProvider_QueryInterface
(
IServiceProvider
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
DownloadBSC
*
This
=
SERVPROV_THIS
(
iface
);
return
IBindStatusCallback_QueryInterface
(
STATUSCLB
(
This
)
,
riid
,
ppv
);
DownloadBSC
*
This
=
impl_from_IServiceProvider
(
iface
);
return
IBindStatusCallback_QueryInterface
(
&
This
->
IBindStatusCallback_iface
,
riid
,
ppv
);
}
static
ULONG
WINAPI
DwlServiceProvider_AddRef
(
IServiceProvider
*
iface
)
{
DownloadBSC
*
This
=
SERVPROV_THIS
(
iface
);
return
IBindStatusCallback_AddRef
(
STATUSCLB
(
This
)
);
DownloadBSC
*
This
=
impl_from_IServiceProvider
(
iface
);
return
IBindStatusCallback_AddRef
(
&
This
->
IBindStatusCallback_iface
);
}
static
ULONG
WINAPI
DwlServiceProvider_Release
(
IServiceProvider
*
iface
)
{
DownloadBSC
*
This
=
SERVPROV_THIS
(
iface
);
return
IBindStatusCallback_Release
(
STATUSCLB
(
This
)
);
DownloadBSC
*
This
=
impl_from_IServiceProvider
(
iface
);
return
IBindStatusCallback_Release
(
&
This
->
IBindStatusCallback_iface
);
}
static
HRESULT
WINAPI
DwlServiceProvider_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
REFIID
riid
,
void
**
ppv
)
{
DownloadBSC
*
This
=
SERVPROV_THIS
(
iface
);
DownloadBSC
*
This
=
impl_from_IServiceProvider
(
iface
);
IServiceProvider
*
serv_prov
;
HRESULT
hres
;
...
...
@@ -294,8 +295,6 @@ static HRESULT WINAPI DwlServiceProvider_QueryService(IServiceProvider *iface,
return
E_NOINTERFACE
;
}
#undef SERVPROV_THIS
static
const
IServiceProviderVtbl
ServiceProviderVtbl
=
{
DwlServiceProvider_QueryInterface
,
DwlServiceProvider_AddRef
,
...
...
@@ -307,8 +306,8 @@ static HRESULT DownloadBSC_Create(IBindStatusCallback *callback, LPCWSTR file_na
{
DownloadBSC
*
ret
=
heap_alloc
(
sizeof
(
*
ret
));
ret
->
lpBindStatusCallback
Vtbl
=
&
BindStatusCallbackVtbl
;
ret
->
lpServiceProviderVtbl
=
&
ServiceProviderVtbl
;
ret
->
IBindStatusCallback_iface
.
lp
Vtbl
=
&
BindStatusCallbackVtbl
;
ret
->
IServiceProvider_iface
.
lpVtbl
=
&
ServiceProviderVtbl
;
ret
->
ref
=
1
;
ret
->
file_name
=
heap_strdupW
(
file_name
);
ret
->
cache_file
=
NULL
;
...
...
@@ -317,7 +316,7 @@ static HRESULT DownloadBSC_Create(IBindStatusCallback *callback, LPCWSTR file_na
IBindStatusCallback_AddRef
(
callback
);
ret
->
callback
=
callback
;
*
ret_callback
=
STATUSCLB
(
ret
)
;
*
ret_callback
=
&
ret
->
IBindStatusCallback_iface
;
return
S_OK
;
}
...
...
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