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
86c47907
Commit
86c47907
authored
Feb 16, 2016
by
Qian Hong
Committed by
Alexandre Julliard
Feb 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add invalid parameter tests for AccessCheck.
Signed-off-by:
Qian Hong
<
qhong@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
546f84d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
security.c
dlls/advapi32/tests/security.c
+53
-0
No files found.
dlls/advapi32/tests/security.c
View file @
86c47907
...
@@ -1411,6 +1411,59 @@ static void test_AccessCheck(void)
...
@@ -1411,6 +1411,59 @@ static void test_AccessCheck(void)
GetLastError
());
GetLastError
());
trace
(
"AccessCheck with MAXIMUM_ALLOWED got Access 0x%08x
\n
"
,
Access
);
trace
(
"AccessCheck with MAXIMUM_ALLOWED got Access 0x%08x
\n
"
,
Access
);
/* Null PrivSet with null PrivSetLen pointer */
SetLastError
(
0xdeadbeef
);
Access
=
AccessStatus
=
0x1abe11ed
;
ret
=
AccessCheck
(
SecurityDescriptor
,
Token
,
KEY_READ
,
&
Mapping
,
NULL
,
NULL
,
&
Access
,
&
AccessStatus
);
err
=
GetLastError
();
ok
(
!
ret
&&
err
==
ERROR_NOACCESS
,
"AccessCheck should have "
"failed with ERROR_NOACCESS, instead of %d
\n
"
,
err
);
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
/* Null PrivSet with zero PrivSetLen */
SetLastError
(
0xdeadbeef
);
Access
=
AccessStatus
=
0x1abe11ed
;
PrivSetLen
=
0
;
ret
=
AccessCheck
(
SecurityDescriptor
,
Token
,
KEY_READ
,
&
Mapping
,
0
,
&
PrivSetLen
,
&
Access
,
&
AccessStatus
);
err
=
GetLastError
();
todo_wine
ok
(
!
ret
&&
err
==
ERROR_INSUFFICIENT_BUFFER
,
"AccessCheck should have "
"failed with ERROR_INSUFFICIENT_BUFFER, instead of %d
\n
"
,
err
);
todo_wine
ok
(
PrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
PrivSetLen
);
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
/* Valid PrivSet with zero PrivSetLen */
SetLastError
(
0xdeadbeef
);
Access
=
AccessStatus
=
0x1abe11ed
;
PrivSetLen
=
0
;
ret
=
AccessCheck
(
SecurityDescriptor
,
Token
,
KEY_READ
,
&
Mapping
,
PrivSet
,
&
PrivSetLen
,
&
Access
,
&
AccessStatus
);
err
=
GetLastError
();
todo_wine
ok
(
!
ret
&&
err
==
ERROR_INSUFFICIENT_BUFFER
,
"AccessCheck should have "
"failed with ERROR_INSUFFICIENT_BUFFER, instead of %d
\n
"
,
err
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
PrivSetLen
=
FIELD_OFFSET
(
PRIVILEGE_SET
,
Privilege
[
16
]);
/* Null PrivSet with valid PrivSetLen */
SetLastError
(
0xdeadbeef
);
Access
=
AccessStatus
=
0x1abe11ed
;
ret
=
AccessCheck
(
SecurityDescriptor
,
Token
,
KEY_READ
,
&
Mapping
,
0
,
&
PrivSetLen
,
&
Access
,
&
AccessStatus
);
err
=
GetLastError
();
ok
(
!
ret
&&
err
==
ERROR_NOACCESS
,
"AccessCheck should have "
"failed with ERROR_NOACCESS, instead of %d
\n
"
,
err
);
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
/* Access denied by SD */
/* Access denied by SD */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
Access
=
AccessStatus
=
0x1abe11ed
;
Access
=
AccessStatus
=
0x1abe11ed
;
...
...
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