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
227cbdea
Commit
227cbdea
authored
Aug 26, 2009
by
Ge van Geldorp
Committed by
Alexandre Julliard
Aug 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Fix tests on Win7.
parent
8bd5619e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
security.c
dlls/advapi32/tests/security.c
+14
-7
No files found.
dlls/advapi32/tests/security.c
View file @
227cbdea
...
@@ -2396,7 +2396,8 @@ static void test_impersonation_level(void)
...
@@ -2396,7 +2396,8 @@ static void test_impersonation_level(void)
/* can't perform access check when opening object against an anonymous impersonation token */
/* can't perform access check when opening object against an anonymous impersonation token */
todo_wine
{
todo_wine
{
error
=
RegOpenKeyEx
(
HKEY_CURRENT_USER
,
"Software"
,
0
,
KEY_READ
,
&
hkey
);
error
=
RegOpenKeyEx
(
HKEY_CURRENT_USER
,
"Software"
,
0
,
KEY_READ
,
&
hkey
);
ok
(
error
==
ERROR_INVALID_HANDLE
,
"RegOpenKeyEx should have failed with ERROR_INVALID_HANDLE instead of %d
\n
"
,
error
);
ok
(
error
==
ERROR_INVALID_HANDLE
||
error
==
ERROR_CANT_OPEN_ANONYMOUS
,
"RegOpenKeyEx should have failed with ERROR_INVALID_HANDLE or ERROR_CANT_OPEN_ANONYMOUS instead of %d
\n
"
,
error
);
}
}
RevertToSelf
();
RevertToSelf
();
...
@@ -2449,7 +2450,8 @@ static void test_impersonation_level(void)
...
@@ -2449,7 +2450,8 @@ static void test_impersonation_level(void)
/* can't perform access check when opening object against an identification impersonation token */
/* can't perform access check when opening object against an identification impersonation token */
error
=
RegOpenKeyEx
(
HKEY_CURRENT_USER
,
"Software"
,
0
,
KEY_READ
,
&
hkey
);
error
=
RegOpenKeyEx
(
HKEY_CURRENT_USER
,
"Software"
,
0
,
KEY_READ
,
&
hkey
);
todo_wine
{
todo_wine
{
ok
(
error
==
ERROR_INVALID_HANDLE
,
"RegOpenKeyEx should have failed with ERROR_INVALID_HANDLE instead of %d
\n
"
,
error
);
ok
(
error
==
ERROR_INVALID_HANDLE
||
error
==
ERROR_BAD_IMPERSONATION_LEVEL
,
"RegOpenKeyEx should have failed with ERROR_INVALID_HANDLE or ERROR_BAD_IMPERSONATION_LEVEL instead of %d
\n
"
,
error
);
}
}
ret
=
PrivilegeCheck
(
Token
,
PrivilegeSet
,
&
AccessGranted
);
ret
=
PrivilegeCheck
(
Token
,
PrivilegeSet
,
&
AccessGranted
);
ok
(
ret
,
"PrivilegeCheck for SecurityIdentification failed with error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"PrivilegeCheck for SecurityIdentification failed with error %d
\n
"
,
GetLastError
());
...
@@ -3050,20 +3052,25 @@ static void test_PrivateObjectSecurity(void)
...
@@ -3050,20 +3052,25 @@ static void test_PrivateObjectSecurity(void)
"GetPrivateObjectSecurity failed (err=%u)
\n
"
,
GetLastError
());
"GetPrivateObjectSecurity failed (err=%u)
\n
"
,
GetLastError
());
ok
(
retSize
<=
dwDescSize
,
"Buffer too small (%d vs %d)
\n
"
,
retSize
,
dwDescSize
);
ok
(
retSize
<=
dwDescSize
,
"Buffer too small (%d vs %d)
\n
"
,
retSize
,
dwDescSize
);
ok
(
pConvertSecurityDescriptorToStringSecurityDescriptorA
(
buf
,
SDDL_REVISION_1
,
sec_info
,
&
string
,
&
len
),
"Conversion failed err=%u
\n
"
,
GetLastError
());
ok
(
pConvertSecurityDescriptorToStringSecurityDescriptorA
(
buf
,
SDDL_REVISION_1
,
sec_info
,
&
string
,
&
len
),
"Conversion failed err=%u
\n
"
,
GetLastError
());
CHECK_RESULT_AND_FREE
(
"G:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"
);
CHECK_ONE_OF_AND_FREE
(
"G:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"
,
"G:S-1-5-21-93476-23408-4576D:P(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"
);
/* Win7 */
GetSecurityDescriptorControl
(
buf
,
&
ctrl
,
&
dwRevision
);
GetSecurityDescriptorControl
(
buf
,
&
ctrl
,
&
dwRevision
);
expect_eq
(
ctrl
,
0x8004
,
int
,
"%x"
);
expect_eq
(
ctrl
&
(
~
SE_DACL_PROTECTED
)
,
0x8004
,
int
,
"%x"
);
ok
(
GetPrivateObjectSecurity
(
sec
,
sec_info
,
buf
,
dwDescSize
,
&
retSize
),
ok
(
GetPrivateObjectSecurity
(
sec
,
sec_info
,
buf
,
dwDescSize
,
&
retSize
),
"GetPrivateObjectSecurity failed (err=%u)
\n
"
,
GetLastError
());
"GetPrivateObjectSecurity failed (err=%u)
\n
"
,
GetLastError
());
ok
(
retSize
==
dwDescSize
,
"Buffer too small (%d vs %d)
\n
"
,
retSize
,
dwDescSize
);
ok
(
retSize
==
dwDescSize
,
"Buffer too small (%d vs %d)
\n
"
,
retSize
,
dwDescSize
);
ok
(
pConvertSecurityDescriptorToStringSecurityDescriptorA
(
buf
,
SDDL_REVISION_1
,
sec_info
,
&
string
,
&
len
),
"Conversion failed
\n
"
);
ok
(
pConvertSecurityDescriptorToStringSecurityDescriptorA
(
buf
,
SDDL_REVISION_1
,
sec_info
,
&
string
,
&
len
),
"Conversion failed
\n
"
);
CHECK_
RESULT
_AND_FREE
(
"O:SY"
CHECK_
ONE_OF
_AND_FREE
(
"O:SY"
"G:S-1-5-21-93476-23408-4576"
"G:S-1-5-21-93476-23408-4576"
"D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"
"D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"
"S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)"
);
"S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)"
,
"O:SY"
"G:S-1-5-21-93476-23408-4576"
"D:P(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"
"S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)"
);
/* Win7 */
GetSecurityDescriptorControl
(
buf
,
&
ctrl
,
&
dwRevision
);
GetSecurityDescriptorControl
(
buf
,
&
ctrl
,
&
dwRevision
);
expect_eq
(
ctrl
,
0x8014
,
int
,
"%x"
);
expect_eq
(
ctrl
&
(
~
SE_DACL_PROTECTED
)
,
0x8014
,
int
,
"%x"
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ok
(
GetPrivateObjectSecurity
(
sec
,
sec_info
,
buf
,
5
,
&
retSize
)
==
FALSE
,
"GetPrivateObjectSecurity should have failed
\n
"
);
ok
(
GetPrivateObjectSecurity
(
sec
,
sec_info
,
buf
,
5
,
&
retSize
)
==
FALSE
,
"GetPrivateObjectSecurity should have failed
\n
"
);
...
...
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