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
21379f3d
Commit
21379f3d
authored
May 17, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
May 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Pass the device instance directly to hid_joystick_device_(try_)open.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cd33f715
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
17 deletions
+8
-17
joystick_hid.c
dlls/dinput/joystick_hid.c
+8
-17
No files found.
dlls/dinput/joystick_hid.c
View file @
21379f3d
...
...
@@ -1564,7 +1564,7 @@ failed:
return
DIERR_DEVICENOTREG
;
}
static
HRESULT
hid_joystick_device_open
(
int
index
,
const
GUID
*
guid
,
DIDEVICEINSTANCEW
*
filter
,
static
HRESULT
hid_joystick_device_open
(
int
index
,
const
GUID
*
guid
,
DIDEVICEINSTANCEW
*
instance
,
WCHAR
*
device_path
,
HANDLE
*
device
,
PHIDP_PREPARSED_DATA
*
preparsed
,
HIDD_ATTRIBUTES
*
attrs
,
HIDP_CAPS
*
caps
,
DWORD
version
)
{
...
...
@@ -1572,7 +1572,6 @@ static HRESULT hid_joystick_device_open( int index, const GUID *guid, DIDEVICEIN
SP_DEVICE_INTERFACE_DETAIL_DATA_W
*
detail
=
(
void
*
)
buffer
;
SP_DEVICE_INTERFACE_DATA
iface
=
{.
cbSize
=
sizeof
(
iface
)};
SP_DEVINFO_DATA
devinfo
=
{.
cbSize
=
sizeof
(
devinfo
)};
DIDEVICEINSTANCEW
instance
=
*
filter
;
WCHAR
device_id
[
MAX_PATH
],
*
tmp
;
HDEVINFO
set
,
xi_set
;
UINT32
i
=
0
,
handle
;
...
...
@@ -1600,10 +1599,10 @@ static HRESULT hid_joystick_device_open( int index, const GUID *guid, DIDEVICEIN
type
!=
DEVPROP_TYPE_UINT32
)
continue
;
if
(
FAILED
(
hid_joystick_device_try_open
(
handle
,
detail
->
DevicePath
,
device
,
preparsed
,
attrs
,
caps
,
&
instance
,
version
)))
attrs
,
caps
,
instance
,
version
)))
continue
;
if
(
device_instance_is_disabled
(
&
instance
,
&
override
))
if
(
device_instance_is_disabled
(
instance
,
&
override
))
goto
next
;
if
(
override
&&
SetupDiGetDeviceInstanceIdW
(
set
,
&
devinfo
,
device_id
,
MAX_PATH
,
NULL
)
&&
...
...
@@ -1620,12 +1619,12 @@ static HRESULT hid_joystick_device_open( int index, const GUID *guid, DIDEVICEIN
CloseHandle
(
*
device
);
HidD_FreePreparsedData
(
*
preparsed
);
if
(
FAILED
(
hid_joystick_device_try_open
(
handle
,
detail
->
DevicePath
,
device
,
preparsed
,
attrs
,
caps
,
&
instance
,
version
)))
attrs
,
caps
,
instance
,
version
)))
continue
;
}
/* enumerate device by GUID */
if
(
IsEqualGUID
(
guid
,
&
instance
.
guidProduct
)
||
IsEqualGUID
(
guid
,
&
instance
.
guidInstance
))
break
;
if
(
IsEqualGUID
(
guid
,
&
instance
->
guidProduct
)
||
IsEqualGUID
(
guid
,
&
instance
->
guidInstance
))
break
;
/* enumerate all devices */
if
(
index
>=
0
&&
!
index
--
)
break
;
...
...
@@ -1642,7 +1641,6 @@ static HRESULT hid_joystick_device_open( int index, const GUID *guid, DIDEVICEIN
if
(
!*
device
||
!*
preparsed
)
return
DIERR_DEVICENOTREG
;
lstrcpynW
(
device_path
,
detail
->
DevicePath
,
MAX_PATH
);
*
filter
=
instance
;
return
DI_OK
;
}
...
...
@@ -2007,12 +2005,6 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi
.
dwHeaderSize
=
sizeof
(
filter
),
.
dwHow
=
DIPH_DEVICE
,
};
DIDEVICEINSTANCEW
instance
=
{
.
dwSize
=
sizeof
(
instance
),
.
guidProduct
=
*
guid
,
.
guidInstance
=
*
guid
};
DIPROPRANGE
range
=
{
.
diph
=
...
...
@@ -2043,18 +2035,17 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi
impl
->
internal_ref
=
1
;
if
(
memcmp
(
device_path_guid
.
Data4
,
guid
->
Data4
,
sizeof
(
device_path_guid
.
Data4
)
))
hr
=
hid_joystick_device_open
(
-
1
,
guid
,
&
instance
,
impl
->
device_path
,
&
impl
->
device
,
&
impl
->
preparsed
,
hr
=
hid_joystick_device_open
(
-
1
,
guid
,
&
i
mpl
->
base
.
i
nstance
,
impl
->
device_path
,
&
impl
->
device
,
&
impl
->
preparsed
,
&
attrs
,
&
impl
->
caps
,
dinput
->
dwVersion
);
else
{
wcscpy
(
impl
->
device_path
,
*
(
const
WCHAR
**
)
guid
);
hr
=
hid_joystick_device_try_open
(
0
,
impl
->
device_path
,
&
impl
->
device
,
&
impl
->
preparsed
,
&
attrs
,
&
impl
->
caps
,
&
instance
,
dinput
->
dwVersion
);
&
impl
->
caps
,
&
i
mpl
->
base
.
i
nstance
,
dinput
->
dwVersion
);
}
if
(
hr
!=
DI_OK
)
goto
failed
;
impl
->
base
.
instance
=
instance
;
impl
->
base
.
caps
.
dwDevType
=
instance
.
dwDevType
;
impl
->
base
.
caps
.
dwDevType
=
impl
->
base
.
instance
.
dwDevType
;
impl
->
attrs
=
attrs
;
list_init
(
&
impl
->
effect_list
);
...
...
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