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
e9ea4360
Commit
e9ea4360
authored
Feb 04, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some tests for querying the security of pseudo-handles.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a4199fa2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
security.c
dlls/advapi32/tests/security.c
+50
-0
No files found.
dlls/advapi32/tests/security.c
View file @
e9ea4360
...
...
@@ -7878,6 +7878,55 @@ static void test_create_process_token_child(void)
}
}
static
void
test_pseudo_handle_security
(
void
)
{
char
buffer
[
200
];
PSECURITY_DESCRIPTOR
sd
=
buffer
,
sd_ptr
;
unsigned
int
i
;
DWORD
size
;
BOOL
ret
;
static
const
HKEY
keys
[]
=
{
HKEY_CLASSES_ROOT
,
HKEY_CURRENT_USER
,
HKEY_LOCAL_MACHINE
,
HKEY_USERS
,
HKEY_PERFORMANCE_DATA
,
HKEY_CURRENT_CONFIG
,
HKEY_DYN_DATA
,
};
ret
=
GetKernelObjectSecurity
(
GetCurrentProcess
(),
OWNER_SECURITY_INFORMATION
,
&
sd
,
sizeof
(
buffer
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ret
=
GetKernelObjectSecurity
(
GetCurrentThread
(),
OWNER_SECURITY_INFORMATION
,
&
sd
,
sizeof
(
buffer
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
keys
);
++
i
)
{
SetLastError
(
0xdeadbeef
);
ret
=
GetKernelObjectSecurity
(
keys
[
i
],
OWNER_SECURITY_INFORMATION
,
&
sd
,
sizeof
(
buffer
),
&
size
);
ok
(
!
ret
,
"key %p: expected failure
\n
"
,
keys
[
i
]);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"key %p: got error %u
\n
"
,
keys
[
i
],
GetLastError
());
ret
=
GetSecurityInfo
(
keys
[
i
],
SE_REGISTRY_KEY
,
DACL_SECURITY_INFORMATION
,
NULL
,
NULL
,
NULL
,
NULL
,
&
sd_ptr
);
if
(
keys
[
i
]
==
HKEY_PERFORMANCE_DATA
)
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"key %p: got error %u
\n
"
,
keys
[
i
],
ret
);
else
if
(
keys
[
i
]
==
HKEY_DYN_DATA
)
todo_wine
ok
(
ret
==
ERROR_CALL_NOT_IMPLEMENTED
||
broken
(
ret
==
ERROR_INVALID_HANDLE
)
/* <7 */
,
"key %p: got error %u
\n
"
,
keys
[
i
],
ret
);
else
todo_wine
ok
(
!
ret
,
"key %p: got error %u
\n
"
,
keys
[
i
],
ret
);
LocalFree
(
sd_ptr
);
ret
=
GetSecurityInfo
(
keys
[
i
],
SE_KERNEL_OBJECT
,
DACL_SECURITY_INFORMATION
,
NULL
,
NULL
,
NULL
,
NULL
,
&
sd_ptr
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"key %p: got error %u
\n
"
,
keys
[
i
],
ret
);
}
}
START_TEST
(
security
)
{
init
();
...
...
@@ -7940,6 +7989,7 @@ START_TEST(security)
test_BuildSecurityDescriptorW
();
test_duplicate_handle_access
();
test_create_process_token
();
test_pseudo_handle_security
();
/* Must be the last test, modifies process token */
test_token_security_descriptor
();
...
...
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