From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/sapi/tests/token.c | 8 ++++++++ dlls/sapi/token.c | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 7778f4e61db..7ef58e697b0 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -194,6 +194,7 @@ static void test_default_token_id(void) static void test_object_token(void) { ISpObjectToken *token; + ISpDataKey *sub_key; HRESULT hr; LPWSTR tempW, token_id; ISpObjectTokenCategory *cat; @@ -253,6 +254,13 @@ static void test_object_token(void) CoTaskMemFree( tempW ); }
+ hr = ISpObjectToken_OpenKey(token, L"Non-exist", &sub_key); + ok( hr == SPERR_NOT_FOUND, "got %08lx\n", hr ); + + hr = ISpObjectToken_OpenKey(token, L"Classes", &sub_key); + ok( hr == S_OK, "got %08lx\n", hr ); + ISpDataKey_Release(sub_key); + cat = (LPVOID)0xdeadbeef; hr = ISpObjectToken_GetCategory( token, &cat ); todo_wine ok( hr == SPERR_INVALID_REGISTRY_KEY, "got %08lx\n", hr ); diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index b5cfc45e5a3..476e8d6d248 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -931,8 +931,37 @@ 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 SPERR_NOT_FOUND; + + hr = data_key_create(NULL, &IID_ISpRegDataKey, (void**)&spregkey); + if (FAILED(hr)) + { + RegCloseKey(key); + return hr; + } + + hr = ISpRegDataKey_SetKey(spregkey, key, FALSE); + if (FAILED(hr)) + { + RegCloseKey(key); + ISpRegDataKey_Release(spregkey); + return hr; + } + + hr = ISpRegDataKey_QueryInterface(spregkey, &IID_ISpDataKey, (void**)sub_key); + ISpRegDataKey_Release(spregkey); + + return hr; }
static HRESULT WINAPI token_CreateKey( ISpObjectToken *iface,
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=125078
Your paranoid android.
=== debian11 (32 bit report) ===
ddraw: ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x1000. ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian11 (build log) ===
Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24738. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24738. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24738.