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
17574518
Commit
17574518
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: Added support for COM aggregation to mk protocol handler.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
44a99402
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
20 deletions
+54
-20
mk.c
dlls/urlmon/mk.c
+53
-20
protocol.c
dlls/urlmon/tests/protocol.c
+1
-0
No files found.
dlls/urlmon/mk.c
View file @
17574518
...
...
@@ -25,26 +25,32 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
typedef
struct
{
IUnknown
IUnknown_outer
;
IInternetProtocolEx
IInternetProtocolEx_iface
;
LONG
ref
;
IUnknown
*
outer
;
IStream
*
stream
;
}
MkProtocol
;
static
inline
MkProtocol
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
MkProtocol
,
IUnknown_outer
);
}
static
inline
MkProtocol
*
impl_from_IInternetProtocolEx
(
IInternetProtocolEx
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
MkProtocol
,
IInternetProtocolEx_iface
);
}
static
HRESULT
WINAPI
MkProtocol
_QueryInterface
(
IInternetProtocolEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
static
HRESULT
WINAPI
MkProtocol
Unk_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
MkProtocol
*
This
=
impl_from_I
InternetProtocolEx
(
iface
);
MkProtocol
*
This
=
impl_from_I
Unknown
(
iface
);
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
I
InternetProtocolEx_iface
;
*
ppv
=
&
This
->
I
Unknown_outer
;
}
else
if
(
IsEqualGUID
(
&
IID_IInternetProtocolRoot
,
riid
))
{
TRACE
(
"(%p)->(IID_IInternetProtocolRoot %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IInternetProtocolEx_iface
;
...
...
@@ -54,28 +60,27 @@ static HRESULT WINAPI MkProtocol_QueryInterface(IInternetProtocolEx *iface, REFI
}
else
if
(
IsEqualGUID
(
&
IID_IInternetProtocolEx
,
riid
))
{
TRACE
(
"(%p)->(IID_IInternetProtocolEx %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IInternetProtocolEx_iface
;
}
else
{
*
ppv
=
NULL
;
WARN
(
"not supported interface %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
if
(
*
ppv
)
{
IInternetProtocolEx_AddRef
(
iface
);
return
S_OK
;
}
WARN
(
"not supported interface %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
MkProtocol
_AddRef
(
IInternetProtocolEx
*
iface
)
static
ULONG
WINAPI
MkProtocol
Unk_AddRef
(
IUnknown
*
iface
)
{
MkProtocol
*
This
=
impl_from_I
InternetProtocolEx
(
iface
);
MkProtocol
*
This
=
impl_from_I
Unknown
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
MkProtocol
_Release
(
IInternetProtocolEx
*
iface
)
static
ULONG
WINAPI
MkProtocol
Unk_Release
(
IUnknown
*
iface
)
{
MkProtocol
*
This
=
impl_from_I
InternetProtocolEx
(
iface
);
MkProtocol
*
This
=
impl_from_I
Unknown
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -92,6 +97,33 @@ static ULONG WINAPI MkProtocol_Release(IInternetProtocolEx *iface)
return
ref
;
}
static
const
IUnknownVtbl
MkProtocolUnkVtbl
=
{
MkProtocolUnk_QueryInterface
,
MkProtocolUnk_AddRef
,
MkProtocolUnk_Release
};
static
HRESULT
WINAPI
MkProtocol_QueryInterface
(
IInternetProtocolEx
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
MkProtocol
*
This
=
impl_from_IInternetProtocolEx
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
return
IUnknown_QueryInterface
(
This
->
outer
,
riid
,
ppv
);
}
static
ULONG
WINAPI
MkProtocol_AddRef
(
IInternetProtocolEx
*
iface
)
{
MkProtocol
*
This
=
impl_from_IInternetProtocolEx
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
IUnknown_AddRef
(
This
->
outer
);
}
static
ULONG
WINAPI
MkProtocol_Release
(
IInternetProtocolEx
*
iface
)
{
MkProtocol
*
This
=
impl_from_IInternetProtocolEx
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
IUnknown_Release
(
This
->
outer
);
}
static
HRESULT
report_result
(
IInternetProtocolSink
*
sink
,
HRESULT
hres
,
DWORD
dwError
)
{
IInternetProtocolSink_ReportResult
(
sink
,
hres
,
dwError
,
NULL
);
...
...
@@ -330,24 +362,25 @@ static const IInternetProtocolExVtbl MkProtocolVtbl = {
MkProtocol_StartEx
};
HRESULT
MkProtocol_Construct
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppobj
)
HRESULT
MkProtocol_Construct
(
IUnknown
*
outer
,
void
**
ppv
)
{
MkProtocol
*
ret
;
TRACE
(
"(%p %p)
\n
"
,
pUnkOuter
,
ppobj
);
TRACE
(
"(%p %p)
\n
"
,
outer
,
ppv
);
URLMON_LockModule
();
ret
=
heap_alloc
(
sizeof
(
MkProtocol
));
ret
->
IUnknown_outer
.
lpVtbl
=
&
MkProtocolUnkVtbl
;
ret
->
IInternetProtocolEx_iface
.
lpVtbl
=
&
MkProtocolVtbl
;
ret
->
ref
=
1
;
ret
->
outer
=
outer
?
outer
:
&
ret
->
IUnknown_outer
;
ret
->
stream
=
NULL
;
/* NOTE:
* Native returns NULL ppobj and S_OK in CreateInstance if called with IID_IUnknown riid.
* Native returns NULL ppobj and S_OK in CreateInstance if called with IID_IUnknown riid
and no outer
.
*/
*
ppobj
=
&
ret
->
IInternetProtocolEx_iface
;
*
ppv
=
&
ret
->
IUnknown_outer
;
return
S_OK
;
}
dlls/urlmon/tests/protocol.c
View file @
17574518
...
...
@@ -4104,6 +4104,7 @@ START_TEST(protocol)
test_com_aggregation
(
&
CLSID_HttpProtocol
);
test_com_aggregation
(
&
CLSID_HttpSProtocol
);
test_com_aggregation
(
&
CLSID_FtpProtocol
);
test_com_aggregation
(
&
CLSID_MkProtocol
);
OleUninitialize
();
}
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