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
682dc4d6
Commit
682dc4d6
authored
Jan 10, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Store object instead of interface pointer to BindProtocol in Binding object.
parent
08b919f8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
98 deletions
+77
-98
binding.c
dlls/urlmon/binding.c
+17
-29
bindprot.c
dlls/urlmon/bindprot.c
+9
-64
session.c
dlls/urlmon/session.c
+2
-2
urlmon_main.h
dlls/urlmon/urlmon_main.h
+49
-3
No files found.
dlls/urlmon/binding.c
View file @
682dc4d6
...
...
@@ -27,17 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static
WCHAR
cbinding_contextW
[]
=
{
'C'
,
'B'
,
'i'
,
'n'
,
'd'
,
'i'
,
'n'
,
'g'
,
' '
,
'C'
,
'o'
,
'n'
,
't'
,
'e'
,
'x'
,
't'
,
0
};
static
WCHAR
bscb_holderW
[]
=
{
'_'
,
'B'
,
'S'
,
'C'
,
'B'
,
'_'
,
'H'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'_'
,
0
};
typedef
struct
Binding
Binding
;
struct
_task_header_t
;
typedef
void
(
*
task_proc_t
)(
Binding
*
,
struct
_task_header_t
*
);
typedef
struct
_task_header_t
{
task_proc_t
proc
;
struct
_task_header_t
*
next
;
}
task_header_t
;
typedef
struct
{
const
IUnknownVtbl
*
lpUnknownVtbl
;
...
...
@@ -79,7 +68,7 @@ typedef enum {
#define BINDING_OBJAVAIL 0x0004
#define BINDING_ABORTED 0x0008
struct
Binding
{
typedef
struct
{
const
IBindingVtbl
*
lpBindingVtbl
;
const
IInternetProtocolSinkVtbl
*
lpIInternetProtocolSinkVtbl
;
const
IInternetBindInfoVtbl
*
lpInternetBindInfoVtbl
;
...
...
@@ -89,9 +78,10 @@ struct Binding {
LONG
ref
;
IBindStatusCallback
*
callback
;
IInternetProtocolEx
*
protocol
;
IServiceProvider
*
service_provider
;
BindProtocol
*
protocol
;
stgmed_buf_t
*
stgmed_buf
;
stgmed_obj_t
*
stgmed_obj
;
...
...
@@ -114,7 +104,7 @@ struct Binding {
HWND
notif_hwnd
;
CRITICAL_SECTION
section
;
};
}
Binding
;
#define BINDING(x) ((IBinding*) &(x)->lpBindingVtbl)
#define BINDINF(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl)
...
...
@@ -212,7 +202,7 @@ static void mime_available(Binding *This, LPCWSTR mime)
static
void
stop_binding
(
Binding
*
binding
,
HRESULT
hres
,
LPCWSTR
str
)
{
if
(
binding
->
state
&
BINDING_LOCKED
)
{
IInternetProtocol
_UnlockRequest
(
binding
->
protocol
);
IInternetProtocol
Ex_UnlockRequest
(
PROTOCOLEX
(
binding
->
protocol
)
);
binding
->
state
&=
~
BINDING_LOCKED
;
}
...
...
@@ -354,7 +344,7 @@ static void create_object(Binding *binding)
stop_binding
(
binding
,
hres
,
NULL
);
if
(
FAILED
(
hres
))
IInternetProtocol
_Terminate
(
binding
->
protocol
,
0
);
IInternetProtocol
Ex_Terminate
(
PROTOCOLEX
(
binding
->
protocol
)
,
0
);
}
static
void
cache_file_available
(
Binding
*
This
,
const
WCHAR
*
file_name
)
...
...
@@ -818,22 +808,20 @@ static HRESULT WINAPI Binding_QueryInterface(IBinding *iface, REFIID riid, void
TRACE
(
"(%p)->(IID_IWinInetInfo %p)
\n
"
,
This
,
ppv
);
/* NOTE: This violidates COM rules, but tests prove that we should do it */
if
(
!
get_wininet_info
(
This
->
protocol
)
)
if
(
!
This
->
protocol
->
wininet_info
)
return
E_NOINTERFACE
;
*
ppv
=
INETINFO
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IWinInetHttpInfo
,
riid
))
{
IWinInetHttpInfo
*
http_info
;
IWinInetInfo
*
info
;
HRESULT
hres
;
TRACE
(
"(%p)->(IID_IWinInetHttpInfo %p)
\n
"
,
This
,
ppv
);
info
=
get_wininet_info
(
This
->
protocol
);
if
(
!
info
)
if
(
!
This
->
protocol
->
wininet_info
)
return
E_NOINTERFACE
;
hres
=
IWinInetInfo_QueryInterface
(
info
,
&
IID_IWinInetHttpInfo
,
(
void
**
)
&
http_info
);
hres
=
IWinInetInfo_QueryInterface
(
This
->
protocol
->
wininet_
info
,
&
IID_IWinInetHttpInfo
,
(
void
**
)
&
http_info
);
if
(
FAILED
(
hres
))
return
E_NOINTERFACE
;
...
...
@@ -875,7 +863,7 @@ static ULONG WINAPI Binding_Release(IBinding *iface)
if
(
This
->
callback
)
IBindStatusCallback_Release
(
This
->
callback
);
if
(
This
->
protocol
)
IInternetProtocol
_Release
(
This
->
protocol
);
IInternetProtocol
Ex_Release
(
PROTOCOLEX
(
This
->
protocol
)
);
if
(
This
->
service_provider
)
IServiceProvider_Release
(
This
->
service_provider
);
if
(
This
->
stgmed_buf
)
...
...
@@ -911,7 +899,7 @@ static HRESULT WINAPI Binding_Abort(IBinding *iface)
if
(
This
->
state
&
BINDING_ABORTED
)
return
E_FAIL
;
hres
=
IInternetProtocol
_Abort
(
This
->
protocol
,
E_ABORT
,
ERROR_SUCCESS
);
hres
=
IInternetProtocol
Ex_Abort
(
PROTOCOLEX
(
This
->
protocol
)
,
E_ABORT
,
ERROR_SUCCESS
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -1128,7 +1116,7 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres
HRESULT
hres
;
if
(
!
(
This
->
state
&
BINDING_LOCKED
))
{
HRESULT
hres
=
IInternetProtocol
_LockRequest
(
This
->
protocol
,
0
);
HRESULT
hres
=
IInternetProtocol
Ex_LockRequest
(
PROTOCOLEX
(
This
->
protocol
)
,
0
);
if
(
SUCCEEDED
(
hres
))
This
->
state
|=
BINDING_LOCKED
;
}
...
...
@@ -1169,7 +1157,7 @@ static HRESULT WINAPI InternetProtocolSink_ReportResult(IInternetProtocolSink *i
TRACE
(
"(%p)->(%08x %d %s)
\n
"
,
This
,
hrResult
,
dwError
,
debugstr_w
(
szResult
));
stop_binding
(
This
,
hrResult
,
szResult
);
IInternetProtocol
_Terminate
(
This
->
protocol
,
0
);
IInternetProtocol
Ex_Terminate
(
PROTOCOLEX
(
This
->
protocol
)
,
0
);
return
S_OK
;
}
...
...
@@ -1472,7 +1460,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB
if
(
binding_ctx
)
{
ret
->
protocol
=
binding_ctx
->
protocol
;
IInternetProtocol
_AddRef
(
ret
->
protocol
);
IInternetProtocol
Ex_AddRef
(
PROTOCOLEX
(
ret
->
protocol
)
);
}
else
{
hres
=
create_binding_protocol
(
TRUE
,
&
ret
->
protocol
);
if
(
FAILED
(
hres
))
{
...
...
@@ -1514,7 +1502,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB
IUnknown_AddRef
(
STGMEDUNK
(
ret
->
stgmed_buf
));
ret
->
clipboard_format
=
binding_ctx
->
clipboard_format
;
}
else
{
ret
->
stgmed_buf
=
create_stgmed_buf
(
ret
->
protocol
);
ret
->
stgmed_buf
=
create_stgmed_buf
(
PROTOCOLEX
(
ret
->
protocol
)
);
}
if
(
to_obj
)
{
...
...
@@ -1560,7 +1548,7 @@ static HRESULT start_binding(IMoniker *mon, Binding *binding_ctx, IUri *uri, IBi
report_data
(
binding
,
BSCF_FIRSTDATANOTIFICATION
|
(
binding_ctx
->
download_state
==
END_DOWNLOAD
?
BSCF_LASTDATANOTIFICATION
:
0
),
0
,
0
);
}
else
{
hres
=
IInternetProtocolEx_StartEx
(
binding
->
protocol
,
uri
,
PROTSINK
(
binding
),
hres
=
IInternetProtocolEx_StartEx
(
PROTOCOLEX
(
binding
->
protocol
)
,
uri
,
PROTSINK
(
binding
),
BINDINF
(
binding
),
PI_APARTMENTTHREADED
|
PI_MIMEVERIFICATION
,
0
);
TRACE
(
"start ret %08x
\n
"
,
hres
);
...
...
@@ -1603,7 +1591,7 @@ HRESULT bind_to_storage(IUri *uri, IBindCtx *pbc, REFIID riid, void **ppv)
if
(
binding
->
hres
==
S_OK
&&
binding
->
stgmed_buf
->
init
)
{
if
((
binding
->
state
&
BINDING_STOPPED
)
&&
(
binding
->
state
&
BINDING_LOCKED
))
IInternetProtocol
_UnlockRequest
(
binding
->
protocol
);
IInternetProtocol
Ex_UnlockRequest
(
PROTOCOLEX
(
binding
->
protocol
)
);
hres
=
binding
->
stgmed_obj
->
vtbl
->
get_result
(
binding
->
stgmed_obj
,
binding
->
bindf
,
ppv
);
}
else
if
(
binding
->
bindf
&
BINDF_ASYNCHRONOUS
)
{
...
...
dlls/urlmon/bindprot.c
View file @
682dc4d6
...
...
@@ -21,64 +21,17 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
typedef
struct
BindProtocol
BindProtocol
;
typedef
void
(
*
task_proc_t
)(
BindProtocol
*
,
task_header_t
*
)
;
struct
_task_header_t
;
typedef
void
(
*
task_proc_t
)(
BindProtocol
*
,
struct
_task_header_t
*
);
typedef
struct
_task_header_t
{
struct
_task_header_t
{
task_proc_t
proc
;
struct
_task_header_t
*
next
;
}
task_header_t
;
struct
BindProtocol
{
const
IInternetProtocolExVtbl
*
lpIInternetProtocolExVtbl
;
const
IInternetBindInfoVtbl
*
lpInternetBindInfoVtbl
;
const
IInternetPriorityVtbl
*
lpInternetPriorityVtbl
;
const
IServiceProviderVtbl
*
lpServiceProviderVtbl
;
const
IInternetProtocolSinkVtbl
*
lpIInternetProtocolSinkVtbl
;
const
IWinInetHttpInfoVtbl
*
lpIWinInetHttpInfoVtbl
;
LONG
ref
;
IInternetProtocol
*
protocol
;
IInternetBindInfo
*
bind_info
;
IInternetProtocolSink
*
protocol_sink
;
IServiceProvider
*
service_provider
;
IWinInetInfo
*
wininet_info
;
struct
{
IInternetProtocol
IInternetProtocol_iface
;
}
default_protocol_handler
;
IInternetProtocol
*
protocol_handler
;
LONG
priority
;
BOOL
reported_result
;
BOOL
reported_mime
;
BOOL
from_urlmon
;
DWORD
pi
;
DWORD
apartment_thread
;
HWND
notif_hwnd
;
DWORD
continue_call
;
CRITICAL_SECTION
section
;
task_header_t
*
task_queue_head
,
*
task_queue_tail
;
BYTE
*
buf
;
DWORD
buf_size
;
LPWSTR
mime
;
IUri
*
uri
;
ProtocolProxy
*
filter_proxy
;
task_header_t
*
next
;
};
#define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl)
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
#define HTTPINFO(x) ((IWinInetHttpInfo*) &(x)->lpIWinInetHttpInfoVtbl)
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
#define PROTOCOLEX(x) ((IInternetProtocolEx*) &(x)->lpIInternetProtocolExVtbl)
#define PROTOCOLHANDLER(x) ((IInternetProtocol*) &(x)->lpIInternetProtocolHandlerVtbl)
...
...
@@ -390,7 +343,7 @@ static ULONG WINAPI BindProtocol_Release(IInternetProtocolEx *iface)
if
(
This
->
uri
)
IUri_Release
(
This
->
uri
);
set_binding_sink
(
PROTOCOLEX
(
This
)
,
NULL
,
NULL
);
set_binding_sink
(
This
,
NULL
,
NULL
);
if
(
This
->
notif_hwnd
)
release_notif_hwnd
(
This
->
notif_hwnd
);
...
...
@@ -576,7 +529,7 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
if
(
urlmon_protocol
)
IInternetProtocol_QueryInterface
(
protocol
,
&
IID_IWinInetInfo
,
(
void
**
)
&
This
->
wininet_info
);
set_binding_sink
(
PROTOCOLEX
(
This
)
,
pOIProtSink
,
pOIBindInfo
);
set_binding_sink
(
This
,
pOIProtSink
,
pOIBindInfo
);
hres
=
IInternetProtocol_QueryInterface
(
protocol
,
&
IID_IInternetPriority
,
(
void
**
)
&
priority
);
if
(
SUCCEEDED
(
hres
))
{
...
...
@@ -602,9 +555,8 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
return
hres
;
}
void
set_binding_sink
(
IInternetProtocolEx
*
bind_protocol
,
IInternetProtocolSink
*
sink
,
IInternetBindInfo
*
bind_info
)
void
set_binding_sink
(
BindProtocol
*
This
,
IInternetProtocolSink
*
sink
,
IInternetBindInfo
*
bind_info
)
{
BindProtocol
*
This
=
PROTOCOL_THIS
(
bind_protocol
);
IInternetProtocolSink
*
prev_sink
;
IServiceProvider
*
service_provider
=
NULL
;
...
...
@@ -627,13 +579,6 @@ void set_binding_sink(IInternetProtocolEx *bind_protocol, IInternetProtocolSink
IInternetBindInfo_Release
(
bind_info
);
}
IWinInetInfo
*
get_wininet_info
(
IInternetProtocolEx
*
bind_protocol
)
{
BindProtocol
*
This
=
PROTOCOL_THIS
(
bind_protocol
);
return
This
->
wininet_info
;
}
#undef PROTOCOL_THIS
static
const
IInternetProtocolExVtbl
BindProtocolVtbl
=
{
...
...
@@ -726,7 +671,7 @@ static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD
This
->
filter_proxy
=
NULL
;
}
set_binding_sink
(
PROTOCOLEX
(
This
)
,
NULL
,
NULL
);
set_binding_sink
(
This
,
NULL
,
NULL
);
if
(
This
->
bind_info
)
{
IInternetBindInfo_Release
(
This
->
bind_info
);
...
...
@@ -1336,7 +1281,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
BPServiceProvider_QueryService
};
HRESULT
create_binding_protocol
(
BOOL
from_urlmon
,
IInternetProtocolEx
**
protocol
)
HRESULT
create_binding_protocol
(
BOOL
from_urlmon
,
BindProtocol
**
protocol
)
{
BindProtocol
*
ret
=
heap_alloc_zero
(
sizeof
(
BindProtocol
));
...
...
@@ -1358,6 +1303,6 @@ HRESULT create_binding_protocol(BOOL from_urlmon, IInternetProtocolEx **protocol
URLMON_LockModule
();
*
protocol
=
PROTOCOLEX
(
ret
)
;
*
protocol
=
ret
;
return
S_OK
;
}
dlls/urlmon/session.c
View file @
682dc4d6
...
...
@@ -424,7 +424,7 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
LPBC
pBC
,
LPCWSTR
szUrl
,
IUnknown
*
pUnkOuter
,
IUnknown
**
ppUnk
,
IInternetProtocol
**
ppOInetProt
,
DWORD
dwOption
)
{
IInternetProtocolEx
*
protocol
;
BindProtocol
*
protocol
;
HRESULT
hres
;
TRACE
(
"(%p %s %p %p %p %08x)
\n
"
,
pBC
,
debugstr_w
(
szUrl
),
pUnkOuter
,
ppUnk
,
...
...
@@ -437,7 +437,7 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
if
(
FAILED
(
hres
))
return
hres
;
*
ppOInetProt
=
(
IInternetProtocol
*
)
protocol
;
*
ppOInetProt
=
(
IInternetProtocol
*
)
PROTOCOLEX
(
protocol
)
;
return
S_OK
;
}
...
...
dlls/urlmon/urlmon_main.h
View file @
682dc4d6
...
...
@@ -76,9 +76,6 @@ void free_session(void);
HRESULT
bind_to_storage
(
IUri
*
,
IBindCtx
*
,
REFIID
,
void
**
);
HRESULT
bind_to_object
(
IMoniker
*
,
IUri
*
,
IBindCtx
*
,
REFIID
,
void
**
ppv
);
HRESULT
create_binding_protocol
(
BOOL
,
IInternetProtocolEx
**
);
void
set_binding_sink
(
IInternetProtocolEx
*
,
IInternetProtocolSink
*
,
IInternetBindInfo
*
);
IWinInetInfo
*
get_wininet_info
(
IInternetProtocolEx
*
);
HRESULT
create_default_callback
(
IBindStatusCallback
**
);
HRESULT
wrap_callback
(
IBindStatusCallback
*
,
IBindStatusCallback
**
);
...
...
@@ -169,6 +166,55 @@ typedef struct {
HRESULT
create_protocol_proxy
(
IInternetProtocol
*
,
IInternetProtocolSink
*
,
ProtocolProxy
**
);
typedef
struct
_task_header_t
task_header_t
;
typedef
struct
{
const
IInternetProtocolExVtbl
*
lpIInternetProtocolExVtbl
;
const
IInternetBindInfoVtbl
*
lpInternetBindInfoVtbl
;
const
IInternetPriorityVtbl
*
lpInternetPriorityVtbl
;
const
IServiceProviderVtbl
*
lpServiceProviderVtbl
;
const
IInternetProtocolSinkVtbl
*
lpIInternetProtocolSinkVtbl
;
const
IWinInetHttpInfoVtbl
*
lpIWinInetHttpInfoVtbl
;
LONG
ref
;
IInternetProtocol
*
protocol
;
IInternetBindInfo
*
bind_info
;
IInternetProtocolSink
*
protocol_sink
;
IServiceProvider
*
service_provider
;
IWinInetInfo
*
wininet_info
;
struct
{
IInternetProtocol
IInternetProtocol_iface
;
}
default_protocol_handler
;
IInternetProtocol
*
protocol_handler
;
LONG
priority
;
BOOL
reported_result
;
BOOL
reported_mime
;
BOOL
from_urlmon
;
DWORD
pi
;
DWORD
apartment_thread
;
HWND
notif_hwnd
;
DWORD
continue_call
;
CRITICAL_SECTION
section
;
task_header_t
*
task_queue_head
,
*
task_queue_tail
;
BYTE
*
buf
;
DWORD
buf_size
;
LPWSTR
mime
;
IUri
*
uri
;
ProtocolProxy
*
filter_proxy
;
}
BindProtocol
;
#define PROTOCOLEX(x) ((IInternetProtocolEx*) &(x)->lpIInternetProtocolExVtbl)
HRESULT
create_binding_protocol
(
BOOL
,
BindProtocol
**
);
void
set_binding_sink
(
BindProtocol
*
,
IInternetProtocolSink
*
,
IInternetBindInfo
*
);
typedef
struct
{
HWND
notif_hwnd
;
DWORD
notif_hwnd_cnt
;
...
...
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