Signed-off-by: Myah Caron qsniyg@protonmail.com --- The last test will likely fail under Marvin due to patch #1. However it succeeds under my prefix (after running `wineboot -u` to update the registry keys).
.token_key will be used when implementing CreateInstance (for querying CLSID). It's still used in order to check if the registry key exists though (otherwise it would fail more tests).
If this is not acceptable (as it is semi-unused), the alternative (I believe) would be to have it be a local variable instead, and either introduce a temporary .initialized member, or use .token_id from #4. Keeping it felt like the cleanest option to me, but please advise if this is not correct.
I set function as a semi-stub because it completely ignores the category, which appears to be an important part of the function, even if it is passed as NULL (which auto-detects the category).
dlls/sapi/tests/token.c | 16 ++++++++-------- dlls/sapi/token.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 9558022b3f4..db41de3d53a 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -202,23 +202,23 @@ static void test_object_token(void) ok( cat == (LPVOID)0xdeadbeef, "got %p\n", cat );
hr = ISpObjectToken_SetId( token, NULL, NULL, FALSE ); - todo_wine ok( hr == E_POINTER, "got %08x\n", hr ); + ok( hr == E_POINTER, "got %08x\n", hr ); hr = ISpObjectToken_SetId( token, L"bogus", NULL, FALSE ); - todo_wine ok( hr == E_POINTER, "got %08x\n", hr ); + ok( hr == E_POINTER, "got %08x\n", hr );
hr = ISpObjectToken_SetId( token, NULL, L"bogus", FALSE ); - todo_wine ok( hr == SPERR_NOT_FOUND, "got %08x\n", hr ); + ok( hr == SPERR_NOT_FOUND, "got %08x\n", hr ); hr = ISpObjectToken_SetId( token, NULL, L"HKEY_LOCAL_MACHINE\SOFTWARE\winetest bogus", FALSE ); - todo_wine ok( hr == SPERR_NOT_FOUND, "got %08x\n", hr ); + ok( hr == SPERR_NOT_FOUND, "got %08x\n", hr );
/* SetId succeeds even if the key is invalid, but exists */ hr = ISpObjectToken_SetId( token, NULL, L"HKEY_LOCAL_MACHINE\SOFTWARE", FALSE ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08x\n", hr );
hr = ISpObjectToken_SetId( token, NULL, NULL, FALSE ); - todo_wine ok( hr == SPERR_ALREADY_INITIALIZED, "got %08x\n", hr ); + ok( hr == SPERR_ALREADY_INITIALIZED, "got %08x\n", hr ); hr = ISpObjectToken_SetId( token, NULL, L"bogus", FALSE ); - todo_wine ok( hr == SPERR_ALREADY_INITIALIZED, "got %08x\n", hr ); + ok( hr == SPERR_ALREADY_INITIALIZED, "got %08x\n", hr );
hr = ISpObjectToken_GetId( token, NULL ); todo_wine ok( hr == E_POINTER, "got %08x\n", hr ); @@ -265,7 +265,7 @@ static void test_object_token(void)
/* NULL appears to auto-detect the category */ hr = ISpObjectToken_SetId( token, NULL, token_id, FALSE ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %08x\n", hr );
tempW = NULL; hr = ISpObjectToken_GetId( token, &tempW ); diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index f7a00d73f02..b4a318b4ade 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -781,6 +781,8 @@ struct object_token { ISpObjectToken ISpObjectToken_iface; LONG ref; + + HKEY token_key; };
static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface ) @@ -827,6 +829,7 @@ static ULONG WINAPI token_Release( ISpObjectToken *iface )
if (!ref) { + if (This->token_key) RegCloseKey( This->token_key ); heap_free( This ); }
@@ -923,8 +926,28 @@ static HRESULT WINAPI token_SetId( ISpObjectToken *iface, LPCWSTR category_id, LPCWSTR token_id, BOOL create ) { - FIXME( "stub\n" ); - return E_NOTIMPL; + struct object_token *This = impl_from_ISpObjectToken( iface ); + BOOL res; + HRESULT hr; + HKEY root, key; + const WCHAR *subkey; + + FIXME( "(%p)->(%s %s %d): semi-stub\n", This, debugstr_w( category_id ), + debugstr_w(token_id), create ); + + if (This->token_key) return SPERR_ALREADY_INITIALIZED; + + if (!token_id) return E_POINTER; + + hr = parse_cat_id( token_id, &root, &subkey ); + if (hr != S_OK) return SPERR_NOT_FOUND; + + res = RegOpenKeyExW( root, subkey, 0, KEY_ALL_ACCESS, &key ); + if (res) return SPERR_NOT_FOUND; + + This->token_key = key; + + return S_OK; }
static HRESULT WINAPI token_GetId( ISpObjectToken *iface, @@ -1047,6 +1070,8 @@ HRESULT token_create( IUnknown *outer, REFIID iid, void **obj ) This->ISpObjectToken_iface.lpVtbl = &token_vtbl; This->ref = 1;
+ This->token_key = NULL; + hr = ISpObjectToken_QueryInterface( &This->ISpObjectToken_iface, iid, obj );
ISpObjectToken_Release( &This->ISpObjectToken_iface ); -- 2.28.0
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=78765
Your paranoid android.
=== w2008s64 (32 bit report) ===
sapi: token.c:256: Test failed: got 8004503a token.c:257: Test failed: got DEADBEEF 0390:token: unhandled exception c0000005 at 740F13F4
=== w8 (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{665c2c6f-15eb-4ad1-8b8d-41ddfac228af}"
=== w8adm (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{665c2c6f-15eb-4ad1-8b8d-41ddfac228af}"
=== w1064v1507 (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{fac82c6d-0bb8-40c1-9837-01e220387133}"
=== w1064v1809 (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{e4578127-d0d4-4d03-acef-3f380d598591}"
=== w10pro64 (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_2scr (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_ar (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_he (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_ja (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_zh_CN (32 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w2008s64 (64 bit report) ===
sapi: token.c:256: Test failed: got 8004503a token.c:257: Test failed: got 00000000DEADBEEF 0390:token: unhandled exception c0000005 at 000007FEF6E66E2E
=== w864 (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{183a6754-bf1f-4b56-aad8-df081533f2ab}"
=== w1064v1507 (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{fac82c6d-0bb8-40c1-9837-01e220387133}"
=== w1064v1809 (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{e4578127-d0d4-4d03-acef-3f380d598591}"
=== w10pro64 (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_2scr (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_ar (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_he (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_ja (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== w10pro64_zh_CN (64 bit report) ===
sapi: token.c:275: Test failed: got L"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioOutput\TokenEnums\MMAudioOut\{0.0.0.00000000}.{d9cbadce-4fe6-4fb8-a4d5-cb72d21fddb0}"
=== debiant (32 bit report) ===
sapi: token.c:186: Test failed: got 80040154 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040208c).
Report validation errors: sapi:token crashed (c0000005)
=== debiant (32 bit French report) ===
sapi: token.c:186: Test failed: got 80040154 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040208c).
Report validation errors: sapi:token crashed (c0000005)
=== debiant (32 bit Japanese:Japan report) ===
sapi: token.c:186: Test failed: got 80040154 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040208c).
Report validation errors: sapi:token crashed (c0000005)
=== debiant (32 bit Chinese:China report) ===
sapi: token.c:186: Test failed: got 80040154 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040208c).
Report validation errors: sapi:token crashed (c0000005)
=== debiant (32 bit WoW report) ===
sapi: token.c:186: Test failed: got 80040154 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040208c).
Report validation errors: sapi:token crashed (c0000005)
=== debiant (64 bit WoW report) ===
sapi: token.c:186: Test failed: got 80040154 Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0040208c).
Report validation errors: sapi:token crashed (c0000005)