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
5df60ff2
Commit
5df60ff2
authored
May 27, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement IDirectInputDevice_GetImageInfo WtoA conversion.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
58694d1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
13 deletions
+57
-13
ansi.c
dlls/dinput/ansi.c
+57
-0
device.c
dlls/dinput/device.c
+0
-13
No files found.
dlls/dinput/ansi.c
View file @
5df60ff2
...
...
@@ -73,6 +73,42 @@ static void dieffectinfo_wtoa( const DIEFFECTINFOW *in, DIEFFECTINFOA *out )
WideCharToMultiByte
(
CP_ACP
,
0
,
in
->
tszName
,
-
1
,
out
->
tszName
,
sizeof
(
out
->
tszName
),
NULL
,
NULL
);
}
static
void
dideviceimageinfo_wtoa
(
const
DIDEVICEIMAGEINFOW
*
in
,
DIDEVICEIMAGEINFOA
*
out
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
in
->
tszImagePath
,
-
1
,
out
->
tszImagePath
,
sizeof
(
out
->
tszImagePath
),
NULL
,
NULL
);
out
->
dwFlags
=
in
->
dwFlags
;
out
->
dwViewID
=
in
->
dwViewID
;
out
->
rcOverlay
=
in
->
rcOverlay
;
out
->
dwObjID
=
in
->
dwObjID
;
out
->
dwcValidPts
=
in
->
dwcValidPts
;
out
->
rgptCalloutLine
[
0
]
=
in
->
rgptCalloutLine
[
0
];
out
->
rgptCalloutLine
[
1
]
=
in
->
rgptCalloutLine
[
1
];
out
->
rgptCalloutLine
[
2
]
=
in
->
rgptCalloutLine
[
2
];
out
->
rgptCalloutLine
[
3
]
=
in
->
rgptCalloutLine
[
3
];
out
->
rgptCalloutLine
[
4
]
=
in
->
rgptCalloutLine
[
4
];
out
->
rcCalloutRect
=
in
->
rcCalloutRect
;
out
->
dwTextAlign
=
in
->
dwTextAlign
;
}
static
void
dideviceimageinfoheader_wtoa
(
const
DIDEVICEIMAGEINFOHEADERW
*
in
,
DIDEVICEIMAGEINFOHEADERA
*
out
)
{
DWORD
i
;
out
->
dwcViews
=
in
->
dwcViews
;
out
->
dwcButtons
=
in
->
dwcButtons
;
out
->
dwcAxes
=
in
->
dwcAxes
;
out
->
dwcPOVs
=
in
->
dwcPOVs
;
out
->
dwBufferUsed
=
0
;
for
(
i
=
0
;
i
<
in
->
dwBufferUsed
/
sizeof
(
DIDEVICEIMAGEINFOW
);
++
i
)
{
dideviceimageinfo_wtoa
(
&
in
->
lprgImageInfoArray
[
i
],
&
out
->
lprgImageInfoArray
[
i
]
);
out
->
dwBufferUsed
+=
sizeof
(
DIDEVICEIMAGEINFOA
);
}
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_QueryInterface
(
IDirectInputDevice8A
*
iface_a
,
REFIID
iid
,
void
**
out
)
{
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8A
(
iface_a
);
...
...
@@ -331,3 +367,24 @@ HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile( IDirectInputDevice8A
return
IDirectInputDevice8_WriteEffectToFile
(
iface_w
,
filename_w
,
entries
,
file_effect
,
flags
);
}
HRESULT
WINAPI
IDirectInputDevice8AImpl_GetImageInfo
(
IDirectInputDevice8A
*
iface_a
,
DIDEVICEIMAGEINFOHEADERA
*
header_a
)
{
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8A
(
iface_a
);
IDirectInputDevice8W
*
iface_w
=
IDirectInputDevice8W_from_impl
(
impl
);
DIDEVICEIMAGEINFOHEADERW
header_w
=
{
sizeof
(
header_w
),
sizeof
(
DIDEVICEIMAGEINFOW
)};
HRESULT
hr
;
if
(
!
header_a
)
return
E_POINTER
;
if
(
header_a
->
dwSize
!=
sizeof
(
DIDEVICEIMAGEINFOHEADERA
))
return
DIERR_INVALIDPARAM
;
if
(
header_a
->
dwSizeImageInfo
!=
sizeof
(
DIDEVICEIMAGEINFOA
))
return
DIERR_INVALIDPARAM
;
header_w
.
dwBufferSize
=
(
header_a
->
dwBufferSize
/
sizeof
(
DIDEVICEIMAGEINFOA
))
*
sizeof
(
DIDEVICEIMAGEINFOW
);
header_w
.
lprgImageInfoArray
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
header_w
.
dwBufferSize
);
if
(
!
header_w
.
lprgImageInfoArray
)
return
DIERR_OUTOFMEMORY
;
hr
=
IDirectInputDevice8_GetImageInfo
(
iface_w
,
&
header_w
);
dideviceimageinfoheader_wtoa
(
&
header_w
,
header_a
);
HeapFree
(
GetProcessHeap
(),
0
,
header_w
.
lprgImageInfoArray
);
return
hr
;
}
dlls/dinput/device.c
View file @
5df60ff2
...
...
@@ -43,10 +43,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dinput
);
static
inline
IDirectInputDeviceImpl
*
impl_from_IDirectInputDevice8A
(
IDirectInputDevice8A
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectInputDeviceImpl
,
IDirectInputDevice8A_iface
);
}
static
inline
IDirectInputDeviceImpl
*
impl_from_IDirectInputDevice8W
(
IDirectInputDevice8W
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectInputDeviceImpl
,
IDirectInputDevice8W_iface
);
...
...
@@ -1699,15 +1695,6 @@ HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W ifa
return
DI_OK
;
}
HRESULT
WINAPI
IDirectInputDevice8AImpl_GetImageInfo
(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIDEVICEIMAGEINFOHEADERA
lpdiDevImageInfoHeader
)
{
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
FIXME
(
"(%p)->(%p): stub !
\n
"
,
This
,
lpdiDevImageInfoHeader
);
return
DI_OK
;
}
HRESULT
WINAPI
IDirectInputDevice8WImpl_GetImageInfo
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIDEVICEIMAGEINFOHEADERW
lpdiDevImageInfoHeader
)
{
...
...
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