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
c45bedbf
Commit
c45bedbf
authored
Feb 02, 2024
by
Shaun Ren
Committed by
Alexandre Julliard
Feb 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Add ISpeechObjectToken stub.
parent
4e54087f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
247 additions
and
7 deletions
+247
-7
token.c
dlls/sapi/tests/token.c
+27
-0
token.c
dlls/sapi/token.c
+219
-6
sapi.idl
include/sapi.idl
+1
-1
No files found.
dlls/sapi/tests/token.c
View file @
c45bedbf
...
@@ -604,6 +604,8 @@ static void test_object_token(void)
...
@@ -604,6 +604,8 @@ static void test_object_token(void)
static
const
WCHAR
test_token_id
[]
=
L"HKEY_LOCAL_MACHINE
\\
Software
\\
Wine
\\
Winetest
\\
sapi
\\
TestToken"
;
static
const
WCHAR
test_token_id
[]
=
L"HKEY_LOCAL_MACHINE
\\
Software
\\
Wine
\\
Winetest
\\
sapi
\\
TestToken"
;
ISpObjectToken
*
token
;
ISpObjectToken
*
token
;
IDispatch
*
disp
;
ISpeechObjectToken
*
speech_token
;
ISpDataKey
*
sub_key
;
ISpDataKey
*
sub_key
;
HRESULT
hr
;
HRESULT
hr
;
LPWSTR
tempW
,
token_id
;
LPWSTR
tempW
,
token_id
;
...
@@ -615,6 +617,31 @@ static void test_object_token(void)
...
@@ -615,6 +617,31 @@ static void test_object_token(void)
&
IID_ISpObjectToken
,
(
void
**
)
&
token
);
&
IID_ISpObjectToken
,
(
void
**
)
&
token
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
ISpObjectToken_QueryInterface
(
token
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
IDispatch_Release
(
disp
);
hr
=
ISpObjectToken_QueryInterface
(
token
,
&
IID_ISpeechObjectToken
,
(
void
**
)
&
speech_token
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ISpeechObjectToken_Release
(
speech_token
);
ISpObjectToken_Release
(
token
);
hr
=
CoCreateInstance
(
&
CLSID_SpObjectToken
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
IDispatch_Release
(
disp
);
hr
=
CoCreateInstance
(
&
CLSID_SpObjectToken
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ISpeechObjectToken
,
(
void
**
)
&
speech_token
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ISpeechObjectToken_Release
(
speech_token
);
hr
=
CoCreateInstance
(
&
CLSID_SpObjectToken
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ISpObjectToken
,
(
void
**
)
&
token
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
ISpObjectToken_GetId
(
token
,
NULL
);
hr
=
ISpObjectToken_GetId
(
token
,
NULL
);
ok
(
hr
==
SPERR_UNINITIALIZED
,
"got %08lx
\n
"
,
hr
);
ok
(
hr
==
SPERR_UNINITIALIZED
,
"got %08lx
\n
"
,
hr
);
...
...
dlls/sapi/token.c
View file @
c45bedbf
...
@@ -51,6 +51,7 @@ static struct data_key *impl_from_ISpRegDataKey( ISpRegDataKey *iface )
...
@@ -51,6 +51,7 @@ static struct data_key *impl_from_ISpRegDataKey( ISpRegDataKey *iface )
struct
object_token
struct
object_token
{
{
ISpObjectToken
ISpObjectToken_iface
;
ISpObjectToken
ISpObjectToken_iface
;
ISpeechObjectToken
ISpeechObjectToken_iface
;
LONG
ref
;
LONG
ref
;
ISpRegDataKey
*
data_key
;
ISpRegDataKey
*
data_key
;
...
@@ -62,6 +63,11 @@ static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
...
@@ -62,6 +63,11 @@ static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
return
CONTAINING_RECORD
(
iface
,
struct
object_token
,
ISpObjectToken_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
object_token
,
ISpObjectToken_iface
);
}
}
static
struct
object_token
*
impl_from_ISpeechObjectToken
(
ISpeechObjectToken
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
object_token
,
ISpeechObjectToken_iface
);
}
static
HRESULT
WINAPI
data_key_QueryInterface
(
ISpRegDataKey
*
iface
,
REFIID
iid
,
void
**
obj
)
static
HRESULT
WINAPI
data_key_QueryInterface
(
ISpRegDataKey
*
iface
,
REFIID
iid
,
void
**
obj
)
{
{
struct
data_key
*
This
=
impl_from_ISpRegDataKey
(
iface
);
struct
data_key
*
This
=
impl_from_ISpRegDataKey
(
iface
);
...
@@ -1160,15 +1166,19 @@ static HRESULT WINAPI token_QueryInterface( ISpObjectToken *iface,
...
@@ -1160,15 +1166,19 @@ static HRESULT WINAPI token_QueryInterface( ISpObjectToken *iface,
if
(
IsEqualIID
(
iid
,
&
IID_IUnknown
)
||
if
(
IsEqualIID
(
iid
,
&
IID_IUnknown
)
||
IsEqualIID
(
iid
,
&
IID_ISpDataKey
)
||
IsEqualIID
(
iid
,
&
IID_ISpDataKey
)
||
IsEqualIID
(
iid
,
&
IID_ISpObjectToken
))
IsEqualIID
(
iid
,
&
IID_ISpObjectToken
))
*
obj
=
&
This
->
ISpObjectToken_iface
;
else
if
(
IsEqualIID
(
iid
,
&
IID_IDispatch
)
||
IsEqualIID
(
iid
,
&
IID_ISpeechObjectToken
))
*
obj
=
&
This
->
ISpeechObjectToken_iface
;
else
{
{
ISpObjectToken_AddRef
(
iface
)
;
*
obj
=
NULL
;
*
obj
=
iface
;
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
iid
)
)
;
return
S_OK
;
return
E_NOINTERFACE
;
}
}
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
iid
)
);
IUnknown_AddRef
(
(
IUnknown
*
)
*
obj
);
*
obj
=
NULL
;
return
S_OK
;
return
E_NOINTERFACE
;
}
}
static
ULONG
WINAPI
token_AddRef
(
ISpObjectToken
*
iface
)
static
ULONG
WINAPI
token_AddRef
(
ISpObjectToken
*
iface
)
...
@@ -1495,6 +1505,208 @@ const struct ISpObjectTokenVtbl token_vtbl =
...
@@ -1495,6 +1505,208 @@ const struct ISpObjectTokenVtbl token_vtbl =
token_MatchesAttributes
token_MatchesAttributes
};
};
static
HRESULT
WINAPI
speech_token_QueryInterface
(
ISpeechObjectToken
*
iface
,
REFIID
iid
,
void
**
obj
)
{
struct
object_token
*
This
=
impl_from_ISpeechObjectToken
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
iid
),
obj
);
return
ISpObjectToken_QueryInterface
(
&
This
->
ISpObjectToken_iface
,
iid
,
obj
);
}
static
ULONG
WINAPI
speech_token_AddRef
(
ISpeechObjectToken
*
iface
)
{
struct
object_token
*
This
=
impl_from_ISpeechObjectToken
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
ISpObjectToken_AddRef
(
&
This
->
ISpObjectToken_iface
);
}
static
ULONG
WINAPI
speech_token_Release
(
ISpeechObjectToken
*
iface
)
{
struct
object_token
*
This
=
impl_from_ISpeechObjectToken
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
ISpObjectToken_Release
(
&
This
->
ISpObjectToken_iface
);
}
static
HRESULT
WINAPI
speech_token_GetTypeInfoCount
(
ISpeechObjectToken
*
iface
,
UINT
*
count
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_GetTypeInfo
(
ISpeechObjectToken
*
iface
,
UINT
index
,
LCID
lcid
,
ITypeInfo
**
type_info
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_GetIDsOfNames
(
ISpeechObjectToken
*
iface
,
REFIID
iid
,
LPOLESTR
*
names
,
UINT
count
,
LCID
lcid
,
DISPID
*
dispids
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_Invoke
(
ISpeechObjectToken
*
iface
,
DISPID
dispid
,
REFIID
iid
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
VARIANT
*
result
,
EXCEPINFO
*
excepinfo
,
UINT
*
argerr
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_get_Id
(
ISpeechObjectToken
*
iface
,
BSTR
*
id
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_get_DataKey
(
ISpeechObjectToken
*
iface
,
ISpeechDataKey
**
key
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_get_Category
(
ISpeechObjectToken
*
iface
,
ISpeechObjectTokenCategory
**
cat
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_GetDescription
(
ISpeechObjectToken
*
iface
,
LONG
locale
,
BSTR
*
desc
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_SetId
(
ISpeechObjectToken
*
iface
,
BSTR
id
,
BSTR
category_id
,
VARIANT_BOOL
create
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_GetAttribute
(
ISpeechObjectToken
*
iface
,
BSTR
name
,
BSTR
*
value
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_CreateInstance
(
ISpeechObjectToken
*
iface
,
IUnknown
*
outer
,
SpeechTokenContext
clsctx
,
IUnknown
**
object
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_Remove
(
ISpeechObjectToken
*
iface
,
BSTR
clsid
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_GetStorageFileName
(
ISpeechObjectToken
*
iface
,
BSTR
clsid
,
BSTR
key
,
BSTR
name
,
SpeechTokenShellFolder
folder
,
BSTR
*
path
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_RemoveStorageFileName
(
ISpeechObjectToken
*
iface
,
BSTR
clsid
,
BSTR
key
,
VARIANT_BOOL
remove
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_IsUISupported
(
ISpeechObjectToken
*
iface
,
const
BSTR
type
,
const
VARIANT
*
data
,
IUnknown
*
object
,
VARIANT_BOOL
*
supported
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_DisplayUI
(
ISpeechObjectToken
*
iface
,
LONG
hwnd
,
BSTR
title
,
const
BSTR
type
,
const
VARIANT
*
data
,
IUnknown
*
object
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
speech_token_MatchesAttributes
(
ISpeechObjectToken
*
iface
,
const
BSTR
attributes
,
VARIANT_BOOL
*
matches
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
const
struct
ISpeechObjectTokenVtbl
speech_token_vtbl
=
{
speech_token_QueryInterface
,
speech_token_AddRef
,
speech_token_Release
,
speech_token_GetTypeInfoCount
,
speech_token_GetTypeInfo
,
speech_token_GetIDsOfNames
,
speech_token_Invoke
,
speech_token_get_Id
,
speech_token_get_DataKey
,
speech_token_get_Category
,
speech_token_GetDescription
,
speech_token_SetId
,
speech_token_GetAttribute
,
speech_token_CreateInstance
,
speech_token_Remove
,
speech_token_GetStorageFileName
,
speech_token_RemoveStorageFileName
,
speech_token_IsUISupported
,
speech_token_DisplayUI
,
speech_token_MatchesAttributes
};
HRESULT
token_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
)
HRESULT
token_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
)
{
{
struct
object_token
*
This
=
malloc
(
sizeof
(
*
This
)
);
struct
object_token
*
This
=
malloc
(
sizeof
(
*
This
)
);
...
@@ -1502,6 +1714,7 @@ HRESULT token_create( IUnknown *outer, REFIID iid, void **obj )
...
@@ -1502,6 +1714,7 @@ HRESULT token_create( IUnknown *outer, REFIID iid, void **obj )
if
(
!
This
)
return
E_OUTOFMEMORY
;
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
ISpObjectToken_iface
.
lpVtbl
=
&
token_vtbl
;
This
->
ISpObjectToken_iface
.
lpVtbl
=
&
token_vtbl
;
This
->
ISpeechObjectToken_iface
.
lpVtbl
=
&
speech_token_vtbl
;
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
data_key
=
NULL
;
This
->
data_key
=
NULL
;
...
...
include/sapi.idl
View file @
c45bedbf
...
@@ -1293,7 +1293,7 @@ library SpeechLib
...
@@ -1293,7 +1293,7 @@ library SpeechLib
coclass
SpObjectToken
coclass
SpObjectToken
{
{
interface
ISpObjectToken
;
interface
ISpObjectToken
;
[
default
]
interface
ISp
DataKey
;
[
default
]
interface
ISp
eechObjectToken
;
}
}
[
[
...
...
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