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
b6c17607
Commit
b6c17607
authored
Feb 08, 2024
by
Shaun Ren
Committed by
Alexandre Julliard
Feb 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Implement ISpeechObjectToken::GetDescription.
parent
23f360b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
6 deletions
+79
-6
Makefile.in
dlls/sapi/Makefile.in
+1
-1
Makefile.in
dlls/sapi/tests/Makefile.in
+1
-1
token.c
dlls/sapi/tests/token.c
+56
-2
token.c
dlls/sapi/token.c
+21
-2
No files found.
dlls/sapi/Makefile.in
View file @
b6c17607
MODULE
=
sapi.dll
IMPORTS
=
uuid ole32 user32 advapi32
IMPORTS
=
uuid ole32
oleaut32
user32 advapi32
DELAYIMPORTS
=
winmm
SOURCES
=
\
...
...
dlls/sapi/tests/Makefile.in
View file @
b6c17607
TESTDLL
=
sapi.dll
IMPORTS
=
ole32 user32 advapi32 winmm
IMPORTS
=
ole32
oleaut32
user32 advapi32 winmm
SOURCES
=
\
automation.c
\
...
...
dlls/sapi/tests/token.c
View file @
b6c17607
...
...
@@ -657,7 +657,7 @@ static IClassFactory test_class_cf = { &ClassFactoryVtbl };
static
void
test_object_token
(
void
)
{
static
const
WCHAR
test_token_id
[]
=
L"HKEY_LOCAL_MACHINE
\\
Software
\\
Wine
\\
Wine
test
\\
sapi
\\
TestToken"
;
static
const
WCHAR
test_token_id
[]
=
L"HKEY_LOCAL_MACHINE
\\
Software
\\
Winetest
\\
sapi
\\
TestToken"
;
ISpObjectToken
*
token
;
IDispatch
*
disp
;
...
...
@@ -665,6 +665,7 @@ static void test_object_token(void)
ISpDataKey
*
sub_key
;
HRESULT
hr
;
LPWSTR
tempW
,
token_id
;
BSTR
tempB
;
ISpObjectTokenCategory
*
cat
;
DWORD
regid
;
IUnknown
*
obj
;
...
...
@@ -863,11 +864,64 @@ static void test_object_token(void)
CoTaskMemFree
(
tempW
);
}
hr
=
ISpObjectToken_SetStringValue
(
token
,
L"409"
,
L"409 - TestToken"
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
ISpObjectToken_SetStringValue
(
token
,
L"407"
,
L"407 - TestToken"
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
ISpObjectToken_SetStringValue
(
token
,
L"E40C"
,
L"E40C - TestToken"
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
ISpObjectToken_QueryInterface
(
token
,
&
IID_ISpeechObjectToken
,
(
void
**
)
&
speech_token
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
ISpeechObjectToken_GetDescription
(
speech_token
,
0x409
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got %08lx
\n
"
,
hr
);
tempB
=
NULL
;
hr
=
ISpeechObjectToken_GetDescription
(
speech_token
,
0x409
,
&
tempB
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
tempB
&&
!
wcscmp
(
tempB
,
L"409 - TestToken"
),
"got %s
\n
"
,
wine_dbgstr_w
(
tempB
)
);
SysFreeString
(
tempB
);
tempB
=
NULL
;
hr
=
ISpeechObjectToken_GetDescription
(
speech_token
,
0x10407
,
&
tempB
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
tempB
&&
!
wcscmp
(
tempB
,
L"407 - TestToken"
),
"got %s
\n
"
,
wine_dbgstr_w
(
tempB
)
);
SysFreeString
(
tempB
);
tempB
=
NULL
;
hr
=
ISpeechObjectToken_GetDescription
(
speech_token
,
0xE40C
,
&
tempB
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
tempB
&&
!
wcscmp
(
tempB
,
L"E40C - TestToken"
),
"got %s
\n
"
,
wine_dbgstr_w
(
tempB
)
);
SysFreeString
(
tempB
);
tempB
=
(
BSTR
)
0xdeadbeef
;
hr
=
ISpeechObjectToken_GetDescription
(
speech_token
,
0x406
,
&
tempB
);
ok
(
hr
==
SPERR_NOT_FOUND
,
"got %08lx
\n
"
,
hr
);
ok
(
tempB
==
(
BSTR
)
0xdeadbeef
||
broken
(
tempB
==
NULL
)
/* < win7 */
,
"got %p
\n
"
,
tempB
);
hr
=
ISpObjectToken_SetStringValue
(
token
,
NULL
,
L"TestToken"
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
tempB
=
NULL
;
hr
=
ISpeechObjectToken_GetDescription
(
speech_token
,
0x406
,
&
tempB
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
tempB
&&
!
wcscmp
(
tempB
,
L"TestToken"
),
"got %s
\n
"
,
wine_dbgstr_w
(
tempB
)
);
SysFreeString
(
tempB
);
tempB
=
NULL
;
hr
=
ISpeechObjectToken_GetDescription
(
speech_token
,
0x0
,
&
tempB
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
tempB
&&
!
wcscmp
(
tempB
,
L"TestToken"
),
"got %s
\n
"
,
wine_dbgstr_w
(
tempB
)
);
SysFreeString
(
tempB
);
ISpeechObjectToken_Release
(
speech_token
);
ISpObjectToken_Release
(
test_class_token
);
IUnknown_Release
(
obj
);
ISpObjectToken_Release
(
token
);
RegDeleteTreeA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
test
\\
sapi"
);
RegDeleteTreeA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Winetest
\\
sapi"
);
}
START_TEST
(
token
)
...
...
dlls/sapi/token.c
View file @
b6c17607
...
...
@@ -1829,8 +1829,27 @@ static HRESULT WINAPI speech_token_get_Category( ISpeechObjectToken *iface,
static
HRESULT
WINAPI
speech_token_GetDescription
(
ISpeechObjectToken
*
iface
,
LONG
locale
,
BSTR
*
desc
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
struct
object_token
*
This
=
impl_from_ISpeechObjectToken
(
iface
);
WCHAR
langid
[
5
];
WCHAR
*
desc_wstr
=
NULL
;
HRESULT
hr
;
TRACE
(
"(%p)->(%#lx %p)
\n
"
,
This
,
locale
,
desc
);
if
(
!
desc
)
return
E_POINTER
;
swprintf
(
langid
,
ARRAY_SIZE
(
langid
),
L"%X"
,
LANGIDFROMLCID
(
locale
)
);
hr
=
ISpObjectToken_GetStringValue
(
&
This
->
ISpObjectToken_iface
,
langid
,
&
desc_wstr
);
if
(
hr
==
SPERR_NOT_FOUND
)
hr
=
ISpObjectToken_GetStringValue
(
&
This
->
ISpObjectToken_iface
,
NULL
,
&
desc_wstr
);
if
(
FAILED
(
hr
))
return
hr
;
*
desc
=
SysAllocString
(
desc_wstr
);
CoTaskMemFree
(
desc_wstr
);
return
*
desc
?
S_OK
:
E_OUTOFMEMORY
;
}
static
HRESULT
WINAPI
speech_token_SetId
(
ISpeechObjectToken
*
iface
,
...
...
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