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
4f4ac8c4
Commit
4f4ac8c4
authored
May 22, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
May 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Use named pipe in overlapped mode.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd6f8071
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
4 deletions
+36
-4
rpc_transport.c
dlls/rpcrt4/rpc_transport.c
+36
-4
No files found.
dlls/rpcrt4/rpc_transport.c
View file @
4f4ac8c4
...
...
@@ -75,6 +75,16 @@ static RpcConnection *rpcrt4_conn_np_alloc(void)
return
&
npc
->
common
;
}
static
HANDLE
get_np_event
(
void
)
{
return
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
}
static
void
release_np_event
(
HANDLE
event
)
{
CloseHandle
(
event
);
}
static
DWORD
CALLBACK
listen_thread
(
void
*
arg
)
{
RpcConnection_np
*
npc
=
arg
;
...
...
@@ -123,7 +133,7 @@ static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *Connection, LPCSTR pnam
RpcConnection_np
*
npc
=
(
RpcConnection_np
*
)
Connection
;
TRACE
(
"listening on %s
\n
"
,
pname
);
npc
->
pipe
=
CreateNamedPipeA
(
pname
,
PIPE_ACCESS_DUPLEX
,
npc
->
pipe
=
CreateNamedPipeA
(
pname
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
PIPE_TYPE_MESSAGE
|
PIPE_READMODE_MESSAGE
,
PIPE_UNLIMITED_INSTANCES
,
RPC_MAX_PACKET_SIZE
,
RPC_MAX_PACKET_SIZE
,
5000
,
NULL
);
...
...
@@ -175,7 +185,7 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname,
dwFlags
|=
SECURITY_CONTEXT_TRACKING
;
}
pipe
=
CreateFileA
(
pname
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
dwFlags
,
0
);
OPEN_EXISTING
,
dwFlags
|
FILE_FLAG_OVERLAPPED
,
0
);
if
(
pipe
!=
INVALID_HANDLE_VALUE
)
break
;
err
=
GetLastError
();
if
(
err
==
ERROR_PIPE_BUSY
)
{
...
...
@@ -413,9 +423,20 @@ static int rpcrt4_conn_np_read(RpcConnection *conn, void *buffer, unsigned int c
{
RpcConnection_np
*
connection
=
(
RpcConnection_np
*
)
conn
;
IO_STATUS_BLOCK
io_status
;
HANDLE
event
;
NTSTATUS
status
;
status
=
NtReadFile
(
connection
->
pipe
,
NULL
,
NULL
,
NULL
,
&
io_status
,
buffer
,
count
,
NULL
,
NULL
);
event
=
get_np_event
();
if
(
!
event
)
return
-
1
;
status
=
NtReadFile
(
connection
->
pipe
,
event
,
NULL
,
NULL
,
&
io_status
,
buffer
,
count
,
NULL
,
NULL
);
if
(
status
==
STATUS_PENDING
)
{
WaitForSingleObject
(
event
,
INFINITE
);
status
=
io_status
.
Status
;
}
release_np_event
(
event
);
return
status
&&
status
!=
STATUS_BUFFER_OVERFLOW
?
-
1
:
io_status
.
Information
;
}
...
...
@@ -423,9 +444,20 @@ static int rpcrt4_conn_np_write(RpcConnection *conn, const void *buffer, unsigne
{
RpcConnection_np
*
connection
=
(
RpcConnection_np
*
)
conn
;
IO_STATUS_BLOCK
io_status
;
HANDLE
event
;
NTSTATUS
status
;
status
=
NtWriteFile
(
connection
->
pipe
,
NULL
,
NULL
,
NULL
,
&
io_status
,
buffer
,
count
,
NULL
,
NULL
);
event
=
get_np_event
();
if
(
!
event
)
return
-
1
;
status
=
NtWriteFile
(
connection
->
pipe
,
event
,
NULL
,
NULL
,
&
io_status
,
buffer
,
count
,
NULL
,
NULL
);
if
(
status
==
STATUS_PENDING
)
{
WaitForSingleObject
(
event
,
INFINITE
);
status
=
io_status
.
Status
;
}
release_np_event
(
event
);
if
(
status
)
return
-
1
;
...
...
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