Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b368cd1b
Commit
b368cd1b
authored
Sep 07, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Avoid test failures when running as an unprivileged user.
parent
fca92ae6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
security.c
dlls/advapi32/tests/security.c
+13
-0
No files found.
dlls/advapi32/tests/security.c
View file @
b368cd1b
...
...
@@ -5886,6 +5886,12 @@ static void test_system_security_access(void)
/* ACCESS_SYSTEM_SECURITY requires special privilege */
res
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
testkeyW
,
0
,
NULL
,
0
,
KEY_READ
|
ACCESS_SYSTEM_SECURITY
,
NULL
,
&
hkey
,
NULL
);
todo_wine
ok
(
res
==
ERROR_PRIVILEGE_NOT_HELD
,
"got %d
\n
"
,
res
);
if
(
res
==
ERROR_ACCESS_DENIED
)
{
skip
(
"unprivileged user
\n
"
);
CloseHandle
(
token
);
return
;
}
priv
.
PrivilegeCount
=
1
;
priv
.
Privileges
[
0
].
Luid
=
luid
;
...
...
@@ -5897,6 +5903,13 @@ static void test_system_security_access(void)
res
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
testkeyW
,
0
,
NULL
,
0
,
KEY_READ
|
ACCESS_SYSTEM_SECURITY
,
NULL
,
&
hkey
,
NULL
);
ok
(
!
res
,
"got %d
\n
"
,
res
);
if
(
res
==
ERROR_PRIVILEGE_NOT_HELD
)
{
win_skip
(
"privilege not held
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
priv_prev
);
CloseHandle
(
token
);
return
;
}
/* restore privileges */
ret
=
AdjustTokenPrivileges
(
token
,
FALSE
,
priv_prev
,
0
,
NULL
,
NULL
);
...
...
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