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
4c4c64bf
Commit
4c4c64bf
authored
May 25, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Handle failure from HID APIs.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
parent
8962ec5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
rawinput.c
dlls/user32/rawinput.c
+19
-6
No files found.
dlls/user32/rawinput.c
View file @
4c4c64bf
...
...
@@ -153,17 +153,26 @@ static struct device *add_device( HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface,
case
RIM_TYPEHID
:
attr
.
Size
=
sizeof
(
HIDD_ATTRIBUTES
);
if
(
!
HidD_GetAttributes
(
device
->
file
,
&
attr
))
WARN
(
"Failed to get attributes.
\n
"
);
{
ERR
(
"Failed to get attributes.
\n
"
);
goto
fail
;
}
info
.
hid
.
dwVendorId
=
attr
.
VendorID
;
info
.
hid
.
dwProductId
=
attr
.
ProductID
;
info
.
hid
.
dwVersionNumber
=
attr
.
VersionNumber
;
if
(
!
HidD_GetPreparsedData
(
file
,
&
preparsed_data
))
WARN
(
"Failed to get preparsed data.
\n
"
);
{
ERR
(
"Failed to get preparsed data.
\n
"
);
goto
fail
;
}
if
(
!
HidP_GetCaps
(
preparsed_data
,
&
caps
))
WARN
(
"Failed to get caps.
\n
"
);
{
ERR
(
"Failed to get caps.
\n
"
);
goto
fail
;
}
info
.
hid
.
usUsagePage
=
caps
.
UsagePage
;
info
.
hid
.
usUsage
=
caps
.
Usage
;
...
...
@@ -198,9 +207,7 @@ static struct device *add_device( HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface,
else
{
ERR
(
"Failed to allocate memory.
\n
"
);
CloseHandle
(
file
);
free
(
detail
);
return
NULL
;
goto
fail
;
}
device
->
detail
=
detail
;
...
...
@@ -210,6 +217,12 @@ static struct device *add_device( HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface,
device
->
data
=
preparsed_data
;
return
device
;
fail:
free
(
preparsed_data
);
CloseHandle
(
file
);
free
(
detail
);
return
NULL
;
}
void
rawinput_update_device_list
(
void
)
...
...
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