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
8c257d0c
Commit
8c257d0c
authored
Oct 26, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Canonicalize code style of IDirectInputWImpl_EnumDevices.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2c95bb37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
75 deletions
+20
-75
dinput_main.c
dlls/dinput/dinput_main.c
+20
-75
No files found.
dlls/dinput/dinput_main.c
View file @
8c257d0c
...
...
@@ -270,58 +270,6 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInputCreateW(HINSTANCE hinst, DWORD dwVer
return
DirectInputCreateEx
(
hinst
,
dwVersion
,
&
IID_IDirectInput7W
,
(
LPVOID
*
)
ppDI
,
punkOuter
);
}
static
const
char
*
_dump_DIDEVTYPE_value
(
DWORD
dwDevType
,
DWORD
dwVersion
)
{
if
(
dwVersion
<
0x0800
)
{
switch
(
dwDevType
)
{
case
0
:
return
"All devices"
;
case
DIDEVTYPE_MOUSE
:
return
"DIDEVTYPE_MOUSE"
;
case
DIDEVTYPE_KEYBOARD
:
return
"DIDEVTYPE_KEYBOARD"
;
case
DIDEVTYPE_JOYSTICK
:
return
"DIDEVTYPE_JOYSTICK"
;
case
DIDEVTYPE_DEVICE
:
return
"DIDEVTYPE_DEVICE"
;
default:
return
"Unknown"
;
}
}
else
{
switch
(
dwDevType
)
{
case
DI8DEVCLASS_ALL
:
return
"All devices"
;
case
DI8DEVCLASS_POINTER
:
return
"DI8DEVCLASS_POINTER"
;
case
DI8DEVCLASS_KEYBOARD
:
return
"DI8DEVCLASS_KEYBOARD"
;
case
DI8DEVCLASS_DEVICE
:
return
"DI8DEVCLASS_DEVICE"
;
case
DI8DEVCLASS_GAMECTRL
:
return
"DI8DEVCLASS_GAMECTRL"
;
default:
return
"Unknown"
;
}
}
}
static
void
_dump_EnumDevices_dwFlags
(
DWORD
dwFlags
)
{
if
(
TRACE_ON
(
dinput
))
{
unsigned
int
i
;
static
const
struct
{
DWORD
mask
;
const
char
*
name
;
}
flags
[]
=
{
#define FE(x) { x, #x}
FE
(
DIEDFL_ALLDEVICES
),
FE
(
DIEDFL_ATTACHEDONLY
),
FE
(
DIEDFL_FORCEFEEDBACK
),
FE
(
DIEDFL_INCLUDEALIASES
),
FE
(
DIEDFL_INCLUDEPHANTOMS
),
FE
(
DIEDFL_INCLUDEHIDDEN
)
#undef FE
};
TRACE
(
" flags: "
);
if
(
dwFlags
==
0
)
{
TRACE
(
"DIEDFL_ALLDEVICES
\n
"
);
return
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
flags
);
i
++
)
if
(
flags
[
i
].
mask
&
dwFlags
)
TRACE
(
"%s "
,
flags
[
i
].
name
);
}
TRACE
(
"
\n
"
);
}
static
DWORD
diactionformat_priorityW
(
LPDIACTIONFORMATW
lpdiaf
,
DWORD
genre
)
{
int
i
;
...
...
@@ -371,38 +319,35 @@ __ASM_GLOBAL_FUNC( enum_callback_wrapper,
/******************************************************************************
* IDirectInputW_EnumDevices
*/
static
HRESULT
WINAPI
IDirectInputWImpl_EnumDevices
(
LPDIRECTINPUT7W
iface
,
DWORD
dwDevType
,
LPDIENUMDEVICESCALLBACKW
lpCallback
,
LPVOID
pvRef
,
DWORD
dwFlags
)
static
HRESULT
WINAPI
IDirectInputWImpl_EnumDevices
(
IDirectInput7W
*
iface
,
DWORD
type
,
LPDIENUMDEVICESCALLBACKW
callback
,
void
*
context
,
DWORD
flags
)
{
IDirectInputImpl
*
This
=
impl_from_IDirectInput7W
(
iface
);
DIDEVICEINSTANCEW
devInstance
;
unsigned
int
i
;
int
j
;
HRESULT
r
;
DIDEVICEINSTANCEW
instance
=
{.
dwSize
=
sizeof
(
DIDEVICEINSTANCEW
)};
IDirectInputImpl
*
impl
=
impl_from_IDirectInput7W
(
iface
);
unsigned
int
i
,
j
;
HRESULT
hr
;
TRACE
(
"(this=%p,0x%04x '%s',%p,%p,0x%04x)
\n
"
,
This
,
dwDevType
,
_dump_DIDEVTYPE_value
(
dwDevType
,
This
->
dwVersion
),
lpCallback
,
pvRef
,
dwFlags
);
_dump_EnumDevices_dwFlags
(
dwFlags
);
TRACE
(
"iface %p, type %#x, callback %p, context %p, flags %#x
\n
"
,
iface
,
type
,
callback
,
context
,
flags
);
if
(
!
lpCallback
||
dwFlags
&
~
(
DIEDFL_ATTACHEDONLY
|
DIEDFL_FORCEFEEDBACK
|
DIEDFL_INCLUDEALIASES
|
DIEDFL_INCLUDEPHANTOMS
|
DIEDFL_INCLUDEHIDDEN
)
||
(
dwDevType
>
DI8DEVCLASS_GAMECTRL
&&
dwDevType
<
DI8DEVTYPE_DEVICE
)
||
dwDevType
>
DI8DEVTYPE_SUPPLEMENTAL
)
if
(
!
callback
)
return
DIERR_INVALIDPARAM
;
if
((
type
>
DI8DEVCLASS_GAMECTRL
&&
type
<
DI8DEVTYPE_DEVICE
)
||
type
>
DI8DEVTYPE_SUPPLEMENTAL
)
return
DIERR_INVALIDPARAM
;
if
(
flags
&
~
(
DIEDFL_ATTACHEDONLY
|
DIEDFL_FORCEFEEDBACK
|
DIEDFL_INCLUDEALIASES
|
DIEDFL_INCLUDEPHANTOMS
|
DIEDFL_INCLUDEHIDDEN
))
return
DIERR_INVALIDPARAM
;
if
(
!
This
->
initialized
)
if
(
!
impl
->
initialized
)
return
DIERR_NOTINITIALIZED
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dinput_devices
);
i
++
)
{
if
(
!
dinput_devices
[
i
]
->
enum_device
)
continue
;
for
(
j
=
0
,
r
=
S_OK
;
SUCCEEDED
(
r
);
j
++
)
{
devInstance
.
dwSize
=
sizeof
(
devInstance
);
for
(
j
=
0
,
hr
=
S_OK
;
SUCCEEDED
(
hr
);
j
++
)
{
TRACE
(
" - checking device %u ('%s')
\n
"
,
i
,
dinput_devices
[
i
]
->
name
);
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
;
hr
=
dinput_devices
[
i
]
->
enum_device
(
type
,
flags
,
&
instance
,
impl
->
dwVersion
,
j
);
if
(
hr
!=
S_OK
)
continue
;
if
(
enum_callback_wrapper
(
callback
,
&
instance
,
context
)
==
DIENUM_STOP
)
return
S_OK
;
}
}
...
...
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