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
a7b8e845
Commit
a7b8e845
authored
Apr 24, 2019
by
Vijay Kiran Kamuju
Committed by
Alexandre Julliard
Apr 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add additional tests for NtAccessCheck.
Signed-off-by:
Vijay Kiran Kamuju
<
infyquest@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
92ee3543
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
1 deletion
+64
-1
security.c
dlls/advapi32/tests/security.c
+64
-1
No files found.
dlls/advapi32/tests/security.c
View file @
a7b8e845
...
...
@@ -1343,11 +1343,13 @@ static void test_AccessCheck(void)
if
(
pNtAccessCheck
)
{
DWORD
ntPrivSetLen
=
sizeof
(
PRIVILEGE_SET
);
/* Generic access mask - no privilegeset buffer */
SetLastError
(
0xdeadbeef
);
Access
=
ntAccessStatus
=
0x1abe11ed
;
ntret
=
pNtAccessCheck
(
SecurityDescriptor
,
Token
,
GENERIC_READ
,
&
Mapping
,
NULL
,
&
PrivSetLen
,
&
Access
,
&
ntAccessStatus
);
NULL
,
&
nt
PrivSetLen
,
&
Access
,
&
ntAccessStatus
);
err
=
GetLastError
();
ok
(
ntret
==
STATUS_ACCESS_VIOLATION
,
"NtAccessCheck should have failed with STATUS_ACCESS_VIOLATION, got %x
\n
"
,
ntret
);
...
...
@@ -1355,6 +1357,7 @@ static void test_AccessCheck(void)
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
/* Generic access mask - no returnlength */
SetLastError
(
0xdeadbeef
);
...
...
@@ -1381,6 +1384,66 @@ static void test_AccessCheck(void)
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
/* Generic access mask - zero returnlength */
SetLastError
(
0xdeadbeef
);
Access
=
ntAccessStatus
=
0x1abe11ed
;
ntPrivSetLen
=
0
;
ntret
=
pNtAccessCheck
(
SecurityDescriptor
,
Token
,
GENERIC_READ
,
&
Mapping
,
PrivSet
,
&
ntPrivSetLen
,
&
Access
,
&
ntAccessStatus
);
err
=
GetLastError
();
ok
(
ntret
==
STATUS_GENERIC_NOT_MAPPED
,
"NtAccessCheck should have failed with STATUS_GENERIC_NOT_MAPPED, got %x
\n
"
,
ntret
);
ok
(
err
==
0xdeadbeef
,
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
todo_wine
ok
(
ntPrivSetLen
==
0
,
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
/* Generic access mask - insufficient returnlength */
SetLastError
(
0xdeadbeef
);
Access
=
ntAccessStatus
=
0x1abe11ed
;
ntPrivSetLen
=
sizeof
(
PRIVILEGE_SET
)
-
1
;
ntret
=
pNtAccessCheck
(
SecurityDescriptor
,
Token
,
GENERIC_READ
,
&
Mapping
,
PrivSet
,
&
ntPrivSetLen
,
&
Access
,
&
ntAccessStatus
);
err
=
GetLastError
();
ok
(
ntret
==
STATUS_GENERIC_NOT_MAPPED
,
"NtAccessCheck should have failed with STATUS_GENERIC_NOT_MAPPED, got %x
\n
"
,
ntret
);
ok
(
err
==
0xdeadbeef
,
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
todo_wine
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
)
-
1
,
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
/* Key access mask - zero returnlength */
SetLastError
(
0xdeadbeef
);
Access
=
ntAccessStatus
=
0x1abe11ed
;
ntPrivSetLen
=
0
;
ntret
=
pNtAccessCheck
(
SecurityDescriptor
,
Token
,
KEY_READ
,
&
Mapping
,
PrivSet
,
&
ntPrivSetLen
,
&
Access
,
&
ntAccessStatus
);
err
=
GetLastError
();
todo_wine
ok
(
ntret
==
STATUS_BUFFER_TOO_SMALL
,
"NtAccessCheck should have failed with STATUS_BUFFER_TOO_SMALL, got %x
\n
"
,
ntret
);
ok
(
err
==
0xdeadbeef
,
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
todo_wine
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
/* Key access mask - insufficient returnlength */
SetLastError
(
0xdeadbeef
);
Access
=
ntAccessStatus
=
0x1abe11ed
;
ntPrivSetLen
=
sizeof
(
PRIVILEGE_SET
)
-
1
;
ntret
=
pNtAccessCheck
(
SecurityDescriptor
,
Token
,
KEY_READ
,
&
Mapping
,
PrivSet
,
&
ntPrivSetLen
,
&
Access
,
&
ntAccessStatus
);
err
=
GetLastError
();
todo_wine
ok
(
ntret
==
STATUS_BUFFER_TOO_SMALL
,
"NtAccessCheck should have failed with STATUS_BUFFER_TOO_SMALL, got %x
\n
"
,
ntret
);
ok
(
err
==
0xdeadbeef
,
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
todo_wine
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
}
else
win_skip
(
"NtAccessCheck unavailable. Skipping.
\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