Added sapi-iteration-tokens patchset

This commit is contained in:
Alistair Leslie-Hughes 2021-09-22 18:37:01 +10:00
parent 640f5f7d0a
commit 100f108822
10 changed files with 586 additions and 0 deletions

View File

@ -187,6 +187,7 @@ patch_enable_all ()
enable_riched20_Class_Tests="$1"
enable_riched20_IText_Interface="$1"
enable_sapi_ISpObjectToken_CreateInstance="$1"
enable_sapi_iteration_tokens="$1"
enable_secur32_InitializeSecurityContextW="$1"
enable_server_File_Permissions="$1"
enable_server_Key_State="$1"
@ -602,6 +603,9 @@ patch_enable ()
sapi-ISpObjectToken-CreateInstance)
enable_sapi_ISpObjectToken_CreateInstance="$2"
;;
sapi-iteration-tokens)
enable_sapi_iteration_tokens="$2"
;;
secur32-InitializeSecurityContextW)
enable_secur32_InitializeSecurityContextW="$2"
;;
@ -1302,6 +1306,13 @@ if test "$enable_server_File_Permissions" -eq 1; then
enable_ntdll_Junction_Points=1
fi
if test "$enable_sapi_iteration_tokens" -eq 1; then
if test "$enable_sapi_ISpObjectToken_CreateInstance" -gt 1; then
abort "Patchset sapi-ISpObjectToken-CreateInstance disabled, but sapi-iteration-tokens depends on that."
fi
enable_sapi_ISpObjectToken_CreateInstance=1
fi
if test "$enable_oleaut32_OLEPictureImpl_SaveAsFile" -eq 1; then
if test "$enable_oleaut32_Load_Save_EMF" -gt 1; then
abort "Patchset oleaut32-Load_Save_EMF disabled, but oleaut32-OLEPictureImpl_SaveAsFile depends on that."
@ -3104,6 +3115,28 @@ if test "$enable_sapi_ISpObjectToken_CreateInstance" -eq 1; then
patch_apply sapi-ISpObjectToken-CreateInstance/0004-sapi-ISpObjectToken-CreateInstance-support-ISpAudio.patch
fi
# Patchset sapi-iteration-tokens
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * sapi-ISpObjectToken-CreateInstance
# |
# | This patchset fixes the following Wine bugs:
# | * [#51775] sapi: Allow iteration of Token objects.
# |
# | Modified files:
# | * dlls/sapi/sapi.rgs, dlls/sapi/token.c, include/sapi.idl
# |
if test "$enable_sapi_iteration_tokens" -eq 1; then
patch_apply sapi-iteration-tokens/0001-sapi-Implement-ISpRegDataKey-CreateKey.patch
patch_apply sapi-iteration-tokens/0002-include-Add-SPSTREAMFORMAT-enum-values.patch
patch_apply sapi-iteration-tokens/0003-sapi-Implement-ISpRegDataKey-GetStringValue.patch
patch_apply sapi-iteration-tokens/0004-sapi-EnumTokens-setup-enumeration-members.patch
patch_apply sapi-iteration-tokens/0005-sapi-Implement-ISpObjectTokenEnumBuilder-Item.patch
patch_apply sapi-iteration-tokens/0006-sapi-Implement-ISpObjectToken-GetId.patch
patch_apply sapi-iteration-tokens/0007-sapi-Implement-ISpObjectToken-OpenKey.patch
patch_apply sapi-iteration-tokens/0008-sapi-Add-default-voice-registry-key.patch
fi
# Patchset secur32-InitializeSecurityContextW
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,49 @@
From 940ec28d5ed0e8d93d844be1a6148a4e63863907 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 1/8] sapi: Implement ISpRegDataKey CreateKey
---
dlls/sapi/token.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index ba91a425e9e..ffdf62008f5 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -145,8 +145,30 @@ static HRESULT WINAPI data_key_OpenKey( ISpRegDataKey *iface,
static HRESULT WINAPI data_key_CreateKey( ISpRegDataKey *iface,
LPCWSTR name, ISpDataKey **sub_key )
{
- FIXME( "stub\n" );
- return E_NOTIMPL;
+ struct data_key *This = impl_from_ISpRegDataKey( iface );
+ ISpRegDataKey *spregkey;
+ HRESULT hr;
+ HKEY key;
+ LONG res;
+
+ TRACE( "%p, %s, %p\n", This, debugstr_w(name), sub_key );
+
+ if (!This->key) return E_INVALIDARG; /* FIXME */
+
+ res = RegCreateKeyExW( This->key, name, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &key, NULL );
+ if (res != ERROR_SUCCESS)
+ return HRESULT_FROM_WIN32(res);
+
+ hr = data_key_create(NULL, &IID_ISpRegDataKey, (void**)&spregkey);
+ if (hr == S_OK)
+ {
+ hr = ISpRegDataKey_SetKey(spregkey, key, FALSE);
+ if (hr == S_OK)
+ hr = ISpRegDataKey_QueryInterface(spregkey, &IID_ISpDataKey, (void**)sub_key);
+ ISpRegDataKey_Release(spregkey);
+ }
+
+ return hr;
}
static HRESULT WINAPI data_key_DeleteKey( ISpRegDataKey *iface, LPCWSTR name )
--
2.33.0

View File

@ -0,0 +1,99 @@
From 248e1d6f1779eab962cfcd91ef31b1dd0feeab62 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 2/8] include: Add SPSTREAMFORMAT enum values
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
include/sapi.idl | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/include/sapi.idl b/include/sapi.idl
index 59c2540ba21..d2c1aac8afc 100644
--- a/include/sapi.idl
+++ b/include/sapi.idl
@@ -351,6 +351,81 @@ typedef [hidden] enum SPVALUETYPE
SPDF_ALL = 0x000000ff
} SPVALUETYPE;
+typedef [hidden] enum SPSTREAMFORMAT
+{
+ SPSF_Default = -1,
+ SPSF_NoAssignedFormat = 0,
+ SPSF_Text,
+ SPSF_NonStandardFormat,
+ SPSF_ExtendedAudioFormat,
+ SPSF_8kHz8BitMono,
+ SPSF_8kHz8BitStereo,
+ SPSF_8kHz16BitMono,
+ SPSF_8kHz16BitStereo,
+ SPSF_11kHz8BitMono,
+ SPSF_11kHz8BitStereo,
+ SPSF_11kHz16BitMono,
+ SPSF_11kHz16BitStereo,
+ SPSF_12kHz8BitMono,
+ SPSF_12kHz8BitStereo,
+ SPSF_12kHz16BitMono,
+ SPSF_12kHz16BitStereo,
+ SPSF_16kHz8BitMono,
+ SPSF_16kHz8BitStereo,
+ SPSF_16kHz16BitMono,
+ SPSF_16kHz16BitStereo,
+ SPSF_22kHz8BitMono,
+ SPSF_22kHz8BitStereo,
+ SPSF_22kHz16BitMono,
+ SPSF_22kHz16BitStereo,
+ SPSF_24kHz8BitMono,
+ SPSF_24kHz8BitStereo,
+ SPSF_24kHz16BitMono,
+ SPSF_24kHz16BitStereo,
+ SPSF_32kHz8BitMono,
+ SPSF_32kHz8BitStereo,
+ SPSF_32kHz16BitMono,
+ SPSF_32kHz16BitStereo,
+ SPSF_44kHz8BitMono,
+ SPSF_44kHz8BitStereo,
+ SPSF_44kHz16BitMono,
+ SPSF_44kHz16BitStereo,
+ SPSF_48kHz8BitMono,
+ SPSF_48kHz8BitStereo,
+ SPSF_48kHz16BitMono,
+ SPSF_48kHz16BitStereo,
+ SPSF_TrueSpeech_8kHz1BitMono,
+ SPSF_CCITT_ALaw_8kHzMono,
+ SPSF_CCITT_ALaw_8kHzStereo,
+ SPSF_CCITT_ALaw_11kHzMono,
+ SPSF_CCITT_ALaw_11kHzStereo,
+ SPSF_CCITT_ALaw_22kHzMono,
+ SPSF_CCITT_ALaw_22kHzStereo,
+ SPSF_CCITT_ALaw_44kHzMono,
+ SPSF_CCITT_ALaw_44kHzStereo,
+ SPSF_CCITT_uLaw_8kHzMono,
+ SPSF_CCITT_uLaw_8kHzStereo,
+ SPSF_CCITT_uLaw_11kHzMono,
+ SPSF_CCITT_uLaw_11kHzStereo,
+ SPSF_CCITT_uLaw_22kHzMono,
+ SPSF_CCITT_uLaw_22kHzStereo,
+ SPSF_CCITT_uLaw_44kHzMono,
+ SPSF_CCITT_uLaw_44kHzStereo,
+ SPSF_ADPCM_8kHzMono,
+ SPSF_ADPCM_8kHzStereo,
+ SPSF_ADPCM_11kHzMono,
+ SPSF_ADPCM_11kHzStereo,
+ SPSF_ADPCM_22kHzMono,
+ SPSF_ADPCM_22kHzStereo,
+ SPSF_ADPCM_44kHzMono,
+ SPSF_ADPCM_44kHzStereo,
+ SPSF_GSM610_8kHzMono,
+ SPSF_GSM610_11kHzMono,
+ SPSF_GSM610_22kHzMono,
+ SPSF_GSM610_44kHzMono,
+ SPSF_NUM_FORMATS
+} SPSTREAMFORMAT;
+
typedef unsigned short SPPHONEID;
typedef [restricted, hidden] struct SPPHRASEELEMENT
--
2.33.0

