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
12dbeef6
Commit
12dbeef6
authored
Jul 20, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Jul 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Run on NT4 again.
parent
8a87d916
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
security.c
dlls/advapi32/tests/security.c
+29
-17
No files found.
dlls/advapi32/tests/security.c
View file @
12dbeef6
...
...
@@ -51,6 +51,8 @@ typedef VOID (WINAPI *fnBuildTrusteeWithObjectsAndSidA)( PTRUSTEEA pTrustee,
typedef
LPSTR
(
WINAPI
*
fnGetTrusteeNameA
)(
PTRUSTEEA
pTrustee
);
typedef
BOOL
(
WINAPI
*
fnConvertSidToStringSidA
)(
PSID
pSid
,
LPSTR
*
str
);
typedef
BOOL
(
WINAPI
*
fnConvertStringSidToSidA
)(
LPCSTR
str
,
PSID
pSid
);
static
BOOL
(
WINAPI
*
pConvertStringSecurityDescriptorToSecurityDescriptorA
)(
LPCSTR
,
DWORD
,
PSECURITY_DESCRIPTOR
*
,
PULONG
);
typedef
BOOL
(
WINAPI
*
fnGetFileSecurityA
)(
LPCSTR
,
SECURITY_INFORMATION
,
PSECURITY_DESCRIPTOR
,
DWORD
,
LPDWORD
);
typedef
DWORD
(
WINAPI
*
fnRtlAdjustPrivilege
)(
ULONG
,
BOOLEAN
,
BOOLEAN
,
PBOOLEAN
);
...
...
@@ -92,12 +94,16 @@ struct sidRef
static
void
init
(
void
)
{
HMODULE
hntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
HMODULE
hntdll
;
hntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
pNtQueryObject
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryObject"
);
hmod
=
GetModuleHandle
(
"advapi32.dll"
);
myARGC
=
winetest_get_mainargs
(
&
myARGV
);
pConvertStringSecurityDescriptorToSecurityDescriptorA
=
(
void
*
)
GetProcAddress
(
hmod
,
"ConvertStringSecurityDescriptorToSecurityDescriptorA"
);
pNtQueryObject
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryObject"
);
myARGC
=
winetest_get_mainargs
(
&
myARGV
);
}
static
void
test_str_sid
(
const
char
*
str_sid
)
...
...
@@ -1763,8 +1769,14 @@ static void test_ConvertStringSecurityDescriptor(void)
BOOL
ret
;
PSECURITY_DESCRIPTOR
pSD
;
if
(
!
pConvertStringSecurityDescriptorToSecurityDescriptorA
)
{
skip
(
"ConvertStringSecurityDescriptorToSecurityDescriptor is not available
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"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
"
,
...
...
@@ -1772,19 +1784,19 @@ static void test_ConvertStringSecurityDescriptor(void)
/* test ACE string type */
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;GA;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(D;;GA;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"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
"
,
...
...
@@ -1792,47 +1804,47 @@ static void test_ConvertStringSecurityDescriptor(void)
/* test ACE string access rights */
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;GA;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;GRGWGX;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;RCSDWDWO;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
LocalFree
(
pSD
);
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"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
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"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
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"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
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"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
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;ROB;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_ACL
,
...
...
@@ -1841,13 +1853,13 @@ static void test_ConvertStringSecurityDescriptor(void)
/* test ACE string SID */
SetLastError
(
0xdeadbeef
);
ret
=
ConvertStringSecurityDescriptorToSecurityDescriptor
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"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
(
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(D;;GA;;;Non existant account)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_ACL
,
...
...
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