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
683a1dc9
Commit
683a1dc9
authored
Dec 26, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Test generic access mapping for a pipe.
parent
8b91e6e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
+53
-2
security.c
dlls/advapi32/tests/security.c
+53
-2
No files found.
dlls/advapi32/tests/security.c
View file @
683a1dc9
...
...
@@ -4678,11 +4678,22 @@ todo_wine
#define WINE_TEST_PIPE "\\\\.\\pipe\\WineTestPipe"
static
void
test_named_pipe_security
(
HANDLE
token
)
{
HANDLE
pipe
,
file
;
DWORD
ret
,
i
,
access
;
HANDLE
pipe
,
file
,
dup
;
GENERIC_MAPPING
mapping
=
{
FILE_GENERIC_READ
,
FILE_GENERIC_WRITE
,
FILE_GENERIC_EXECUTE
,
STANDARD_RIGHTS_ALL
|
FILE_ALL_ACCESS
};
static
const
struct
{
int
todo
,
generic
,
mapped
;
}
map
[]
=
{
{
1
,
GENERIC_READ
,
FILE_GENERIC_READ
},
{
1
,
GENERIC_WRITE
,
FILE_GENERIC_WRITE
},
{
1
,
GENERIC_EXECUTE
,
FILE_GENERIC_EXECUTE
},
{
1
,
GENERIC_ALL
,
STANDARD_RIGHTS_ALL
|
FILE_ALL_ACCESS
}
};
SetLastError
(
0xdeadbeef
);
pipe
=
CreateNamedPipeA
(
WINE_TEST_PIPE
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_FIRST_PIPE_INSTANCE
,
...
...
@@ -4695,13 +4706,53 @@ static void test_named_pipe_security(HANDLE token)
SetLastError
(
0xdeadbeef
);
file
=
CreateFileA
(
WINE_TEST_PIPE
,
FILE_ALL_ACCESS
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"CreateFile error %d
\n
"
,
GetLastError
());
CloseHandle
(
file
);
access
=
get_obj_access
(
file
);
ok
(
access
==
FILE_ALL_ACCESS
,
"expected FILE_ALL_ACCESS, got %#x
\n
"
,
access
);
for
(
i
=
0
;
i
<
sizeof
(
map
)
/
sizeof
(
map
[
0
]);
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
file
,
GetCurrentProcess
(),
&
dup
,
map
[
i
].
generic
,
FALSE
,
0
);
ok
(
ret
,
"DuplicateHandle error %d
\n
"
,
GetLastError
());
access
=
get_obj_access
(
dup
);
ok
(
access
==
map
[
i
].
mapped
,
"%d: expected %#x, got %#x
\n
"
,
i
,
map
[
i
].
mapped
,
access
);
CloseHandle
(
dup
);
}
CloseHandle
(
file
);
CloseHandle
(
pipe
);
SetLastError
(
0xdeadbeef
);
file
=
CreateFileA
(
"
\\\\
.
\\
pipe
\\
"
,
FILE_ALL_ACCESS
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
||
broken
(
file
==
INVALID_HANDLE_VALUE
)
/* before Vista */
,
"CreateFile error %d
\n
"
,
GetLastError
());
if
(
file
!=
INVALID_HANDLE_VALUE
)
{
access
=
get_obj_access
(
file
);
ok
(
access
==
FILE_ALL_ACCESS
,
"expected FILE_ALL_ACCESS, got %#x
\n
"
,
access
);
for
(
i
=
0
;
i
<
sizeof
(
map
)
/
sizeof
(
map
[
0
]);
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
file
,
GetCurrentProcess
(),
&
dup
,
map
[
i
].
generic
,
FALSE
,
0
);
ok
(
ret
,
"DuplicateHandle error %d
\n
"
,
GetLastError
());
access
=
get_obj_access
(
dup
);
if
(
map
[
i
].
todo
)
todo_wine
ok
(
access
==
map
[
i
].
mapped
,
"%d: expected %#x, got %#x
\n
"
,
i
,
map
[
i
].
mapped
,
access
);
else
ok
(
access
==
map
[
i
].
mapped
,
"%d: expected %#x, got %#x
\n
"
,
i
,
map
[
i
].
mapped
,
access
);
CloseHandle
(
dup
);
}
}
CloseHandle
(
file
);
}
...
...
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