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
7011685e
Commit
7011685e
authored
Oct 11, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Move PIDVID internal guid to device.c.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
46d35211
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
17 deletions
+18
-17
device.c
dlls/dinput/device.c
+9
-0
device_private.h
dlls/dinput/device_private.h
+1
-1
joystick.c
dlls/dinput/joystick.c
+0
-8
joystick_hid.c
dlls/dinput/joystick_hid.c
+3
-3
joystick_linux.c
dlls/dinput/joystick_linux.c
+1
-1
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+1
-1
joystick_osx.c
dlls/dinput/joystick_osx.c
+3
-3
No files found.
dlls/dinput/device.c
View file @
7011685e
...
...
@@ -36,6 +36,9 @@
#include "winuser.h"
#include "winerror.h"
#include "dinput.h"
#include "dinputd.h"
#include "initguid.h"
#include "device_private.h"
#include "dinput_private.h"
...
...
@@ -43,6 +46,12 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dinput
);
/* Windows uses this GUID for guidProduct on non-keyboard/mouse devices.
* Data1 contains the device VID (low word) and PID (high word).
* Data4 ends with the ASCII bytes "PIDVID".
*/
DEFINE_GUID
(
dinput_pidvid_guid
,
0x00000000
,
0x0000
,
0x0000
,
0x00
,
0x00
,
'P'
,
'I'
,
'D'
,
'V'
,
'I'
,
'D'
);
static
inline
IDirectInputDeviceImpl
*
impl_from_IDirectInputDevice8W
(
IDirectInputDevice8W
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectInputDeviceImpl
,
IDirectInputDevice8W_iface
);
...
...
dlls/dinput/device_private.h
View file @
7011685e
...
...
@@ -128,7 +128,7 @@ typedef struct
LPDIRECTINPUTEFFECT
ref
;
}
effect_list_item
;
extern
const
GUID
DInput_PIDVID_Product_GUID
DECLSPEC_HIDDEN
;
extern
const
GUID
dinput_pidvid_guid
DECLSPEC_HIDDEN
;
/* Various debug tools */
extern
void
_dump_DIPROPHEADER
(
LPCDIPROPHEADER
diph
)
DECLSPEC_HIDDEN
;
...
...
dlls/dinput/joystick.c
View file @
7011685e
...
...
@@ -52,14 +52,6 @@ static const WORD PID_XBOX_CONTROLLERS[] = {
0x0719
,
/* Xbox 360 Wireless Adapter */
};
/* Windows uses this GUID for guidProduct on non-keyboard/mouse devices.
* Data1 contains the device VID (low word) and PID (high word).
* Data4 ends with the ASCII bytes "PIDVID".
*/
const
GUID
DInput_PIDVID_Product_GUID
=
{
/* device_pidvid-0000-0000-0000-504944564944 */
0x00000000
,
0x0000
,
0x0000
,
{
0x00
,
0x00
,
0x50
,
0x49
,
0x44
,
0x56
,
0x49
,
0x44
}
};
static
inline
JoystickGenericImpl
*
impl_from_IDirectInputDevice8W
(
IDirectInputDevice8W
*
iface
)
{
return
CONTAINING_RECORD
(
CONTAINING_RECORD
(
iface
,
IDirectInputDeviceImpl
,
IDirectInputDevice8W_iface
),
JoystickGenericImpl
,
base
);
...
...
dlls/dinput/joystick_hid.c
View file @
7011685e
...
...
@@ -1737,7 +1737,7 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND
instance
->
guidInstance
=
hid_joystick_guid
;
instance
->
guidInstance
.
Data1
^=
handle
;
instance
->
guidProduct
=
DInput_PIDVID_Product_GUID
;
instance
->
guidProduct
=
dinput_pidvid_guid
;
instance
->
guidProduct
.
Data1
=
MAKELONG
(
attrs
->
VendorID
,
attrs
->
ProductID
);
instance
->
guidFFDriver
=
GUID_NULL
;
instance
->
wUsagePage
=
caps
->
UsagePage
;
...
...
@@ -2258,9 +2258,9 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID
TRACE
(
"dinput %p, guid %s, out %p
\n
"
,
dinput
,
debugstr_guid
(
guid
),
out
);
*
out
=
NULL
;
instance
.
guidProduct
.
Data1
=
DInput_PIDVID_Product_GUID
.
Data1
;
instance
.
guidProduct
.
Data1
=
dinput_pidvid_guid
.
Data1
;
instance
.
guidInstance
.
Data1
=
hid_joystick_guid
.
Data1
;
if
(
IsEqualGUID
(
&
DInput_PIDVID_Product_GUID
,
&
instance
.
guidProduct
))
if
(
IsEqualGUID
(
&
dinput_pidvid_guid
,
&
instance
.
guidProduct
))
instance
.
guidProduct
=
*
guid
;
else
if
(
IsEqualGUID
(
&
hid_joystick_guid
,
&
instance
.
guidInstance
))
instance
.
guidInstance
=
*
guid
;
...
...
dlls/dinput/joystick_linux.c
View file @
7011685e
...
...
@@ -315,7 +315,7 @@ static INT find_joystick_devices(void)
else
{
/* Concatenate product_id with vendor_id to mimic Windows behaviour */
joydev
.
guid_product
=
DInput_PIDVID_Product_GUID
;
joydev
.
guid_product
=
dinput_pidvid_guid
;
joydev
.
guid_product
.
Data1
=
MAKELONG
(
joydev
.
vendor_id
,
joydev
.
product_id
);
}
...
...
dlls/dinput/joystick_linuxinput.c
View file @
7011685e
...
...
@@ -320,7 +320,7 @@ static void find_joydevs(void)
joydev
.
bus_type
=
device_id
.
bustype
;
/* Concatenate product_id with vendor_id to mimic Windows behaviour */
joydev
.
guid_product
=
DInput_PIDVID_Product_GUID
;
joydev
.
guid_product
=
dinput_pidvid_guid
;
joydev
.
guid_product
.
Data1
=
MAKELONG
(
joydev
.
vendor_id
,
joydev
.
product_id
);
}
...
...
dlls/dinput/joystick_osx.c
View file @
7011685e
...
...
@@ -1058,7 +1058,7 @@ static HRESULT joydev_enum_device(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINST
/* Return joystick */
lpddi
->
guidInstance
=
DInput_Wine_OsX_Joystick_GUID
;
lpddi
->
guidInstance
.
Data3
=
id
;
lpddi
->
guidProduct
=
DInput_PIDVID_Product_GUID
;
lpddi
->
guidProduct
=
dinput_pidvid_guid
;
lpddi
->
guidProduct
.
Data1
=
make_vid_pid
(
device
);
lpddi
->
dwDevType
=
get_device_type
(
version
,
is_joystick
);
lpddi
->
dwDevType
|=
DIDEVTYPE_HID
;
...
...
@@ -1131,7 +1131,7 @@ static HRESULT alloc_device( REFGUID rguid, IDirectInputImpl *dinput, JoystickIm
newDevice
->
generic
.
guidInstance
=
DInput_Wine_OsX_Joystick_GUID
;
newDevice
->
generic
.
guidInstance
.
Data3
=
index
;
newDevice
->
generic
.
guidProduct
=
DInput_PIDVID_Product_GUID
;
newDevice
->
generic
.
guidProduct
=
dinput_pidvid_guid
;
newDevice
->
generic
.
guidProduct
.
Data1
=
make_vid_pid
(
device
);
newDevice
->
generic
.
joy_polldev
=
poll_osx_device_state
;
...
...
@@ -1309,7 +1309,7 @@ static unsigned short get_joystick_index(REFGUID guid)
if
(
IsEqualGUID
(
&
wine_joystick
,
&
dev_guid
))
return
guid
->
Data3
;
prod_guid
.
Data1
=
0
;
if
(
IsEqualGUID
(
&
DInput_PIDVID_Product_GUID
,
&
prod_guid
))
if
(
IsEqualGUID
(
&
dinput_pidvid_guid
,
&
prod_guid
))
{
joystick_devices_count
=
find_joystick_devices
();
for
(
i
=
0
;
i
<
joystick_devices_count
;
i
++
)
...
...
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