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
5d49d334
Commit
5d49d334
authored
Sep 16, 2020
by
Myah Caron
Committed by
Alexandre Julliard
Sep 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sapi: Improve stub for ISpObjectToken::SetId.
Signed-off-by:
Myah Caron
<
qsniyg@protonmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
64808e17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
10 deletions
+35
-10
token.c
dlls/sapi/tests/token.c
+8
-8
token.c
dlls/sapi/token.c
+27
-2
No files found.
dlls/sapi/tests/token.c
View file @
5d49d334
...
...
@@ -202,23 +202,23 @@ static void test_object_token(void)
ok
(
cat
==
(
LPVOID
)
0xdeadbeef
,
"got %p
\n
"
,
cat
);
hr
=
ISpObjectToken_SetId
(
token
,
NULL
,
NULL
,
FALSE
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectToken_SetId
(
token
,
L"bogus"
,
NULL
,
FALSE
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectToken_SetId
(
token
,
NULL
,
L"bogus"
,
FALSE
);
todo_wine
ok
(
hr
==
SPERR_NOT_FOUND
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
SPERR_NOT_FOUND
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectToken_SetId
(
token
,
NULL
,
L"HKEY_LOCAL_MACHINE
\\
SOFTWARE
\\
winetest bogus"
,
FALSE
);
todo_wine
ok
(
hr
==
SPERR_NOT_FOUND
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
SPERR_NOT_FOUND
,
"got %08x
\n
"
,
hr
);
/* SetId succeeds even if the key is invalid, but exists */
hr
=
ISpObjectToken_SetId
(
token
,
NULL
,
L"HKEY_LOCAL_MACHINE
\\
SOFTWARE"
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectToken_SetId
(
token
,
NULL
,
NULL
,
FALSE
);
todo_wine
ok
(
hr
==
SPERR_ALREADY_INITIALIZED
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
SPERR_ALREADY_INITIALIZED
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectToken_SetId
(
token
,
NULL
,
L"bogus"
,
FALSE
);
todo_wine
ok
(
hr
==
SPERR_ALREADY_INITIALIZED
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
SPERR_ALREADY_INITIALIZED
,
"got %08x
\n
"
,
hr
);
hr
=
ISpObjectToken_GetId
(
token
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"got %08x
\n
"
,
hr
);
...
...
@@ -265,7 +265,7 @@ static void test_object_token(void)
/* NULL appears to auto-detect the category */
hr
=
ISpObjectToken_SetId
(
token
,
NULL
,
token_id
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
tempW
=
NULL
;
hr
=
ISpObjectToken_GetId
(
token
,
&
tempW
);
...
...
dlls/sapi/token.c
View file @
5d49d334
...
...
@@ -781,6 +781,8 @@ struct object_token
{
ISpObjectToken
ISpObjectToken_iface
;
LONG
ref
;
HKEY
token_key
;
};
static
struct
object_token
*
impl_from_ISpObjectToken
(
ISpObjectToken
*
iface
)
...
...
@@ -827,6 +829,7 @@ static ULONG WINAPI token_Release( ISpObjectToken *iface )
if
(
!
ref
)
{
if
(
This
->
token_key
)
RegCloseKey
(
This
->
token_key
);
heap_free
(
This
);
}
...
...
@@ -923,8 +926,28 @@ static HRESULT WINAPI token_SetId( ISpObjectToken *iface,
LPCWSTR
category_id
,
LPCWSTR
token_id
,
BOOL
create
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
struct
object_token
*
This
=
impl_from_ISpObjectToken
(
iface
);
BOOL
res
;
HRESULT
hr
;
HKEY
root
,
key
;
const
WCHAR
*
subkey
;
FIXME
(
"(%p)->(%s %s %d): semi-stub
\n
"
,
This
,
debugstr_w
(
category_id
),
debugstr_w
(
token_id
),
create
);
if
(
This
->
token_key
)
return
SPERR_ALREADY_INITIALIZED
;
if
(
!
token_id
)
return
E_POINTER
;
hr
=
parse_cat_id
(
token_id
,
&
root
,
&
subkey
);
if
(
hr
!=
S_OK
)
return
SPERR_NOT_FOUND
;
res
=
RegOpenKeyExW
(
root
,
subkey
,
0
,
KEY_ALL_ACCESS
,
&
key
);
if
(
res
)
return
SPERR_NOT_FOUND
;
This
->
token_key
=
key
;
return
S_OK
;
}
static
HRESULT
WINAPI
token_GetId
(
ISpObjectToken
*
iface
,
...
...
@@ -1047,6 +1070,8 @@ HRESULT token_create( IUnknown *outer, REFIID iid, void **obj )
This
->
ISpObjectToken_iface
.
lpVtbl
=
&
token_vtbl
;
This
->
ref
=
1
;
This
->
token_key
=
NULL
;
hr
=
ISpObjectToken_QueryInterface
(
&
This
->
ISpObjectToken_iface
,
iid
,
obj
);
ISpObjectToken_Release
(
&
This
->
ISpObjectToken_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