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
3d30db22
Commit
3d30db22
authored
Apr 07, 2015
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Add JoystickID to the Instance Name.
parent
915bef87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
joystick.c
dlls/dinput/joystick.c
+26
-2
No files found.
dlls/dinput/joystick.c
View file @
3d30db22
...
...
@@ -26,6 +26,8 @@
* force feedback
*/
#include <stdio.h>
#include "joystick_private.h"
#include "wine/debug.h"
#include "winreg.h"
...
...
@@ -608,6 +610,8 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo(
LPDIDEVICEINSTANCEA
pdidi
)
{
JoystickGenericImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIPROPDWORD
pd
;
DWORD
index
=
0
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pdidi
);
...
...
@@ -622,12 +626,20 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo(
return
DIERR_INVALIDPARAM
;
}
/* Try to get joystick index */
pd
.
diph
.
dwSize
=
sizeof
(
pd
);
pd
.
diph
.
dwHeaderSize
=
sizeof
(
pd
.
diph
);
pd
.
diph
.
dwObj
=
0
;
pd
.
diph
.
dwHow
=
DIPH_DEVICE
;
if
(
SUCCEEDED
(
IDirectInputDevice2_GetProperty
(
iface
,
DIPROP_JOYSTICKID
,
&
pd
.
diph
)))
index
=
pd
.
dwData
;
/* Return joystick */
pdidi
->
guidInstance
=
This
->
guidInstance
;
pdidi
->
guidProduct
=
This
->
guidProduct
;
/* we only support traditional joysticks for now */
pdidi
->
dwDevType
=
This
->
devcaps
.
dwDevType
;
s
trcpy
(
pdidi
->
tszInstanceName
,
"Joystick"
);
s
nprintf
(
pdidi
->
tszInstanceName
,
MAX_PATH
,
"Joystick %d"
,
index
);
strcpy
(
pdidi
->
tszProductName
,
This
->
name
);
if
(
pdidi
->
dwSize
>
sizeof
(
DIDEVICEINSTANCE_DX3A
))
{
pdidi
->
guidFFDriver
=
GUID_NULL
;
...
...
@@ -646,6 +658,9 @@ HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo(
LPDIDEVICEINSTANCEW
pdidi
)
{
JoystickGenericImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
CHAR
buffer
[
MAX_PATH
];
DIPROPDWORD
pd
;
DWORD
index
=
0
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pdidi
);
...
...
@@ -655,12 +670,21 @@ HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo(
return
DIERR_INVALIDPARAM
;
}
/* Try to get joystick index */
pd
.
diph
.
dwSize
=
sizeof
(
pd
);
pd
.
diph
.
dwHeaderSize
=
sizeof
(
pd
.
diph
);
pd
.
diph
.
dwObj
=
0
;
pd
.
diph
.
dwHow
=
DIPH_DEVICE
;
if
(
SUCCEEDED
(
IDirectInputDevice2_GetProperty
(
iface
,
DIPROP_JOYSTICKID
,
&
pd
.
diph
)))
index
=
pd
.
dwData
;
/* Return joystick */
pdidi
->
guidInstance
=
This
->
guidInstance
;
pdidi
->
guidProduct
=
This
->
guidProduct
;
/* we only support traditional joysticks for now */
pdidi
->
dwDevType
=
This
->
devcaps
.
dwDevType
;
MultiByteToWideChar
(
CP_ACP
,
0
,
"Joystick"
,
-
1
,
pdidi
->
tszInstanceName
,
MAX_PATH
);
snprintf
(
buffer
,
sizeof
(
buffer
),
"Joystick %d"
,
index
);
MultiByteToWideChar
(
CP_ACP
,
0
,
buffer
,
-
1
,
pdidi
->
tszInstanceName
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
This
->
name
,
-
1
,
pdidi
->
tszProductName
,
MAX_PATH
);
if
(
pdidi
->
dwSize
>
sizeof
(
DIDEVICEINSTANCE_DX3W
))
{
pdidi
->
guidFFDriver
=
GUID_NULL
;
...
...
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