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
bbb97558
Commit
bbb97558
authored
Mar 16, 2015
by
Jactry Zeng
Committed by
Alexandre Julliard
Mar 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement IOleWindow interface.
parent
879261dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
0 deletions
+103
-0
richole.c
dlls/riched20/richole.c
+51
-0
richole.c
dlls/riched20/tests/richole.c
+52
-0
No files found.
dlls/riched20/richole.c
View file @
bbb97558
...
...
@@ -82,6 +82,7 @@ struct ITextSelectionImpl {
struct
IOleClientSiteImpl
{
IOleClientSite
IOleClientSite_iface
;
IOleWindow
IOleWindow_iface
;
LONG
ref
;
IRichEditOleImpl
*
reOle
;
...
...
@@ -219,12 +220,15 @@ static inline IOleClientSiteImpl *impl_from_IOleClientSite(IOleClientSite *iface
static
HRESULT
WINAPI
IOleClientSite_fnQueryInterface
(
IOleClientSite
*
me
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
IOleClientSiteImpl
*
This
=
impl_from_IOleClientSite
(
me
);
TRACE
(
"%p %s
\n
"
,
me
,
debugstr_guid
(
riid
)
);
*
ppvObj
=
NULL
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IOleClientSite
))
*
ppvObj
=
me
;
else
if
(
IsEqualGUID
(
riid
,
&
IID_IOleWindow
))
*
ppvObj
=
&
This
->
IOleWindow_iface
;
if
(
*
ppvObj
)
{
IOleClientSite_AddRef
(
me
);
...
...
@@ -325,6 +329,52 @@ static const IOleClientSiteVtbl ocst = {
IOleClientSite_fnRequestNewObjectLayout
};
/* IOleWindow interface */
static
inline
IOleClientSiteImpl
*
impl_from_IOleWindow
(
IOleWindow
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IOleClientSiteImpl
,
IOleWindow_iface
);
}
static
HRESULT
WINAPI
IOleWindow_fnQueryInterface
(
IOleWindow
*
iface
,
REFIID
riid
,
void
**
ppvObj
)
{
IOleClientSiteImpl
*
This
=
impl_from_IOleWindow
(
iface
);
return
IOleClientSite_QueryInterface
(
&
This
->
IOleClientSite_iface
,
riid
,
ppvObj
);
}
static
ULONG
WINAPI
IOleWindow_fnAddRef
(
IOleWindow
*
iface
)
{
IOleClientSiteImpl
*
This
=
impl_from_IOleWindow
(
iface
);
return
IOleClientSite_AddRef
(
&
This
->
IOleClientSite_iface
);
}
static
ULONG
WINAPI
IOleWindow_fnRelease
(
IOleWindow
*
iface
)
{
IOleClientSiteImpl
*
This
=
impl_from_IOleWindow
(
iface
);
return
IOleClientSite_Release
(
&
This
->
IOleClientSite_iface
);
}
static
HRESULT
WINAPI
IOleWindow_fnContextSensitiveHelp
(
IOleWindow
*
iface
,
BOOL
fEnterMode
)
{
IOleClientSiteImpl
*
This
=
impl_from_IOleWindow
(
iface
);
FIXME
(
"not implemented: (%p)->(%d)
\n
"
,
This
,
fEnterMode
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IOleWindow_fnGetWindow
(
IOleWindow
*
iface
,
HWND
*
phwnd
)
{
IOleClientSiteImpl
*
This
=
impl_from_IOleWindow
(
iface
);
FIXME
(
"not implemented: (%p)->(%p)
\n
"
,
This
,
phwnd
);
return
E_NOTIMPL
;
}
static
const
IOleWindowVtbl
olewinvt
=
{
IOleWindow_fnQueryInterface
,
IOleWindow_fnAddRef
,
IOleWindow_fnRelease
,
IOleWindow_fnGetWindow
,
IOleWindow_fnContextSensitiveHelp
};
static
IOleClientSiteImpl
*
CreateOleClientSite
(
IRichEditOleImpl
*
reOle
)
{
...
...
@@ -333,6 +383,7 @@ CreateOleClientSite(IRichEditOleImpl *reOle)
return
NULL
;
clientSite
->
IOleClientSite_iface
.
lpVtbl
=
&
ocst
;
clientSite
->
IOleWindow_iface
.
lpVtbl
=
&
olewinvt
;
clientSite
->
ref
=
1
;
clientSite
->
reOle
=
reOle
;
return
clientSite
;
...
...
dlls/riched20/tests/richole.c
View file @
bbb97558
...
...
@@ -949,6 +949,57 @@ static void test_ITextSelection_Collapse(void)
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
}
static
void
test_IOleClientSite_QueryInterface
(
void
)
{
HWND
w
;
IRichEditOle
*
reOle
=
NULL
,
*
reOle1
=
NULL
;
ITextDocument
*
txtDoc
=
NULL
;
IOleClientSite
*
clientSite
=
NULL
,
*
clientSite1
=
NULL
,
*
clientSite2
=
NULL
;
IOleWindow
*
oleWin
=
NULL
,
*
oleWin1
=
NULL
;
HRESULT
hres
;
LONG
refcount1
,
refcount2
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
hres
=
IRichEditOle_GetClientSite
(
reOle
,
&
clientSite
);
ok
(
hres
==
S_OK
,
"IRichEditOle_QueryInterface: 0x%08x
\n
"
,
hres
);
refcount1
=
get_refcount
((
IUnknown
*
)
clientSite
);
todo_wine
ok
(
refcount1
==
1
,
"got wrong ref count: %d
\n
"
,
refcount1
);
hres
=
IOleClientSite_QueryInterface
(
clientSite
,
&
IID_IRichEditOle
,
(
void
**
)
&
reOle1
);
ok
(
hres
==
E_NOINTERFACE
,
"IOleClientSite_QueryInterface: %x
\n
"
,
hres
);
hres
=
IOleClientSite_QueryInterface
(
clientSite
,
&
IID_IOleClientSite
,
(
void
**
)
&
clientSite1
);
ok
(
hres
==
S_OK
,
"IOleClientSite_QueryInterface: 0x%08x
\n
"
,
hres
);
ok
(
clientSite
==
clientSite1
,
"Should not return a new pointer.
\n
"
);
refcount1
=
get_refcount
((
IUnknown
*
)
clientSite
);
todo_wine
ok
(
refcount1
==
2
,
"got wrong ref count: %d
\n
"
,
refcount1
);
/* IOleWindow interface */
hres
=
IOleClientSite_QueryInterface
(
clientSite
,
&
IID_IOleWindow
,
(
void
**
)
&
oleWin
);
ok
(
hres
==
S_OK
,
"IOleClientSite_QueryInterface: 0x%08x
\n
"
,
hres
);
refcount1
=
get_refcount
((
IUnknown
*
)
clientSite
);
refcount2
=
get_refcount
((
IUnknown
*
)
oleWin
);
ok
(
refcount1
==
refcount2
,
"got wrong ref count.
\n
"
);
hres
=
IOleClientSite_QueryInterface
(
clientSite
,
&
IID_IOleWindow
,
(
void
**
)
&
oleWin1
);
ok
(
hres
==
S_OK
,
"IOleClientSite_QueryInterface: 0x%08x
\n
"
,
hres
);
ok
(
oleWin
==
oleWin1
,
"Should not return a new pointer.
\n
"
);
refcount1
=
get_refcount
((
IUnknown
*
)
clientSite
);
refcount2
=
get_refcount
((
IUnknown
*
)
oleWin
);
ok
(
refcount1
==
refcount2
,
"got wrong ref count.
\n
"
);
hres
=
IOleWindow_QueryInterface
(
oleWin
,
&
IID_IOleClientSite
,
(
void
**
)
&
clientSite2
);
ok
(
hres
==
S_OK
,
"IOleWindow_QueryInterface: 0x%08x
\n
"
,
hres
);
ok
(
clientSite2
==
clientSite1
,
"got wrong pointer
\n
"
);
IOleWindow_Release
(
oleWin1
);
IOleWindow_Release
(
oleWin
);
IOleClientSite_Release
(
clientSite2
);
IOleClientSite_Release
(
clientSite1
);
IOleClientSite_Release
(
clientSite
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
}
START_TEST
(
richole
)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
...
...
@@ -967,4 +1018,5 @@ START_TEST(richole)
test_ITextRange_GetStart_GetEnd
();
test_ITextRange_GetDuplicate
();
test_ITextRange_Collapse
();
test_IOleClientSite_QueryInterface
();
}
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