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
6246fa62
Commit
6246fa62
authored
Dec 12, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Dec 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Remove redundant parameter.
parent
d5b57f39
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
23 deletions
+25
-23
device.c
dlls/dinput/device.c
+20
-18
device_private.h
dlls/dinput/device_private.h
+1
-1
joystick_linux.c
dlls/dinput/joystick_linux.c
+1
-1
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+1
-1
keyboard.c
dlls/dinput/keyboard.c
+1
-1
mouse.c
dlls/dinput/mouse.c
+1
-1
No files found.
dlls/dinput/device.c
View file @
6246fa62
...
...
@@ -336,7 +336,7 @@ static void calculate_ids(LPDIDATAFORMAT df)
}
}
HRESULT
create_DataFormat
(
LPCDIDATAFORMAT
wine_format
,
LPCDIDATAFORMAT
asked_format
,
DataFormat
*
format
)
HRESULT
create_DataFormat
(
LPCDIDATAFORMAT
asked_format
,
DataFormat
*
format
)
{
DataTransform
*
dt
;
unsigned
int
i
,
j
;
...
...
@@ -344,12 +344,13 @@ HRESULT create_DataFormat(LPCDIDATAFORMAT wine_format, LPCDIDATAFORMAT asked_for
int
*
done
;
int
index
=
0
;
DWORD
next
=
0
;
if
(
!
format
->
wine_df
)
return
DIERR_INVALIDPARAM
;
done
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
asked_format
->
dwNumObjs
*
sizeof
(
int
));
dt
=
HeapAlloc
(
GetProcessHeap
(),
0
,
asked_format
->
dwNumObjs
*
sizeof
(
DataTransform
));
if
(
!
dt
||
!
done
)
goto
failed
;
if
(
!
(
format
->
offsets
=
HeapAlloc
(
GetProcessHeap
(),
0
,
wine_format
->
dwNumObjs
*
sizeof
(
int
))))
if
(
!
(
format
->
offsets
=
HeapAlloc
(
GetProcessHeap
(),
0
,
format
->
wine_df
->
dwNumObjs
*
sizeof
(
int
))))
goto
failed
;
if
(
!
(
format
->
user_df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
asked_format
->
dwSize
)))
...
...
@@ -362,7 +363,8 @@ HRESULT create_DataFormat(LPCDIDATAFORMAT wine_format, LPCDIDATAFORMAT asked_for
TRACE
(
"Creating DataTransform :
\n
"
);
for
(
i
=
0
;
i
<
wine_format
->
dwNumObjs
;
i
++
)
{
for
(
i
=
0
;
i
<
format
->
wine_df
->
dwNumObjs
;
i
++
)
{
format
->
offsets
[
i
]
=
-
1
;
for
(
j
=
0
;
j
<
asked_format
->
dwNumObjs
;
j
++
)
{
...
...
@@ -373,18 +375,18 @@ HRESULT create_DataFormat(LPCDIDATAFORMAT wine_format, LPCDIDATAFORMAT asked_for
* the GUID of the Wine object.
*/
((
asked_format
->
rgodf
[
j
].
pguid
==
NULL
)
||
(
wine_format
->
rgodf
[
i
].
pguid
==
NULL
)
||
(
IsEqualGUID
(
wine_format
->
rgodf
[
i
].
pguid
,
asked_format
->
rgodf
[
j
].
pguid
)))
(
format
->
wine_df
->
rgodf
[
i
].
pguid
==
NULL
)
||
(
IsEqualGUID
(
format
->
wine_df
->
rgodf
[
i
].
pguid
,
asked_format
->
rgodf
[
j
].
pguid
)))
&&
(
/* Then check if it accepts any instance id, and if not, if it matches Wine's
* instance id.
*/
(
DIDFT_GETINSTANCE
(
asked_format
->
rgodf
[
j
].
dwType
)
==
0xFFFF
)
||
(
DIDFT_GETINSTANCE
(
asked_format
->
rgodf
[
j
].
dwType
)
==
0x00FF
)
||
/* This is mentionned in no DX docs, but it works fine - tested on WinXP */
(
DIDFT_GETINSTANCE
(
asked_format
->
rgodf
[
j
].
dwType
)
==
DIDFT_GETINSTANCE
(
wine_format
->
rgodf
[
i
].
dwType
)))
(
DIDFT_GETINSTANCE
(
asked_format
->
rgodf
[
j
].
dwType
)
==
DIDFT_GETINSTANCE
(
format
->
wine_df
->
rgodf
[
i
].
dwType
)))
&&
(
/* Then if the asked type matches the one Wine provides */
DIDFT_GETTYPE
(
asked_format
->
rgodf
[
j
].
dwType
)
&
wine_format
->
rgodf
[
i
].
dwType
))
DIDFT_GETTYPE
(
asked_format
->
rgodf
[
j
].
dwType
)
&
format
->
wine_df
->
rgodf
[
i
].
dwType
))
{
done
[
j
]
=
1
;
...
...
@@ -399,23 +401,23 @@ HRESULT create_DataFormat(LPCDIDATAFORMAT wine_format, LPCDIDATAFORMAT asked_for
TRACE
(
" - Wine (%d) :
\n
"
,
i
);
TRACE
(
" * GUID: %s ('%s')
\n
"
,
debugstr_guid
(
wine_format
->
rgodf
[
i
].
pguid
),
_dump_dinput_GUID
(
wine_format
->
rgodf
[
i
].
pguid
));
TRACE
(
" * Offset: %3d
\n
"
,
wine_format
->
rgodf
[
i
].
dwOfs
);
TRACE
(
" * dwType: %08x
\n
"
,
wine_format
->
rgodf
[
i
].
dwType
);
TRACE
(
" "
);
_dump_EnumObjects_flags
(
wine_format
->
rgodf
[
i
].
dwType
);
TRACE
(
"
\n
"
);
debugstr_guid
(
format
->
wine_df
->
rgodf
[
i
].
pguid
),
_dump_dinput_GUID
(
format
->
wine_df
->
rgodf
[
i
].
pguid
));
TRACE
(
" * Offset: %3d
\n
"
,
format
->
wine_df
->
rgodf
[
i
].
dwOfs
);
TRACE
(
" * dwType: %08x
\n
"
,
format
->
wine_df
->
rgodf
[
i
].
dwType
);
TRACE
(
" "
);
_dump_EnumObjects_flags
(
format
->
wine_df
->
rgodf
[
i
].
dwType
);
TRACE
(
"
\n
"
);
if
(
wine_format
->
rgodf
[
i
].
dwType
&
DIDFT_BUTTON
)
if
(
format
->
wine_df
->
rgodf
[
i
].
dwType
&
DIDFT_BUTTON
)
dt
[
index
].
size
=
sizeof
(
BYTE
);
else
dt
[
index
].
size
=
sizeof
(
DWORD
);
dt
[
index
].
offset_in
=
wine_format
->
rgodf
[
i
].
dwOfs
;
dt
[
index
].
offset_in
=
format
->
wine_df
->
rgodf
[
i
].
dwOfs
;
dt
[
index
].
offset_out
=
asked_format
->
rgodf
[
j
].
dwOfs
;
format
->
offsets
[
i
]
=
asked_format
->
rgodf
[
j
].
dwOfs
;
dt
[
index
].
value
=
0
;
next
=
next
+
dt
[
index
].
size
;
if
(
wine_format
->
rgodf
[
i
].
dwOfs
!=
dt
[
index
].
offset_out
)
if
(
format
->
wine_df
->
rgodf
[
i
].
dwOfs
!=
dt
[
index
].
offset_out
)
same
=
0
;
index
++
;
...
...
@@ -451,7 +453,7 @@ HRESULT create_DataFormat(LPCDIDATAFORMAT wine_format, LPCDIDATAFORMAT asked_for
}
}
format
->
internal_format_size
=
wine_format
->
dwDataSize
;
format
->
internal_format_size
=
format
->
wine_df
->
dwDataSize
;
format
->
size
=
index
;
if
(
same
)
{
HeapFree
(
GetProcessHeap
(),
0
,
dt
);
...
...
@@ -635,7 +637,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
EnterCriticalSection
(
&
This
->
crit
);
release_DataFormat
(
&
This
->
data_format
);
res
=
create_DataFormat
(
This
->
data_format
.
wine_df
,
df
,
&
This
->
data_format
);
res
=
create_DataFormat
(
df
,
&
This
->
data_format
);
LeaveCriticalSection
(
&
This
->
crit
);
return
res
;
...
...
dlls/dinput/device_private.h
View file @
6246fa62
...
...
@@ -69,7 +69,7 @@ struct IDirectInputDevice2AImpl
/* Routines to do DataFormat / WineFormat conversions */
extern
void
fill_DataFormat
(
void
*
out
,
const
void
*
in
,
DataFormat
*
df
)
;
extern
HRESULT
create_DataFormat
(
LPCDIDATAFORMAT
wine_format
,
LPCDIDATAFORMAT
asked_format
,
DataFormat
*
format
);
extern
HRESULT
create_DataFormat
(
LPCDIDATAFORMAT
asked_format
,
DataFormat
*
format
);
extern
void
release_DataFormat
(
DataFormat
*
df
)
;
extern
void
queue_event
(
LPDIRECTINPUTDEVICE8A
iface
,
int
ofs
,
DWORD
data
,
DWORD
time
,
DWORD
seq
);
/* Helper functions to work with data format */
...
...
dlls/dinput/joystick_linux.c
View file @
6246fa62
...
...
@@ -481,7 +481,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
newDevice
->
base
.
data_format
.
wine_df
=
&
c_dfDIJoystick2
;
/* create the default transform filter */
hr
=
create_DataFormat
(
&
c_dfDIJoystick2
,
&
c_dfDIJoystick2
,
&
newDevice
->
base
.
data_format
);
hr
=
create_DataFormat
(
&
c_dfDIJoystick2
,
&
newDevice
->
base
.
data_format
);
if
(
hr
!=
DI_OK
)
goto
FAILED
;
IDirectInputDevice_AddRef
((
LPDIRECTINPUTDEVICE8A
)
newDevice
->
dinput
);
...
...
dlls/dinput/joystick_linuxinput.c
View file @
6246fa62
...
...
@@ -392,7 +392,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
newDevice
->
base
.
data_format
.
wine_df
=
&
c_dfDIJoystick2
;
/* create the default transform filter */
if
(
create_DataFormat
(
&
c_dfDIJoystick2
,
&
c_dfDIJoystick2
,
&
newDevice
->
base
.
data_format
)
==
DI_OK
)
if
(
create_DataFormat
(
&
c_dfDIJoystick2
,
&
newDevice
->
base
.
data_format
)
==
DI_OK
)
return
newDevice
;
HeapFree
(
GetProcessHeap
(),
0
,
newDevice
);
...
...
dlls/dinput/keyboard.c
View file @
6246fa62
...
...
@@ -197,7 +197,7 @@ static SysKeyboardImpl *alloc_device(REFGUID rguid, const void *kvt, IDirectInpu
InitializeCriticalSection
(
&
newDevice
->
base
.
crit
);
newDevice
->
base
.
data_format
.
wine_df
=
&
c_dfDIKeyboard
;
if
(
create_DataFormat
(
&
c_dfDIKeyboard
,
&
c_dfDIKeyboard
,
&
newDevice
->
base
.
data_format
)
==
DI_OK
)
if
(
create_DataFormat
(
&
c_dfDIKeyboard
,
&
newDevice
->
base
.
data_format
)
==
DI_OK
)
return
newDevice
;
return
NULL
;
}
...
...
dlls/dinput/mouse.c
View file @
6246fa62
...
...
@@ -237,7 +237,7 @@ static SysMouseImpl *alloc_device(REFGUID rguid, const void *mvt, IDirectInputIm
newDevice
->
dinput
=
dinput
;
newDevice
->
base
.
data_format
.
wine_df
=
&
Wine_InternalMouseFormat
;
if
(
create_DataFormat
(
&
Wine_InternalMouseFormat
,
&
Wine_InternalMouseFormat
,
&
newDevice
->
base
.
data_format
)
==
DI_OK
)
if
(
create_DataFormat
(
&
Wine_InternalMouseFormat
,
&
newDevice
->
base
.
data_format
)
==
DI_OK
)
return
newDevice
;
return
NULL
;
...
...
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