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
0f17c828
Commit
0f17c828
authored
Jun 28, 2011
by
Lucas Fialho Zawacki
Committed by
Alexandre Julliard
Jun 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: EnumDevicesBySemantics enumerating keyboard and mouse with priority flags.
parent
3ed476ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
10 deletions
+76
-10
dinput_main.c
dlls/dinput/dinput_main.c
+68
-5
dinput_private.h
dlls/dinput/dinput_private.h
+3
-0
device.c
dlls/dinput8/tests/device.c
+5
-5
No files found.
dlls/dinput/dinput_main.c
View file @
0f17c828
...
...
@@ -681,8 +681,13 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
)
{
IDirectInputImpl
*
This
=
impl_from_IDirectInput8A
(
iface
);
DIDEVICEINSTANCEA
didevi
;
LPDIRECTINPUTDEVICE8A
lpdid
;
BOOL
ret
;
DWORD
callbackFlags
=
0
;
int
i
;
FIXME
(
"(this=%p,%s,%p,%p,%p,%04x): stub
\n
"
,
This
,
ptszUserName
,
lpdiActionFormat
,
FIXME
(
"(this=%p,%s,%p,%p,%p,%04x): s
emi-s
tub
\n
"
,
This
,
ptszUserName
,
lpdiActionFormat
,
lpCallback
,
pvRef
,
dwFlags
);
#define X(x) if (dwFlags & x) FIXME("\tdwFlags |= "#x"\n");
X
(
DIEDBSFL_ATTACHEDONLY
)
...
...
@@ -695,6 +700,32 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
_dump_diactionformatA
(
lpdiActionFormat
);
didevi
.
dwSize
=
sizeof
(
didevi
);
/* enum the keyboard first */
IDirectInput_CreateDevice
(
iface
,
&
GUID_SysKeyboard
,
&
lpdid
,
NULL
);
IDirectInputDevice_GetDeviceInfo
(
lpdid
,
&
didevi
);
/* if there's any DIKEYBOARD action, keyboard is priority 1*/
for
(
i
=
0
;
i
<
lpdiActionFormat
->
dwActionSize
;
i
++
)
if
((
lpdiActionFormat
->
rgoAction
[
i
].
dwSemantic
&
DIKEYBOARD_MASK
)
==
DIKEYBOARD_MASK
)
callbackFlags
|=
DIEDBS_MAPPEDPRI1
;
ret
=
lpCallback
(
&
didevi
,
lpdid
,
callbackFlags
,
1
,
pvRef
);
if
(
ret
==
DIENUM_STOP
)
return
DI_OK
;
callbackFlags
=
0
;
/* and then the mouse */
IDirectInput_CreateDevice
(
iface
,
&
GUID_SysMouse
,
&
lpdid
,
NULL
);
IDirectInputDevice_GetDeviceInfo
(
lpdid
,
&
didevi
);
/* same as above, but for the mouse */
for
(
i
=
0
;
i
<
lpdiActionFormat
->
dwActionSize
;
i
++
)
if
((
lpdiActionFormat
->
rgoAction
[
i
].
dwSemantic
&
DIMOUSE_MASK
)
==
DIMOUSE_MASK
)
callbackFlags
|=
DIEDBS_MAPPEDPRI1
;
lpCallback
(
&
didevi
,
lpdid
,
callbackFlags
,
0
,
pvRef
);
return
DI_OK
;
}
...
...
@@ -704,11 +735,43 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
LPVOID
pvRef
,
DWORD
dwFlags
)
{
IDirectInputImpl
*
This
=
impl_from_IDirectInput8W
(
iface
);
IDirectInputImpl
*
This
=
impl_from_IDirectInput8W
(
iface
);
DIDEVICEINSTANCEW
didevi
;
LPDIRECTINPUTDEVICE8W
lpdid
;
BOOL
ret
;
DWORD
callbackFlags
=
0
;
int
i
;
FIXME
(
"(this=%p,%s,%p,%p,%p,%04x): stub
\n
"
,
This
,
debugstr_w
(
ptszUserName
),
lpdiActionFormat
,
lpCallback
,
pvRef
,
dwFlags
);
return
0
;
FIXME
(
"(this=%p,%s,%p,%p,%p,%04x): semi-stub
\n
"
,
This
,
debugstr_w
(
ptszUserName
),
lpdiActionFormat
,
lpCallback
,
pvRef
,
dwFlags
);
didevi
.
dwSize
=
sizeof
(
didevi
);
/* enum the keyboard first */
IDirectInput_CreateDevice
(
iface
,
&
GUID_SysKeyboard
,
&
lpdid
,
NULL
);
IDirectInputDevice_GetDeviceInfo
(
lpdid
,
&
didevi
);
/* if there's any DIKEYBOARD action, keyboard is priority 1*/
for
(
i
=
0
;
i
<
lpdiActionFormat
->
dwActionSize
;
i
++
)
if
((
lpdiActionFormat
->
rgoAction
[
i
].
dwSemantic
&
DIKEYBOARD_MASK
)
==
DIKEYBOARD_MASK
)
callbackFlags
|=
DIEDBS_MAPPEDPRI1
;
ret
=
lpCallback
(
&
didevi
,
lpdid
,
callbackFlags
,
1
,
pvRef
);
if
(
ret
==
DIENUM_STOP
)
return
DI_OK
;
callbackFlags
=
0
;
/* and then the mouse */
IDirectInput_CreateDevice
(
iface
,
&
GUID_SysMouse
,
&
lpdid
,
NULL
);
IDirectInputDevice_GetDeviceInfo
(
lpdid
,
&
didevi
);
/* same as above, but for the mouse */
for
(
i
=
0
;
i
<
lpdiActionFormat
->
dwActionSize
;
i
++
)
if
((
lpdiActionFormat
->
rgoAction
[
i
].
dwSemantic
&
DIMOUSE_MASK
)
==
DIMOUSE_MASK
)
callbackFlags
|=
DIEDBS_MAPPEDPRI1
;
lpCallback
(
&
didevi
,
lpdid
,
callbackFlags
,
0
,
pvRef
);
return
DI_OK
;
}
static
HRESULT
WINAPI
IDirectInput8AImpl_ConfigureDevices
(
...
...
dlls/dinput/dinput_private.h
View file @
0f17c828
...
...
@@ -66,4 +66,7 @@ extern void _dump_diactionformatA(LPDIACTIONFORMATA) DECLSPEC_HIDDEN;
#define IS_DIPROP(x) (((ULONG_PTR)(x) >> 16) == 0)
#define DIKEYBOARD_MASK 0x81000000
#define DIMOUSE_MASK 0x82000000
#endif
/* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */
dlls/dinput8/tests/device.c
View file @
0f17c828
...
...
@@ -68,7 +68,7 @@ static BOOL CALLBACK enumeration_callback(
IDirectInputDevice_AddRef
(
lpdid
);
data
->
keyboard
=
lpdid
;
todo_wine
ok
(
dwFlags
&
DIEDBS_MAPPEDPRI1
,
"Keyboard should be mapped as pri1 dwFlags=%08x
\n
"
,
dwFlags
);
ok
(
dwFlags
&
DIEDBS_MAPPEDPRI1
,
"Keyboard should be mapped as pri1 dwFlags=%08x
\n
"
,
dwFlags
);
}
if
(
IsEqualGUID
(
&
lpddi
->
guidInstance
,
&
GUID_SysMouse
))
...
...
@@ -76,7 +76,7 @@ static BOOL CALLBACK enumeration_callback(
IDirectInputDevice_AddRef
(
lpdid
);
data
->
mouse
=
lpdid
;
todo_wine
ok
(
dwFlags
&
DIEDBS_MAPPEDPRI1
,
"Mouse should be mapped as pri1 dwFlags=%08x
\n
"
,
dwFlags
);
ok
(
dwFlags
&
DIEDBS_MAPPEDPRI1
,
"Mouse should be mapped as pri1 dwFlags=%08x
\n
"
,
dwFlags
);
}
return
DIENUM_CONTINUE
;
...
...
@@ -122,9 +122,9 @@ static void test_action_mapping(void)
hr
=
IDirectInput8_EnumDevicesBySemantics
(
pDI
,
0
,
&
af
,
enumeration_callback
,
&
data
,
0
);
ok
(
SUCCEEDED
(
hr
),
"EnumDevicesBySemantics failed: hr=%08x
\n
"
,
hr
);
todo_wine
ok
(
data
.
ndevices
>
0
,
"EnumDevicesBySemantics did not call the callback hr=%08x
\n
"
,
hr
);
todo_wine
ok
(
data
.
keyboard
!=
NULL
,
"EnumDevicesBySemantics should enumerate the keyboard
\n
"
);
todo_wine
ok
(
data
.
mouse
!=
NULL
,
"EnumDevicesBySemantics should enumerate the mouse
\n
"
);
ok
(
data
.
ndevices
>
0
,
"EnumDevicesBySemantics did not call the callback hr=%08x
\n
"
,
hr
);
ok
(
data
.
keyboard
!=
NULL
,
"EnumDevicesBySemantics should enumerate the keyboard
\n
"
);
ok
(
data
.
mouse
!=
NULL
,
"EnumDevicesBySemantics should enumerate the mouse
\n
"
);
/* The call fails with a zeroed GUID */
memset
(
&
af
.
guidActionMap
,
0
,
sizeof
(
GUID
));
...
...
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