Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
3b1354ff
Commit
3b1354ff
authored
Nov 08, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Move bus_event list entry to an internal structure.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
82d27a0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
39 deletions
+44
-39
unixlib.c
dlls/winebus.sys/unixlib.c
+44
-37
unixlib.h
dlls/winebus.sys/unixlib.h
+0
-2
No files found.
dlls/winebus.sys/unixlib.c
View file @
3b1354ff
...
...
@@ -355,93 +355,100 @@ void bus_event_cleanup(struct bus_event *event)
unix_device_decref
(
event
->
device
);
}
struct
bus_event_entry
{
struct
list
entry
;
struct
bus_event
event
;
};
void
bus_event_queue_destroy
(
struct
list
*
queue
)
{
struct
bus_event
*
event
,
*
next
;
struct
bus_event
_entry
*
entry
,
*
next
;
LIST_FOR_EACH_ENTRY_SAFE
(
e
vent
,
next
,
queue
,
struct
bus_event
,
entry
)
LIST_FOR_EACH_ENTRY_SAFE
(
e
ntry
,
next
,
queue
,
struct
bus_event_entry
,
entry
)
{
bus_event_cleanup
(
event
);
free
(
event
);
bus_event_cleanup
(
&
entry
->
event
);
list_remove
(
&
entry
->
entry
);
free
(
entry
);
}
}
BOOL
bus_event_queue_device_removed
(
struct
list
*
queue
,
struct
unix_device
*
device
)
{
ULONG
size
=
sizeof
(
struct
bus_event
);
struct
bus_event
*
event
=
malloc
(
size
);
if
(
!
e
vent
)
return
FALSE
;
ULONG
size
=
sizeof
(
struct
bus_event
_entry
);
struct
bus_event
_entry
*
entry
=
malloc
(
size
);
if
(
!
e
ntry
)
return
FALSE
;
if
(
unix_device_incref
(
device
)
==
1
)
/* being destroyed */
{
free
(
e
vent
);
free
(
e
ntry
);
return
FALSE
;
}
e
vent
->
type
=
BUS_EVENT_TYPE_DEVICE_REMOVED
;
e
vent
->
device
=
device
;
list_add_tail
(
queue
,
&
e
vent
->
entry
);
e
ntry
->
event
.
type
=
BUS_EVENT_TYPE_DEVICE_REMOVED
;
e
ntry
->
event
.
device
=
device
;
list_add_tail
(
queue
,
&
e
ntry
->
entry
);
return
TRUE
;
}
BOOL
bus_event_queue_device_created
(
struct
list
*
queue
,
struct
unix_device
*
device
,
struct
device_desc
*
desc
)
{
ULONG
size
=
sizeof
(
struct
bus_event
);
struct
bus_event
*
event
=
malloc
(
size
);
if
(
!
e
vent
)
return
FALSE
;
ULONG
size
=
sizeof
(
struct
bus_event
_entry
);
struct
bus_event
_entry
*
entry
=
malloc
(
size
);
if
(
!
e
ntry
)
return
FALSE
;
if
(
unix_device_incref
(
device
)
==
1
)
/* being destroyed */
{
free
(
e
vent
);
free
(
e
ntry
);
return
FALSE
;
}
e
vent
->
type
=
BUS_EVENT_TYPE_DEVICE_CREATED
;
e
vent
->
device
=
device
;
e
vent
->
device_created
.
desc
=
*
desc
;
list_add_tail
(
queue
,
&
e
vent
->
entry
);
e
ntry
->
event
.
type
=
BUS_EVENT_TYPE_DEVICE_CREATED
;
e
ntry
->
event
.
device
=
device
;
e
ntry
->
event
.
device_created
.
desc
=
*
desc
;
list_add_tail
(
queue
,
&
e
ntry
->
entry
);
return
TRUE
;
}
BOOL
bus_event_queue_input_report
(
struct
list
*
queue
,
struct
unix_device
*
device
,
BYTE
*
report
,
USHORT
length
)
{
ULONG
size
=
offsetof
(
struct
bus_event
,
input_report
.
buffer
[
length
]);
struct
bus_event
*
event
=
malloc
(
size
);
if
(
!
e
vent
)
return
FALSE
;
ULONG
size
=
offsetof
(
struct
bus_event
_entry
,
event
.
input_report
.
buffer
[
length
]);
struct
bus_event
_entry
*
entry
=
malloc
(
size
);
if
(
!
e
ntry
)
return
FALSE
;
if
(
unix_device_incref
(
device
)
==
1
)
/* being destroyed */
{
free
(
e
vent
);
free
(
e
ntry
);
return
FALSE
;
}
e
vent
->
type
=
BUS_EVENT_TYPE_INPUT_REPORT
;
e
vent
->
device
=
device
;
e
vent
->
input_report
.
length
=
length
;
memcpy
(
e
vent
->
input_report
.
buffer
,
report
,
length
);
list_add_tail
(
queue
,
&
e
vent
->
entry
);
e
ntry
->
event
.
type
=
BUS_EVENT_TYPE_INPUT_REPORT
;
e
ntry
->
event
.
device
=
device
;
e
ntry
->
event
.
input_report
.
length
=
length
;
memcpy
(
e
ntry
->
event
.
input_report
.
buffer
,
report
,
length
);
list_add_tail
(
queue
,
&
e
ntry
->
entry
);
return
TRUE
;
}
BOOL
bus_event_queue_pop
(
struct
list
*
queue
,
struct
bus_event
*
event
)
{
struct
list
*
entry
=
list_head
(
queue
);
struct
bus_event
*
tmp
;
struct
list
*
head
=
list_head
(
queue
);
struct
bus_event
_entry
*
entry
;
ULONG
size
;
if
(
!
entry
)
return
FALSE
;
if
(
!
head
)
return
FALSE
;
tmp
=
LIST_ENTRY
(
entry
,
struct
bus_event
,
entry
);
list_remove
(
entry
);
entry
=
LIST_ENTRY
(
head
,
struct
bus_event_entry
,
entry
);
list_remove
(
&
entry
->
entry
);
if
(
tmp
->
type
!=
BUS_EVENT_TYPE_INPUT_REPORT
)
size
=
sizeof
(
*
tmp
);
else
size
=
offsetof
(
struct
bus_event
,
input_report
.
buffer
[
tmp
->
input_report
.
length
]);
if
(
entry
->
event
.
type
!=
BUS_EVENT_TYPE_INPUT_REPORT
)
size
=
sizeof
(
entry
->
event
);
else
size
=
offsetof
(
struct
bus_event
,
input_report
.
buffer
[
entry
->
event
.
input_report
.
length
]);
memcpy
(
event
,
tmp
,
size
);
free
(
tmp
);
memcpy
(
event
,
&
entry
->
event
,
size
);
free
(
entry
);
return
TRUE
;
}
dlls/winebus.sys/unixlib.h
View file @
3b1354ff
...
...
@@ -77,8 +77,6 @@ enum bus_event_type
struct
bus_event
{
enum
bus_event_type
type
;
struct
list
entry
;
struct
unix_device
*
device
;
union
{
...
...
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