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
fa4c386e
Commit
fa4c386e
authored
Jun 02, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Maintain context reference in ranges.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
86cbfafe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
7 deletions
+38
-7
range.c
dlls/msctf/range.c
+13
-6
inputprocessor.c
dlls/msctf/tests/inputprocessor.c
+25
-1
No files found.
dlls/msctf/range.c
View file @
fa4c386e
...
@@ -42,7 +42,7 @@ typedef struct tagRange {
...
@@ -42,7 +42,7 @@ typedef struct tagRange {
LONG
refCount
;
LONG
refCount
;
ITextStoreACP
*
pITextStoreACP
;
ITextStoreACP
*
pITextStoreACP
;
ITfContext
*
pITfC
ontext
;
ITfContext
*
c
ontext
;
DWORD
lockType
;
DWORD
lockType
;
TfGravity
gravityStart
,
gravityEnd
;
TfGravity
gravityStart
,
gravityEnd
;
...
@@ -58,6 +58,7 @@ static inline Range *impl_from_ITfRange(ITfRange *iface)
...
@@ -58,6 +58,7 @@ static inline Range *impl_from_ITfRange(ITfRange *iface)
static
void
Range_Destructor
(
Range
*
This
)
static
void
Range_Destructor
(
Range
*
This
)
{
{
TRACE
(
"destroying %p
\n
"
,
This
);
TRACE
(
"destroying %p
\n
"
,
This
);
ITfContext_Release
(
This
->
context
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
@@ -282,13 +283,18 @@ static HRESULT WINAPI Range_Clone(ITfRange *iface, ITfRange **ppClone)
...
@@ -282,13 +283,18 @@ static HRESULT WINAPI Range_Clone(ITfRange *iface, ITfRange **ppClone)
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
Range_GetContext
(
ITfRange
*
iface
,
ITfContext
**
ppC
ontext
)
static
HRESULT
WINAPI
Range_GetContext
(
ITfRange
*
iface
,
ITfContext
**
c
ontext
)
{
{
Range
*
This
=
impl_from_ITfRange
(
iface
);
Range
*
This
=
impl_from_ITfRange
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
ppContext
)
TRACE
(
"(%p, %p)
\n
"
,
This
,
context
);
if
(
!
context
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
*
ppContext
=
This
->
pITfContext
;
*
context
=
This
->
context
;
ITfContext_AddRef
(
*
context
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -334,7 +340,8 @@ HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD l
...
@@ -334,7 +340,8 @@ HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD l
This
->
ITfRange_iface
.
lpVtbl
=
&
Range_RangeVtbl
;
This
->
ITfRange_iface
.
lpVtbl
=
&
Range_RangeVtbl
;
This
->
refCount
=
1
;
This
->
refCount
=
1
;
This
->
pITfContext
=
context
;
This
->
context
=
context
;
ITfContext_AddRef
(
This
->
context
);
This
->
pITextStoreACP
=
textstore
;
This
->
pITextStoreACP
=
textstore
;
This
->
lockType
=
lockType
;
This
->
lockType
=
lockType
;
This
->
anchorStart
=
anchorStart
;
This
->
anchorStart
=
anchorStart
;
...
...
dlls/msctf/tests/inputprocessor.c
View file @
fa4c386e
...
@@ -228,6 +228,8 @@ static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface,
...
@@ -228,6 +228,8 @@ static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface,
REFIID
riid
,
IUnknown
*
punk
,
DWORD
dwMask
)
REFIID
riid
,
IUnknown
*
punk
,
DWORD
dwMask
)
{
{
ITextStoreACPServices
*
services
;
ITextStoreACPServices
*
services
;
ITfRangeACP
*
range
;
ITfContext
*
context
;
HRESULT
hr
;
HRESULT
hr
;
if
(
winetest_debug
>
1
)
trace
(
"ITextStoreACP::AdviseSink(iid %s, mask %#x)
\n
"
,
if
(
winetest_debug
>
1
)
trace
(
"ITextStoreACP::AdviseSink(iid %s, mask %#x)
\n
"
,
...
@@ -243,6 +245,18 @@ static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface,
...
@@ -243,6 +245,18 @@ static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface,
hr
=
ITextStoreACPSink_QueryInterface
(
ACPSink
,
&
IID_ITextStoreACPServices
,
(
void
**
)
&
services
);
hr
=
ITextStoreACPSink_QueryInterface
(
ACPSink
,
&
IID_ITextStoreACPServices
,
(
void
**
)
&
services
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
range
=
NULL
;
hr
=
ITextStoreACPServices_CreateRange
(
services
,
0
,
1
,
&
range
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
range
)
{
hr
=
ITfRangeACP_GetContext
(
range
,
&
context
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ITfContext_Release
(
context
);
ITfRangeACP_Release
(
range
);
}
ITextStoreACPServices_Release
(
services
);
ITextStoreACPServices_Release
(
services
);
return
S_OK
;
return
S_OK
;
...
@@ -2084,10 +2098,11 @@ static void test_InsertAtSelection(TfEditCookie ec, ITfContext *cxt)
...
@@ -2084,10 +2098,11 @@ static void test_InsertAtSelection(TfEditCookie ec, ITfContext *cxt)
static
HRESULT
WINAPI
EditSession_DoEditSession
(
ITfEditSession
*
iface
,
static
HRESULT
WINAPI
EditSession_DoEditSession
(
ITfEditSession
*
iface
,
TfEditCookie
ec
)
TfEditCookie
ec
)
{
{
ITfContext
*
cxt
;
ITfContext
*
cxt
,
*
context2
;
ITfDocumentMgr
*
dm
;
ITfDocumentMgr
*
dm
;
ITfRange
*
range
;
ITfRange
*
range
;
TF_SELECTION
selection
;
TF_SELECTION
selection
;
IUnknown
*
unk
;
ULONG
fetched
;
ULONG
fetched
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -2109,6 +2124,15 @@ TfEditCookie ec)
...
@@ -2109,6 +2124,15 @@ TfEditCookie ec)
ok
(
SUCCEEDED
(
hr
),
"Unexpected return code %x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Unexpected return code %x
\n
"
,
hr
);
ok
(
range
!=
NULL
,
"Range set to NULL
\n
"
);
ok
(
range
!=
NULL
,
"Range set to NULL
\n
"
);
hr
=
ITfRange_GetContext
(
range
,
&
context2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
context2
==
cxt
,
"Unexpected context pointer.
\n
"
);
ITfContext_Release
(
context2
);
hr
=
ITfRange_QueryInterface
(
range
,
&
IID_ITfRangeACP
,
(
void
**
)
&
unk
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ITfRange_Release
(
range
);
ITfRange_Release
(
range
);
hr
=
ITfContext_GetEnd
(
cxt
,
ec
,
NULL
);
hr
=
ITfContext_GetEnd
(
cxt
,
ec
,
NULL
);
...
...
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