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
0edc6e26
Commit
0edc6e26
authored
Jan 03, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jan 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement GetObjectInfo[A|W] in base device class.
parent
b4bc2c36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
7 deletions
+72
-7
device.c
dlls/dinput/device.c
+72
-7
No files found.
dlls/dinput/device.c
View file @
0edc6e26
...
@@ -294,6 +294,12 @@ void release_DataFormat(DataFormat * format)
...
@@ -294,6 +294,12 @@ void release_DataFormat(DataFormat * format)
format
->
user_df
=
NULL
;
format
->
user_df
=
NULL
;
}
}
inline
LPDIOBJECTDATAFORMAT
dataformat_to_odf
(
LPCDIDATAFORMAT
df
,
int
idx
)
{
if
(
idx
<
0
||
idx
>=
df
->
dwNumObjs
)
return
NULL
;
return
(
LPDIOBJECTDATAFORMAT
)((
LPBYTE
)
df
->
rgodf
+
idx
*
df
->
dwObjSize
);
}
/* Make all instances sequential */
/* Make all instances sequential */
static
void
calculate_ids
(
LPDIDATAFORMAT
df
)
static
void
calculate_ids
(
LPDIDATAFORMAT
df
)
{
{
...
@@ -971,10 +977,29 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
...
@@ -971,10 +977,29 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
DWORD
dwObj
,
DWORD
dwObj
,
DWORD
dwHow
)
DWORD
dwHow
)
{
{
FIXME
(
"(this=%p,%p,%d,0x%08x): stub!
\n
"
,
DIDEVICEOBJECTINSTANCEW
didoiW
;
iface
,
pdidoi
,
dwObj
,
dwHow
);
HRESULT
res
;
return
DI_OK
;
if
(
!
pdidoi
||
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEA
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3A
)))
return
DIERR_INVALIDPARAM
;
didoiW
.
dwSize
=
sizeof
(
didoiW
);
res
=
IDirectInputDevice2WImpl_GetObjectInfo
((
LPDIRECTINPUTDEVICE8W
)
iface
,
&
didoiW
,
dwObj
,
dwHow
);
if
(
res
==
DI_OK
)
{
DWORD
dwSize
=
pdidoi
->
dwSize
;
memset
(
pdidoi
,
0
,
pdidoi
->
dwSize
);
pdidoi
->
dwSize
=
dwSize
;
pdidoi
->
guidType
=
didoiW
.
guidType
;
pdidoi
->
dwOfs
=
didoiW
.
dwOfs
;
pdidoi
->
dwType
=
didoiW
.
dwType
;
pdidoi
->
dwFlags
=
didoiW
.
dwFlags
;
}
return
res
;
}
}
HRESULT
WINAPI
IDirectInputDevice2WImpl_GetObjectInfo
(
HRESULT
WINAPI
IDirectInputDevice2WImpl_GetObjectInfo
(
...
@@ -983,9 +1008,49 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(
...
@@ -983,9 +1008,49 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(
DWORD
dwObj
,
DWORD
dwObj
,
DWORD
dwHow
)
DWORD
dwHow
)
{
{
FIXME
(
"(this=%p,%p,%d,0x%08x): stub!
\n
"
,
IDirectInputDevice2AImpl
*
This
=
(
IDirectInputDevice2AImpl
*
)
iface
;
iface
,
pdidoi
,
dwObj
,
dwHow
);
DWORD
dwSize
=
pdidoi
->
dwSize
;
LPDIOBJECTDATAFORMAT
odf
;
int
idx
=
-
1
;
TRACE
(
"(%p) %d(0x%08x) -> %p
\n
"
,
This
,
dwHow
,
dwObj
,
pdidoi
);
if
(
!
pdidoi
||
(
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCEW
)
&&
pdidoi
->
dwSize
!=
sizeof
(
DIDEVICEOBJECTINSTANCE_DX3W
)))
return
DIERR_INVALIDPARAM
;
switch
(
dwHow
)
{
case
DIPH_BYOFFSET
:
if
(
!
This
->
data_format
.
offsets
)
break
;
for
(
idx
=
This
->
data_format
.
wine_df
->
dwNumObjs
-
1
;
idx
>=
0
;
idx
--
)
if
(
This
->
data_format
.
offsets
[
idx
]
==
dwObj
)
break
;
break
;
case
DIPH_BYID
:
dwObj
&=
0x00ffffff
;
for
(
idx
=
This
->
data_format
.
wine_df
->
dwNumObjs
-
1
;
idx
>=
0
;
idx
--
)
if
((
dataformat_to_odf
(
This
->
data_format
.
wine_df
,
idx
)
->
dwType
&
0x00ffffff
)
==
dwObj
)
break
;
break
;
case
DIPH_BYUSAGE
:
FIXME
(
"dwHow = DIPH_BYUSAGE not implemented
\n
"
);
break
;
default:
WARN
(
"invalid parameter: dwHow = %08x
\n
"
,
dwHow
);
return
DIERR_INVALIDPARAM
;
}
if
(
idx
<
0
)
return
DIERR_OBJECTNOTFOUND
;
odf
=
dataformat_to_odf
(
This
->
data_format
.
wine_df
,
idx
);
memset
(
pdidoi
,
0
,
pdidoi
->
dwSize
);
pdidoi
->
dwSize
=
dwSize
;
pdidoi
->
guidType
=
*
odf
->
pguid
;
pdidoi
->
dwOfs
=
This
->
data_format
.
offsets
?
This
->
data_format
.
offsets
[
idx
]
:
odf
->
dwOfs
;
pdidoi
->
dwType
=
odf
->
dwType
;
pdidoi
->
dwFlags
=
odf
->
dwFlags
;
return
DI_OK
;
return
DI_OK
;
}
}
...
...
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