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
a604db12
Commit
a604db12
authored
Feb 15, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Create async object in register_async handler.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8ef4f9a0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
23 deletions
+20
-23
fd.c
server/fd.c
+9
-6
file.h
server/file.h
+3
-3
mailslot.c
server/mailslot.c
+3
-4
serial.c
server/serial.c
+3
-4
sock.c
server/sock.c
+2
-6
No files found.
server/fd.c
View file @
a604db12
...
...
@@ -2091,16 +2091,14 @@ void fd_reselect_async( struct fd *fd, struct async_queue *queue )
fd
->
fd_ops
->
reselect_async
(
fd
,
queue
);
}
void
no_fd_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
)
void
no_fd_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
)
{
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
}
void
default_fd_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
)
void
default_fd_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
)
{
struct
async
*
async
;
if
((
async
=
fd_queue_async
(
fd
,
data
,
NULL
,
type
)))
if
((
async
=
fd_queue_async
(
fd
,
async_get_data
(
async
),
NULL
,
type
)))
{
release_object
(
async
);
set_error
(
STATUS_PENDING
);
...
...
@@ -2509,6 +2507,7 @@ DECL_HANDLER(ioctl)
DECL_HANDLER
(
register_async
)
{
unsigned
int
access
;
struct
async
*
async
;
struct
fd
*
fd
;
switch
(
req
->
type
)
...
...
@@ -2526,7 +2525,11 @@ DECL_HANDLER(register_async)
if
((
fd
=
get_handle_fd_obj
(
current
->
process
,
req
->
async
.
handle
,
access
)))
{
if
(
get_unix_fd
(
fd
)
!=
-
1
)
fd
->
fd_ops
->
queue_async
(
fd
,
&
req
->
async
,
req
->
type
,
req
->
count
);
if
(
get_unix_fd
(
fd
)
!=
-
1
&&
(
async
=
create_async
(
current
,
&
req
->
async
,
NULL
)))
{
fd
->
fd_ops
->
queue_async
(
fd
,
async
,
req
->
type
,
req
->
count
);
release_object
(
async
);
}
release_object
(
fd
);
}
}
...
...
server/file.h
View file @
a604db12
...
...
@@ -60,7 +60,7 @@ struct fd_ops
/* perform an ioctl on the file */
obj_handle_t
(
*
ioctl
)(
struct
fd
*
fd
,
ioctl_code_t
code
,
const
async_data_t
*
async
,
int
blocking
);
/* queue an async operation */
void
(
*
queue_async
)(
struct
fd
*
,
const
async_data_t
*
data
,
int
type
,
int
count
);
void
(
*
queue_async
)(
struct
fd
*
,
struct
async
*
async
,
int
type
,
int
count
);
/* selected events for async i/o need an update */
void
(
*
reselect_async
)(
struct
fd
*
,
struct
async_queue
*
queue
);
};
...
...
@@ -105,8 +105,8 @@ extern obj_handle_t no_fd_write( struct fd *fd, struct async *async, int blockin
extern
obj_handle_t
no_fd_flush
(
struct
fd
*
fd
,
const
async_data_t
*
async
,
int
blocking
);
extern
obj_handle_t
no_fd_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
const
async_data_t
*
async
,
int
blocking
);
extern
obj_handle_t
default_fd_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
const
async_data_t
*
async
,
int
blocking
);
extern
void
no_fd_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
);
extern
void
default_fd_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
);
extern
void
no_fd_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
);
extern
void
default_fd_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
);
extern
void
default_fd_reselect_async
(
struct
fd
*
fd
,
struct
async_queue
*
queue
);
extern
void
main_loop
(
void
);
extern
void
remove_process_locks
(
struct
process
*
process
);
...
...
server/mailslot.c
View file @
a604db12
...
...
@@ -94,7 +94,7 @@ static const struct object_ops mailslot_ops =
};
static
enum
server_fd_type
mailslot_get_fd_type
(
struct
fd
*
fd
);
static
void
mailslot_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
);
static
void
mailslot_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
);
static
const
struct
fd_ops
mailslot_fd_ops
=
{
...
...
@@ -325,14 +325,13 @@ static struct object *mailslot_open_file( struct object *obj, unsigned int acces
return
&
writer
->
obj
;
}
static
void
mailslot_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
)
static
void
mailslot_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
)
{
struct
mailslot
*
mailslot
=
get_fd_user
(
fd
);
struct
async
*
async
;
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
if
((
async
=
fd_queue_async
(
fd
,
data
,
NULL
,
type
)))
if
((
async
=
fd_queue_async
(
fd
,
async_get_data
(
async
)
,
NULL
,
type
)))
{
async_set_timeout
(
async
,
mailslot
->
read_timeout
?
mailslot
->
read_timeout
:
-
1
,
STATUS_IO_TIMEOUT
);
...
...
server/serial.c
View file @
a604db12
...
...
@@ -61,7 +61,7 @@ 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_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
);
static
void
serial_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
);
static
void
serial_reselect_async
(
struct
fd
*
fd
,
struct
async_queue
*
queue
);
struct
serial
...
...
@@ -183,11 +183,10 @@ static enum server_fd_type serial_get_fd_type( struct fd *fd )
return
FD_TYPE_SERIAL
;
}
static
void
serial_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
)
static
void
serial_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
)
{
struct
serial
*
serial
=
get_fd_user
(
fd
);
timeout_t
timeout
=
0
;
struct
async
*
async
;
assert
(
serial
->
obj
.
ops
==
&
serial_ops
);
...
...
@@ -201,7 +200,7 @@ static void serial_queue_async( struct fd *fd, const async_data_t *data, int typ
break
;
}
if
((
async
=
fd_queue_async
(
fd
,
data
,
NULL
,
type
)))
if
((
async
=
fd_queue_async
(
fd
,
async_get_data
(
async
)
,
NULL
,
type
)))
{
if
(
timeout
)
async_set_timeout
(
async
,
timeout
*
-
10000
,
STATUS_TIMEOUT
);
release_object
(
async
);
...
...
server/sock.c
View file @
a604db12
...
...
@@ -130,7 +130,7 @@ static int sock_get_poll_events( struct fd *fd );
static
void
sock_poll_event
(
struct
fd
*
fd
,
int
event
);
static
enum
server_fd_type
sock_get_fd_type
(
struct
fd
*
fd
);
static
obj_handle_t
sock_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
const
async_data_t
*
async
,
int
blocking
);
static
void
sock_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
);
static
void
sock_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
);
static
void
sock_reselect_async
(
struct
fd
*
fd
,
struct
async_queue
*
queue
);
static
int
sock_get_ntstatus
(
int
err
);
...
...
@@ -564,10 +564,9 @@ obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *a
}
}
static
void
sock_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
)
static
void
sock_queue_async
(
struct
fd
*
fd
,
struct
async
*
async
,
int
type
,
int
count
)
{
struct
sock
*
sock
=
get_fd_user
(
fd
);
struct
async
*
async
;
struct
async_queue
*
queue
;
assert
(
sock
->
obj
.
ops
==
&
sock_ops
);
...
...
@@ -594,10 +593,7 @@ static void sock_queue_async( struct fd *fd, const async_data_t *data, int type,
return
;
}
if
(
!
(
async
=
create_async
(
current
,
data
,
NULL
)))
return
;
queue_async
(
queue
,
async
);
release_object
(
async
);
sock_reselect
(
sock
);
set_error
(
STATUS_PENDING
);
...
...
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