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
e44c0f71
Commit
e44c0f71
authored
Mar 30, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Use default buffer size in CreatePipe if 0 was passed.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3d7fabf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
14 deletions
+25
-14
sync.c
dlls/kernel32/sync.c
+2
-0
pipe.c
dlls/kernel32/tests/pipe.c
+23
-14
No files found.
dlls/kernel32/sync.c
View file @
e44c0f71
...
...
@@ -1932,6 +1932,8 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
!
size
)
size
=
4096
;
timeout
.
QuadPart
=
(
ULONGLONG
)
NMPWAIT_USE_DEFAULT_WAIT
*
-
10000
;
/* generate a unique pipe name (system wide) */
do
...
...
dlls/kernel32/tests/pipe.c
View file @
e44c0f71
...
...
@@ -125,6 +125,20 @@ static void _test_signaled(unsigned line, HANDLE handle)
ok_
(
__FILE__
,
line
)(
res
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
res
);
}
#define test_pipe_info(a,b,c,d,e) _test_pipe_info(__LINE__,a,b,c,d,e)
static
void
_test_pipe_info
(
unsigned
line
,
HANDLE
pipe
,
DWORD
ex_flags
,
DWORD
ex_out_buf_size
,
DWORD
ex_in_buf_size
,
DWORD
ex_max_instances
)
{
DWORD
flags
=
0xdeadbeef
,
out_buf_size
=
0xdeadbeef
,
in_buf_size
=
0xdeadbeef
,
max_instances
=
0xdeadbeef
;
BOOL
res
;
res
=
GetNamedPipeInfo
(
pipe
,
&
flags
,
&
out_buf_size
,
&
in_buf_size
,
&
max_instances
);
ok_
(
__FILE__
,
line
)(
res
,
"GetNamedPipeInfo failed: %x
\n
"
,
res
);
ok_
(
__FILE__
,
line
)(
flags
==
ex_flags
,
"flags = %x, expected %x
\n
"
,
flags
,
ex_flags
);
ok_
(
__FILE__
,
line
)(
out_buf_size
==
ex_out_buf_size
,
"out_buf_size = %x, expected %u
\n
"
,
out_buf_size
,
ex_out_buf_size
);
ok_
(
__FILE__
,
line
)(
in_buf_size
==
ex_in_buf_size
,
"in_buf_size = %x, expected %u
\n
"
,
in_buf_size
,
ex_in_buf_size
);
ok_
(
__FILE__
,
line
)(
max_instances
==
ex_max_instances
,
"max_instances = %x, expected %u
\n
"
,
max_instances
,
ex_max_instances
);
}
static
void
test_CreateNamedPipe
(
int
pipemode
)
{
HANDLE
hnp
;
...
...
@@ -1319,6 +1333,9 @@ static void test_CreatePipe(void)
pipe_attr
.
bInheritHandle
=
TRUE
;
pipe_attr
.
lpSecurityDescriptor
=
NULL
;
ok
(
CreatePipe
(
&
piperead
,
&
pipewrite
,
&
pipe_attr
,
0
)
!=
0
,
"CreatePipe failed
\n
"
);
test_pipe_info
(
piperead
,
FILE_PIPE_SERVER_END
,
4096
,
4096
,
1
);
test_pipe_info
(
pipewrite
,
0
,
4096
,
4096
,
1
);
ok
(
WriteFile
(
pipewrite
,
PIPENAME
,
sizeof
(
PIPENAME
),
&
written
,
NULL
),
"Write to anonymous pipe failed
\n
"
);
ok
(
written
==
sizeof
(
PIPENAME
),
"Write to anonymous pipe wrote %d bytes
\n
"
,
written
);
ok
(
ReadFile
(
piperead
,
readbuf
,
sizeof
(
readbuf
),
&
read
,
NULL
),
"Read from non empty pipe failed
\n
"
);
...
...
@@ -1358,6 +1375,12 @@ static void test_CreatePipe(void)
ok
(
user_apc_ran
==
FALSE
,
"user apc ran, pipe using alertable io mode
\n
"
);
SleepEx
(
0
,
TRUE
);
/* get rid of apc */
ok
(
CreatePipe
(
&
piperead
,
&
pipewrite
,
&
pipe_attr
,
1
)
!=
0
,
"CreatePipe failed
\n
"
);
test_pipe_info
(
piperead
,
FILE_PIPE_SERVER_END
,
1
,
1
,
1
);
test_pipe_info
(
pipewrite
,
0
,
1
,
1
,
1
);
ok
(
CloseHandle
(
pipewrite
),
"CloseHandle for the Write Pipe failed
\n
"
);
ok
(
CloseHandle
(
piperead
),
"CloseHandle for the read pipe failed
\n
"
);
}
static
void
test_CloseHandle
(
void
)
...
...
@@ -2250,20 +2273,6 @@ static void test_NamedPipeHandleState(void)
CloseHandle
(
server
);
}
#define test_pipe_info(a,b,c,d,e) _test_pipe_info(__LINE__,a,b,c,d,e)
static
void
_test_pipe_info
(
unsigned
line
,
HANDLE
pipe
,
DWORD
ex_flags
,
DWORD
ex_out_buf_size
,
DWORD
ex_in_buf_size
,
DWORD
ex_max_instances
)
{
DWORD
flags
=
0xdeadbeef
,
out_buf_size
=
0xdeadbeef
,
in_buf_size
=
0xdeadbeef
,
max_instances
=
0xdeadbeef
;
BOOL
res
;
res
=
GetNamedPipeInfo
(
pipe
,
&
flags
,
&
out_buf_size
,
&
in_buf_size
,
&
max_instances
);
ok_
(
__FILE__
,
line
)(
res
,
"GetNamedPipeInfo failed: %x
\n
"
,
res
);
ok_
(
__FILE__
,
line
)(
flags
==
ex_flags
,
"flags = %x, expected %x
\n
"
,
flags
,
ex_flags
);
ok_
(
__FILE__
,
line
)(
out_buf_size
==
ex_out_buf_size
,
"out_buf_size = %x, expected %u
\n
"
,
out_buf_size
,
ex_out_buf_size
);
ok_
(
__FILE__
,
line
)(
in_buf_size
==
ex_in_buf_size
,
"in_buf_size = %x, expected %u
\n
"
,
in_buf_size
,
ex_in_buf_size
);
ok_
(
__FILE__
,
line
)(
max_instances
==
ex_max_instances
,
"max_instances = %x, expected %u
\n
"
,
max_instances
,
ex_max_instances
);
}
static
void
test_GetNamedPipeInfo
(
void
)
{
HANDLE
server
;
...
...
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