View File

@ -0,0 +1,51 @@
From c6d5ef9803d17e35a3ee1a006be1a9b21d838ac9 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 3/8] sapi: Implement ISpRegDataKey GetStringValue
---
dlls/sapi/token.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index ffdf62008f5..0a160455d2b 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -117,8 +117,32 @@ static HRESULT WINAPI data_key_SetStringValue( ISpRegDataKey *iface,
static HRESULT WINAPI data_key_GetStringValue( ISpRegDataKey *iface,
LPCWSTR name, LPWSTR *value )
{
- FIXME( "stub\n" );
- return E_NOTIMPL;
+ struct data_key *This = impl_from_ISpRegDataKey( iface );
+ DWORD ret, size;
+ WCHAR *content;
+
+ FIXME( "%p, %s, %p\n", This, debugstr_w(name), value);
+
+ if (!This->key) return E_INVALIDARG; /* FIXME */
+
+ size = 0;
+ ret = RegGetValueW( This->key, NULL, name, RRF_RT_REG_SZ, NULL, NULL, &size );
+ if (ret == ERROR_FILE_NOT_FOUND)
+ return SPERR_NOT_FOUND;
+
+ content = CoTaskMemAlloc(size);
+ if (!content)
+ return E_OUTOFMEMORY;
+
+ ret = RegGetValueW( This->key, NULL, name, RRF_RT_REG_SZ, NULL, content, &size );
+ if (ret != ERROR_SUCCESS)
+ {
+ CoTaskMemFree(content);
+ return HRESULT_FROM_WIN32(ret);
+ }
+
+ *value = content;
+ return S_OK;
}
static HRESULT WINAPI data_key_SetDWORD( ISpRegDataKey *iface,
--
2.33.0

View File

@ -0,0 +1,100 @@
From 0aab7e8ef8f33b63fd3589ecf3413822cc36c37b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 4/8] sapi: EnumTokens setup enumeration members
---
dlls/sapi/token.c | 47 ++++++++++++++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 17 deletions(-)
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index 0a160455d2b..6bf66bc0d5b 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -48,6 +48,22 @@ static struct data_key *impl_from_ISpRegDataKey( ISpRegDataKey *iface )
return CONTAINING_RECORD( iface, struct data_key, ISpRegDataKey_iface );
}
+struct token_enum
+{
+ ISpObjectTokenEnumBuilder ISpObjectTokenEnumBuilder_iface;
+ LONG ref;
+
+ BOOL init;
+ WCHAR *req, *opt;
+ ULONG count;
+ HKEY key;
+};
+
+static struct token_enum *impl_from_ISpObjectTokenEnumBuilder( ISpObjectTokenEnumBuilder *iface )
+{
+ return CONTAINING_RECORD( iface, struct token_enum, ISpObjectTokenEnumBuilder_iface );
+}
+
static HRESULT WINAPI data_key_QueryInterface( ISpRegDataKey *iface, REFIID iid, void **obj )
{
struct data_key *This = impl_from_ISpRegDataKey( iface );
@@ -503,9 +519,11 @@ static HRESULT WINAPI token_category_EnumTokens( ISpObjectTokenCategory *iface,
{
struct token_category *This = impl_from_ISpObjectTokenCategory( iface );
ISpObjectTokenEnumBuilder *builder;
+ struct token_enum *tokenenum;
+ struct data_key *this_data_key;
HRESULT hr;
- FIXME( "(%p)->(%s %s %p): semi-stub\n", This, debugstr_w( req ), debugstr_w( opt ), enum_tokens );
+ TRACE( "(%p)->(%s %s %p)\n", This, debugstr_w( req ), debugstr_w( opt ), enum_tokens );
if (!This->data_key) return SPERR_UNINITIALIZED;
@@ -516,7 +534,15 @@ static HRESULT WINAPI token_category_EnumTokens( ISpObjectTokenCategory *iface,
hr = ISpObjectTokenEnumBuilder_SetAttribs( builder, req, opt );
if (FAILED(hr)) goto fail;
- /* FIXME: Build the enumerator */
+ this_data_key = impl_from_ISpRegDataKey( This->data_key );
+
+ tokenenum = impl_from_ISpObjectTokenEnumBuilder( builder );
+
+ if(!RegOpenKeyExW( this_data_key->key, L"Tokens", 0, KEY_ALL_ACCESS, &tokenenum->key ))
+ {
+ RegQueryInfoKeyW(tokenenum->key, NULL, NULL, NULL, &tokenenum->count, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL);
+ }
hr = ISpObjectTokenEnumBuilder_QueryInterface( builder, &IID_IEnumSpObjectTokens,
(void **)enum_tokens );
@@ -611,21 +637,6 @@ HRESULT token_category_create( IUnknown *outer, REFIID iid, void **obj )
return hr;
}
-struct token_enum
-{
- ISpObjectTokenEnumBuilder ISpObjectTokenEnumBuilder_iface;
- LONG ref;
-
- BOOL init;
- WCHAR *req, *opt;
- ULONG count;
-};
-
-static struct token_enum *impl_from_ISpObjectTokenEnumBuilder( ISpObjectTokenEnumBuilder *iface )
-{
- return CONTAINING_RECORD( iface, struct token_enum, ISpObjectTokenEnumBuilder_iface );
-}
-
static HRESULT WINAPI token_enum_QueryInterface( ISpObjectTokenEnumBuilder *iface,
REFIID iid, void **obj )
{
@@ -665,6 +676,8 @@ static ULONG WINAPI token_enum_Release( ISpObjectTokenEnumBuilder *iface )
if (!ref)
{
+ if (This->key)
+ RegCloseKey(This->key);
heap_free( This->req );
heap_free( This->opt );
heap_free( This );
--
2.33.0

View File

@ -0,0 +1,104 @@
From 9642c43791d10664565e11fb11f9e6165eb4cef6 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 5/8] sapi: Implement ISpObjectTokenEnumBuilder Item
---
dlls/sapi/token.c | 67 ++++++++++++++++++++++++++++++++++++-----------
1 file changed, 52 insertions(+), 15 deletions(-)
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index 6bf66bc0d5b..d16478d0064 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -64,6 +64,19 @@ static struct token_enum *impl_from_ISpObjectTokenEnumBuilder( ISpObjectTokenEnu
return CONTAINING_RECORD( iface, struct token_enum, ISpObjectTokenEnumBuilder_iface );
}
+struct object_token
+{
+ ISpObjectToken ISpObjectToken_iface;
+ LONG ref;
+
+ HKEY token_key;
+};
+
+static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
+{
+ return CONTAINING_RECORD( iface, struct object_token, ISpObjectToken_iface );
+}
+
static HRESULT WINAPI data_key_QueryInterface( ISpRegDataKey *iface, REFIID iid, void **obj )
{
struct data_key *This = impl_from_ISpRegDataKey( iface );
@@ -725,8 +738,45 @@ static HRESULT WINAPI token_enum_Clone( ISpObjectTokenEnumBuilder *iface,
static HRESULT WINAPI token_enum_Item( ISpObjectTokenEnumBuilder *iface,
ULONG index, ISpObjectToken **token )
{
- FIXME( "stub\n" );
- return E_NOTIMPL;
+ struct token_enum *This = impl_from_ISpObjectTokenEnumBuilder( iface );
+ struct object_token *object;
+ ISpObjectToken *subtoken;
+ HRESULT hr;
+ WCHAR *subkey;
+ DWORD size;
+ LONG ret;
+ HKEY key;
+
+ TRACE( "%p, %d, %p\n", This, index, token );
+
+ if (!This->init)
+ return SPERR_UNINITIALIZED;
+
+ RegQueryInfoKeyW(This->key, NULL, NULL, NULL, NULL, &size, NULL, NULL, NULL, NULL, NULL, NULL);
+ size = (size+1) * sizeof(WCHAR);
+ subkey = heap_alloc(size);
+ if (!subkey)
+ return E_OUTOFMEMORY;
+
+ ret = RegEnumKeyExW(This->key, index, subkey, &size, NULL, NULL, NULL, NULL);
+ if (ret != ERROR_SUCCESS)
+ return HRESULT_FROM_WIN32(ret);
+
+ ret = RegOpenKeyExW (This->key, subkey, 0, KEY_READ, &key);
+ if (ret != ERROR_SUCCESS)
+ return HRESULT_FROM_WIN32(ret);
+ heap_free(subkey);
+
+ hr = token_create( NULL, &IID_ISpObjectToken, (void**)&subtoken );
+ if (FAILED(hr))
+ return hr;
+
+ object = impl_from_ISpObjectToken( subtoken );
+ object->token_key = key;
+
+ *token = subtoken;
+
+ return hr;
}
static HRESULT WINAPI token_enum_GetCount( ISpObjectTokenEnumBuilder *iface,
@@ -837,19 +887,6 @@ HRESULT token_enum_create( IUnknown *outer, REFIID iid, void **obj )
return hr;
}
-struct object_token
-{
- ISpObjectToken ISpObjectToken_iface;
- LONG ref;
-
- HKEY token_key;
-};
-
-static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
-{
- return CONTAINING_RECORD( iface, struct object_token, ISpObjectToken_iface );
-}
-
static HRESULT WINAPI token_QueryInterface( ISpObjectToken *iface,
REFIID iid, void **obj )
{
--
2.33.0

View File

@ -0,0 +1,70 @@
From c2a21bbb02715a43fda52ad4326d8783272df234 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 6/8] sapi: Implement ISpObjectToken GetId
---
dlls/sapi/token.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index d16478d0064..4b9ca15fe11 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -70,6 +70,7 @@ struct object_token
LONG ref;
HKEY token_key;
+ WCHAR *token_id;
};
static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
@@ -765,7 +766,6 @@ static HRESULT WINAPI token_enum_Item( ISpObjectTokenEnumBuilder *iface,
ret = RegOpenKeyExW (This->key, subkey, 0, KEY_READ, &key);
if (ret != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(ret);
- heap_free(subkey);
hr = token_create( NULL, &IID_ISpObjectToken, (void**)&subtoken );
if (FAILED(hr))
@@ -773,6 +773,7 @@ static HRESULT WINAPI token_enum_Item( ISpObjectTokenEnumBuilder *iface,
object = impl_from_ISpObjectToken( subtoken );
object->token_key = key;
+ object->token_id = subkey;
*token = subtoken;
@@ -927,6 +928,7 @@ static ULONG WINAPI token_Release( ISpObjectToken *iface )
if (!ref)
{
if (This->token_key) RegCloseKey( This->token_key );
+ heap_free(This->token_id);
heap_free( This );
}
@@ -1053,8 +1055,19 @@ static HRESULT WINAPI token_SetId( ISpObjectToken *iface,
static HRESULT WINAPI token_GetId( ISpObjectToken *iface,
LPWSTR *token_id )
{
- FIXME( "stub\n" );
- return E_NOTIMPL;
+ struct object_token *This = impl_from_ISpObjectToken( iface );
+
+ TRACE( "%p, %p\n", This, token_id);
+
+ if (!This->token_key)
+ return SPERR_UNINITIALIZED;
+
+ *token_id = CoTaskMemAlloc( (wcslen(This->token_id) + 1) * sizeof(WCHAR));
+ if (!*token_id)
+ return E_OUTOFMEMORY;
+
+ wcscpy(*token_id, This->token_id);
+ return S_OK;
}
static HRESULT WINAPI token_GetCategory( ISpObjectToken *iface,
--
2.33.0

View File

@ -0,0 +1,48 @@
From 26a5401b90c60a267646975321a7a25126fc165c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 7/8] sapi: Implement ISpObjectToken OpenKey
---
dlls/sapi/token.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index 4b9ca15fe11..06f1250a40b 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -982,8 +982,29 @@ static HRESULT WINAPI token_GetDWORD( ISpObjectToken *iface,
static HRESULT WINAPI token_OpenKey( ISpObjectToken *iface,
LPCWSTR name, ISpDataKey **sub_key )
{
- FIXME( "stub\n" );
- return E_NOTIMPL;
+ struct object_token *This = impl_from_ISpObjectToken( iface );
+ ISpRegDataKey *spregkey;
+ HRESULT hr;
+ HKEY key;
+ LONG ret;
+
+ TRACE( "%p, %s, %p\n", This, debugstr_w(name), sub_key );
+
+ ret = RegOpenKeyExW (This->token_key, name, 0, KEY_ALL_ACCESS, &key);
+ if (ret != ERROR_SUCCESS)
+ return HRESULT_FROM_WIN32(ret);
+
+ hr = data_key_create(NULL, &IID_ISpRegDataKey, (void**)&spregkey);
+ if (hr == S_OK)
+ {
+ hr = ISpRegDataKey_SetKey(spregkey, key, FALSE);
+ if (hr == S_OK)
+ {
+ hr = ISpRegDataKey_QueryInterface(spregkey, &IID_ISpDataKey, (void**)sub_key);
+ ISpRegDataKey_Release(spregkey);
+ }
+ }
+ return hr;
}
static HRESULT WINAPI token_CreateKey( ISpObjectToken *iface,
--
2.33.0

View File

@ -0,0 +1,30 @@
From 7c650212c2e33820d9436875c6987fca3579151c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 8/8] sapi: Add default voice registry key
---
dlls/sapi/sapi.rgs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dlls/sapi/sapi.rgs b/dlls/sapi/sapi.rgs
index 331e115ae71..33b720784cd 100644
--- a/dlls/sapi/sapi.rgs
+++ b/dlls/sapi/sapi.rgs
@@ -19,6 +19,13 @@ HKLM
}
NoRemove Voices
{
+ NoRemove Tokens
+ {
+ NoRemove 'Wine Default Voice'
+ {
+ NoRemove Attributes
+ }
+ }
}
}
}
--
2.33.0

View File

@ -0,0 +1,2 @@
Fixes: [51775] sapi: Allow iteration of Token objects.
Depends: sapi-ISpObjectToken-CreateInstance