Signed-off-by: Bernhard Kölbl besentv@gmail.com --- dlls/windows.media.speech/Makefile.in | 1 + .../speechrecognitioncompilationresult.c | 151 ++++++++++++++++++ .../windows_media_speech_private.h | 2 + 3 files changed, 154 insertions(+) create mode 100644 dlls/windows.media.speech/speechrecognitioncompilationresult.c
diff --git a/dlls/windows.media.speech/Makefile.in b/dlls/windows.media.speech/Makefile.in index fd6e0b1ac63..7a8a784d35f 100644 --- a/dlls/windows.media.speech/Makefile.in +++ b/dlls/windows.media.speech/Makefile.in @@ -3,6 +3,7 @@ IMPORTS = combase uuid
C_SRCS = \ main.c \ + speechrecognitioncompilationresult.c \ speechrecognitionlistconstraint.c \ speechrecognitionresult.c \ speechrecognizer.c \ diff --git a/dlls/windows.media.speech/speechrecognitioncompilationresult.c b/dlls/windows.media.speech/speechrecognitioncompilationresult.c new file mode 100644 index 00000000000..d177127a26b --- /dev/null +++ b/dlls/windows.media.speech/speechrecognitioncompilationresult.c @@ -0,0 +1,151 @@ +/* WinRT Windows.Media.SpeechRecognition implementation + * + * Copyright 2022 Bernhard Kölbl + * + * 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 "windows_media_speech_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(speech); + +/* + * + * SpeechRecognitionCompilationResult + * + */ + +struct speech_recognition_compilation_result +{ + ISpeechRecognitionCompilationResult ISpeechRecognitionCompilationResult_iface; + LONG ref; +}; + +/* + * + * ISpeechRecognitionCompilationResult + * + */ + +static inline struct speech_recognition_compilation_result *impl_from_ISpeechRecognitionCompilationResult(ISpeechRecognitionCompilationResult *iface) +{ + return CONTAINING_RECORD(iface, struct speech_recognition_compilation_result, ISpeechRecognitionCompilationResult_iface); +} + +static HRESULT STDMETHODCALLTYPE speech_recognition_compilation_result_QueryInterface(ISpeechRecognitionCompilationResult *iface, REFIID iid, void **out) +{ + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_ISpeechRecognitionCompilationResult)) + { + IUnknown_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE speech_recognition_compilation_result_AddRef(ISpeechRecognitionCompilationResult *iface) +{ + struct speech_recognition_compilation_result *impl = impl_from_ISpeechRecognitionCompilationResult(iface); + + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %u.\n", iface, ref); + + return ref; +} + +static ULONG STDMETHODCALLTYPE speech_recognition_compilation_result_Release(ISpeechRecognitionCompilationResult *iface) +{ + struct speech_recognition_compilation_result *impl = impl_from_ISpeechRecognitionCompilationResult(iface); + + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %u.\n", iface, ref); + + if(!ref) + heap_free(impl); + + return ref; +} + +static HRESULT STDMETHODCALLTYPE speech_recognition_compilation_result_GetIids(ISpeechRecognitionCompilationResult *iface, ULONG *iid_count, IID **iids) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE speech_recognition_compilation_result_GetRuntimeClassName(ISpeechRecognitionCompilationResult *iface, HSTRING *class_name) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE speech_recognition_compilation_result_GetTrustLevel(ISpeechRecognitionCompilationResult *iface, TrustLevel *trust_level) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE speech_recognition_compilation_result_get_Status( + ISpeechRecognitionCompilationResult *iface, SpeechRecognitionResultStatus* value) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + + return E_NOTIMPL; +} + +static const struct ISpeechRecognitionCompilationResultVtbl speech_recognition_compilation_result_vtbl = +{ + /* IUnknown methods */ + speech_recognition_compilation_result_QueryInterface, + speech_recognition_compilation_result_AddRef, + speech_recognition_compilation_result_Release, + /* IInspectable methods */ + speech_recognition_compilation_result_GetIids, + speech_recognition_compilation_result_GetRuntimeClassName, + speech_recognition_compilation_result_GetTrustLevel, + /* ISpeechRecognitionCompilationResult methods */ + speech_recognition_compilation_result_get_Status +}; + +HRESULT STDMETHODCALLTYPE speech_recognition_compilation_result_create_from_iid(REFIID iid, void **obj) +{ + struct speech_recognition_compilation_result *impl; + HRESULT hr; + + TRACE("iid %p, obj %p.\n", iid, obj); + + if (!(impl = calloc(1, sizeof(*impl)))) + { + *obj = NULL; + return E_OUTOFMEMORY; + } + + impl->ISpeechRecognitionCompilationResult_iface.lpVtbl = &speech_recognition_compilation_result_vtbl; + impl->ref = 1; + + hr = ISpeechRecognitionCompilationResult_QueryInterface(&impl->ISpeechRecognitionCompilationResult_iface, iid, obj); + ISpeechRecognitionCompilationResult_Release(&impl->ISpeechRecognitionCompilationResult_iface); + + return hr; +} \ No newline at end of file diff --git a/dlls/windows.media.speech/windows_media_speech_private.h b/dlls/windows.media.speech/windows_media_speech_private.h index f7a3b89e072..88eb9a01140 100644 --- a/dlls/windows.media.speech/windows_media_speech_private.h +++ b/dlls/windows.media.speech/windows_media_speech_private.h @@ -83,6 +83,8 @@ struct activation_factory * */
+HRESULT STDMETHODCALLTYPE speech_recognition_compilation_result_create_from_iid(REFIID iid, void **obj) DECLSPEC_HIDDEN; + HRESULT STDMETHODCALLTYPE speech_recognition_list_constraint_create_default(IInspectable **inspectable) DECLSPEC_HIDDEN; HRESULT STDMETHODCALLTYPE speech_recognition_list_constraint_create(IIterable_HSTRING *commands, ISpeechRecognitionListConstraint **listconstraint) DECLSPEC_HIDDEN; HRESULT STDMETHODCALLTYPE speech_recognition_list_constraint_create_with_tag(IIterable_HSTRING *commands, HSTRING tag, ISpeechRecognitionListConstraint **listconstraint) DECLSPEC_HIDDEN;