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
a6361204
Commit
a6361204
authored
May 03, 2023
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add some RtlValidSecurityDescriptor() tests.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
5a3fd972
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
security.c
dlls/advapi32/tests/security.c
+29
-0
rtl.c
dlls/ntdll/tests/rtl.c
+24
-0
No files found.
dlls/advapi32/tests/security.c
View file @
a6361204
...
...
@@ -8560,6 +8560,34 @@ static void test_group_as_file_owner(void)
ok
(
ret
,
"got error %lu
\n
"
,
GetLastError
());
}
static
void
test_IsValidSecurityDescriptor
(
void
)
{
SECURITY_DESCRIPTOR
*
sd
;
BOOL
ret
;
SetLastError
(
0xdeadbeef
);
ret
=
IsValidSecurityDescriptor
(
NULL
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_SECURITY_DESCR
,
"Unexpected error %ld.
\n
"
,
GetLastError
());
sd
=
calloc
(
1
,
SECURITY_DESCRIPTOR_MIN_LENGTH
);
SetLastError
(
0xdeadbeef
);
ret
=
IsValidSecurityDescriptor
(
sd
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_SECURITY_DESCR
,
"Unexpected error %ld.
\n
"
,
GetLastError
());
ret
=
InitializeSecurityDescriptor
(
sd
,
SECURITY_DESCRIPTOR_REVISION
);
ok
(
ret
,
"Unexpected return value %d, error %ld.
\n
"
,
ret
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
IsValidSecurityDescriptor
(
sd
);
ok
(
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Unexpected error %ld.
\n
"
,
GetLastError
());
free
(
sd
);
}
START_TEST
(
security
)
{
init
();
...
...
@@ -8629,6 +8657,7 @@ START_TEST(security)
test_GetKernelObjectSecurity
();
test_elevation
();
test_group_as_file_owner
();
test_IsValidSecurityDescriptor
();
/* Must be the last test, modifies process token */
test_token_security_descriptor
();
...
...
dlls/ntdll/tests/rtl.c
View file @
a6361204
...
...
@@ -3625,6 +3625,29 @@ static void test_RtlInitializeSid(void)
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Unexpected status %#lx.
\n
"
,
status
);
}
static
void
test_RtlValidSecurityDescriptor
(
void
)
{
SECURITY_DESCRIPTOR
*
sd
;
NTSTATUS
status
;
BOOLEAN
ret
;
ret
=
RtlValidSecurityDescriptor
(
NULL
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
sd
=
calloc
(
1
,
SECURITY_DESCRIPTOR_MIN_LENGTH
);
ret
=
RtlValidSecurityDescriptor
(
sd
);
ok
(
!
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
status
=
RtlCreateSecurityDescriptor
(
sd
,
SECURITY_DESCRIPTOR_REVISION
);
ok
(
!
status
,
"Unexpected return value %#lx.
\n
"
,
status
);
ret
=
RtlValidSecurityDescriptor
(
sd
);
ok
(
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
free
(
sd
);
}
START_TEST
(
rtl
)
{
InitFunctionPtrs
();
...
...
@@ -3670,4 +3693,5 @@ START_TEST(rtl)
test_RtlDestroyHeap
();
test_RtlFirstFreeAce
();
test_RtlInitializeSid
();
test_RtlValidSecurityDescriptor
();
}
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