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
f93a5d25
Commit
f93a5d25
authored
Jan 20, 2009
by
Wolfgang Walter
Committed by
Alexandre Julliard
Aug 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Call tcdrain for serial handles from NtFlushBuffersFile.
parent
d35c67be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
18 deletions
+32
-18
file.c
dlls/ntdll/file.c
+31
-8
serial.c
server/serial.c
+1
-10
No files found.
dlls/ntdll/file.c
View file @
f93a5d25
...
...
@@ -66,6 +66,9 @@
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#ifdef HAVE_VALGRIND_MEMCHECK_H
# include <valgrind/memcheck.h>
#endif
...
...
@@ -2749,19 +2752,39 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock
{
NTSTATUS
ret
;
HANDLE
hEvent
=
NULL
;
enum
server_fd_type
type
;
int
fd
,
needs_close
;
SERVER_START_REQ
(
flush_file
)
ret
=
server_get_unix_fd
(
hFile
,
FILE_WRITE_DATA
,
&
fd
,
&
needs_close
,
&
type
,
NULL
);
if
(
!
ret
&&
type
==
FD_TYPE_SERIAL
)
{
req
->
handle
=
wine_server_obj_handle
(
hFile
);
ret
=
wine_server_call
(
req
);
hEvent
=
wine_server_ptr_handle
(
reply
->
event
);
while
(
tcdrain
(
fd
)
==
-
1
)
{
if
(
errno
!=
EINTR
)
{
ret
=
FILE_GetNtStatus
();
break
;
}
}
}
SERVER_END_REQ
;
if
(
!
ret
&&
hEvent
)
else
{
ret
=
NtWaitForSingleObject
(
hEvent
,
FALSE
,
NULL
);
NtClose
(
hEvent
);
SERVER_START_REQ
(
flush_file
)
{
req
->
handle
=
wine_server_obj_handle
(
hFile
);
ret
=
wine_server_call
(
req
);
hEvent
=
wine_server_ptr_handle
(
reply
->
event
);
}
SERVER_END_REQ
;
if
(
!
ret
&&
hEvent
)
{
ret
=
NtWaitForSingleObject
(
hEvent
,
FALSE
,
NULL
);
NtClose
(
hEvent
);
}
}
if
(
needs_close
)
close
(
fd
);
return
ret
;
}
...
...
server/serial.c
View file @
f93a5d25
...
...
@@ -61,7 +61,6 @@ static struct fd *serial_get_fd( struct object *obj );
static
void
serial_destroy
(
struct
object
*
obj
);
static
enum
server_fd_type
serial_get_fd_type
(
struct
fd
*
fd
);
static
void
serial_flush
(
struct
fd
*
fd
,
struct
event
**
event
);
static
void
serial_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
);
struct
serial
...
...
@@ -107,7 +106,7 @@ static const struct fd_ops serial_fd_ops =
{
default_fd_get_poll_events
,
/* get_poll_events */
default_poll_event
,
/* poll_event */
serial_flush
,
/* flush */
no_flush
,
/* flush */
serial_get_fd_type
,
/* get_fd_type */
default_fd_ioctl
,
/* ioctl */
serial_queue_async
,
/* queue_async */
...
...
@@ -196,14 +195,6 @@ static void serial_queue_async( struct fd *fd, const async_data_t *data, int typ
}
}
static
void
serial_flush
(
struct
fd
*
fd
,
struct
event
**
event
)
{
/* MSDN says: If hFile is a handle to a communications device,
* the function only flushes the transmit buffer.
*/
if
(
tcflush
(
get_unix_fd
(
fd
),
TCOFLUSH
)
==
-
1
)
file_set_error
();
}
DECL_HANDLER
(
get_serial_info
)
{
struct
serial
*
serial
;
...
...
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