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
e6f45145
Commit
e6f45145
authored
Jan 22, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Jan 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Try to avoid partial named pipe read/writes by looping.
parent
9fb15b41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
rpc_transport.c
dlls/rpcrt4/rpc_transport.c
+28
-9
No files found.
dlls/rpcrt4/rpc_transport.c
View file @
e6f45145
...
...
@@ -354,21 +354,40 @@ static int rpcrt4_conn_np_read(RpcConnection *Connection,
void
*
buffer
,
unsigned
int
count
)
{
RpcConnection_np
*
npc
=
(
RpcConnection_np
*
)
Connection
;
DWORD
dwRead
=
0
;
if
(
!
ReadFile
(
npc
->
pipe
,
buffer
,
count
,
&
dwRead
,
NULL
)
&&
(
GetLastError
()
!=
ERROR_MORE_DATA
))
return
-
1
;
return
dwRead
;
char
*
buf
=
buffer
;
BOOL
ret
=
TRUE
;
unsigned
int
bytes_left
=
count
;
while
(
bytes_left
)
{
DWORD
bytes_read
;
ret
=
ReadFile
(
npc
->
pipe
,
buf
,
bytes_left
,
&
bytes_read
,
NULL
);
if
(
!
ret
||
!
bytes_read
)
break
;
bytes_left
-=
bytes_read
;
buf
+=
bytes_read
;
}
return
ret
?
count
:
-
1
;
}
static
int
rpcrt4_conn_np_write
(
RpcConnection
*
Connection
,
const
void
*
buffer
,
unsigned
int
count
)
{
RpcConnection_np
*
npc
=
(
RpcConnection_np
*
)
Connection
;
DWORD
dwWritten
=
0
;
if
(
!
WriteFile
(
npc
->
pipe
,
buffer
,
count
,
&
dwWritten
,
NULL
))
return
-
1
;
return
dwWritten
;
const
char
*
buf
=
buffer
;
BOOL
ret
=
TRUE
;
unsigned
int
bytes_left
=
count
;
while
(
bytes_left
)
{
DWORD
bytes_written
;
ret
=
WriteFile
(
npc
->
pipe
,
buf
,
count
,
&
bytes_written
,
NULL
);
if
(
!
ret
||
!
bytes_written
)
break
;
bytes_left
-=
bytes_written
;
buf
+=
bytes_written
;
}
return
ret
?
count
:
-
1
;
}
static
int
rpcrt4_conn_np_close
(
RpcConnection
*
Connection
)
...
...
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