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
d666aea3
Commit
d666aea3
authored
May 31, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Remove the need for ANSI enum_device callback.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
17958bc8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
263 deletions
+18
-263
dinput_main.c
dlls/dinput/dinput_main.c
+7
-7
dinput_private.h
dlls/dinput/dinput_private.h
+1
-2
joystick_linux.c
dlls/dinput/joystick_linux.c
+2
-56
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+2
-52
joystick_osx.c
dlls/dinput/joystick_osx.c
+2
-50
keyboard.c
dlls/dinput/keyboard.c
+2
-48
mouse.c
dlls/dinput/mouse.c
+2
-48
No files found.
dlls/dinput/dinput_main.c
View file @
d666aea3
...
...
@@ -382,11 +382,11 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices(
return
DIERR_NOTINITIALIZED
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
);
i
++
)
{
if
(
!
dinput_devices
[
i
]
->
enum_device
W
)
continue
;
if
(
!
dinput_devices
[
i
]
->
enum_device
)
continue
;
for
(
j
=
0
,
r
=
S_OK
;
SUCCEEDED
(
r
);
j
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
TRACE
(
" - checking device %u ('%s')
\n
"
,
i
,
dinput_devices
[
i
]
->
name
);
r
=
dinput_devices
[
i
]
->
enum_device
W
(
dwDevType
,
dwFlags
,
&
devInstance
,
This
->
dwVersion
,
j
);
r
=
dinput_devices
[
i
]
->
enum_device
(
dwDevType
,
dwFlags
,
&
devInstance
,
This
->
dwVersion
,
j
);
if
(
r
==
S_OK
)
if
(
enum_callback_wrapper
(
lpCallback
,
&
devInstance
,
pvRef
)
==
DIENUM_STOP
)
return
S_OK
;
...
...
@@ -825,14 +825,14 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
{
HRESULT
enumSuccess
;
if
(
!
dinput_devices
[
i
]
->
enum_device
W
)
continue
;
if
(
!
dinput_devices
[
i
]
->
enum_device
)
continue
;
for
(
j
=
0
,
enumSuccess
=
S_OK
;
SUCCEEDED
(
enumSuccess
);
j
++
)
{
TRACE
(
" - checking device %u ('%s')
\n
"
,
i
,
dinput_devices
[
i
]
->
name
);
/* Default behavior is to enumerate attached game controllers */
enumSuccess
=
dinput_devices
[
i
]
->
enum_device
W
(
DI8DEVCLASS_GAMECTRL
,
DIEDFL_ATTACHEDONLY
|
dwFlags
,
&
didevi
,
This
->
dwVersion
,
j
);
enumSuccess
=
dinput_devices
[
i
]
->
enum_device
(
DI8DEVCLASS_GAMECTRL
,
DIEDFL_ATTACHEDONLY
|
dwFlags
,
&
didevi
,
This
->
dwVersion
,
j
);
if
(
enumSuccess
==
S_OK
&&
should_enumerate_device
(
ptszUserName
,
dwFlags
,
&
This
->
device_players
,
&
didevi
.
guidInstance
))
{
...
...
@@ -998,13 +998,13 @@ static HRESULT WINAPI JoyConfig8Impl_GetConfig(IDirectInputJoyConfig8 *iface, UI
/* Enumerate all joysticks in order */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
);
i
++
)
{
if
(
!
dinput_devices
[
i
]
->
enum_device
A
)
continue
;
if
(
!
dinput_devices
[
i
]
->
enum_device
)
continue
;
for
(
j
=
0
,
r
=
S_OK
;
SUCCEEDED
(
r
);
j
++
)
{
DIDEVICEINSTANCE
A
dev
;
DIDEVICEINSTANCE
W
dev
;
dev
.
dwSize
=
sizeof
(
dev
);
if
((
r
=
dinput_devices
[
i
]
->
enum_device
A
(
DI8DEVCLASS_GAMECTRL
,
0
,
&
dev
,
di
->
dwVersion
,
j
))
==
S_OK
)
if
((
r
=
dinput_devices
[
i
]
->
enum_device
(
DI8DEVCLASS_GAMECTRL
,
0
,
&
dev
,
di
->
dwVersion
,
j
))
==
S_OK
)
{
/* Only take into account the chosen id */
if
(
found
==
id
)
...
...
dlls/dinput/dinput_private.h
View file @
d666aea3
...
...
@@ -55,8 +55,7 @@ extern const IDirectInput8AVtbl dinput8_a_vtbl DECLSPEC_HIDDEN;
/* Function called by all devices that Wine supports */
struct
dinput_device
{
const
char
*
name
;
HRESULT
(
*
enum_deviceA
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
);
HRESULT
(
*
enum_deviceW
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
);
HRESULT
(
*
enum_device
)(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
);
HRESULT
(
*
create_device
)(
IDirectInputImpl
*
dinput
,
REFGUID
rguid
,
IDirectInputDevice8W
**
out
);
};
...
...
dlls/dinput/joystick_linux.c
View file @
d666aea3
...
...
@@ -369,59 +369,7 @@ static void fill_joystick_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD ver
lpddi
->
guidFFDriver
=
GUID_NULL
;
}
static
void
fill_joystick_dideviceinstanceA
(
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
DIDEVICEINSTANCEW
lpddiW
;
DWORD
dwSize
=
lpddi
->
dwSize
;
lpddiW
.
dwSize
=
sizeof
(
lpddiW
);
fill_joystick_dideviceinstanceW
(
&
lpddiW
,
version
,
id
);
TRACE
(
"%d %p
\n
"
,
dwSize
,
lpddi
);
memset
(
lpddi
,
0
,
dwSize
);
/* Convert W->A */
lpddi
->
dwSize
=
dwSize
;
lpddi
->
guidInstance
=
lpddiW
.
guidInstance
;
lpddi
->
guidProduct
=
lpddiW
.
guidProduct
;
lpddi
->
dwDevType
=
lpddiW
.
dwDevType
;
strcpy
(
lpddi
->
tszInstanceName
,
joystick_devices
[
id
].
name
);
strcpy
(
lpddi
->
tszProductName
,
joystick_devices
[
id
].
name
);
lpddi
->
guidFFDriver
=
lpddiW
.
guidFFDriver
;
lpddi
->
wUsagePage
=
lpddiW
.
wUsagePage
;
lpddi
->
wUsage
=
lpddiW
.
wUsage
;
}
static
HRESULT
joydev_enum_deviceA
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
int
fd
=
-
1
;
if
(
id
>=
find_joystick_devices
())
return
E_FAIL
;
if
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
{
WARN
(
"force feedback not supported
\n
"
);
return
S_FALSE
;
}
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_JOYSTICK
)
&&
(
version
>=
0x0300
&&
version
<
0x0800
))
||
(((
dwDevType
==
DI8DEVCLASS_GAMECTRL
)
||
(
dwDevType
==
DI8DEVTYPE_JOYSTICK
))
&&
(
version
>=
0x0800
)))
{
/* check whether we have a joystick */
if
((
fd
=
open
(
joystick_devices
[
id
].
device
,
O_RDONLY
))
==
-
1
)
{
WARN
(
"open(%s, O_RDONLY) failed: %s
\n
"
,
joystick_devices
[
id
].
device
,
strerror
(
errno
));
return
S_FALSE
;
}
fill_joystick_dideviceinstanceA
(
lpddi
,
version
,
id
);
close
(
fd
);
TRACE
(
"Enumerating the linux Joystick device: %s (%s)
\n
"
,
joystick_devices
[
id
].
device
,
joystick_devices
[
id
].
name
);
return
S_OK
;
}
return
S_FALSE
;
}
static
HRESULT
joydev_enum_deviceW
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
static
HRESULT
joydev_enum_device
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
{
int
fd
=
-
1
;
...
...
@@ -616,8 +564,7 @@ static HRESULT joydev_create_device( IDirectInputImpl *dinput, REFGUID rguid, ID
const
struct
dinput_device
joystick_linux_device
=
{
"Wine Linux joystick driver"
,
joydev_enum_deviceA
,
joydev_enum_deviceW
,
joydev_enum_device
,
joydev_create_device
};
...
...
@@ -877,7 +824,6 @@ const struct dinput_device joystick_linux_device = {
"Wine Linux joystick driver"
,
NULL
,
NULL
,
NULL
};
#endif
/* HAVE_LINUX_22_JOYSTICK_API */
dlls/dinput/joystick_linuxinput.c
View file @
d666aea3
...
...
@@ -371,55 +371,7 @@ static void fill_joystick_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD ver
MultiByteToWideChar
(
CP_ACP
,
0
,
joydevs
[
id
].
name
,
-
1
,
lpddi
->
tszProductName
,
MAX_PATH
);
}
static
void
fill_joystick_dideviceinstanceA
(
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
DIDEVICEINSTANCEW
lpddiW
;
DWORD
dwSize
=
lpddi
->
dwSize
;
lpddiW
.
dwSize
=
sizeof
(
lpddiW
);
fill_joystick_dideviceinstanceW
(
&
lpddiW
,
version
,
id
);
TRACE
(
"%d %p
\n
"
,
dwSize
,
lpddi
);
memset
(
lpddi
,
0
,
dwSize
);
/* Convert W->A */
lpddi
->
dwSize
=
dwSize
;
lpddi
->
guidInstance
=
lpddiW
.
guidInstance
;
lpddi
->
guidProduct
=
lpddiW
.
guidProduct
;
lpddi
->
dwDevType
=
lpddiW
.
dwDevType
;
lstrcpynA
(
lpddi
->
tszInstanceName
,
joydevs
[
id
].
name
,
MAX_PATH
);
lstrcpynA
(
lpddi
->
tszProductName
,
joydevs
[
id
].
name
,
MAX_PATH
);
lpddi
->
guidFFDriver
=
lpddiW
.
guidFFDriver
;
lpddi
->
wUsagePage
=
lpddiW
.
wUsagePage
;
lpddi
->
wUsage
=
lpddiW
.
wUsage
;
}
static
HRESULT
joydev_enum_deviceA
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
find_joydevs
();
if
(
id
>=
have_joydevs
)
{
return
E_FAIL
;
}
if
(
!
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_JOYSTICK
)
&&
(
version
>=
0x0300
&&
version
<
0x0800
))
||
(((
dwDevType
==
DI8DEVCLASS_GAMECTRL
)
||
(
dwDevType
==
DI8DEVTYPE_JOYSTICK
))
&&
(
version
>=
0x0800
))))
return
S_FALSE
;
#ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION
if
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
return
S_FALSE
;
#endif
if
(
!
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
||
joydevs
[
id
].
has_ff
)
{
fill_joystick_dideviceinstanceA
(
lpddi
,
version
,
id
);
return
S_OK
;
}
return
S_FALSE
;
}
static
HRESULT
joydev_enum_deviceW
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
static
HRESULT
joydev_enum_device
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
{
find_joydevs
();
...
...
@@ -640,8 +592,7 @@ static HRESULT joydev_create_device( IDirectInputImpl *dinput, REFGUID rguid, ID
const
struct
dinput_device
joystick_linuxinput_device
=
{
"Wine Linux-input joystick driver"
,
joydev_enum_deviceA
,
joydev_enum_deviceW
,
joydev_enum_device
,
joydev_create_device
};
...
...
@@ -1318,7 +1269,6 @@ const struct dinput_device joystick_linuxinput_device = {
"Wine Linux-input joystick driver"
,
NULL
,
NULL
,
NULL
};
#endif
/* HAS_PROPER_HEADER */
dlls/dinput/joystick_osx.c
View file @
d666aea3
...
...
@@ -984,53 +984,7 @@ static DWORD make_vid_pid(IOHIDDeviceRef device)
return
MAKELONG
(
vendID
,
prodID
);
}
static
HRESULT
joydev_enum_deviceA
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
IOHIDDeviceRef
device
;
BOOL
is_joystick
;
TRACE
(
"dwDevType %u dwFlags 0x%08x version 0x%04x id %d
\n
"
,
dwDevType
,
dwFlags
,
version
,
id
);
if
(
id
>=
find_joystick_devices
())
return
E_FAIL
;
device
=
get_device_ref
(
id
);
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_JOYSTICK
)
&&
(
version
>=
0x0300
&&
version
<
0x0800
))
||
(((
dwDevType
==
DI8DEVCLASS_GAMECTRL
)
||
(
dwDevType
==
DI8DEVTYPE_JOYSTICK
))
&&
(
version
>=
0x0800
)))
{
if
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
{
if
(
!
device
)
return
S_FALSE
;
if
(
get_ff
(
device
,
NULL
)
!=
S_OK
)
return
S_FALSE
;
}
is_joystick
=
get_device_property_long
(
device
,
CFSTR
(
kIOHIDDeviceUsageKey
))
==
kHIDUsage_GD_Joystick
;
/* Return joystick */
lpddi
->
guidInstance
=
DInput_Wine_OsX_Joystick_GUID
;
lpddi
->
guidInstance
.
Data3
=
id
;
lpddi
->
guidProduct
=
DInput_PIDVID_Product_GUID
;
lpddi
->
guidProduct
.
Data1
=
make_vid_pid
(
device
);
lpddi
->
dwDevType
=
get_device_type
(
version
,
is_joystick
);
lpddi
->
dwDevType
|=
DIDEVTYPE_HID
;
lpddi
->
wUsagePage
=
0x01
;
/* Desktop */
if
(
is_joystick
)
lpddi
->
wUsage
=
0x04
;
/* Joystick */
else
lpddi
->
wUsage
=
0x05
;
/* Game Pad */
sprintf
(
lpddi
->
tszInstanceName
,
"Joystick %d"
,
id
);
/* get the device name */
get_osx_device_name
(
id
,
lpddi
->
tszProductName
,
MAX_PATH
);
lpddi
->
guidFFDriver
=
GUID_NULL
;
return
S_OK
;
}
return
S_FALSE
;
}
static
HRESULT
joydev_enum_deviceW
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
static
HRESULT
joydev_enum_device
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
{
char
name
[
MAX_PATH
];
char
friendly
[
32
];
...
...
@@ -1522,8 +1476,7 @@ static HRESULT WINAPI JoystickWImpl_SendForceFeedbackCommand(IDirectInputDevice8
const
struct
dinput_device
joystick_osx_device
=
{
"Wine OS X joystick driver"
,
joydev_enum_deviceA
,
joydev_enum_deviceW
,
joydev_enum_device
,
joydev_create_device
};
...
...
@@ -1700,7 +1653,6 @@ const struct dinput_device joystick_osx_device = {
"Wine OS X joystick driver"
,
NULL
,
NULL
,
NULL
};
#endif
/* HAVE_IOHIDMANAGERCREATE */
dlls/dinput/keyboard.c
View file @
d666aea3
...
...
@@ -149,30 +149,6 @@ static DWORD get_keyboard_subtype(void)
return
dev_subtype
;
}
static
void
fill_keyboard_dideviceinstanceA
(
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
DWORD
subtype
)
{
DWORD
dwSize
;
DIDEVICEINSTANCEA
ddi
;
dwSize
=
lpddi
->
dwSize
;
TRACE
(
"%d %p
\n
"
,
dwSize
,
lpddi
);
memset
(
lpddi
,
0
,
dwSize
);
memset
(
&
ddi
,
0
,
sizeof
(
ddi
));
ddi
.
dwSize
=
dwSize
;
ddi
.
guidInstance
=
GUID_SysKeyboard
;
/* DInput's GUID */
ddi
.
guidProduct
=
GUID_SysKeyboard
;
if
(
version
>=
0x0800
)
ddi
.
dwDevType
=
DI8DEVTYPE_KEYBOARD
|
(
subtype
<<
8
);
else
ddi
.
dwDevType
=
DIDEVTYPE_KEYBOARD
|
(
subtype
<<
8
);
strcpy
(
ddi
.
tszInstanceName
,
"Keyboard"
);
strcpy
(
ddi
.
tszProductName
,
"Wine Keyboard"
);
memcpy
(
lpddi
,
&
ddi
,
(
dwSize
<
sizeof
(
ddi
)
?
dwSize
:
sizeof
(
ddi
)));
}
static
void
fill_keyboard_dideviceinstanceW
(
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
DWORD
subtype
)
{
DWORD
dwSize
;
DIDEVICEINSTANCEW
ddi
;
...
...
@@ -197,28 +173,7 @@ static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD ver
memcpy
(
lpddi
,
&
ddi
,
(
dwSize
<
sizeof
(
ddi
)
?
dwSize
:
sizeof
(
ddi
)));
}
static
HRESULT
keyboarddev_enum_deviceA
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
if
(
id
!=
0
)
return
E_FAIL
;
if
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
return
S_FALSE
;
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_KEYBOARD
)
&&
(
version
<
0x0800
))
||
(((
dwDevType
==
DI8DEVCLASS_KEYBOARD
)
||
(
dwDevType
==
DI8DEVTYPE_KEYBOARD
))
&&
(
version
>=
0x0800
)))
{
TRACE
(
"Enumerating the Keyboard device
\n
"
);
fill_keyboard_dideviceinstanceA
(
lpddi
,
version
,
get_keyboard_subtype
());
return
S_OK
;
}
return
S_FALSE
;
}
static
HRESULT
keyboarddev_enum_deviceW
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
static
HRESULT
keyboarddev_enum_device
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
{
if
(
id
!=
0
)
return
E_FAIL
;
...
...
@@ -306,8 +261,7 @@ static HRESULT keyboarddev_create_device( IDirectInputImpl *dinput, REFGUID rgui
const
struct
dinput_device
keyboard_device
=
{
"Wine keyboard driver"
,
keyboarddev_enum_deviceA
,
keyboarddev_enum_deviceW
,
keyboarddev_enum_device
,
keyboarddev_create_device
};
...
...
dlls/dinput/mouse.c
View file @
d666aea3
...
...
@@ -93,30 +93,6 @@ static void _dump_mouse_state(const DIMOUSESTATE2 *m_state)
TRACE
(
")
\n
"
);
}
static
void
fill_mouse_dideviceinstanceA
(
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
)
{
DWORD
dwSize
;
DIDEVICEINSTANCEA
ddi
;
dwSize
=
lpddi
->
dwSize
;
TRACE
(
"%d %p
\n
"
,
dwSize
,
lpddi
);
memset
(
lpddi
,
0
,
dwSize
);
memset
(
&
ddi
,
0
,
sizeof
(
ddi
));
ddi
.
dwSize
=
dwSize
;
ddi
.
guidInstance
=
GUID_SysMouse
;
/* DInput's GUID */
ddi
.
guidProduct
=
GUID_SysMouse
;
if
(
version
>=
0x0800
)
ddi
.
dwDevType
=
DI8DEVTYPE_MOUSE
|
(
DI8DEVTYPEMOUSE_TRADITIONAL
<<
8
);
else
ddi
.
dwDevType
=
DIDEVTYPE_MOUSE
|
(
DIDEVTYPEMOUSE_TRADITIONAL
<<
8
);
strcpy
(
ddi
.
tszInstanceName
,
"Mouse"
);
strcpy
(
ddi
.
tszProductName
,
"Wine Mouse"
);
memcpy
(
lpddi
,
&
ddi
,
(
dwSize
<
sizeof
(
ddi
)
?
dwSize
:
sizeof
(
ddi
)));
}
static
void
fill_mouse_dideviceinstanceW
(
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
)
{
DWORD
dwSize
;
DIDEVICEINSTANCEW
ddi
;
...
...
@@ -141,28 +117,7 @@ static void fill_mouse_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD versio
memcpy
(
lpddi
,
&
ddi
,
(
dwSize
<
sizeof
(
ddi
)
?
dwSize
:
sizeof
(
ddi
)));
}
static
HRESULT
mousedev_enum_deviceA
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
if
(
id
!=
0
)
return
E_FAIL
;
if
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
return
S_FALSE
;
if
((
dwDevType
==
0
)
||
((
dwDevType
==
DIDEVTYPE_MOUSE
)
&&
(
version
<
0x0800
))
||
(((
dwDevType
==
DI8DEVCLASS_POINTER
)
||
(
dwDevType
==
DI8DEVTYPE_MOUSE
))
&&
(
version
>=
0x0800
)))
{
TRACE
(
"Enumerating the mouse device
\n
"
);
fill_mouse_dideviceinstanceA
(
lpddi
,
version
);
return
S_OK
;
}
return
S_FALSE
;
}
static
HRESULT
mousedev_enum_deviceW
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
static
HRESULT
mousedev_enum_device
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
{
if
(
id
!=
0
)
return
E_FAIL
;
...
...
@@ -263,8 +218,7 @@ static HRESULT mousedev_create_device( IDirectInputImpl *dinput, REFGUID rguid,
const
struct
dinput_device
mouse_device
=
{
"Wine mouse driver"
,
mousedev_enum_deviceA
,
mousedev_enum_deviceW
,
mousedev_enum_device
,
mousedev_create_device
};
...
...
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