Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d45a2a14
Commit
d45a2a14
authored
Mar 08, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.gaming.input: Implement IRawGameControllerStatics_FromGameController.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
09cb88e9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
10 deletions
+42
-10
controller.c
dlls/windows.gaming.input/controller.c
+14
-2
main.c
dlls/windows.gaming.input/main.c
+3
-4
manager.c
dlls/windows.gaming.input/manager.c
+24
-3
private.h
dlls/windows.gaming.input/private.h
+1
-1
No files found.
dlls/windows.gaming.input/controller.c
View file @
d45a2a14
...
...
@@ -174,8 +174,20 @@ static HRESULT WINAPI statics_get_RawGameControllers( IRawGameControllerStatics
static
HRESULT
WINAPI
statics_FromGameController
(
IRawGameControllerStatics
*
iface
,
IGameController
*
game_controller
,
IRawGameController
**
value
)
{
FIXME
(
"iface %p, game_controller %p, value %p stub!
\n
"
,
iface
,
game_controller
,
value
);
return
E_NOTIMPL
;
struct
controller_statics
*
impl
=
impl_from_IRawGameControllerStatics
(
iface
);
IGameController
*
controller
;
HRESULT
hr
;
TRACE
(
"iface %p, game_controller %p, value %p.
\n
"
,
iface
,
game_controller
,
value
);
hr
=
IGameControllerFactoryManagerStatics2_TryGetFactoryControllerFromGameController
(
manager_factory
,
&
impl
->
ICustomGameControllerFactory_iface
,
game_controller
,
&
controller
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IGameController_QueryInterface
(
controller
,
&
IID_IRawGameController
,
(
void
**
)
value
);
IGameController_Release
(
controller
);
return
hr
;
}
static
const
struct
IRawGameControllerStaticsVtbl
statics_vtbl
=
...
...
dlls/windows.gaming.input/main.c
View file @
d45a2a14
...
...
@@ -169,7 +169,7 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING class_str, IActivationFactory **
{
static
INIT_ONCE
init_once
=
INIT_ONCE_STATIC_INIT
;
const
WCHAR
*
buffer
=
WindowsGetStringRawBuffer
(
class_str
,
NULL
);
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
REGDB_E_CLASSNOTREG
;
TRACE
(
"class %s, factory %p.
\n
"
,
debugstr_w
(
buffer
),
factory
);
...
...
@@ -182,10 +182,9 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING class_str, IActivationFactory **
if
(
!
wcscmp
(
buffer
,
RuntimeClass_Windows_Gaming_Input_Gamepad
))
hr
=
ICustomGameControllerFactory_QueryInterface
(
gamepad_factory
,
&
IID_IActivationFactory
,
(
void
**
)
factory
);
if
(
!
wcscmp
(
buffer
,
RuntimeClass_Windows_Gaming_Input_Custom_GameControllerFactoryManager
))
IActivationFactory_AddRef
(
(
*
factory
=
manager_factory
)
);
hr
=
IGameControllerFactoryManagerStatics2_QueryInterface
(
manager_factory
,
&
IID_IActivationFactory
,
(
void
**
)
factory
);
if
(
SUCCEEDED
(
hr
)
&&
*
factory
)
return
S_OK
;
return
REGDB_E_CLASSNOTREG
;
return
hr
;
}
BOOL
WINAPI
DllMain
(
HINSTANCE
instance
,
DWORD
reason
,
void
*
reserved
)
...
...
dlls/windows.gaming.input/manager.c
View file @
d45a2a14
...
...
@@ -370,8 +370,29 @@ statics2_TryGetFactoryControllerFromGameController( IGameControllerFactoryManage
ICustomGameControllerFactory
*
factory
,
IGameController
*
controller
,
IGameController
**
value
)
{
FIXME
(
"iface %p, factory %p, controller %p, value %p stub!
\n
"
,
iface
,
factory
,
controller
,
value
);
return
E_NOTIMPL
;
struct
controller
*
entry
,
*
other
;
BOOL
found
=
FALSE
;
TRACE
(
"iface %p, factory %p, controller %p, value %p.
\n
"
,
iface
,
factory
,
controller
,
value
);
EnterCriticalSection
(
&
manager_cs
);
LIST_FOR_EACH_ENTRY
(
entry
,
&
controller_list
,
struct
controller
,
entry
)
if
((
found
=
&
entry
->
IGameController_iface
==
controller
))
break
;
if
(
!
found
)
WARN
(
"Failed to find controller %p
\n
"
,
controller
);
else
{
LIST_FOR_EACH_ENTRY
(
other
,
&
controller_list
,
struct
controller
,
entry
)
if
((
found
=
entry
->
provider
==
other
->
provider
&&
other
->
factory
==
factory
))
break
;
if
(
!
found
)
WARN
(
"Failed to find controller %p, factory %p
\n
"
,
controller
,
factory
);
else
IGameController_AddRef
(
(
*
value
=
&
other
->
IGameController_iface
)
);
}
LeaveCriticalSection
(
&
manager_cs
);
if
(
!
found
)
return
E_FAIL
;
return
S_OK
;
}
static
const
struct
IGameControllerFactoryManagerStatics2Vtbl
statics2_vtbl
=
...
...
@@ -395,7 +416,7 @@ static struct manager_statics manager_statics =
1
,
};
I
ActivationFactory
*
manager_factory
=
&
manager_statics
.
IActivationFactory
_iface
;
I
GameControllerFactoryManagerStatics2
*
manager_factory
=
&
manager_statics
.
IGameControllerFactoryManagerStatics2
_iface
;
static
HRESULT
controller_create
(
ICustomGameControllerFactory
*
factory
,
IGameControllerProvider
*
provider
,
struct
controller
**
out
)
...
...
dlls/windows.gaming.input/private.h
View file @
d45a2a14
...
...
@@ -39,7 +39,7 @@
extern
HINSTANCE
windows_gaming_input
;
extern
ICustomGameControllerFactory
*
controller_factory
;
extern
ICustomGameControllerFactory
*
gamepad_factory
;
extern
I
ActivationFactory
*
manager_factory
;
extern
I
GameControllerFactoryManagerStatics2
*
manager_factory
;
extern
HRESULT
vector_create
(
REFIID
iid
,
REFIID
view_iid
,
void
**
out
);
...
...
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