Module: wine Branch: master Commit: c522fedf19f6e217c7ae1017f84134cbb0432f5b URL: http://source.winehq.org/git/wine.git/?a=commit;h=c522fedf19f6e217c7ae1017f8...
Author: Huw Davies huw@codeweavers.com Date: Thu Sep 28 08:40:51 2017 +0100
sapi: Add a partial implementation of SpObjectTokenEnum::Next().
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/sapi/tests/token.c | 34 ++++++++++++++++++++++++++++++++++ dlls/sapi/token.c | 12 ++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 8c445ea..688ade7 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -49,9 +49,43 @@ static void test_data_key(void) ISpRegDataKey_Release( data_key ); }
+static void test_token_enum(void) +{ + ISpObjectTokenEnumBuilder *token_enum; + HRESULT hr; + ISpObjectToken *token; + ULONG count; + + hr = CoCreateInstance( &CLSID_SpObjectTokenEnum, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpObjectTokenEnumBuilder, (void **)&token_enum ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = ISpObjectTokenEnumBuilder_GetCount( token_enum, &count ); + ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr ); + + hr = ISpObjectTokenEnumBuilder_Next( token_enum, 1, &token, &count ); + ok( hr == SPERR_UNINITIALIZED, "got %08x\n", hr ); + + hr = ISpObjectTokenEnumBuilder_SetAttribs( token_enum, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + count = 0xdeadbeef; + hr = ISpObjectTokenEnumBuilder_GetCount( token_enum, &count ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( count == 0, "got %u\n", count ); + + count = 0xdeadbeef; + hr = ISpObjectTokenEnumBuilder_Next( token_enum, 1, &token, &count ); + ok( hr == S_FALSE, "got %08x\n", hr ); + ok( count == 0, "got %u\n", count ); + + ISpObjectTokenEnumBuilder_Release( token_enum ); +} + START_TEST(token) { CoInitialize( NULL ); test_data_key(); + test_token_enum(); CoUninitialize(); } diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index 27d3abe..51d2ed1 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -293,8 +293,16 @@ static HRESULT WINAPI token_enum_Next( ISpObjectTokenEnumBuilder *iface, ULONG num, ISpObjectToken **tokens, ULONG *fetched ) { - FIXME( "stub\n" ); - return E_NOTIMPL; + struct token_enum *This = impl_from_ISpObjectTokenEnumBuilder( iface ); + + TRACE( "(%p)->(%u %p %p)\n", This, num, tokens, fetched ); + + if (!This->init) return SPERR_UNINITIALIZED; + + FIXME( "semi-stub: Returning an empty enumerator\n" ); + + if (fetched) *fetched = 0; + return S_FALSE; }
static HRESULT WINAPI token_enum_Skip( ISpObjectTokenEnumBuilder *iface,