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
4fdf90d4
Commit
4fdf90d4
authored
Jul 18, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Jul 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add tests for ConvertStringSecurityDescriptorToSecurityDescriptor.
parent
ccfa9ad8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
security.c
dlls/advapi32/tests/security.c
+98
-0
No files found.
dlls/advapi32/tests/security.c
View file @
4fdf90d4
...
...
@@ -1758,6 +1758,103 @@ static void test_GetNamedSecurityInfoA(void)
ok
(
group
!=
NULL
,
"group should not be NULL
\n
"
);
}
static
void
test_ConvertSecurityStringSecurityDescriptor
(
void
)
{
BOOL
ret
;
PSECURITY_DESCRIPTOR
pSD
;
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;GA;;;WD)"
,
0xdeadbeef
,
&
pSD
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_UNKNOWN_REVISION
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_UNKNOWN_REVISION instead of %d
\n
"
,
GetLastError
());
/* test ACE string type */
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;GA;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(D;;GA;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"ERROR:(D;;GA;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_PARAMETER instead of %d
\n
"
,
GetLastError
());
/* test ACE string access rights */
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;GA;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;GRGWGX;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;RCSDWDWO;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;RPWPCCDCLCSWLODTCR;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;FAFRFWFX;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;KAKRKWKX;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;0xFFFFFFFF;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
/* test ACE string access right error case */
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(A;;ROB;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_ACL
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_ACL instead of %d
\n
"
,
GetLastError
());
/* test ACE string SID */
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(D;;GA;;;S-1-0-0)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
"D:(D;;GA;;;Non existant account)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_ACL
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_ACL instead of %d
\n
"
,
GetLastError
());
}
START_TEST
(
security
)
{
init
();
...
...
@@ -1780,4 +1877,5 @@ START_TEST(security)
test_impersonation_level
();
test_SetEntriesInAcl
();
test_GetNamedSecurityInfoA
();
test_ConvertSecurityStringSecurityDescriptor
();
}
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