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
74c5d202
Commit
74c5d202
authored
Mar 28, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Mar 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Support COM aggregation in CreateTextServices().
parent
6f299c5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
31 deletions
+65
-31
txtsrv.c
dlls/riched20/txtsrv.c
+65
-31
No files found.
dlls/riched20/txtsrv.c
View file @
74c5d202
...
...
@@ -54,53 +54,57 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
richedit
);
typedef
struct
ITextServicesImpl
{
IUnknown
IUnknown_inner
;
ITextServices
ITextServices_iface
;
I
TextHost
*
pMyHost
;
I
Unknown
*
outer_unk
;
LONG
ref
;
ITextHost
*
pMyHost
;
CRITICAL_SECTION
csTxtSrv
;
ME_TextEditor
*
editor
;
char
spare
[
256
];
}
ITextServicesImpl
;
static
inline
ITextServicesImpl
*
impl_from_I
TextServices
(
ITextServices
*
iface
)
static
inline
ITextServicesImpl
*
impl_from_I
Unknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ITextServicesImpl
,
I
TextServices_iface
);
return
CONTAINING_RECORD
(
iface
,
ITextServicesImpl
,
I
Unknown_inner
);
}
static
HRESULT
WINAPI
fnTextSrv_QueryInterface
(
ITextServices
*
iface
,
REFIID
riid
,
void
**
ppv
)
static
HRESULT
WINAPI
ITextServicesImpl_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ITextServicesImpl
*
This
=
impl_from_I
TextServices
(
iface
);
TRACE
(
"(%p
/%p)->(%s, %p)
\n
"
,
This
,
iface
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_ITextServices
)
)
*
ppv
=
This
;
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)(
*
ppv
))
;
TRACE
(
"-- Interface = %p
\n
"
,
*
ppv
);
return
S_OK
;
ITextServicesImpl
*
This
=
impl_from_I
Unknown
(
iface
);
TRACE
(
"(%p
)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
*
ppv
=
&
This
->
IUnknown_inner
;
else
if
IsEqualIID
(
riid
,
&
IID_ITextServices
)
*
ppv
=
&
This
->
ITextServices_iface
;
else
{
*
ppv
=
NULL
;
FIXME
(
"Unknown interface: %s
\n
"
,
debugstr_guid
(
riid
)
);
return
E_NOINTERFACE
;
}
FIXME
(
"Unknown interface: %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
fnTextSrv_AddRef
(
ITextServices
*
iface
)
static
ULONG
WINAPI
ITextServicesImpl_AddRef
(
IUnknown
*
iface
)
{
ITextServicesImpl
*
This
=
impl_from_ITextServices
(
iface
);
DWORD
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ITextServicesImpl
*
This
=
impl_from_IUnknown
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
TRACE
(
"(%p/%p)->() AddRef from %d
\n
"
,
This
,
iface
,
ref
-
1
);
return
ref
;
}
static
ULONG
WINAPI
fnTextSrv_Release
(
ITextServices
*
iface
)
static
ULONG
WINAPI
ITextServicesImpl_Release
(
IUnknown
*
iface
)
{
ITextServicesImpl
*
This
=
impl_from_I
TextServices
(
iface
);
DWORD
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ITextServicesImpl
*
This
=
impl_from_I
Unknown
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p
/%p)->() Release from %d
\n
"
,
This
,
iface
,
ref
+
1
);
TRACE
(
"(%p
) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
...
...
@@ -112,6 +116,36 @@ static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
return
ref
;
}
static
const
IUnknownVtbl
textservices_inner_vtbl
=
{
ITextServicesImpl_QueryInterface
,
ITextServicesImpl_AddRef
,
ITextServicesImpl_Release
};
static
inline
ITextServicesImpl
*
impl_from_ITextServices
(
ITextServices
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ITextServicesImpl
,
ITextServices_iface
);
}
static
HRESULT
WINAPI
fnTextSrv_QueryInterface
(
ITextServices
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ITextServicesImpl
*
This
=
impl_from_ITextServices
(
iface
);
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppv
);
}
static
ULONG
WINAPI
fnTextSrv_AddRef
(
ITextServices
*
iface
)
{
ITextServicesImpl
*
This
=
impl_from_ITextServices
(
iface
);
return
IUnknown_AddRef
(
This
->
outer_unk
);
}
static
ULONG
WINAPI
fnTextSrv_Release
(
ITextServices
*
iface
)
{
ITextServicesImpl
*
This
=
impl_from_ITextServices
(
iface
);
return
IUnknown_Release
(
This
->
outer_unk
);
}
DECLSPEC_HIDDEN
HRESULT
WINAPI
fnTextSrv_TxSendMessage
(
ITextServices
*
iface
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
LRESULT
*
plresult
)
{
...
...
@@ -371,6 +405,7 @@ HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, I
ITextImpl
->
ref
=
1
;
ITextHost_AddRef
(
pITextHost
);
ITextImpl
->
pMyHost
=
pITextHost
;
ITextImpl
->
IUnknown_inner
.
lpVtbl
=
&
textservices_inner_vtbl
;
ITextImpl
->
ITextServices_iface
.
lpVtbl
=
&
textservices_vtbl
;
ITextImpl
->
editor
=
ME_MakeEditor
(
pITextHost
,
FALSE
);
ITextImpl
->
editor
->
exStyleFlags
=
0
;
...
...
@@ -382,11 +417,10 @@ HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, I
ME_HandleMessage
(
ITextImpl
->
editor
,
WM_CREATE
,
0
,
0
,
TRUE
,
&
hres
);
if
(
pUnkOuter
)
{
FIXME
(
"Support aggregation
\n
"
);
return
CLASS_E_NOAGGREGATION
;
}
ITextImpl
->
outer_unk
=
pUnkOuter
;
else
ITextImpl
->
outer_unk
=
&
ITextImpl
->
IUnknown_inner
;
*
ppUnk
=
(
IUnknown
*
)
&
ITextImpl
->
ITextServices_iface
;
*
ppUnk
=
&
ITextImpl
->
IUnknown_inner
;
return
S_OK
;
}
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