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
f031c676
Commit
f031c676
authored
Sep 10, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add a serial event mask change counter.
parent
4b772c2c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
15 deletions
+23
-15
comm.c
dlls/kernel32/tests/comm.c
+2
-4
serial.c
dlls/ntdll/serial.c
+10
-6
server_protocol.h
include/wine/server_protocol.h
+3
-1
protocol.def
server/protocol.def
+1
-0
request.h
server/request.h
+2
-1
serial.c
server/serial.c
+4
-3
trace.c
server/trace.c
+1
-0
No files found.
dlls/kernel32/tests/comm.c
View file @
f031c676
...
...
@@ -860,8 +860,7 @@ todo_wine
{
/* unblock pending wait */
trace
(
"recovering after WAIT_TIMEOUT...
\n
"
);
/* FIXME: Wine fails to unblock with new mask being equal to the old one */
res
=
SetCommMask
(
hcom
,
0
);
res
=
SetCommMask
(
hcom
,
EV_TXEMPTY
);
ok
(
res
,
"SetCommMask error %d
\n
"
,
GetLastError
());
res
=
WaitForSingleObject
(
ovl_wait
.
hEvent
,
TIMEOUT
);
...
...
@@ -968,8 +967,7 @@ todo_wine
/* unblock pending wait */
trace
(
"recovering after WAIT_TIMEOUT...
\n
"
);
/* FIXME: Wine fails to unblock with new mask being equal to the old one */
res
=
SetCommMask
(
hcom
,
0
);
res
=
SetCommMask
(
hcom
,
EV_TXEMPTY
);
ok
(
res
,
"SetCommMask error %d
\n
"
,
GetLastError
());
res
=
WaitForSingleObject
(
ovl_wait
.
hEvent
,
TIMEOUT
);
...
...
dlls/ntdll/serial.c
View file @
f031c676
...
...
@@ -380,7 +380,7 @@ static NTSTATUS get_timeouts(HANDLE handle, SERIAL_TIMEOUTS* st)
return
status
;
}
static
NTSTATUS
get_wait_mask
(
HANDLE
hDevice
,
DWORD
*
mask
)
static
NTSTATUS
get_wait_mask
(
HANDLE
hDevice
,
DWORD
*
mask
,
DWORD
*
cookie
)
{
NTSTATUS
status
;
...
...
@@ -388,7 +388,10 @@ static NTSTATUS get_wait_mask(HANDLE hDevice, DWORD* mask)
{
req
->
handle
=
wine_server_obj_handle
(
hDevice
);
if
(
!
(
status
=
wine_server_call
(
req
)))
{
*
mask
=
reply
->
eventmask
;
if
(
cookie
)
*
cookie
=
reply
->
cookie
;
}
}
SERVER_END_REQ
;
return
status
;
...
...
@@ -794,6 +797,7 @@ typedef struct async_commio
IO_STATUS_BLOCK
*
iosb
;
HANDLE
hEvent
;
DWORD
evtmask
;
DWORD
cookie
;
DWORD
mstat
;
serial_irq_info
irq_info
;
}
async_commio
;
...
...
@@ -906,7 +910,7 @@ static DWORD CALLBACK wait_for_event(LPVOID arg)
if
(
!
server_get_unix_fd
(
commio
->
hDevice
,
FILE_READ_DATA
|
FILE_WRITE_DATA
,
&
fd
,
&
needs_close
,
NULL
,
NULL
))
{
serial_irq_info
new_irq_info
;
DWORD
new_mstat
,
new_evtmask
;
DWORD
new_mstat
,
dummy
,
cookie
;
LARGE_INTEGER
time
;
TRACE
(
"device=%p fd=0x%08x mask=0x%08x buffer=%p event=%p irq_info=%p
\n
"
,
...
...
@@ -934,8 +938,8 @@ static DWORD CALLBACK wait_for_event(LPVOID arg)
&
new_irq_info
,
&
commio
->
irq_info
,
new_mstat
,
commio
->
mstat
);
if
(
*
commio
->
events
)
break
;
get_wait_mask
(
commio
->
hDevice
,
&
new_evtmask
);
if
(
commio
->
evtmask
!=
new_evtmask
)
get_wait_mask
(
commio
->
hDevice
,
&
dummy
,
&
cookie
);
if
(
commio
->
cookie
!=
cookie
)
{
*
commio
->
events
=
0
;
break
;
...
...
@@ -964,7 +968,7 @@ static NTSTATUS wait_on(HANDLE hDevice, int fd, HANDLE hEvent, PIO_STATUS_BLOCK
commio
->
events
=
events
;
commio
->
iosb
=
piosb
;
commio
->
hEvent
=
hEvent
;
get_wait_mask
(
commio
->
hDevice
,
&
commio
->
evtmask
);
get_wait_mask
(
commio
->
hDevice
,
&
commio
->
evtmask
,
&
commio
->
cookie
);
/* We may never return, if some capabilities miss
* Return error in that case
...
...
@@ -1159,7 +1163,7 @@ static inline NTSTATUS io_control(HANDLE hDevice,
case
IOCTL_SERIAL_GET_WAIT_MASK
:
if
(
lpOutBuffer
&&
nOutBufferSize
==
sizeof
(
DWORD
))
{
if
(
!
(
status
=
get_wait_mask
(
hDevice
,
lpOutBuffer
)))
if
(
!
(
status
=
get_wait_mask
(
hDevice
,
lpOutBuffer
,
NULL
)))
sz
=
sizeof
(
DWORD
);
}
else
...
...
include/wine/server_protocol.h
View file @
f031c676
...
...
@@ -3055,6 +3055,8 @@ struct get_serial_info_reply
unsigned
int
writeconst
;
unsigned
int
writemult
;
unsigned
int
eventmask
;
unsigned
int
cookie
;
char
__pad_36
[
4
];
};
...
...
@@ -5821,6 +5823,6 @@ union generic_reply
struct
set_suspend_context_reply
set_suspend_context_reply
;
};
#define SERVER_PROTOCOL_VERSION 44
8
#define SERVER_PROTOCOL_VERSION 44
9
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
f031c676
...
...
@@ -2219,6 +2219,7 @@ enum message_type
unsigned int writeconst;
unsigned int writemult;
unsigned int eventmask;
unsigned int cookie;
@END
...
...
server/request.h
View file @
f031c676
...
...
@@ -1477,7 +1477,8 @@ C_ASSERT( FIELD_OFFSET(struct get_serial_info_reply, readmult) == 16 );
C_ASSERT
(
FIELD_OFFSET
(
struct
get_serial_info_reply
,
writeconst
)
==
20
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_serial_info_reply
,
writemult
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_serial_info_reply
,
eventmask
)
==
28
);
C_ASSERT
(
sizeof
(
struct
get_serial_info_reply
)
==
32
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_serial_info_reply
,
cookie
)
==
32
);
C_ASSERT
(
sizeof
(
struct
get_serial_info_reply
)
==
40
);
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
);
...
...
server/serial.c
View file @
f031c676
...
...
@@ -76,6 +76,7 @@ struct serial
unsigned
int
writemult
;
unsigned
int
eventmask
;
unsigned
int
generation
;
/* event mask change counter */
struct
termios
original
;
...
...
@@ -135,6 +136,7 @@ struct object *create_serial( struct fd *fd )
serial
->
writemult
=
0
;
serial
->
writeconst
=
0
;
serial
->
eventmask
=
0
;
serial
->
generation
=
0
;
serial
->
fd
=
(
struct
fd
*
)
grab_object
(
fd
);
set_fd_user
(
fd
,
&
serial_fd_ops
,
&
serial
->
obj
);
return
&
serial
->
obj
;
...
...
@@ -210,6 +212,7 @@ DECL_HANDLER(get_serial_info)
/* event mask */
reply
->
eventmask
=
serial
->
eventmask
;
reply
->
cookie
=
serial
->
generation
;
release_object
(
serial
);
}
...
...
@@ -235,11 +238,9 @@ DECL_HANDLER(set_serial_info)
if
(
req
->
flags
&
SERIALINFO_SET_MASK
)
{
serial
->
eventmask
=
req
->
eventmask
;
if
(
!
serial
->
eventmask
)
{
serial
->
generation
++
;
fd_async_wake_up
(
serial
->
fd
,
ASYNC_TYPE_WAIT
,
STATUS_SUCCESS
);
}
}
release_object
(
serial
);
}
...
...
server/trace.c
View file @
f031c676
...
...
@@ -2687,6 +2687,7 @@ static void dump_get_serial_info_reply( const struct get_serial_info_reply *req
fprintf
(
stderr
,
", writeconst=%08x"
,
req
->
writeconst
);
fprintf
(
stderr
,
", writemult=%08x"
,
req
->
writemult
);
fprintf
(
stderr
,
", eventmask=%08x"
,
req
->
eventmask
);
fprintf
(
stderr
,
", cookie=%08x"
,
req
->
cookie
);
}
static
void
dump_set_serial_info_request
(
const
struct
set_serial_info_request
*
req
)
...
...
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