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
5fa86231
Commit
5fa86231
authored
Mar 10, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.gaming.input: Return object counts and VID/PID for RawGameController.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e9b83a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
14 deletions
+80
-14
controller.c
dlls/windows.gaming.input/controller.c
+17
-10
provider.c
dlls/windows.gaming.input/provider.c
+60
-4
provider.idl
dlls/windows.gaming.input/provider.idl
+3
-0
No files found.
dlls/windows.gaming.input/controller.c
View file @
5fa86231
...
...
@@ -65,6 +65,7 @@ struct controller
LONG
ref
;
IGameControllerProvider
*
provider
;
IWineGameControllerProvider
*
wine_provider
;
};
static
inline
struct
controller
*
impl_from_IGameControllerImpl
(
IGameControllerImpl
*
iface
)
...
...
@@ -120,6 +121,8 @@ static ULONG WINAPI controller_Release( IGameControllerImpl *iface )
if
(
!
ref
)
{
if
(
impl
->
wine_provider
)
IWineGameControllerProvider_Release
(
impl
->
wine_provider
);
IGameControllerProvider_Release
(
impl
->
provider
);
free
(
impl
);
}
...
...
@@ -157,6 +160,10 @@ static HRESULT WINAPI controller_Initialize( IGameControllerImpl *iface, IGameCo
impl
->
IGameController_outer
=
outer
;
IGameControllerProvider_AddRef
(
(
impl
->
provider
=
provider
)
);
hr
=
IGameControllerProvider_QueryInterface
(
provider
,
&
IID_IWineGameControllerProvider
,
(
void
**
)
&
impl
->
wine_provider
);
if
(
FAILED
(
hr
))
return
hr
;
EnterCriticalSection
(
&
controller_cs
);
if
(
SUCCEEDED
(
hr
=
init_controllers
()))
hr
=
IVector_RawGameController_Append
(
controllers
,
&
impl
->
IRawGameController_iface
);
...
...
@@ -210,14 +217,14 @@ DEFINE_IINSPECTABLE_OUTER( raw_controller, IRawGameController, struct controller
static
HRESULT
WINAPI
raw_controller_get_AxisCount
(
IRawGameController
*
iface
,
INT32
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
valu
e
);
return
E_NOTIMPL
;
struct
controller
*
impl
=
impl_from_IRawGameController
(
ifac
e
);
return
IWineGameControllerProvider_get_AxisCount
(
impl
->
wine_provider
,
value
)
;
}
static
HRESULT
WINAPI
raw_controller_get_ButtonCount
(
IRawGameController
*
iface
,
INT32
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
valu
e
);
return
E_NOTIMPL
;
struct
controller
*
impl
=
impl_from_IRawGameController
(
ifac
e
);
return
IWineGameControllerProvider_get_ButtonCount
(
impl
->
wine_provider
,
value
)
;
}
static
HRESULT
WINAPI
raw_controller_get_ForceFeedbackMotors
(
IRawGameController
*
iface
,
IVectorView_ForceFeedbackMotor
**
value
)
...
...
@@ -228,20 +235,20 @@ static HRESULT WINAPI raw_controller_get_ForceFeedbackMotors( IRawGameController
static
HRESULT
WINAPI
raw_controller_get_HardwareProductId
(
IRawGameController
*
iface
,
UINT16
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
valu
e
);
return
E_NOTIMPL
;
struct
controller
*
impl
=
impl_from_IRawGameController
(
ifac
e
);
return
IGameControllerProvider_get_HardwareProductId
(
impl
->
provider
,
value
)
;
}
static
HRESULT
WINAPI
raw_controller_get_HardwareVendorId
(
IRawGameController
*
iface
,
UINT16
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
valu
e
);
return
E_NOTIMPL
;
struct
controller
*
impl
=
impl_from_IRawGameController
(
ifac
e
);
return
IGameControllerProvider_get_HardwareVendorId
(
impl
->
provider
,
value
)
;
}
static
HRESULT
WINAPI
raw_controller_get_SwitchCount
(
IRawGameController
*
iface
,
INT32
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
valu
e
);
return
E_NOTIMPL
;
struct
controller
*
impl
=
impl_from_IRawGameController
(
ifac
e
);
return
IWineGameControllerProvider_get_SwitchCount
(
impl
->
wine_provider
,
value
)
;
}
static
HRESULT
WINAPI
raw_controller_GetButtonLabel
(
IRawGameController
*
iface
,
INT32
index
,
...
...
dlls/windows.gaming.input/provider.c
View file @
5fa86231
...
...
@@ -143,6 +143,45 @@ static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface
return
S_OK
;
}
static
HRESULT
WINAPI
wine_provider_get_AxisCount
(
IWineGameControllerProvider
*
iface
,
INT32
*
value
)
{
struct
provider
*
impl
=
impl_from_IWineGameControllerProvider
(
iface
);
DIDEVCAPS
caps
=
{.
dwSize
=
sizeof
(
DIDEVCAPS
)};
HRESULT
hr
;
TRACE
(
"iface %p, value %p.
\n
"
,
iface
,
value
);
if
(
SUCCEEDED
(
hr
=
IDirectInputDevice8_GetCapabilities
(
impl
->
dinput_device
,
&
caps
)))
*
value
=
caps
.
dwAxes
;
return
hr
;
}
static
HRESULT
WINAPI
wine_provider_get_ButtonCount
(
IWineGameControllerProvider
*
iface
,
INT32
*
value
)
{
struct
provider
*
impl
=
impl_from_IWineGameControllerProvider
(
iface
);
DIDEVCAPS
caps
=
{.
dwSize
=
sizeof
(
DIDEVCAPS
)};
HRESULT
hr
;
TRACE
(
"iface %p, value %p.
\n
"
,
iface
,
value
);
if
(
SUCCEEDED
(
hr
=
IDirectInputDevice8_GetCapabilities
(
impl
->
dinput_device
,
&
caps
)))
*
value
=
caps
.
dwButtons
;
return
hr
;
}
static
HRESULT
WINAPI
wine_provider_get_SwitchCount
(
IWineGameControllerProvider
*
iface
,
INT32
*
value
)
{
struct
provider
*
impl
=
impl_from_IWineGameControllerProvider
(
iface
);
DIDEVCAPS
caps
=
{.
dwSize
=
sizeof
(
DIDEVCAPS
)};
HRESULT
hr
;
TRACE
(
"iface %p, value %p.
\n
"
,
iface
,
value
);
if
(
SUCCEEDED
(
hr
=
IDirectInputDevice8_GetCapabilities
(
impl
->
dinput_device
,
&
caps
)))
*
value
=
caps
.
dwPOVs
;
return
hr
;
}
static
const
struct
IWineGameControllerProviderVtbl
wine_provider_vtbl
=
{
wine_provider_QueryInterface
,
...
...
@@ -154,6 +193,9 @@ static const struct IWineGameControllerProviderVtbl wine_provider_vtbl =
wine_provider_GetTrustLevel
,
/* IWineGameControllerProvider methods */
wine_provider_get_Type
,
wine_provider_get_AxisCount
,
wine_provider_get_ButtonCount
,
wine_provider_get_SwitchCount
,
};
DEFINE_IINSPECTABLE
(
game_provider
,
IGameControllerProvider
,
struct
provider
,
IWineGameControllerProvider_iface
)
...
...
@@ -166,14 +208,28 @@ static HRESULT WINAPI game_provider_get_FirmwareVersionInfo( IGameControllerProv
static
HRESULT
WINAPI
game_provider_get_HardwareProductId
(
IGameControllerProvider
*
iface
,
UINT16
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
DIPROPDWORD
vid_pid
=
{.
diph
=
{.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
),
.
dwSize
=
sizeof
(
DIPROPDWORD
)}};
struct
provider
*
impl
=
impl_from_IGameControllerProvider
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, value %p.
\n
"
,
iface
,
value
);
if
(
SUCCEEDED
(
hr
=
IDirectInputDevice8_GetProperty
(
impl
->
dinput_device
,
DIPROP_VIDPID
,
&
vid_pid
.
diph
)))
*
value
=
HIWORD
(
vid_pid
.
dwData
);
return
hr
;
}
static
HRESULT
WINAPI
game_provider_get_HardwareVendorId
(
IGameControllerProvider
*
iface
,
UINT16
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
DIPROPDWORD
vid_pid
=
{.
diph
=
{.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
),
.
dwSize
=
sizeof
(
DIPROPDWORD
)}};
struct
provider
*
impl
=
impl_from_IGameControllerProvider
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, value %p.
\n
"
,
iface
,
value
);
if
(
SUCCEEDED
(
hr
=
IDirectInputDevice8_GetProperty
(
impl
->
dinput_device
,
DIPROP_VIDPID
,
&
vid_pid
.
diph
)))
*
value
=
LOWORD
(
vid_pid
.
dwData
);
return
hr
;
}
static
HRESULT
WINAPI
game_provider_get_HardwareVersionInfo
(
IGameControllerProvider
*
iface
,
GameControllerVersionInfo
*
value
)
...
...
dlls/windows.gaming.input/provider.idl
View file @
5fa86231
...
...
@@ -59,6 +59,9 @@ namespace Windows.Gaming.Input.Custom {
requires
Windows
.
Gaming.Input.Custom.IGameControllerProvider
{
[
propget
]
HRESULT
Type
(
[
out
,
retval
]
WineGameControllerType
*
value
)
;
[
propget
]
HRESULT
AxisCount
(
[
out
,
retval
]
INT32
*
value
)
;
[
propget
]
HRESULT
ButtonCount
(
[
out
,
retval
]
INT32
*
value
)
;
[
propget
]
HRESULT
SwitchCount
(
[
out
,
retval
]
INT32
*
value
)
;
}
[
...
...
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