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
731f2283
Commit
731f2283
authored
Apr 18, 2018
by
Sebastian Lackner
Committed by
Alexandre Julliard
Apr 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add basic tests for BuildSecurityDescriptor.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b58577aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
security.c
dlls/advapi32/tests/security.c
+37
-0
No files found.
dlls/advapi32/tests/security.c
View file @
731f2283
...
...
@@ -7316,6 +7316,42 @@ static void test_GetExplicitEntriesFromAclW(void)
HeapFree
(
GetProcessHeap
(),
0
,
old_acl
);
}
static
void
test_BuildSecurityDescriptorW
(
void
)
{
SECURITY_DESCRIPTOR
old_sd
,
*
new_sd
,
*
rel_sd
;
ULONG
new_sd_size
;
DWORD
buf_size
;
char
buf
[
1024
];
BOOL
success
;
DWORD
ret
;
InitializeSecurityDescriptor
(
&
old_sd
,
SECURITY_DESCRIPTOR_REVISION
);
buf_size
=
sizeof
(
buf
);
rel_sd
=
(
SECURITY_DESCRIPTOR
*
)
buf
;
success
=
MakeSelfRelativeSD
(
&
old_sd
,
rel_sd
,
&
buf_size
);
ok
(
success
,
"MakeSelfRelativeSD failed with %u
\n
"
,
GetLastError
());
new_sd
=
NULL
;
new_sd_size
=
0
;
ret
=
BuildSecurityDescriptorW
(
NULL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
NULL
,
&
new_sd_size
,
(
void
**
)
&
new_sd
);
ok
(
ret
==
ERROR_SUCCESS
,
"BuildSecurityDescriptor failed with %u
\n
"
,
ret
);
ok
(
new_sd
!=
NULL
,
"expected new_sd != NULL
\n
"
);
LocalFree
(
new_sd
);
new_sd
=
(
void
*
)
0xdeadbeef
;
ret
=
BuildSecurityDescriptorW
(
NULL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
&
old_sd
,
&
new_sd_size
,
(
void
**
)
&
new_sd
);
ok
(
ret
==
ERROR_INVALID_SECURITY_DESCR
,
"expected ERROR_INVALID_SECURITY_DESCR, got %u
\n
"
,
ret
);
ok
(
new_sd
==
(
void
*
)
0xdeadbeef
,
"expected new_sd == 0xdeadbeef, got %p
\n
"
,
new_sd
);
new_sd
=
NULL
;
new_sd_size
=
0
;
ret
=
BuildSecurityDescriptorW
(
NULL
,
NULL
,
0
,
NULL
,
0
,
NULL
,
rel_sd
,
&
new_sd_size
,
(
void
**
)
&
new_sd
);
ok
(
ret
==
ERROR_SUCCESS
,
"BuildSecurityDescriptor failed with %u
\n
"
,
ret
);
ok
(
new_sd
!=
NULL
,
"expected new_sd != NULL
\n
"
);
LocalFree
(
new_sd
);
}
START_TEST
(
security
)
{
init
();
...
...
@@ -7370,6 +7406,7 @@ START_TEST(security)
test_maximum_allowed
();
test_token_label
();
test_GetExplicitEntriesFromAclW
();
test_BuildSecurityDescriptorW
();
/* 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