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
18ee811e
Commit
18ee811e
authored
Dec 27, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Dec 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: mouse: Copy and modify default data format.
parent
b22ff801
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
mouse.c
dlls/dinput/mouse.c
+21
-1
No files found.
dlls/dinput/mouse.c
View file @
18ee811e
...
...
@@ -182,6 +182,8 @@ static BOOL mousedev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINST
static
SysMouseImpl
*
alloc_device
(
REFGUID
rguid
,
const
void
*
mvt
,
IDirectInputImpl
*
dinput
)
{
SysMouseImpl
*
newDevice
;
LPDIDATAFORMAT
df
=
NULL
;
int
i
;
newDevice
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
SysMouseImpl
));
if
(
!
newDevice
)
return
NULL
;
...
...
@@ -192,13 +194,29 @@ static SysMouseImpl *alloc_device(REFGUID rguid, const void *mvt, IDirectInputIm
InitializeCriticalSection
(
&
newDevice
->
base
.
crit
);
newDevice
->
dinput
=
dinput
;
newDevice
->
base
.
data_format
.
wine_df
=
&
c_dfDIMouse2
;
/* Create copy of default data format */
if
(
!
(
df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
c_dfDIMouse2
.
dwSize
)))
goto
failed
;
memcpy
(
df
,
&
c_dfDIMouse2
,
c_dfDIMouse2
.
dwSize
);
if
(
!
(
df
->
rgodf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
df
->
dwNumObjs
*
df
->
dwObjSize
)))
goto
failed
;
memcpy
(
df
->
rgodf
,
c_dfDIMouse2
.
rgodf
,
df
->
dwNumObjs
*
df
->
dwObjSize
);
/* Because we don't do any detection yet just modify instance and type */
for
(
i
=
0
;
i
<
df
->
dwNumObjs
;
i
++
)
if
(
DIDFT_GETTYPE
(
df
->
rgodf
[
i
].
dwType
)
&
DIDFT_AXIS
)
df
->
rgodf
[
i
].
dwType
=
DIDFT_MAKEINSTANCE
(
i
)
|
DIDFT_RELAXIS
;
else
df
->
rgodf
[
i
].
dwType
=
DIDFT_MAKEINSTANCE
(
i
)
|
DIDFT_PSHBUTTON
;
newDevice
->
base
.
data_format
.
wine_df
=
df
;
if
(
create_DataFormat
(
&
c_dfDIMouse2
,
&
newDevice
->
base
.
data_format
)
==
DI_OK
)
{
IDirectInput_AddRef
((
LPDIRECTINPUTDEVICE8A
)
newDevice
->
dinput
);
return
newDevice
;
}
failed:
if
(
df
)
HeapFree
(
GetProcessHeap
(),
0
,
df
->
rgodf
);
HeapFree
(
GetProcessHeap
(),
0
,
df
);
HeapFree
(
GetProcessHeap
(),
0
,
newDevice
);
return
NULL
;
}
...
...
@@ -272,6 +290,8 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
/* Free the data queue */
HeapFree
(
GetProcessHeap
(),
0
,
This
->
base
.
data_queue
);
/* Free data format */
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
This
->
base
.
data_format
.
wine_df
);
release_DataFormat
(
&
This
->
base
.
data_format
);
IDirectInput_Release
((
LPDIRECTINPUTDEVICE8A
)
This
->
dinput
);
...
...
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