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
2095f66d
Commit
2095f66d
authored
May 10, 2005
by
Robert Reif
Committed by
Alexandre Julliard
May 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix joystick crash when a button guid is specified in the data
format. Add some parameter checking.
parent
74641349
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
8 deletions
+40
-8
device.c
dlls/dinput/device.c
+8
-7
dinput_main.c
dlls/dinput/dinput_main.c
+10
-0
joystick_linux.c
dlls/dinput/joystick_linux.c
+22
-1
No files found.
dlls/dinput/device.c
View file @
2095f66d
...
...
@@ -313,6 +313,7 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a
* 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
)))
&&
(
/* Then check if it accepts any instance id, and if not, if it matches Wine's
...
...
@@ -336,19 +337,19 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a
TRACE
(
" * dwType: %08lx
\n
"
,
asked_format
->
rgodf
[
j
].
dwType
);
TRACE
(
" "
);
_dump_EnumObjects_flags
(
asked_format
->
rgodf
[
j
].
dwType
);
TRACE
(
"
\n
"
);
TRACE
(
" - Wine (%d) :
\n
"
,
j
);
TRACE
(
" - Wine (%d) :
\n
"
,
i
);
TRACE
(
" * GUID: %s ('%s')
\n
"
,
debugstr_guid
(
wine_format
->
rgodf
[
j
].
pguid
),
_dump_dinput_GUID
(
wine_format
->
rgodf
[
j
].
pguid
));
TRACE
(
" * Offset: %3ld
\n
"
,
wine_format
->
rgodf
[
j
].
dwOfs
);
TRACE
(
" * dwType: %08lx
\n
"
,
wine_format
->
rgodf
[
j
].
dwType
);
TRACE
(
" "
);
_dump_EnumObjects_flags
(
wine_format
->
rgodf
[
j
].
dwType
);
TRACE
(
"
\n
"
);
debugstr_guid
(
wine_format
->
rgodf
[
i
].
pguid
),
_dump_dinput_GUID
(
wine_format
->
rgodf
[
i
].
pguid
));
TRACE
(
" * Offset: %3ld
\n
"
,
wine_format
->
rgodf
[
i
].
dwOfs
);
TRACE
(
" * dwType: %08lx
\n
"
,
wine_format
->
rgodf
[
i
].
dwType
);
TRACE
(
" "
);
_dump_EnumObjects_flags
(
wine_format
->
rgodf
[
i
].
dwType
);
TRACE
(
"
\n
"
);
if
(
wine_format
->
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
=
wine_format
->
rgodf
[
i
].
dwOfs
;
if
(
asked_format
->
rgodf
[
j
].
dwOfs
<
next
)
{
WARN
(
"bad format: dwOfs=%ld, changing to %ld
\n
"
,
asked_format
->
rgodf
[
j
].
dwOfs
,
next
);
dt
[
index
].
offset_out
=
next
;
...
...
dlls/dinput/dinput_main.c
View file @
2095f66d
...
...
@@ -331,6 +331,16 @@ static HRESULT WINAPI IDirectInputAImpl_CreateDevice(
TRACE
(
"(this=%p,%s,%p,%p)
\n
"
,
This
,
debugstr_guid
(
rguid
),
pdev
,
punk
);
if
(
pdev
==
NULL
)
{
WARN
(
"invalid pointer: pdev == NULL
\n
"
);
return
E_POINTER
;
}
if
(
rguid
==
NULL
)
{
WARN
(
"invalid pointer: rguid == NULL
\n
"
);
return
E_POINTER
;
}
/* Loop on all the devices to see if anyone matches the given GUID */
for
(
i
=
0
;
i
<
NB_DINPUT_DEVICES
;
i
++
)
{
HRESULT
ret
;
...
...
dlls/dinput/joystick_linux.c
View file @
2095f66d
...
...
@@ -713,6 +713,16 @@ static HRESULT WINAPI JoystickAImpl_SetDataFormat(
TRACE
(
"(%p,%p)
\n
"
,
This
,
df
);
if
(
df
==
NULL
)
{
WARN
(
"invalid pointer
\n
"
);
return
E_POINTER
;
}
if
(
df
->
dwSize
!=
sizeof
(
*
df
))
{
WARN
(
"invalid argument
\n
"
);
return
DIERR_INVALIDPARAM
;
}
if
(
This
->
acquired
)
{
WARN
(
"acquired
\n
"
);
return
DIERR_ACQUIRED
;
...
...
@@ -1113,6 +1123,11 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(
TRACE
(
"(%p,%s,%p)
\n
"
,
This
,
debugstr_guid
(
rguid
),
ph
);
if
(
ph
==
NULL
)
{
WARN
(
"invalid pointer
\n
"
);
return
E_POINTER
;
}
if
(
TRACE_ON
(
dinput
))
_dump_DIPROPHEADER
(
ph
);
...
...
@@ -1214,10 +1229,16 @@ static HRESULT WINAPI JoystickAImpl_GetCapabilities(
if
(
lpDIDevCaps
==
NULL
)
{
WARN
(
"invalid parameter: lpDIDevCaps = NULL
\n
"
);
return
DIERR_INVALIDPARAM
;
return
E_POINTER
;
}
size
=
lpDIDevCaps
->
dwSize
;
if
(
!
(
size
==
sizeof
(
DIDEVCAPS
)
||
size
==
sizeof
(
DIDEVCAPS_DX3
)))
{
WARN
(
"invalid parameter
\n
"
);
return
DIERR_INVALIDPARAM
;
}
CopyMemory
(
lpDIDevCaps
,
&
This
->
devcaps
,
size
);
lpDIDevCaps
->
dwSize
=
size
;
...
...
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