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
a1d0c6d7
Commit
a1d0c6d7
authored
Jan 26, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Added COM aggregation support to MimeHtmlProtocol object.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fe3e5b9c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
27 deletions
+99
-27
inetcomm_main.c
dlls/inetcomm/inetcomm_main.c
+8
-1
protocol.c
dlls/inetcomm/protocol.c
+53
-22
mimeole.c
dlls/inetcomm/tests/mimeole.c
+38
-4
No files found.
dlls/inetcomm/inetcomm_main.c
View file @
a1d0c6d7
...
...
@@ -117,13 +117,20 @@ static HRESULT WINAPI cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter,
*
ppobj
=
NULL
;
if
(
pOuter
&&
!
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
return
CLASS_E_NOAGGREGATION
;
r
=
This
->
create_object
(
pOuter
,
(
LPVOID
*
)
&
punk
);
if
(
FAILED
(
r
))
return
r
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
*
ppobj
=
punk
;
return
S_OK
;
}
r
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
IUnknown_Release
(
punk
);
return
r
;
}
...
...
dlls/inetcomm/protocol.c
View file @
a1d0c6d7
...
...
@@ -28,31 +28,34 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
inetcomm
);
typedef
struct
{
IUnknown
IUnknown_inner
;
IInternetProtocol
IInternetProtocol_iface
;
IInternetProtocolInfo
IInternetProtocolInfo_iface
;
LONG
ref
;
IUnknown
*
outer_unk
;
}
MimeHtmlProtocol
;
static
inline
MimeHtmlProtocol
*
impl_from_I
InternetProtocol
(
IInternetProtocol
*
iface
)
static
inline
MimeHtmlProtocol
*
impl_from_I
Unknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
MimeHtmlProtocol
,
I
InternetProtocol_iface
);
return
CONTAINING_RECORD
(
iface
,
MimeHtmlProtocol
,
I
Unknown_inner
);
}
static
HRESULT
WINAPI
MimeHtmlProtocol_QueryInterface
(
I
InternetProtocol
*
iface
,
REFIID
riid
,
void
**
ppv
)
static
HRESULT
WINAPI
MimeHtmlProtocol_QueryInterface
(
I
Unknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
MimeHtmlProtocol
*
This
=
impl_from_I
InternetProtocol
(
iface
);
MimeHtmlProtocol
*
This
=
impl_from_I
Unknown
(
iface
);
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
iface
,
ppv
);
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IInternetProtocol_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IInternetProtocolRoot
,
riid
))
{
TRACE
(
"(%p)->(IID_IInternetProtocolRoot %p)
\n
"
,
iface
,
ppv
);
TRACE
(
"(%p)->(IID_IInternetProtocolRoot %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IInternetProtocol_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IInternetProtocol
,
riid
))
{
TRACE
(
"(%p)->(IID_IInternetProtocol %p)
\n
"
,
iface
,
ppv
);
TRACE
(
"(%p)->(IID_IInternetProtocol %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IInternetProtocol_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IInternetProtocolInfo
,
riid
))
{
TRACE
(
"(%p)->(IID_IInternetProtocolInfo %p)
\n
"
,
iface
,
ppv
);
TRACE
(
"(%p)->(IID_IInternetProtocolInfo %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IInternetProtocolInfo_iface
;
}
else
{
FIXME
(
"unknown interface %s
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -64,9 +67,9 @@ static HRESULT WINAPI MimeHtmlProtocol_QueryInterface(IInternetProtocol *iface,
return
S_OK
;
}
static
ULONG
WINAPI
MimeHtmlProtocol_AddRef
(
I
InternetProtocol
*
iface
)
static
ULONG
WINAPI
MimeHtmlProtocol_AddRef
(
I
Unknown
*
iface
)
{
MimeHtmlProtocol
*
This
=
impl_from_I
InternetProtocol
(
iface
);
MimeHtmlProtocol
*
This
=
impl_from_I
Unknown
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -74,9 +77,9 @@ static ULONG WINAPI MimeHtmlProtocol_AddRef(IInternetProtocol *iface)
return
ref
;
}
static
ULONG
WINAPI
MimeHtmlProtocol_Release
(
I
InternetProtocol
*
iface
)
static
ULONG
WINAPI
MimeHtmlProtocol_Release
(
I
Unknown
*
iface
)
{
MimeHtmlProtocol
*
This
=
impl_from_I
InternetProtocol
(
iface
);
MimeHtmlProtocol
*
This
=
impl_from_I
Unknown
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%x
\n
"
,
This
,
ref
);
...
...
@@ -87,6 +90,35 @@ static ULONG WINAPI MimeHtmlProtocol_Release(IInternetProtocol *iface)
return
ref
;
}
static
const
IUnknownVtbl
MimeHtmlProtocolInnerVtbl
=
{
MimeHtmlProtocol_QueryInterface
,
MimeHtmlProtocol_AddRef
,
MimeHtmlProtocol_Release
};
static
inline
MimeHtmlProtocol
*
impl_from_IInternetProtocol
(
IInternetProtocol
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
MimeHtmlProtocol
,
IInternetProtocol_iface
);
}
static
HRESULT
WINAPI
InternetProtocol_QueryInterface
(
IInternetProtocol
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
MimeHtmlProtocol
*
This
=
impl_from_IInternetProtocol
(
iface
);
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppv
);
}
static
ULONG
WINAPI
InternetProtocol_AddRef
(
IInternetProtocol
*
iface
)
{
MimeHtmlProtocol
*
This
=
impl_from_IInternetProtocol
(
iface
);
return
IUnknown_AddRef
(
This
->
outer_unk
);
}
static
ULONG
WINAPI
InternetProtocol_Release
(
IInternetProtocol
*
iface
)
{
MimeHtmlProtocol
*
This
=
impl_from_IInternetProtocol
(
iface
);
return
IUnknown_Release
(
This
->
outer_unk
);
}
static
HRESULT
WINAPI
MimeHtmlProtocol_Start
(
IInternetProtocol
*
iface
,
const
WCHAR
*
szUrl
,
IInternetProtocolSink
*
pOIProtSink
,
IInternetBindInfo
*
pOIBindInfo
,
DWORD
grfPI
,
HANDLE_PTR
dwReserved
)
...
...
@@ -162,9 +194,9 @@ static HRESULT WINAPI MimeHtmlProtocol_UnlockRequest(IInternetProtocol *iface)
}
static
const
IInternetProtocolVtbl
MimeHtmlProtocolVtbl
=
{
MimeHtml
Protocol_QueryInterface
,
MimeHtml
Protocol_AddRef
,
MimeHtml
Protocol_Release
,
Internet
Protocol_QueryInterface
,
Internet
Protocol_AddRef
,
Internet
Protocol_Release
,
MimeHtmlProtocol_Start
,
MimeHtmlProtocol_Continue
,
MimeHtmlProtocol_Abort
,
...
...
@@ -185,19 +217,19 @@ static inline MimeHtmlProtocol *impl_from_IInternetProtocolInfo(IInternetProtoco
static
HRESULT
WINAPI
MimeHtmlProtocolInfo_QueryInterface
(
IInternetProtocolInfo
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
MimeHtmlProtocol
*
This
=
impl_from_IInternetProtocolInfo
(
iface
);
return
I
InternetProtocol_QueryInterface
(
&
This
->
IInternetProtocol_iface
,
riid
,
ppv
);
return
I
Unknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppv
);
}
static
ULONG
WINAPI
MimeHtmlProtocolInfo_AddRef
(
IInternetProtocolInfo
*
iface
)
{
MimeHtmlProtocol
*
This
=
impl_from_IInternetProtocolInfo
(
iface
);
return
I
InternetProtocol_AddRef
(
&
This
->
IInternetProtocol_iface
);
return
I
Unknown_AddRef
(
This
->
outer_unk
);
}
static
ULONG
WINAPI
MimeHtmlProtocolInfo_Release
(
IInternetProtocolInfo
*
iface
)
{
MimeHtmlProtocol
*
This
=
impl_from_IInternetProtocolInfo
(
iface
);
return
I
InternetProtocol_Release
(
&
This
->
IInternetProtocol_iface
);
return
I
Unknown_Release
(
This
->
outer_unk
);
}
static
HRESULT
WINAPI
MimeHtmlProtocolInfo_ParseUrl
(
IInternetProtocolInfo
*
iface
,
LPCWSTR
pwzUrl
,
...
...
@@ -253,17 +285,16 @@ HRESULT MimeHtmlProtocol_create(IUnknown *outer, void **obj)
{
MimeHtmlProtocol
*
protocol
;
if
(
outer
)
FIXME
(
"outer not supported
\n
"
);
protocol
=
heap_alloc
(
sizeof
(
*
protocol
));
if
(
!
protocol
)
return
E_OUTOFMEMORY
;
protocol
->
IUnknown_inner
.
lpVtbl
=
&
MimeHtmlProtocolInnerVtbl
;
protocol
->
IInternetProtocol_iface
.
lpVtbl
=
&
MimeHtmlProtocolVtbl
;
protocol
->
IInternetProtocolInfo_iface
.
lpVtbl
=
&
MimeHtmlProtocolInfoVtbl
;
protocol
->
ref
=
1
;
protocol
->
outer_unk
=
outer
?
outer
:
&
protocol
->
IUnknown_inner
;
*
obj
=
&
protocol
->
I
InternetProtocol_iface
;
*
obj
=
&
protocol
->
I
Unknown_inner
;
return
S_OK
;
}
dlls/inetcomm/tests/mimeole.c
View file @
a1d0c6d7
...
...
@@ -772,8 +772,32 @@ static void test_mhtml_protocol_info(void)
IInternetProtocolInfo_Release
(
protocol_info
);
}
static
HRESULT
WINAPI
outer_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
outer_AddRef
(
IUnknown
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
outer_Release
(
IUnknown
*
iface
)
{
return
1
;
}
static
const
IUnknownVtbl
outer_vtbl
=
{
outer_QueryInterface
,
outer_AddRef
,
outer_Release
};
static
void
test_mhtml_protocol
(
void
)
{
IUnknown
outer
=
{
&
outer_vtbl
};
IClassFactory
*
class_factory
;
IUnknown
*
unk
,
*
unk2
;
HRESULT
hres
;
...
...
@@ -781,15 +805,25 @@ static void test_mhtml_protocol(void)
hres
=
CoGetClassObject
(
&
CLSID_IMimeHtmlProtocol
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hres
==
S_OK
,
"CoGetClassObject failed: %08x
\n
"
,
hres
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IClassFactory
,
(
void
**
)
&
unk2
);
ok
(
hres
==
S_OK
,
"Could not get IClassFactory iface: %08x
\n
"
,
hres
);
IUnknown_Release
(
unk2
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IInternetProtocolInfo
,
(
void
**
)
&
unk2
);
ok
(
hres
==
E_NOINTERFACE
,
"IInternetProtocolInfo supported
\n
"
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IClassFactory
,
(
void
**
)
&
class_factory
);
ok
(
hres
==
S_OK
,
"Could not get IClassFactory iface: %08x
\n
"
,
hres
);
IUnknown_Release
(
unk
);
hres
=
IClassFactory_CreateInstance
(
class_factory
,
&
outer
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hres
==
S_OK
,
"CreateInstance returned: %08x
\n
"
,
hres
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IInternetProtocol
,
(
void
**
)
&
unk2
);
ok
(
hres
==
S_OK
,
"Coult not get IInternetProtocol iface: %08x
\n
"
,
hres
);
IUnknown_Release
(
unk2
);
IUnknown_Release
(
unk
);
hres
=
IClassFactory_CreateInstance
(
class_factory
,
(
IUnknown
*
)
0xdeadbeef
,
&
IID_IInternetProtocol
,
(
void
**
)
&
unk2
);
ok
(
hres
==
CLASS_E_NOAGGREGATION
,
"CreateInstance returned: %08x
\n
"
,
hres
);
IClassFactory_Release
(
class_factory
);
test_mhtml_protocol_info
();
}
...
...
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