sapi: Add a partial implementation of SpObjectTokenEnum::Next().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-09-28 08:40:51 +01:00 committed by Alexandre Julliard
parent 211f2c7b93
commit c522fedf19
2 changed files with 44 additions and 2 deletions

View File

@ -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();
}

View File

@ -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,