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
84e97cf6
Commit
84e97cf6
authored
May 05, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Implement IOCTL_SERIAL_SET_TIMEOUTS as an ioctl on the server side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a682420b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
74 deletions
+33
-74
serial.c
dlls/ntdll/serial.c
+15
-38
server_protocol.h
include/wine/server_protocol.h
+1
-8
protocol.def
server/protocol.def
+0
-6
request.h
server/request.h
+2
-7
serial.c
server/serial.c
+14
-10
trace.c
server/trace.c
+1
-5
No files found.
dlls/ntdll/serial.c
View file @
84e97cf6
...
...
@@ -771,25 +771,6 @@ static NTSTATUS set_special_chars(int fd, const SERIAL_CHARS* sc)
return
STATUS_SUCCESS
;
}
static
NTSTATUS
set_timeouts
(
HANDLE
handle
,
const
SERIAL_TIMEOUTS
*
st
)
{
NTSTATUS
status
;
SERVER_START_REQ
(
set_serial_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
flags
=
SERIALINFO_SET_TIMEOUTS
;
req
->
readinterval
=
st
->
ReadIntervalTimeout
;
req
->
readmult
=
st
->
ReadTotalTimeoutMultiplier
;
req
->
readconst
=
st
->
ReadTotalTimeoutConstant
;
req
->
writemult
=
st
->
WriteTotalTimeoutMultiplier
;
req
->
writeconst
=
st
->
WriteTotalTimeoutConstant
;
status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
return
status
;
}
static
NTSTATUS
set_wait_mask
(
HANDLE
hDevice
,
DWORD
mask
)
{
NTSTATUS
status
;
...
...
@@ -1135,25 +1116,29 @@ static inline NTSTATUS io_control(HANDLE hDevice,
DWORD
sz
=
0
,
access
=
FILE_READ_DATA
;
NTSTATUS
status
=
STATUS_SUCCESS
;
int
fd
=
-
1
,
needs_close
=
0
;
enum
server_fd_type
type
;
TRACE
(
"%p %s %p %d %p %d %p
\n
"
,
hDevice
,
iocode2str
(
dwIoControlCode
),
lpInBuffer
,
nInBufferSize
,
lpOutBuffer
,
nOutBufferSize
,
piosb
);
switch
(
dwIoControlCode
)
{
case
IOCTL_SERIAL_GET_TIMEOUTS
:
case
IOCTL_SERIAL_SET_TIMEOUTS
:
/* these are handled on the server side */
return
STATUS_NOT_SUPPORTED
;
}
piosb
->
Information
=
0
;
if
(
dwIoControlCode
!=
IOCTL_SERIAL_GET_TIMEOUTS
&&
dwIoControlCode
!=
IOCTL_SERIAL_SET_TIMEOUTS
)
if
((
status
=
server_get_unix_fd
(
hDevice
,
access
,
&
fd
,
&
needs_close
,
&
type
,
NULL
)))
goto
error
;
if
(
type
!=
FD_TYPE_SERIAL
)
{
enum
server_fd_type
type
;
if
((
status
=
server_get_unix_fd
(
hDevice
,
access
,
&
fd
,
&
needs_close
,
&
type
,
NULL
)))
goto
error
;
if
(
type
!=
FD_TYPE_SERIAL
)
{
if
(
needs_close
)
close
(
fd
);
status
=
STATUS_OBJECT_TYPE_MISMATCH
;
goto
error
;
}
if
(
needs_close
)
close
(
fd
);
status
=
STATUS_OBJECT_TYPE_MISMATCH
;
goto
error
;
}
switch
(
dwIoControlCode
)
...
...
@@ -1224,8 +1209,6 @@ static inline NTSTATUS io_control(HANDLE hDevice,
}
else
status
=
STATUS_INVALID_PARAMETER
;
break
;
case
IOCTL_SERIAL_GET_TIMEOUTS
:
return
STATUS_NOT_SUPPORTED
;
case
IOCTL_SERIAL_GET_WAIT_MASK
:
if
(
lpOutBuffer
&&
nOutBufferSize
==
sizeof
(
DWORD
))
{
...
...
@@ -1318,12 +1301,6 @@ static inline NTSTATUS io_control(HANDLE hDevice,
status
=
STATUS_NOT_SUPPORTED
;
#endif
break
;
case
IOCTL_SERIAL_SET_TIMEOUTS
:
if
(
lpInBuffer
&&
nInBufferSize
==
sizeof
(
SERIAL_TIMEOUTS
))
status
=
set_timeouts
(
hDevice
,
lpInBuffer
);
else
status
=
STATUS_INVALID_PARAMETER
;
break
;
case
IOCTL_SERIAL_SET_WAIT_MASK
:
if
(
lpInBuffer
&&
nInBufferSize
==
sizeof
(
DWORD
))
{
...
...
include/wine/server_protocol.h
View file @
84e97cf6
...
...
@@ -3164,19 +3164,12 @@ struct set_serial_info_request
struct
request_header
__header
;
obj_handle_t
handle
;
int
flags
;
unsigned
int
readinterval
;
unsigned
int
readconst
;
unsigned
int
readmult
;
unsigned
int
writeconst
;
unsigned
int
writemult
;
unsigned
int
eventmask
;
char
__pad_44
[
4
];
};
struct
set_serial_info_reply
{
struct
reply_header
__header
;
};
#define SERIALINFO_SET_TIMEOUTS 0x01
#define SERIALINFO_SET_MASK 0x02
#define SERIALINFO_PENDING_WRITE 0x04
#define SERIALINFO_PENDING_WAIT 0x08
...
...
@@ -6403,6 +6396,6 @@ union generic_reply
struct
terminate_job_reply
terminate_job_reply
;
};
#define SERVER_PROTOCOL_VERSION 52
8
#define SERVER_PROTOCOL_VERSION 52
9
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
84e97cf6
...
...
@@ -2309,14 +2309,8 @@ enum message_type
@REQ(set_serial_info)
obj_handle_t handle; /* handle to comm port */
int flags; /* bitmask to set values (see below) */
unsigned int readinterval;
unsigned int readconst;
unsigned int readmult;
unsigned int writeconst;
unsigned int writemult;
unsigned int eventmask;
@END
#define SERIALINFO_SET_TIMEOUTS 0x01
#define SERIALINFO_SET_MASK 0x02
#define SERIALINFO_PENDING_WRITE 0x04
#define SERIALINFO_PENDING_WAIT 0x08
...
...
server/request.h
View file @
84e97cf6
...
...
@@ -1559,13 +1559,8 @@ C_ASSERT( FIELD_OFFSET(struct get_serial_info_reply, pending_write) == 16 );
C_ASSERT
(
sizeof
(
struct
get_serial_info_reply
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
flags
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
readinterval
)
==
20
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
readconst
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
readmult
)
==
28
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
writeconst
)
==
32
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
writemult
)
==
36
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
eventmask
)
==
40
);
C_ASSERT
(
sizeof
(
struct
set_serial_info_request
)
==
48
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_serial_info_request
,
eventmask
)
==
20
);
C_ASSERT
(
sizeof
(
struct
set_serial_info_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
register_async_request
,
type
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
register_async_request
,
async
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
register_async_request
,
count
)
==
56
);
...
...
server/serial.c
View file @
84e97cf6
...
...
@@ -206,6 +206,20 @@ static obj_handle_t serial_ioctl( struct fd *fd, ioctl_code_t code, struct async
else
set_error
(
STATUS_BUFFER_TOO_SMALL
);
return
0
;
case
IOCTL_SERIAL_SET_TIMEOUTS
:
if
(
get_req_data_size
()
>=
sizeof
(
SERIAL_TIMEOUTS
))
{
const
SERIAL_TIMEOUTS
*
timeouts
=
get_req_data
();
serial
->
readinterval
=
timeouts
->
ReadIntervalTimeout
;
serial
->
readconst
=
timeouts
->
ReadTotalTimeoutConstant
;
serial
->
readmult
=
timeouts
->
ReadTotalTimeoutMultiplier
;
serial
->
writeconst
=
timeouts
->
WriteTotalTimeoutConstant
;
serial
->
writemult
=
timeouts
->
WriteTotalTimeoutMultiplier
;
}
else
set_error
(
STATUS_BUFFER_TOO_SMALL
);
return
0
;
default:
set_error
(
STATUS_NOT_SUPPORTED
);
return
0
;
...
...
@@ -311,16 +325,6 @@ DECL_HANDLER(set_serial_info)
serial
->
pending_wait
=
0
;
}
/* timeouts */
if
(
req
->
flags
&
SERIALINFO_SET_TIMEOUTS
)
{
serial
->
readinterval
=
req
->
readinterval
;
serial
->
readconst
=
req
->
readconst
;
serial
->
readmult
=
req
->
readmult
;
serial
->
writeconst
=
req
->
writeconst
;
serial
->
writemult
=
req
->
writemult
;
}
/* pending write */
if
(
req
->
flags
&
SERIALINFO_PENDING_WRITE
)
serial
->
pending_write
=
1
;
...
...
server/trace.c
View file @
84e97cf6
...
...
@@ -120,6 +120,7 @@ static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code )
CASE
(
FSCTL_PIPE_PEEK
);
CASE
(
FSCTL_PIPE_WAIT
);
CASE
(
IOCTL_SERIAL_GET_TIMEOUTS
);
CASE
(
IOCTL_SERIAL_SET_TIMEOUTS
);
CASE
(
WS_SIO_ADDRESS_LIST_CHANGE
);
default:
fprintf
(
stderr
,
"%s%08x"
,
prefix
,
*
code
);
break
;
#undef CASE
...
...
@@ -2842,11 +2843,6 @@ static void dump_set_serial_info_request( const struct set_serial_info_request *
{
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
fprintf
(
stderr
,
", flags=%d"
,
req
->
flags
);
fprintf
(
stderr
,
", readinterval=%08x"
,
req
->
readinterval
);
fprintf
(
stderr
,
", readconst=%08x"
,
req
->
readconst
);
fprintf
(
stderr
,
", readmult=%08x"
,
req
->
readmult
);
fprintf
(
stderr
,
", writeconst=%08x"
,
req
->
writeconst
);
fprintf
(
stderr
,
", writemult=%08x"
,
req
->
writemult
);
fprintf
(
stderr
,
", eventmask=%08x"
,
req
->
eventmask
);
}
...
...
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