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
55396b70
Commit
55396b70
authored
Aug 21, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Aug 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement SetNamedPipeHandleState.
Based on a patch by Adam Martinson.
parent
9e66e97d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
sync.c
dlls/kernel32/sync.c
+28
-7
pipe.c
dlls/kernel32/tests/pipe.c
+1
-9
No files found.
dlls/kernel32/sync.c
View file @
55396b70
...
...
@@ -1790,9 +1790,34 @@ BOOL WINAPI SetNamedPipeHandleState(
{
/* should be a fixme, but this function is called a lot by the RPC
* runtime, and it slows down InstallShield a fair bit. */
WARN
(
"stub: %p %p/%d %p %p
\n
"
,
WARN
(
"s
emi-s
tub: %p %p/%d %p %p
\n
"
,
hNamedPipe
,
lpMode
,
lpMode
?
*
lpMode
:
0
,
lpMaxCollectionCount
,
lpCollectDataTimeout
);
return
FALSE
;
if
(
lpMode
)
{
FILE_PIPE_INFORMATION
fpi
;
IO_STATUS_BLOCK
iosb
;
NTSTATUS
status
;
if
(
*
lpMode
&
~
(
PIPE_READMODE_MESSAGE
|
PIPE_NOWAIT
))
status
=
STATUS_INVALID_PARAMETER
;
else
{
fpi
.
CompletionMode
=
(
*
lpMode
&
PIPE_NOWAIT
)
?
FILE_PIPE_COMPLETE_OPERATION
:
FILE_PIPE_QUEUE_OPERATION
;
fpi
.
ReadMode
=
(
*
lpMode
&
PIPE_READMODE_MESSAGE
)
?
FILE_PIPE_MESSAGE_MODE
:
FILE_PIPE_BYTE_STREAM_MODE
;
status
=
NtSetInformationFile
(
hNamedPipe
,
&
iosb
,
&
fpi
,
sizeof
(
fpi
),
FilePipeInformation
);
}
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
}
return
TRUE
;
}
/***********************************************************************
...
...
@@ -1854,15 +1879,11 @@ BOOL WINAPI CallNamedPipeW(
mode
=
PIPE_READMODE_MESSAGE
;
ret
=
SetNamedPipeHandleState
(
pipe
,
&
mode
,
NULL
,
NULL
);
/* Currently SetNamedPipeHandleState() is a stub returning FALSE */
if
(
ret
)
FIXME
(
"Now that SetNamedPipeHandleState() is more than a stub, please update CallNamedPipeW
\n
"
);
/*
if
(
!
ret
)
{
CloseHandle
(
pipe
);
return
FALSE
;
}
*/
}
ret
=
TransactNamedPipe
(
pipe
,
lpInput
,
lpInputSize
,
lpOutput
,
lpOutputSize
,
lpBytesRead
,
NULL
);
CloseHandle
(
pipe
);
...
...
dlls/kernel32/tests/pipe.c
View file @
55396b70
...
...
@@ -233,9 +233,7 @@ static void test_CreateNamedPipe(int pipemode)
ok
(
!
SetNamedPipeHandleState
(
hFile
,
&
lpmode
,
NULL
,
NULL
),
"Change mode
\n
"
);
}
else
{
todo_wine
{
ok
(
SetNamedPipeHandleState
(
hFile
,
&
lpmode
,
NULL
,
NULL
),
"Change mode
\n
"
);
}
ok
(
SetNamedPipeHandleState
(
hFile
,
&
lpmode
,
NULL
,
NULL
),
"Change mode
\n
"
);
memset
(
ibuf
,
0
,
sizeof
(
ibuf
));
ok
(
WriteFile
(
hnp
,
obuf
,
sizeof
(
obuf
),
&
written
,
NULL
),
"WriteFile5a
\n
"
);
...
...
@@ -1685,7 +1683,6 @@ static void test_NamedPipeHandleState(void)
state
=
PIPE_READMODE_MESSAGE
;
SetLastError
(
0xdeadbeef
);
ret
=
SetNamedPipeHandleState
(
server
,
&
state
,
NULL
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
...
...
@@ -1695,13 +1692,11 @@ static void test_NamedPipeHandleState(void)
state
=
PIPE_READMODE_BYTE
;
ret
=
SetNamedPipeHandleState
(
client
,
&
state
,
NULL
,
NULL
);
todo_wine
ok
(
ret
,
"SetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
/* A byte-mode pipe client can't be changed to message mode, either. */
state
=
PIPE_READMODE_MESSAGE
;
SetLastError
(
0xdeadbeef
);
ret
=
SetNamedPipeHandleState
(
server
,
&
state
,
NULL
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
...
...
@@ -1731,7 +1726,6 @@ static void test_NamedPipeHandleState(void)
*/
state
=
PIPE_READMODE_BYTE
;
ret
=
SetNamedPipeHandleState
(
server
,
&
state
,
NULL
,
NULL
);
todo_wine
ok
(
ret
,
"SetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
client
=
CreateFileA
(
PIPENAME
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
...
...
@@ -1740,13 +1734,11 @@ static void test_NamedPipeHandleState(void)
state
=
PIPE_READMODE_MESSAGE
;
ret
=
SetNamedPipeHandleState
(
client
,
&
state
,
NULL
,
NULL
);
todo_wine
ok
(
ret
,
"SetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
/* A message-mode pipe client can also be changed to byte mode.
*/
state
=
PIPE_READMODE_BYTE
;
ret
=
SetNamedPipeHandleState
(
client
,
&
state
,
NULL
,
NULL
);
todo_wine
ok
(
ret
,
"SetNamedPipeHandleState failed: %d
\n
"
,
GetLastError
());
CloseHandle
(
client
);
...
...
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