Signed-off-by: Myah Caron qsniyg@protonmail.com --- This function is not strictly necessary for the bug, but it was simple enough to implement.
dlls/sapi/tests/token.c | 14 +++++++------- dlls/sapi/token.c | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index db41de3d53a..3bbecf67e44 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -186,11 +186,11 @@ static void test_object_token(void) ok( hr == S_OK, "got %08x\n", hr );
hr = ISpObjectToken_GetId( token, NULL ); - todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr ); + ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr );
tempW = (LPWSTR)0xdeadbeef; hr = ISpObjectToken_GetId( token, &tempW ); - todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr ); + ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr ); ok( tempW == (LPWSTR)0xdeadbeef, "got %s\n", wine_dbgstr_w(tempW) );
hr = ISpObjectToken_GetCategory( token, NULL ); @@ -221,15 +221,15 @@ static void test_object_token(void) ok( hr == SPERR_ALREADY_INITIALIZED, "got %08x\n", hr );
hr = ISpObjectToken_GetId( token, NULL ); - todo_wine ok( hr == E_POINTER, "got %08x\n", hr ); + ok( hr == E_POINTER, "got %08x\n", hr );
hr = ISpObjectToken_GetCategory( token, NULL ); todo_wine ok( hr == E_POINTER, "got %08x\n", hr );
tempW = NULL; hr = ISpObjectToken_GetId( token, &tempW ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); - todo_wine ok( tempW != NULL, "got %p\n", tempW ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( tempW != NULL, "got %p\n", tempW ); if (tempW) { ok( !wcscmp(tempW, L"HKEY_LOCAL_MACHINE\SOFTWARE"), "got %s\n", wine_dbgstr_w(tempW) ); @@ -269,8 +269,8 @@ static void test_object_token(void)
tempW = NULL; hr = ISpObjectToken_GetId( token, &tempW ); - todo_wine ok( hr == S_OK, "got %08x\n", hr ); - todo_wine ok( tempW != NULL, "got %p\n", tempW ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( tempW != NULL, "got %p\n", tempW ); if (tempW) { ok( !wcscmp(tempW, token_id), "got %s\n", wine_dbgstr_w(tempW) ); CoTaskMemFree( tempW ); diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index b4a318b4ade..955ee738f71 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -783,6 +783,7 @@ struct object_token LONG ref;
HKEY token_key; + LPWSTR token_id; };
static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface ) @@ -830,6 +831,7 @@ static ULONG WINAPI token_Release( ISpObjectToken *iface ) if (!ref) { if (This->token_key) RegCloseKey( This->token_key ); + if (This->token_id) heap_free( This->token_id ); heap_free( This ); }
@@ -946,6 +948,7 @@ static HRESULT WINAPI token_SetId( ISpObjectToken *iface, if (res) return SPERR_NOT_FOUND;
This->token_key = key; + This->token_id = heap_strdupW( token_id );
return S_OK; } @@ -953,8 +956,18 @@ 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_id) return SPERR_UNINITIALIZED; + + if (!token_id) return E_POINTER; + + *token_id = CoTaskMemAlloc( lstrlenW( This->token_id ) * sizeof( WCHAR ) ); + wcscpy( *token_id, This->token_id ); + + return S_OK; }
static HRESULT WINAPI token_GetCategory( ISpObjectToken *iface, @@ -1071,6 +1084,7 @@ HRESULT token_create( IUnknown *outer, REFIID iid, void **obj ) This->ref = 1;
This->token_key = NULL; + This->token_id = NULL;
hr = ISpObjectToken_QueryInterface( &This->ISpObjectToken_iface, iid, obj );
-- 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=78766
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 (0x00402080).
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 (0x00402080).
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 (0x00402080).
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 (0x00402080).
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 (0x00402080).
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 (0x00402080).
Report validation errors: sapi:token crashed (c0000005)