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
2fe9f14b
Commit
2fe9f14b
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: SetActionMap setting the device buffer.
parent
636cc9ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
6 deletions
+87
-6
device.c
dlls/dinput/device.c
+30
-5
dinput_main.c
dlls/dinput/dinput_main.c
+54
-0
dinput_private.h
dlls/dinput/dinput_private.h
+2
-0
device.c
dlls/dinput8/tests/device.c
+1
-1
No files found.
dlls/dinput/device.c
View file @
2fe9f14b
...
...
@@ -1391,9 +1391,20 @@ HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface
LPCSTR
lpszUserName
,
DWORD
dwFlags
)
{
FIXME
(
"(%p)->(%p,%s,%08x): stub !
\n
"
,
iface
,
lpdiaf
,
lpszUserName
,
dwFlags
);
return
DI_OK
;
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIACTIONFORMATW
diafW
;
HRESULT
hr
;
FIXME
(
"(%p)->(%p,%s,%08x): semi-stub !
\n
"
,
iface
,
lpdiaf
,
lpszUserName
,
dwFlags
);
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
hr
=
IDirectInputDevice8WImpl_SetActionMap
(
&
This
->
IDirectInputDevice8W_iface
,
&
diafW
,
NULL
,
dwFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
return
hr
;
}
HRESULT
WINAPI
IDirectInputDevice8WImpl_SetActionMap
(
LPDIRECTINPUTDEVICE8W
iface
,
...
...
@@ -1401,8 +1412,22 @@ HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
LPCWSTR
lpszUserName
,
DWORD
dwFlags
)
{
FIXME
(
"(%p)->(%p,%s,%08x): stub !
\n
"
,
iface
,
lpdiaf
,
debugstr_w
(
lpszUserName
),
dwFlags
);
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
DIPROPDWORD
dp
;
FIXME
(
"(%p)->(%p,%s,%08x): semi-stub !
\n
"
,
iface
,
lpdiaf
,
debugstr_w
(
lpszUserName
),
dwFlags
);
if
(
This
->
acquired
)
return
DIERR_ACQUIRED
;
if
(
lpdiaf
->
dwBufferSize
>
0
)
{
dp
.
diph
.
dwSize
=
sizeof
(
DIPROPDWORD
);
dp
.
dwData
=
lpdiaf
->
dwBufferSize
;
dp
.
diph
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
);
dp
.
diph
.
dwHow
=
DIPH_DEVICE
;
IDirectInputDevice8_SetProperty
(
iface
,
DIPROP_BUFFERSIZE
,
&
dp
.
diph
);
}
return
DI_OK
;
}
...
...
dlls/dinput/dinput_main.c
View file @
2fe9f14b
...
...
@@ -254,6 +254,60 @@ void _dump_diactionformatA(LPDIACTIONFORMATA lpdiActionFormat) {
}
}
void
_copy_diactionformatAtoW
(
LPDIACTIONFORMATW
to
,
LPDIACTIONFORMATA
from
)
{
int
i
;
to
->
dwSize
=
sizeof
(
DIACTIONFORMATW
);
to
->
dwActionSize
=
sizeof
(
DIACTIONW
);
to
->
dwDataSize
=
from
->
dwDataSize
;
to
->
dwNumActions
=
from
->
dwNumActions
;
to
->
guidActionMap
=
from
->
guidActionMap
;
to
->
dwGenre
=
from
->
dwGenre
;
to
->
dwBufferSize
=
from
->
dwBufferSize
;
to
->
lAxisMin
=
from
->
lAxisMin
;
to
->
lAxisMax
=
from
->
lAxisMax
;
to
->
dwCRC
=
from
->
dwCRC
;
to
->
ftTimeStamp
=
from
->
ftTimeStamp
;
for
(
i
=
0
;
i
<
to
->
dwNumActions
;
i
++
)
{
to
->
rgoAction
[
i
].
uAppData
=
from
->
rgoAction
[
i
].
uAppData
;
to
->
rgoAction
[
i
].
dwSemantic
=
from
->
rgoAction
[
i
].
dwSemantic
;
to
->
rgoAction
[
i
].
dwFlags
=
from
->
rgoAction
[
i
].
dwFlags
;
to
->
rgoAction
[
i
].
guidInstance
=
from
->
rgoAction
[
i
].
guidInstance
;
to
->
rgoAction
[
i
].
dwObjID
=
from
->
rgoAction
[
i
].
dwObjID
;
to
->
rgoAction
[
i
].
dwHow
=
from
->
rgoAction
[
i
].
dwHow
;
}
}
void
_copy_diactionformatWtoA
(
LPDIACTIONFORMATA
to
,
LPDIACTIONFORMATW
from
)
{
int
i
;
to
->
dwSize
=
sizeof
(
DIACTIONFORMATA
);
to
->
dwActionSize
=
sizeof
(
DIACTIONA
);
to
->
dwDataSize
=
from
->
dwDataSize
;
to
->
dwNumActions
=
from
->
dwNumActions
;
to
->
guidActionMap
=
from
->
guidActionMap
;
to
->
dwGenre
=
from
->
dwGenre
;
to
->
dwBufferSize
=
from
->
dwBufferSize
;
to
->
lAxisMin
=
from
->
lAxisMin
;
to
->
lAxisMax
=
from
->
lAxisMax
;
to
->
dwCRC
=
from
->
dwCRC
;
to
->
ftTimeStamp
=
from
->
ftTimeStamp
;
for
(
i
=
0
;
i
<
to
->
dwNumActions
;
i
++
)
{
to
->
rgoAction
[
i
].
uAppData
=
from
->
rgoAction
[
i
].
uAppData
;
to
->
rgoAction
[
i
].
dwSemantic
=
from
->
rgoAction
[
i
].
dwSemantic
;
to
->
rgoAction
[
i
].
dwFlags
=
from
->
rgoAction
[
i
].
dwFlags
;
to
->
rgoAction
[
i
].
guidInstance
=
from
->
rgoAction
[
i
].
guidInstance
;
to
->
rgoAction
[
i
].
dwObjID
=
from
->
rgoAction
[
i
].
dwObjID
;
to
->
rgoAction
[
i
].
dwHow
=
from
->
rgoAction
[
i
].
dwHow
;
}
}
/******************************************************************************
* IDirectInputA_EnumDevices
*/
...
...
dlls/dinput/dinput_private.h
View file @
2fe9f14b
...
...
@@ -63,6 +63,8 @@ extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W) DECLSPEC_HIDDEN;
typedef
int
(
*
DI_EVENT_PROC
)(
LPDIRECTINPUTDEVICE8A
,
WPARAM
,
LPARAM
);
extern
void
_dump_diactionformatA
(
LPDIACTIONFORMATA
)
DECLSPEC_HIDDEN
;
extern
void
_copy_diactionformatAtoW
(
LPDIACTIONFORMATW
,
LPDIACTIONFORMATA
)
DECLSPEC_HIDDEN
;
extern
void
_copy_diactionformatWtoA
(
LPDIACTIONFORMATA
,
LPDIACTIONFORMATW
)
DECLSPEC_HIDDEN
;
#define IS_DIPROP(x) (((ULONG_PTR)(x) >> 16) == 0)
...
...
dlls/dinput8/tests/device.c
View file @
2fe9f14b
...
...
@@ -165,7 +165,7 @@ static BOOL CALLBACK enumeration_callback(
hr
=
IDirectInputDevice_GetProperty
(
lpdid
,
DIPROP_BUFFERSIZE
,
&
dp
.
diph
);
ok
(
SUCCEEDED
(
hr
),
"GetProperty failed hr=%08x
\n
"
,
hr
);
todo_wine
ok
(
dp
.
dwData
==
data
->
lpdiaf
->
dwBufferSize
,
"SetActionMap must set the buffer, buffersize=%d
\n
"
,
dp
.
dwData
);
ok
(
dp
.
dwData
==
data
->
lpdiaf
->
dwBufferSize
,
"SetActionMap must set the buffer, buffersize=%d
\n
"
,
dp
.
dwData
);
/* SetActionMap has set the data format so now it should work */
hr
=
IDirectInputDevice8_Acquire
(
lpdid
);
...
...
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