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
001d1a43
Commit
001d1a43
authored
Feb 07, 2024
by
Shaun Ren
Committed by
Alexandre Julliard
Feb 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Implement ISpeechObjectToken::Invoke.
parent
b6c17607
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
2 deletions
+127
-2
Makefile.in
dlls/sapi/Makefile.in
+1
-0
dispatch.c
dlls/sapi/dispatch.c
+85
-0
sapi_private.h
dlls/sapi/sapi_private.h
+9
-0
token.c
dlls/sapi/tests/token.c
+20
-0
token.c
dlls/sapi/token.c
+12
-2
No files found.
dlls/sapi/Makefile.in
View file @
001d1a43
...
...
@@ -5,6 +5,7 @@ DELAYIMPORTS = winmm
SOURCES
=
\
async.c
\
automation.c
\
dispatch.c
\
main.c
\
mmaudio.c
\
resource.c
\
...
...
dlls/sapi/dispatch.c
0 → 100644
View file @
001d1a43
/*
* ITypeInfo cache for IDispatch
*
* Copyright 2019 Zebediah Figura
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/debug.h"
#define COBJMACROS
#include "objbase.h"
#include "sapiddk.h"
#include "sapi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
sapi
);
static
ITypeLib
*
typelib
;
static
ITypeInfo
*
typeinfos
[
last_tid
];
static
REFIID
tid_id
[]
=
{
&
IID_ISpeechObjectToken
,
};
HRESULT
get_typeinfo
(
enum
type_id
tid
,
ITypeInfo
**
ret
)
{
HRESULT
hr
;
if
(
!
typelib
)
{
ITypeLib
*
tl
;
hr
=
LoadRegTypeLib
(
&
LIBID_SpeechLib
,
5
,
4
,
LOCALE_SYSTEM_DEFAULT
,
&
tl
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to load typelib, hr %#lx.
\n
"
,
hr
);
return
hr
;
}
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
typelib
,
tl
,
NULL
))
ITypeLib_Release
(
tl
);
}
if
(
!
typeinfos
[
tid
])
{
ITypeInfo
*
typeinfo
;
hr
=
ITypeLib_GetTypeInfoOfGuid
(
typelib
,
tid_id
[
tid
],
&
typeinfo
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to get type info for %s, hr %#lx.
\n
"
,
debugstr_guid
(
tid_id
[
tid
]),
hr
);
return
hr
;
}
if
(
InterlockedCompareExchangePointer
((
void
**
)(
typeinfos
+
tid
),
typeinfo
,
NULL
))
ITypeInfo_Release
(
typeinfo
);
}
ITypeInfo_AddRef
(
*
ret
=
typeinfos
[
tid
]);
return
S_OK
;
}
void
release_typelib
(
void
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
typeinfos
);
++
i
)
{
if
(
typeinfos
[
i
])
ITypeInfo_Release
(
typeinfos
[
i
]);
}
if
(
typelib
)
ITypeLib_Release
(
typelib
);
}
dlls/sapi/sapi_private.h
View file @
001d1a43
...
...
@@ -52,3 +52,12 @@ HRESULT mmaudio_out_create( IUnknown *outer, REFIID iid, void **obj );
HRESULT
token_category_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
);
HRESULT
token_enum_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
);
HRESULT
token_create
(
IUnknown
*
outer
,
REFIID
iid
,
void
**
obj
);
enum
type_id
{
ISpeechObjectToken_tid
,
last_tid
};
HRESULT
get_typeinfo
(
enum
type_id
tid
,
ITypeInfo
**
typeinfo
);
void
release_typelib
(
void
);
dlls/sapi/tests/token.c
View file @
001d1a43
...
...
@@ -26,6 +26,8 @@
#include "wine/test.h"
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
static
void
test_data_key
(
void
)
{
ISpRegDataKey
*
data_key
;
...
...
@@ -669,6 +671,8 @@ static void test_object_token(void)
ISpObjectTokenCategory
*
cat
;
DWORD
regid
;
IUnknown
*
obj
;
DISPPARAMS
params
;
VARIANT
arg
,
ret
;
hr
=
CoCreateInstance
(
&
CLSID_SpObjectToken
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ISpObjectToken
,
(
void
**
)
&
token
);
...
...
@@ -915,6 +919,22 @@ static void test_object_token(void)
ok
(
tempB
&&
!
wcscmp
(
tempB
,
L"TestToken"
),
"got %s
\n
"
,
wine_dbgstr_w
(
tempB
)
);
SysFreeString
(
tempB
);
memset
(
&
params
,
0
,
sizeof
(
params
)
);
params
.
cArgs
=
1
;
params
.
cNamedArgs
=
0
;
params
.
rgvarg
=
&
arg
;
VariantInit
(
&
arg
);
V_VT
(
&
arg
)
=
VT_I4
;
V_I4
(
&
arg
)
=
0x409
;
VariantInit
(
&
ret
);
hr
=
ISpeechObjectToken_Invoke
(
speech_token
,
DISPID_SOTGetDescription
,
&
IID_NULL
,
0
,
DISPATCH_METHOD
,
&
params
,
&
ret
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
ok
(
V_VT
(
&
ret
)
==
VT_BSTR
,
"got %#x
\n
"
,
V_VT
(
&
ret
)
);
ok
(
V_BSTR
(
&
ret
)
&&
!
wcscmp
(
V_BSTR
(
&
ret
),
L"409 - TestToken"
),
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
ret
)
)
);
VariantClear
(
&
ret
);
ISpeechObjectToken_Release
(
speech_token
);
ISpObjectToken_Release
(
test_class_token
);
...
...
dlls/sapi/token.c
View file @
001d1a43
...
...
@@ -1801,8 +1801,18 @@ static HRESULT WINAPI speech_token_Invoke( ISpeechObjectToken *iface,
EXCEPINFO
*
excepinfo
,
UINT
*
argerr
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
ITypeInfo
*
ti
;
HRESULT
hr
;
TRACE
(
"(%p)->(%ld %s %#lx %#x %p %p %p %p)
\n
"
,
iface
,
dispid
,
debugstr_guid
(
iid
),
lcid
,
flags
,
params
,
result
,
excepinfo
,
argerr
);
if
(
FAILED
(
hr
=
get_typeinfo
(
ISpeechObjectToken_tid
,
&
ti
)))
return
hr
;
hr
=
ITypeInfo_Invoke
(
ti
,
iface
,
dispid
,
flags
,
params
,
result
,
excepinfo
,
argerr
);
ITypeInfo_Release
(
ti
);
return
hr
;
}
static
HRESULT
WINAPI
speech_token_get_Id
(
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