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
9eaaadbb
Commit
9eaaadbb
authored
Apr 16, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Use the correct access rights when opening named pipes.
parent
58c7c514
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
sync.c
dlls/kernel32/sync.c
+22
-8
No files found.
dlls/kernel32/sync.c
View file @
9eaaadbb
...
...
@@ -1114,7 +1114,7 @@ HANDLE WINAPI CreateNamedPipeW( LPCWSTR name, DWORD dwOpenMode,
HANDLE
handle
;
UNICODE_STRING
nt_name
;
OBJECT_ATTRIBUTES
attr
;
DWORD
options
;
DWORD
access
,
options
;
BOOLEAN
pipe_type
,
read_mode
,
non_block
;
NTSTATUS
status
;
IO_STATUS_BLOCK
iosb
;
...
...
@@ -1144,13 +1144,27 @@ HANDLE WINAPI CreateNamedPipeW( LPCWSTR name, DWORD dwOpenMode,
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
options
=
0
;
switch
(
dwOpenMode
&
3
)
{
case
PIPE_ACCESS_INBOUND
:
options
=
FILE_PIPE_INBOUND
;
access
=
GENERIC_READ
;
break
;
case
PIPE_ACCESS_OUTBOUND
:
options
=
FILE_PIPE_OUTBOUND
;
access
=
GENERIC_WRITE
;
break
;
case
PIPE_ACCESS_DUPLEX
:
options
=
FILE_PIPE_FULL_DUPLEX
;
access
=
GENERIC_READ
|
GENERIC_WRITE
;
break
;
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
INVALID_HANDLE_VALUE
;
}
access
|=
SYNCHRONIZE
;
if
(
dwOpenMode
&
FILE_FLAG_WRITE_THROUGH
)
options
|=
FILE_WRITE_THROUGH
;
if
(
!
(
dwOpenMode
&
FILE_FLAG_OVERLAPPED
))
options
|=
FILE_SYNCHRONOUS_IO_ALERT
;
if
((
dwOpenMode
&
PIPE_ACCESS_DUPLEX
)
==
PIPE_ACCESS_DUPLEX
)
options
|=
FILE_PIPE_FULL_DUPLEX
;
else
if
(
dwOpenMode
&
PIPE_ACCESS_INBOUND
)
options
|=
FILE_PIPE_INBOUND
;
else
if
(
dwOpenMode
&
PIPE_ACCESS_OUTBOUND
)
options
|=
FILE_PIPE_OUTBOUND
;
pipe_type
=
(
dwPipeMode
&
PIPE_TYPE_MESSAGE
)
?
TRUE
:
FALSE
;
read_mode
=
(
dwPipeMode
&
PIPE_READMODE_MESSAGE
)
?
TRUE
:
FALSE
;
non_block
=
(
dwPipeMode
&
PIPE_NOWAIT
)
?
TRUE
:
FALSE
;
...
...
@@ -1160,8 +1174,8 @@ HANDLE WINAPI CreateNamedPipeW( LPCWSTR name, DWORD dwOpenMode,
SetLastError
(
0
);
status
=
NtCreateNamedPipeFile
(
&
handle
,
GENERIC_READ
|
GENERIC_WRITE
,
&
attr
,
&
iosb
,
0
,
FILE_OVERWRITE_IF
,
options
,
pipe_type
,
status
=
NtCreateNamedPipeFile
(
&
handle
,
access
,
&
attr
,
&
iosb
,
0
,
FILE_OVERWRITE_IF
,
options
,
pipe_type
,
read_mode
,
non_block
,
nMaxInstances
,
nInBufferSize
,
nOutBufferSize
,
&
timeout
);
...
...
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