Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
682c1b95
Commit
682c1b95
authored
Sep 28, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Sep 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Add a partial implementation of SpObjectTokenCategory::EnumTokens().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6a7259d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
2 deletions
+58
-2
token.c
dlls/sapi/tests/token.c
+35
-0
token.c
dlls/sapi/token.c
+23
-2
No files found.
dlls/sapi/tests/token.c
View file @
682c1b95
...
...
@@ -49,6 +49,40 @@ static void test_data_key(void)
ISpRegDataKey_Release
(
data_key
);
}
static
void
test_token_category
(
void
)
{
ISpObjectTokenCategory
*
cat
;
IEnumSpObjectTokens
*
enum_tokens
;
HRESULT
hr
;
WCHAR
bogus
[]
=
{
'b'
,
'o'
,
'g'
,
'u'
,
's'
,
0
};
ULONG
count
;
hr
=
CoCreateInstance
(
&
CLSID_SpObjectTokenCategory
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ISpObjectTokenCategory
,
(
void
**
)
&
cat
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectTokenCategory_EnumTokens
(
cat
,
NULL
,
NULL
,
&
enum_tokens
);
ok
(
hr
==
SPERR_UNINITIALIZED
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectTokenCategory_SetId
(
cat
,
bogus
,
FALSE
);
ok
(
hr
==
SPERR_INVALID_REGISTRY_KEY
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectTokenCategory_SetId
(
cat
,
SPCAT_VOICES
,
FALSE
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectTokenCategory_SetId
(
cat
,
SPCAT_VOICES
,
FALSE
);
ok
(
hr
==
SPERR_ALREADY_INITIALIZED
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectTokenCategory_EnumTokens
(
cat
,
NULL
,
NULL
,
&
enum_tokens
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IEnumSpObjectTokens_GetCount
(
enum_tokens
,
&
count
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IEnumSpObjectTokens_Release
(
enum_tokens
);
ISpObjectTokenCategory_Release
(
cat
);
}
static
void
test_token_enum
(
void
)
{
ISpObjectTokenEnumBuilder
*
token_enum
;
...
...
@@ -86,6 +120,7 @@ START_TEST(token)
{
CoInitialize
(
NULL
);
test_data_key
();
test_token_category
();
test_token_enum
();
CoUninitialize
();
}
dlls/sapi/token.c
View file @
682c1b95
...
...
@@ -455,8 +455,29 @@ static HRESULT WINAPI token_category_EnumTokens( ISpObjectTokenCategory *iface,
LPCWSTR
req
,
LPCWSTR
opt
,
IEnumSpObjectTokens
**
enum_tokens
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
struct
token_category
*
This
=
impl_from_ISpObjectTokenCategory
(
iface
);
ISpObjectTokenEnumBuilder
*
builder
;
HRESULT
hr
;
FIXME
(
"(%p)->(%s %s %p): semi-stub
\n
"
,
This
,
debugstr_w
(
req
),
debugstr_w
(
opt
),
enum_tokens
);
if
(
!
This
->
data_key
)
return
SPERR_UNINITIALIZED
;
hr
=
CoCreateInstance
(
&
CLSID_SpObjectTokenEnum
,
NULL
,
CLSCTX_ALL
,
&
IID_ISpObjectTokenEnumBuilder
,
(
void
**
)
&
builder
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
ISpObjectTokenEnumBuilder_SetAttribs
(
builder
,
req
,
opt
);
if
(
FAILED
(
hr
))
goto
fail
;
/* FIXME: Build the enumerator */
hr
=
ISpObjectTokenEnumBuilder_QueryInterface
(
builder
,
&
IID_IEnumSpObjectTokens
,
(
void
**
)
enum_tokens
);
fail:
ISpObjectTokenEnumBuilder_Release
(
builder
);
return
hr
;
}
static
HRESULT
WINAPI
token_category_SetDefaultTokenId
(
ISpObjectTokenCategory
*
iface
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment