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
19c2b7cb
Commit
19c2b7cb
authored
May 04, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
May 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Implement ITfCategoryMgr::RegisterGUID, ITfCategoryMgr::GetGUID and…
msctf: Implement ITfCategoryMgr::RegisterGUID, ITfCategoryMgr::GetGUID and ITfCategoryMgr::IsEqualTfGuidAtom.
parent
1fa15f3d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
6 deletions
+112
-6
categorymgr.c
dlls/msctf/categorymgr.c
+58
-6
msctf.c
dlls/msctf/msctf.c
+12
-0
msctf_internal.h
dlls/msctf/msctf_internal.h
+2
-0
inputprocessor.c
dlls/msctf/tests/inputprocessor.c
+40
-0
No files found.
dlls/msctf/categorymgr.c
View file @
19c2b7cb
...
...
@@ -312,25 +312,77 @@ static HRESULT WINAPI CategoryMgr_RegisterGUID ( ITfCategoryMgr *iface,
REFGUID
rguid
,
TfGuidAtom
*
pguidatom
)
{
DWORD
index
;
GUID
*
checkguid
;
DWORD
id
;
CategoryMgr
*
This
=
(
CategoryMgr
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p) %s %p
\n
"
,
This
,
debugstr_guid
(
rguid
),
pguidatom
);
if
(
!
pguidatom
)
return
E_INVALIDARG
;
index
=
0
;
do
{
id
=
enumerate_Cookie
(
COOKIE_MAGIC_GUIDATOM
,
&
index
);
if
(
id
&&
IsEqualGUID
(
rguid
,
get_Cookie_data
(
id
)))
{
*
pguidatom
=
id
;
return
S_OK
;
}
}
while
(
id
);
checkguid
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GUID
));
*
checkguid
=
*
rguid
;
id
=
generate_Cookie
(
COOKIE_MAGIC_GUIDATOM
,
checkguid
);
if
(
!
id
)
{
HeapFree
(
GetProcessHeap
(),
0
,
checkguid
);
return
E_FAIL
;
}
*
pguidatom
=
id
;
return
S_OK
;
}
static
HRESULT
WINAPI
CategoryMgr_GetGUID
(
ITfCategoryMgr
*
iface
,
TfGuidAtom
guidatom
,
GUID
*
pguid
)
{
CategoryMgr
*
This
=
(
CategoryMgr
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p) %i
\n
"
,
This
,
guidatom
);
if
(
!
pguid
)
return
E_INVALIDARG
;
*
pguid
=
GUID_NULL
;
if
(
get_Cookie_magic
(
guidatom
)
==
COOKIE_MAGIC_GUIDATOM
)
*
pguid
=
*
((
REFGUID
)
get_Cookie_data
(
guidatom
));
return
S_OK
;
}
static
HRESULT
WINAPI
CategoryMgr_IsEqualTfGuidAtom
(
ITfCategoryMgr
*
iface
,
TfGuidAtom
guidatom
,
REFGUID
rguid
,
BOOL
*
pfEqual
)
{
CategoryMgr
*
This
=
(
CategoryMgr
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p) %i %s %p
\n
"
,
This
,
guidatom
,
debugstr_guid
(
rguid
),
pfEqual
);
if
(
!
pfEqual
)
return
E_INVALIDARG
;
*
pfEqual
=
FALSE
;
if
(
get_Cookie_magic
(
guidatom
)
==
COOKIE_MAGIC_GUIDATOM
)
{
if
(
IsEqualGUID
(
rguid
,
get_Cookie_data
(
guidatom
)))
*
pfEqual
=
TRUE
;
}
return
S_OK
;
}
...
...
dlls/msctf/msctf.c
View file @
19c2b7cb
...
...
@@ -252,6 +252,18 @@ LPVOID remove_Cookie(DWORD id)
return
cookies
[
index
].
data
;
}
DWORD
enumerate_Cookie
(
DWORD
magic
,
DWORD
*
index
)
{
int
i
;
for
(
i
=
*
index
;
i
<
id_last
;
i
++
)
if
(
cookies
[
i
].
id
!=
0
&&
cookies
[
i
].
magic
==
magic
)
{
*
index
=
(
i
+
1
);
return
cookies
[
i
].
id
;
}
return
0x0
;
}
/*************************************************************************
* MSCTF DllMain
*/
...
...
dlls/msctf/msctf_internal.h
View file @
19c2b7cb
...
...
@@ -23,6 +23,7 @@
#define COOKIE_MAGIC_TMSINK 0x0010
#define COOKIE_MAGIC_CONTEXTSINK 0x0020
#define COOKIE_MAGIC_GUIDATOM 0x0030
extern
DWORD
tlsIndex
;
...
...
@@ -37,6 +38,7 @@ extern DWORD generate_Cookie(DWORD magic, LPVOID data);
extern
DWORD
get_Cookie_magic
(
DWORD
id
);
extern
LPVOID
get_Cookie_data
(
DWORD
id
);
extern
LPVOID
remove_Cookie
(
DWORD
id
);
extern
DWORD
enumerate_Cookie
(
DWORD
magic
,
DWORD
*
index
);
extern
const
WCHAR
szwSystemTIPKey
[];
#endif
/* __WINE_MSCTF_I_H */
dlls/msctf/tests/inputprocessor.c
View file @
19c2b7cb
...
...
@@ -609,6 +609,45 @@ static void test_endSession(void)
test_OnSetFocus
=
SINK_UNEXPECTED
;
}
static
void
test_TfGuidAtom
(
void
)
{
GUID
gtest
,
g1
;
HRESULT
hr
;
TfGuidAtom
atom1
,
atom2
;
BOOL
equal
;
CoCreateGuid
(
&
gtest
);
/* msdn reports this should return E_INVALIDARG. However my test show it crashing (winxp)*/
/*
hr = ITfCategoryMgr_RegisterGUID(g_cm,>est,NULL);
ok(hr==E_INVALIDARG,"ITfCategoryMgr_RegisterGUID should have failed\n");
*/
hr
=
ITfCategoryMgr_RegisterGUID
(
g_cm
,
&
gtest
,
&
atom1
);
ok
(
SUCCEEDED
(
hr
),
"ITfCategoryMgr_RegisterGUID failed
\n
"
);
hr
=
ITfCategoryMgr_RegisterGUID
(
g_cm
,
&
gtest
,
&
atom2
);
ok
(
SUCCEEDED
(
hr
),
"ITfCategoryMgr_RegisterGUID failed
\n
"
);
ok
(
atom1
==
atom2
,
"atoms do not match
\n
"
);
hr
=
ITfCategoryMgr_GetGUID
(
g_cm
,
atom2
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ITfCategoryMgr_GetGUID should have failed
\n
"
);
hr
=
ITfCategoryMgr_GetGUID
(
g_cm
,
atom2
,
&
g1
);
ok
(
SUCCEEDED
(
hr
),
"ITfCategoryMgr_GetGUID failed
\n
"
);
ok
(
IsEqualGUID
(
&
g1
,
&
gtest
),
"guids do not match
\n
"
);
hr
=
ITfCategoryMgr_IsEqualTfGuidAtom
(
g_cm
,
atom1
,
&
gtest
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"ITfCategoryMgr_IsEqualTfGuidAtom should have failed
\n
"
);
hr
=
ITfCategoryMgr_IsEqualTfGuidAtom
(
g_cm
,
atom1
,
&
gtest
,
&
equal
);
ok
(
SUCCEEDED
(
hr
),
"ITfCategoryMgr_IsEqualTfGuidAtom failed
\n
"
);
ok
(
equal
==
TRUE
,
"Equal value invalid
\n
"
);
/* show that cid and tid TfClientIds are also TfGuidAtoms */
hr
=
ITfCategoryMgr_IsEqualTfGuidAtom
(
g_cm
,
tid
,
&
CLSID_FakeService
,
&
equal
);
ok
(
SUCCEEDED
(
hr
),
"ITfCategoryMgr_IsEqualTfGuidAtom failed
\n
"
);
todo_wine
ok
(
equal
==
TRUE
,
"Equal value invalid
\n
"
);
hr
=
ITfCategoryMgr_GetGUID
(
g_cm
,
cid
,
&
g1
);
ok
(
SUCCEEDED
(
hr
),
"ITfCategoryMgr_GetGUID failed
\n
"
);
todo_wine
ok
(
!
IsEqualGUID
(
&
g1
,
&
GUID_NULL
),
"guid should not be NULL
\n
"
);
}
START_TEST
(
inputprocessor
)
{
if
(
SUCCEEDED
(
initialize
()))
...
...
@@ -620,6 +659,7 @@ START_TEST(inputprocessor)
test_ThreadMgrAdviseSinks
();
test_Activate
();
test_startSession
();
test_TfGuidAtom
();
test_KeystrokeMgr
();
test_endSession
();
test_EnumLanguageProfiles
();
...
...
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