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
a37c60b0
Commit
a37c60b0
authored
May 11, 2008
by
Vitaliy Margolen
Committed by
Alexandre Julliard
May 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement GetDeviceStatus.
parent
d7b98841
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
dinput_main.c
dlls/dinput/dinput_main.c
+8
-1
device.c
dlls/dinput/tests/device.c
+18
-3
No files found.
dlls/dinput/dinput_main.c
View file @
a37c60b0
...
@@ -417,8 +417,15 @@ static HRESULT WINAPI IDirectInputWImpl_Initialize(LPDIRECTINPUT7W iface, HINSTA
...
@@ -417,8 +417,15 @@ static HRESULT WINAPI IDirectInputWImpl_Initialize(LPDIRECTINPUT7W iface, HINSTA
static
HRESULT
WINAPI
IDirectInputAImpl_GetDeviceStatus
(
LPDIRECTINPUT7A
iface
,
REFGUID
rguid
)
static
HRESULT
WINAPI
IDirectInputAImpl_GetDeviceStatus
(
LPDIRECTINPUT7A
iface
,
REFGUID
rguid
)
{
{
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
IDirectInputImpl
*
This
=
(
IDirectInputImpl
*
)
iface
;
HRESULT
hr
;
LPDIRECTINPUTDEVICEA
device
;
FIXME
(
"(%p)->(%s): stub
\n
"
,
This
,
debugstr_guid
(
rguid
)
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_guid
(
rguid
)
);
hr
=
IDirectInput_CreateDevice
(
iface
,
rguid
,
&
device
,
NULL
);
if
(
hr
!=
DI_OK
)
return
DI_NOTATTACHED
;
IUnknown_Release
(
device
);
return
DI_OK
;
return
DI_OK
;
}
}
...
...
dlls/dinput/tests/device.c
View file @
a37c60b0
...
@@ -124,10 +124,13 @@ static BOOL CALLBACK enum_devices(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
...
@@ -124,10 +124,13 @@ static BOOL CALLBACK enum_devices(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef)
LPDIRECTINPUTDEVICE
device
;
LPDIRECTINPUTDEVICE
device
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
IDirectInput_CreateDevice
(
data
->
pDI
,
&
lpddi
->
guidInstance
,
&
device
,
NULL
);
hr
=
IDirectInput_GetDeviceStatus
(
data
->
pDI
,
&
lpddi
->
guidInstance
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_CreateDevice() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
hr
==
DI_OK
,
"IDirectInput_GetDeviceStatus() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
if
(
SUCCEEDED
(
hr
))
if
(
hr
==
DI_OK
)
{
{
hr
=
IDirectInput_CreateDevice
(
data
->
pDI
,
&
lpddi
->
guidInstance
,
&
device
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_CreateDevice() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
trace
(
"Testing device
\"
%s
\"\n
"
,
lpddi
->
tszInstanceName
);
trace
(
"Testing device
\"
%s
\"\n
"
,
lpddi
->
tszInstanceName
);
test_object_info
(
device
,
data
->
hwnd
);
test_object_info
(
device
,
data
->
hwnd
);
IUnknown_Release
(
device
);
IUnknown_Release
(
device
);
...
@@ -164,6 +167,18 @@ static void device_tests(void)
...
@@ -164,6 +167,18 @@ static void device_tests(void)
hr
=
IDirectInput_EnumDevices
(
pDI
,
0
,
enum_devices
,
&
data
,
DIEDFL_ALLDEVICES
);
hr
=
IDirectInput_EnumDevices
(
pDI
,
0
,
enum_devices
,
&
data
,
DIEDFL_ALLDEVICES
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_EnumDevices() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_EnumDevices() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
/* If GetDeviceStatus returns DI_OK the device must exist */
hr
=
IDirectInput_GetDeviceStatus
(
pDI
,
&
GUID_Joystick
);
if
(
hr
==
DI_OK
)
{
LPDIRECTINPUTDEVICE
device
=
NULL
;
hr
=
IDirectInput_CreateDevice
(
pDI
,
&
GUID_Joystick
,
&
device
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirectInput_CreateDevice() failed: %s
\n
"
,
DXGetErrorString8
(
hr
));
if
(
device
)
IUnknown_Release
(
device
);
}
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
}
}
if
(
pDI
)
IUnknown_Release
(
pDI
);
if
(
pDI
)
IUnknown_Release
(
pDI
);
...
...
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