Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
114b0705
Commit
114b0705
authored
May 08, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
May 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Release protocol handler in BindProtocol::Terminate.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
03183590
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
bindprot.c
dlls/urlmon/bindprot.c
+32
-3
protocol.c
dlls/urlmon/tests/protocol.c
+10
-0
No files found.
dlls/urlmon/bindprot.c
View file @
114b0705
...
...
@@ -681,13 +681,24 @@ static HRESULT WINAPI ProtocolHandler_Start(IInternetProtocol *iface, LPCWSTR sz
static
HRESULT
WINAPI
ProtocolHandler_Continue
(
IInternetProtocol
*
iface
,
PROTOCOLDATA
*
pProtocolData
)
{
BindProtocol
*
This
=
impl_from_IInternetProtocol
(
iface
);
IInternetProtocol
*
protocol
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pProtocolData
);
hres
=
IInternetProtocol_Continue
(
This
->
protocol
,
pProtocolData
);
/* FIXME: This should not be needed. */
if
(
!
This
->
protocol
&&
This
->
protocol_unk
)
{
hres
=
IUnknown_QueryInterface
(
This
->
protocol_unk
,
&
IID_IInternetProtocol
,
(
void
**
)
&
protocol
);
if
(
FAILED
(
hres
))
return
E_FAIL
;
}
else
{
IInternetProtocol_AddRef
(
protocol
=
This
->
protocol
);
}
hres
=
IInternetProtocol_Continue
(
protocol
,
pProtocolData
);
heap_free
(
pProtocolData
);
IInternetProtocol_Release
(
protocol
);
return
hres
;
}
...
...
@@ -716,7 +727,11 @@ static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD
/* This may get released in Terminate call. */
IInternetProtocolEx_AddRef
(
&
This
->
IInternetProtocolEx_iface
);
IInternetProtocol_Terminate
(
This
->
protocol
,
0
);
if
(
This
->
protocol
)
{
IInternetProtocol_Terminate
(
This
->
protocol
,
0
);
IInternetProtocol_Release
(
This
->
protocol
);
This
->
protocol
=
NULL
;
}
set_binding_sink
(
This
,
NULL
,
NULL
);
...
...
@@ -772,14 +787,28 @@ static HRESULT WINAPI ProtocolHandler_Read(IInternetProtocol *iface, void *pv,
}
if
(
read
<
cb
)
{
IInternetProtocol
*
protocol
;
ULONG
cread
=
0
;
/* FIXME: We shouldn't need it, but out binding code currently depends on it. */
if
(
!
This
->
protocol
&&
This
->
protocol_unk
)
{
hres
=
IUnknown_QueryInterface
(
This
->
protocol_unk
,
&
IID_IInternetProtocol
,
(
void
**
)
&
protocol
);
if
(
FAILED
(
hres
))
return
E_ABORT
;
}
else
{
protocol
=
This
->
protocol
;
}
if
(
is_apartment_thread
(
This
))
This
->
continue_call
++
;
hres
=
IInternetProtocol_Read
(
This
->
protocol
,
(
BYTE
*
)
pv
+
read
,
cb
-
read
,
&
cread
);
hres
=
IInternetProtocol_Read
(
protocol
,
(
BYTE
*
)
pv
+
read
,
cb
-
read
,
&
cread
);
if
(
is_apartment_thread
(
This
))
This
->
continue_call
--
;
read
+=
cread
;
if
(
!
This
->
protocol
)
IInternetProtocol_Release
(
protocol
);
}
*
pcbRead
=
read
;
...
...
dlls/urlmon/tests/protocol.c
View file @
114b0705
...
...
@@ -3758,6 +3758,16 @@ static void test_CreateBinding(void)
ok
(
hres
==
S_OK
,
"Switch failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
Continue
);
SET_EXPECT
(
Read
);
read
=
0xdeadbeef
;
hres
=
IInternetProtocol_Read
(
protocol
,
expect_pv
=
buf
,
sizeof
(
buf
),
&
read
);
todo_wine
ok
(
hres
==
E_ABORT
,
"Read failed: %08x
\n
"
,
hres
);
todo_wine
ok
(
read
==
0
,
"read = %d
\n
"
,
read
);
todo_wine
CHECK_NOT_CALLED
(
Read
);
hres
=
IInternetProtocolSink_ReportProgress
(
binding_sink
,
BINDSTATUS_CACHEFILENAMEAVAILABLE
,
expect_wsz
=
emptyW
);
ok
(
hres
==
S_OK
,
"ReportProgress(BINDSTATUS_CACHEFILENAMEAVAILABLE) failed: %08x
\n
"
,
hres
);
...
...
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