From: Shaun Ren shaun.ren@linux.com
--- dlls/sapi/tests/token.c | 10 ++++++++++ dlls/sapi/token.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 6d2c40ea154..c7067718c45 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -205,6 +205,16 @@ static void test_token_category(void)
IEnumSpObjectTokens_Release( enum_tokens );
+ hr = ISpObjectTokenCategory_EnumTokens( cat, L"", NULL, &enum_tokens ); + ok( hr == S_OK, "got %08lx\n", hr ); + + count = 0xdeadbeef; + hr = IEnumSpObjectTokens_GetCount( enum_tokens, &count ); + ok( hr == S_OK, "got %08lx\n", hr ); + ok( count == 5, "got %lu\n", count ); + + IEnumSpObjectTokens_Release( enum_tokens ); + hr = ISpObjectTokenCategory_EnumTokens( cat, L"Language=409", NULL, &enum_tokens ); ok( hr == S_OK, "got %08lx\n", hr );
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index ad8163c9567..65d35dc96ff 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -947,7 +947,7 @@ static HRESULT score_attributes( ISpObjectToken *token, const WCHAR *attrs, unsigned int i, j; HRESULT hr;
- if (!attrs) + if (!attrs || !*attrs) { *score = 1; return S_OK;