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
ee49a5a2
Commit
ee49a5a2
authored
Feb 05, 2014
by
Erich E. Hoover
Committed by
Alexandre Julliard
Feb 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add support for security access parameters for named pipes.
parent
83c45eaa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
security.c
dlls/advapi32/tests/security.c
+29
-0
sync.c
dlls/kernel32/sync.c
+3
-0
No files found.
dlls/advapi32/tests/security.c
View file @
ee49a5a2
...
...
@@ -4713,6 +4713,35 @@ static void test_named_pipe_security(HANDLE token)
{
1
,
GENERIC_EXECUTE
,
FILE_GENERIC_EXECUTE
},
{
1
,
GENERIC_ALL
,
STANDARD_RIGHTS_ALL
|
FILE_ALL_ACCESS
}
};
static
const
struct
{
DWORD
open_mode
;
DWORD
access
;
}
creation_access
[]
=
{
{
PIPE_ACCESS_INBOUND
,
FILE_GENERIC_READ
},
{
PIPE_ACCESS_OUTBOUND
,
FILE_GENERIC_WRITE
},
{
PIPE_ACCESS_DUPLEX
,
FILE_GENERIC_READ
|
FILE_GENERIC_WRITE
},
{
PIPE_ACCESS_INBOUND
|
WRITE_DAC
,
FILE_GENERIC_READ
|
WRITE_DAC
},
{
PIPE_ACCESS_INBOUND
|
WRITE_OWNER
,
FILE_GENERIC_READ
|
WRITE_OWNER
}
/* ACCESS_SYSTEM_SECURITY is also valid, but will fail with ERROR_PRIVILEGE_NOT_HELD */
};
/* Test the different security access options for pipes */
for
(
i
=
0
;
i
<
sizeof
(
creation_access
)
/
sizeof
(
creation_access
[
0
]);
i
++
)
{
SetLastError
(
0xdeadbeef
);
pipe
=
CreateNamedPipeA
(
WINE_TEST_PIPE
,
creation_access
[
i
].
open_mode
,
PIPE_TYPE_BYTE
|
PIPE_NOWAIT
,
PIPE_UNLIMITED_INSTANCES
,
0
,
0
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
);
ok
(
pipe
!=
INVALID_HANDLE_VALUE
,
"CreateNamedPipe(0x%x) error %d
\n
"
,
creation_access
[
i
].
open_mode
,
GetLastError
());
access
=
get_obj_access
(
pipe
);
ok
(
access
==
creation_access
[
i
].
access
,
"CreateNamedPipeA(0x%x) pipe expected access 0x%x (got 0x%x)
\n
"
,
creation_access
[
i
].
open_mode
,
creation_access
[
i
].
access
,
access
);
CloseHandle
(
pipe
);
}
SetLastError
(
0xdeadbeef
);
pipe
=
CreateNamedPipeA
(
WINE_TEST_PIPE
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_FIRST_PIPE_INSTANCE
,
...
...
dlls/kernel32/sync.c
View file @
ee49a5a2
...
...
@@ -1395,6 +1395,9 @@ HANDLE WINAPI CreateNamedPipeW( LPCWSTR name, DWORD dwOpenMode,
}
access
|=
SYNCHRONIZE
;
options
=
0
;
if
(
dwOpenMode
&
WRITE_DAC
)
access
|=
WRITE_DAC
;
if
(
dwOpenMode
&
WRITE_OWNER
)
access
|=
WRITE_OWNER
;
if
(
dwOpenMode
&
ACCESS_SYSTEM_SECURITY
)
access
|=
ACCESS_SYSTEM_SECURITY
;
if
(
dwOpenMode
&
FILE_FLAG_WRITE_THROUGH
)
options
|=
FILE_WRITE_THROUGH
;
if
(
!
(
dwOpenMode
&
FILE_FLAG_OVERLAPPED
))
options
|=
FILE_SYNCHRONOUS_IO_NONALERT
;
pipe_type
=
(
dwPipeMode
&
PIPE_TYPE_MESSAGE
)
!=
0
;
...
...
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