Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2022
- 86 participants
- 2418 messages
Re: [PATCH 3/4] dinput: Allow 0xff as a DIDFT_ANYINSTANCE alias with old dinput version.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=104755
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors:
dinput8:hid prints too much data (42030 bytes)
=== debian11 (32 bit Arabic:Morocco report) ===
Report validation errors:
dinput8:hid prints too much data (41290 bytes)
=== debian11 (32 bit German report) ===
Report validation errors:
dinput8:hid prints too much data (41290 bytes)
=== debian11 (32 bit French report) ===
Report validation errors:
dinput8:hid prints too much data (41290 bytes)
=== debian11 (32 bit Hebrew:Israel report) ===
Report validation errors:
dinput8:hid prints too much data (41290 bytes)
=== debian11 (32 bit Hindi:India report) ===
Report validation errors:
dinput8:hid prints too much data (41290 bytes)
=== debian11 (32 bit Japanese:Japan report) ===
Report validation errors:
dinput8:hid prints too much data (41290 bytes)
=== debian11 (32 bit Chinese:China report) ===
Report validation errors:
dinput8:hid prints too much data (41337 bytes)
=== debian11 (64 bit WoW report) ===
Report validation errors:
dinput8:hid prints too much data (42030 bytes)
Jan. 3, 2022
Re: [PATCH 2/4] dinput: Return DIERR_UNSUPPORTED for properties with old dinput version.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=104754
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors:
dinput8:hid prints too much data (42111 bytes)
=== debian11 (32 bit Arabic:Morocco report) ===
Report validation errors:
dinput8:hid prints too much data (41371 bytes)
=== debian11 (32 bit German report) ===
Report validation errors:
dinput8:hid prints too much data (41371 bytes)
=== debian11 (32 bit French report) ===
Report validation errors:
dinput8:hid prints too much data (41371 bytes)
=== debian11 (32 bit Hebrew:Israel report) ===
Report validation errors:
dinput8:hid prints too much data (41371 bytes)
=== debian11 (32 bit Hindi:India report) ===
Report validation errors:
dinput8:hid prints too much data (41371 bytes)
=== debian11 (32 bit Japanese:Japan report) ===
Report validation errors:
dinput8:hid prints too much data (41371 bytes)
=== debian11 (32 bit Chinese:China report) ===
Report validation errors:
dinput8:hid prints too much data (41418 bytes)
=== debian11 (64 bit WoW report) ===
Report validation errors:
dinput8:hid prints too much data (42111 bytes)
Jan. 3, 2022
Re: [PATCH 1/4] dinput8/tests: Test simple joystick with older dinput versions.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=104753
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors:
dinput8:hid prints too much data (44892 bytes)
=== debian11 (32 bit Arabic:Morocco report) ===
Report validation errors:
dinput8:hid prints too much data (44199 bytes)
=== debian11 (32 bit German report) ===
Report validation errors:
dinput8:hid prints too much data (44199 bytes)
=== debian11 (32 bit French report) ===
Report validation errors:
dinput8:hid prints too much data (44199 bytes)
=== debian11 (32 bit Hebrew:Israel report) ===
Report validation errors:
dinput8:hid prints too much data (44199 bytes)
=== debian11 (32 bit Hindi:India report) ===
Report validation errors:
dinput8:hid prints too much data (44199 bytes)
=== debian11 (32 bit Japanese:Japan report) ===
Report validation errors:
dinput8:hid prints too much data (44199 bytes)
=== debian11 (32 bit Chinese:China report) ===
Report validation errors:
dinput8:hid prints too much data (44199 bytes)
=== debian11 (64 bit WoW report) ===
Report validation errors:
dinput8:hid prints too much data (44892 bytes)
Jan. 3, 2022
[PATCH 4/4] dinput: Return HID class guid in DIPROP_GUIDANDPATH property.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/joystick_hid.c | 1 +
dlls/dinput8/tests/hid.c | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index 874eca6646e..2e3efd2ee8a 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -819,6 +819,7 @@ static HRESULT hid_joystick_get_property( IDirectInputDevice8W *iface, DWORD pro
case (DWORD_PTR)DIPROP_GUIDANDPATH:
{
DIPROPGUIDANDPATH *value = (DIPROPGUIDANDPATH *)header;
+ value->guidClass = GUID_DEVCLASS_HIDCLASS;
lstrcpynW( value->wszPath, impl->device_path, MAX_PATH );
return DI_OK;
}
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 4f22d5dbde8..a3bcd523acd 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -4261,7 +4261,6 @@ static void test_simple_joystick( DWORD version )
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
ok( hr == DI_OK, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
- todo_wine
ok( IsEqualGUID( &prop_guid_path.guidClass, &GUID_DEVCLASS_HIDCLASS ), "got guid %s\n",
debugstr_guid( &prop_guid_path.guidClass ) );
todo_wine
--
2.34.1
Jan. 3, 2022
[PATCH 3/4] dinput: Allow 0xff as a DIDFT_ANYINSTANCE alias with old dinput version.
by Rémi Bernon
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52267
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/device.c | 6 ++++--
dlls/dinput8/tests/hid.c | 1 -
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 834b87f5fe0..a4c85351648 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -240,11 +240,13 @@ LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD
}
static BOOL match_device_object( DIDATAFORMAT *device_format, DIDATAFORMAT *user_format,
- const DIDATAFORMAT *format, const DIOBJECTDATAFORMAT *match_obj )
+ const DIDATAFORMAT *format, const DIOBJECTDATAFORMAT *match_obj, DWORD version )
{
DWORD i, device_instance, instance = DIDFT_GETINSTANCE( match_obj->dwType );
DIOBJECTDATAFORMAT *device_obj, *user_obj;
+ if (version < 0x0700 && instance == 0xff) instance = 0xffff;
+
for (i = 0; i < device_format->dwNumObjs; i++)
{
user_obj = user_format->rgodf + i;
@@ -292,7 +294,7 @@ static HRESULT dinput_device_init_user_format( struct dinput_device *impl, const
{
match_obj = format->rgodf + i;
- if (!match_device_object( device_format, user_format, format, match_obj ))
+ if (!match_device_object( device_format, user_format, format, match_obj, impl->dinput->dwVersion ))
{
WARN( "object %s not found\n", debugstr_diobjectdataformat( match_obj ) );
if (!(match_obj->dwType & DIDFT_OPTIONAL)) goto failed;
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 514dfaac9bb..4f22d5dbde8 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -4891,7 +4891,6 @@ static void test_simple_joystick( DWORD version )
ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr );
objdataformat[1].dwType = DIDFT_AXIS|DIDFT_MAKEINSTANCE( 0xff );
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
- todo_wine_if( version < 0x0700 )
ok( hr == (version < 0x0700 ? DI_OK : DIERR_INVALIDPARAM),
"SetDataFormat returned: %#x\n", hr );
objdataformat[1].dwType = DIDFT_AXIS|DIDFT_MAKEINSTANCE( 1 );
--
2.34.1
Jan. 3, 2022
[PATCH 2/4] dinput: Return DIERR_UNSUPPORTED for properties with old dinput version.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/device.c | 13 +++++++++++++
dlls/dinput8/tests/hid.c | 16 +---------------
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 1dc3c311f2b..834b87f5fe0 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -907,6 +907,19 @@ static HRESULT enum_object_filter_init( struct dinput_device *impl, DIPROPHEADER
static HRESULT check_property( struct dinput_device *impl, const GUID *guid, const DIPROPHEADER *header, BOOL set )
{
+ switch (LOWORD( guid ))
+ {
+ case (DWORD_PTR)DIPROP_VIDPID:
+ case (DWORD_PTR)DIPROP_TYPENAME:
+ case (DWORD_PTR)DIPROP_USERNAME:
+ case (DWORD_PTR)DIPROP_KEYNAME:
+ case (DWORD_PTR)DIPROP_LOGICALRANGE:
+ case (DWORD_PTR)DIPROP_PHYSICALRANGE:
+ case (DWORD_PTR)DIPROP_APPDATA:
+ if (impl->dinput->dwVersion < 0x0800) return DIERR_UNSUPPORTED;
+ break;
+ }
+
switch (LOWORD( guid ))
{
case (DWORD_PTR)DIPROP_INSTANCENAME:
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 17559c61a39..514dfaac9bb 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -4242,7 +4242,6 @@ static void test_simple_joystick( DWORD version )
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, NULL );
ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
"GetProperty DIPROP_VIDPID returned %#x\n", hr );
prop_dword.diph.dwHeaderSize = sizeof(DIPROPHEADER) - 1;
@@ -4252,7 +4251,6 @@ static void test_simple_joystick( DWORD version )
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
"GetProperty DIPROP_VIDPID returned %#x\n", hr );
if (hr == DI_OK)
@@ -4297,7 +4295,6 @@ static void test_simple_joystick( DWORD version )
ok( !wcscmp( prop_string.wsz, expect_vidpid_str ), "got type %s\n", debugstr_w(prop_string.wsz) );
}
hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_NOEFFECT),
"GetProperty DIPROP_USERNAME returned %#x\n", hr );
if (hr == DI_NOEFFECT)
@@ -4344,7 +4341,6 @@ static void test_simple_joystick( DWORD version )
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
"GetProperty DIPROP_KEYNAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
@@ -4374,7 +4370,6 @@ static void test_simple_joystick( DWORD version )
prop_string.diph.dwHow = DIPH_BYUSAGE;
prop_string.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
"GetProperty DIPROP_KEYNAME returned %#x\n", hr );
if (hr == DI_OK)
@@ -4413,7 +4408,6 @@ static void test_simple_joystick( DWORD version )
ok( prop_range.lMin == 0, "got %d expected %d\n", prop_range.lMin, 0 );
ok( prop_range.lMax == 65535, "got %d expected %d\n", prop_range.lMax, 65535 );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
"GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
if (hr == DI_OK)
@@ -4422,7 +4416,6 @@ static void test_simple_joystick( DWORD version )
ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
}
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
"GetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
if (hr == DI_OK)
@@ -5002,11 +4995,9 @@ static void test_simple_joystick( DWORD version )
hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
"SetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
"SetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
@@ -5061,7 +5052,6 @@ static void test_simple_joystick( DWORD version )
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, NULL );
ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
"SetProperty DIPROP_VIDPID returned %#x\n", hr );
@@ -5069,7 +5059,6 @@ static void test_simple_joystick( DWORD version )
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
"SetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
@@ -5092,11 +5081,9 @@ static void test_simple_joystick( DWORD version )
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
"SetProperty DIPROP_TYPENAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
"SetProperty DIPROP_USERNAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
@@ -5116,7 +5103,7 @@ static void test_simple_joystick( DWORD version )
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- todo_wine
+ todo_wine_if( version >= 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
"SetProperty DIPROP_APPDATA returned %#x\n", hr );
@@ -5270,7 +5257,6 @@ static void test_simple_joystick( DWORD version )
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_pointer.uData = 0xfeedcafe;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- todo_wine_if( version < 0x0800 )
ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
"SetProperty DIPROP_APPDATA returned %#x\n", hr );
--
2.34.1
Jan. 3, 2022
[PATCH 1/4] dinput8/tests: Test simple joystick with older dinput versions.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
This will overflow the test output limit on Wine, and I'm not sure what
to do about it. I don't think there's an unusually large number of todos
but the number of tests in this file simply has grow very large.
I can split the tests into individual files, if that's better, but I
believe it will make some of the tests run less often if they aren't
touched, which may not be desirable.
dlls/dinput8/tests/hid.c | 464 ++++++++++++++++++++++++++++-----------
1 file changed, 335 insertions(+), 129 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 82657c2e235..17559c61a39 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -3350,8 +3350,11 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c
struct check_objects_todos
{
BOOL type;
+ BOOL ofs;
BOOL guid;
+ BOOL flags;
BOOL usage;
+ BOOL usage_page;
BOOL name;
};
@@ -3388,16 +3391,18 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar
check_member( *obj, *exp, "%u", dwSize );
todo_wine_if( todo->guid )
check_member_guid( *obj, *exp, guidType );
- todo_wine_if( params->version < 0x700 && (obj->dwType & DIDFT_BUTTON) )
+ todo_wine_if( todo->ofs )
check_member( *obj, *exp, "%#x", dwOfs );
todo_wine_if( todo->type )
check_member( *obj, *exp, "%#x", dwType );
+ todo_wine_if( todo->flags )
check_member( *obj, *exp, "%#x", dwFlags );
if (!localized) todo_wine_if( todo->name )check_member_wstr( *obj, *exp, tszName );
check_member( *obj, *exp, "%u", dwFFMaxForce );
check_member( *obj, *exp, "%u", dwFFForceResolution );
check_member( *obj, *exp, "%u", wCollectionNumber );
check_member( *obj, *exp, "%u", wDesignatorIndex );
+ todo_wine_if( todo->usage_page )
check_member( *obj, *exp, "%#04x", wUsagePage );
todo_wine_if( todo->usage )
check_member( *obj, *exp, "%#04x", wUsage );
@@ -3681,7 +3686,7 @@ static HRESULT create_dinput_device( DWORD version, DIDEVICEINSTANCEW *devinst,
return DI_OK;
}
-static void test_simple_joystick(void)
+static void test_simple_joystick( DWORD version )
{
#include "psh_hid_macros.h"
static const unsigned char report_desc[] =
@@ -3737,11 +3742,12 @@ static void test_simple_joystick(void)
{
.InputReportByteLength = 9,
};
- static const DIDEVCAPS expect_caps =
+ const DIDEVCAPS expect_caps =
{
.dwSize = sizeof(DIDEVCAPS),
.dwFlags = DIDC_ATTACHED | DIDC_EMULATED,
- .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK,
+ .dwDevType = version >= 0x800 ? DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK
+ : DIDEVTYPE_HID | (DIDEVTYPEJOYSTICK_RUDDER << 8) | DIDEVTYPE_JOYSTICK,
.dwAxes = 6,
.dwPOVs = 1,
.dwButtons = 2,
@@ -3826,7 +3832,8 @@ static void test_simple_joystick(void)
.dwSize = sizeof(DIDEVICEINSTANCEW),
.guidInstance = expect_guid_product,
.guidProduct = expect_guid_product,
- .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK,
+ .dwDevType = version >= 0x800 ? DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK
+ : DIDEVTYPE_HID | (DIDEVTYPEJOYSTICK_RUDDER << 8) | DIDEVTYPE_JOYSTICK,
.tszInstanceName = L"Wine test root driver",
.tszProductName = L"Wine test root driver",
.guidFFDriver = GUID_NULL,
@@ -3954,14 +3961,110 @@ static void test_simple_joystick(void)
.wUsage = HID_USAGE_GENERIC_JOYSTICK,
},
};
- const DIEFFECTINFOW expect_effects[] = {};
-
+ const DIDEVICEOBJECTINSTANCEW expect_objects_5[] =
+ {
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_XAxis,
+ .dwOfs = DIJOFS_X,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(0),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"X Axis",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_X,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_YAxis,
+ .dwOfs = DIJOFS_Y,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(1),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Y Axis",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Y,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_ZAxis,
+ .dwOfs = DIJOFS_Z,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(2),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Wheel",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_WHEEL,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_RzAxis,
+ .dwOfs = DIJOFS_RZ,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(5),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Rudder",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_SIMULATION,
+ .wUsage = HID_USAGE_SIMULATION_RUDDER,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_POV,
+ .dwOfs = DIJOFS_POV(0),
+ .dwType = DIDFT_POV|DIDFT_MAKEINSTANCE(0),
+ .tszName = L"Hat Switch",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_HATSWITCH,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Button,
+ .dwOfs = DIJOFS_BUTTON(0),
+ .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(0),
+ .tszName = L"Button 0",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_BUTTON,
+ .wUsage = 0x1,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Button,
+ .dwOfs = DIJOFS_BUTTON(1),
+ .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(1),
+ .tszName = L"Button 1",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_BUTTON,
+ .wUsage = 0x2,
+ .wReportId = 1,
+ },
+ };
+ struct check_objects_todos todo_objects_5[ARRAY_SIZE(expect_objects_5)] =
+ {
+ {.guid = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .type = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ };
struct check_objects_params check_objects_params =
{
- .version = DIRECTINPUT_VERSION,
- .expect_count = ARRAY_SIZE(expect_objects),
- .expect_objs = expect_objects,
+ .version = version,
+ .expect_count = version < 0x700 ? ARRAY_SIZE(expect_objects_5) : ARRAY_SIZE(expect_objects),
+ .expect_objs = version < 0x700 ? expect_objects_5 : expect_objects,
+ .todo_objs = version < 0x700 ? todo_objects_5 : NULL,
+ .todo_extra = version < 0x700 ? TRUE : FALSE,
};
+
+ const DIEFFECTINFOW expect_effects[] = {};
struct check_effects_params check_effects_params =
{
.expect_count = ARRAY_SIZE(expect_effects),
@@ -4015,44 +4118,55 @@ static void test_simple_joystick(void)
WCHAR cwd[MAX_PATH], tempdir[MAX_PATH];
DIDEVICEOBJECTDATA objdata[32] = {{0}};
DIDEVICEOBJECTINSTANCEW objinst = {0};
+ DIDEVICEOBJECTINSTANCEW expect_obj;
DIDEVICEINSTANCEW devinst = {0};
DIEFFECTINFOW effectinfo = {0};
DIDATAFORMAT dataformat = {0};
IDirectInputDevice8W *device;
IDirectInputEffect *effect;
DIEFFESCAPE escape = {0};
+ ULONG i, size, res, ref;
DIDEVCAPS caps = {0};
HANDLE event, file;
char buffer[1024];
DIJOYSTATE2 state;
- ULONG i, res, ref;
HRESULT hr;
WCHAR *tmp;
GUID guid;
HWND hwnd;
+ winetest_push_context( "version %#x", version );
+
GetCurrentDirectoryW( ARRAY_SIZE(cwd), cwd );
GetTempPathW( ARRAY_SIZE(tempdir), tempdir );
SetCurrentDirectoryW( tempdir );
cleanup_registry_keys();
if (!dinput_driver_start( report_desc, sizeof(report_desc), &hid_caps, NULL, 0 )) goto done;
- if (FAILED(hr = create_dinput_device( DIRECTINPUT_VERSION, &devinst, &device ))) goto done;
+ if (FAILED(hr = create_dinput_device( version, &devinst, &device ))) goto done;
- hr = IDirectInputDevice8_Initialize( device, instance, 0x0700, &GUID_NULL );
- todo_wine
- ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, NULL );
+ hr = IDirectInputDevice8_Initialize( device, instance, 0x800 - (version - 0x700), &GUID_NULL );
+ if (version == 0x800)
+ {
+ todo_wine
+ ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
+ }
+ else
+ {
+ todo_wine
+ ok( hr == DIERR_OLDDIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
+ }
+ hr = IDirectInputDevice8_Initialize( device, instance, version, NULL );
todo_wine
ok( hr == E_POINTER, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, NULL, DIRECTINPUT_VERSION, &GUID_NULL );
+ hr = IDirectInputDevice8_Initialize( device, NULL, version, &GUID_NULL );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &GUID_NULL );
+ hr = IDirectInputDevice8_Initialize( device, instance, version, &GUID_NULL );
todo_wine
ok( hr == REGDB_E_CLASSNOTREG, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidInstance );
+ hr = IDirectInputDevice8_Initialize( device, instance, version, &devinst.guidInstance );
ok( hr == DI_OK, "Initialize returned %#x\n", hr );
guid = devinst.guidInstance;
memset( &devinst, 0, sizeof(devinst) );
@@ -4061,7 +4175,7 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr );
ok( IsEqualGUID( &guid, &devinst.guidInstance ), "got %s expected %s\n", debugstr_guid( &guid ),
debugstr_guid( &devinst.guidInstance ) );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidProduct );
+ hr = IDirectInputDevice8_Initialize( device, instance, version, &devinst.guidProduct );
ok( hr == DI_OK, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, NULL );
@@ -4076,6 +4190,7 @@ static void test_simple_joystick(void)
todo_wine
check_member_guid( devinst, expect_devinst, guidInstance );
check_member_guid( devinst, expect_devinst, guidProduct );
+ todo_wine_if( version < 0x0800 )
check_member( devinst, expect_devinst, "%#x", dwDevType );
todo_wine
check_member_wstr( devinst, expect_devinst, tszInstanceName );
@@ -4090,6 +4205,7 @@ static void test_simple_joystick(void)
todo_wine
check_member_guid( devinst, expect_devinst, guidInstance );
check_member_guid( devinst, expect_devinst, guidProduct );
+ todo_wine_if( version < 0x0800 )
check_member( devinst, expect_devinst, "%#x", dwDevType );
todo_wine
check_member_wstr( devinst, expect_devinst, tszInstanceName );
@@ -4108,6 +4224,7 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr );
check_member( caps, expect_caps, "%d", dwSize );
check_member( caps, expect_caps, "%#x", dwFlags );
+ todo_wine_if( version < 0x0800 )
check_member( caps, expect_caps, "%#x", dwDevType );
check_member( caps, expect_caps, "%d", dwAxes );
check_member( caps, expect_caps, "%d", dwButtons );
@@ -4125,7 +4242,9 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, NULL );
ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
+ "GetProperty DIPROP_VIDPID returned %#x\n", hr );
prop_dword.diph.dwHeaderSize = sizeof(DIPROPHEADER) - 1;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
@@ -4133,8 +4252,14 @@ static void test_simple_joystick(void)
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
- ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n", prop_dword.dwData, EXPECT_VIDPID );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_VIDPID returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n",
+ prop_dword.dwData, EXPECT_VIDPID );
+ }
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
ok( hr == DI_OK, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
@@ -4163,14 +4288,23 @@ static void test_simple_joystick(void)
ok( !wcscmp( prop_string.wsz, expect_devinst.tszProductName ), "got product %s\n",
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
- todo_wine
- ok( hr == DI_OK, "GetProperty DIPROP_TYPENAME returned %#x\n", hr );
- todo_wine
- ok( !wcscmp( prop_string.wsz, expect_vidpid_str ), "got type %s\n", debugstr_w(prop_string.wsz) );
+ todo_wine_if( version >= 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_TYPENAME returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ todo_wine
+ ok( !wcscmp( prop_string.wsz, expect_vidpid_str ), "got type %s\n", debugstr_w(prop_string.wsz) );
+ }
hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr );
- todo_wine
- ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_NOEFFECT),
+ "GetProperty DIPROP_USERNAME returned %#x\n", hr );
+ if (hr == DI_NOEFFECT)
+ {
+ todo_wine
+ ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
+ }
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph );
@@ -4210,7 +4344,9 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
+ "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
@@ -4238,9 +4374,14 @@ static void test_simple_joystick(void)
prop_string.diph.dwHow = DIPH_BYUSAGE;
prop_string.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
- ok( !wcscmp( prop_string.wsz, expect_objects[4].tszName ), "got DIPROP_KEYNAME %s\n",
- debugstr_w( prop_string.wsz ) );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( !wcscmp( prop_string.wsz, expect_objects[4].tszName ), "got DIPROP_KEYNAME %s\n",
+ debugstr_w( prop_string.wsz ) );
+ }
prop_string.diph.dwObj = MAKELONG( 0x1, HID_USAGE_PAGE_BUTTON );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
todo_wine
@@ -4255,7 +4396,9 @@ static void test_simple_joystick(void)
prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DI_OK : DIERR_NOTFOUND),
+ "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( 0, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
@@ -4270,19 +4413,33 @@ static void test_simple_joystick(void)
ok( prop_range.lMin == 0, "got %d expected %d\n", prop_range.lMin, 0 );
ok( prop_range.lMax == 65535, "got %d expected %d\n", prop_range.lMax, 65535 );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
- ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
- ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
+ ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ }
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
- ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
- ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
+ ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ }
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- todo_wine
- ok( hr == DIERR_NOTINITIALIZED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ if (version < 0x0800) ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ else
+ {
+ todo_wine
+ ok( hr == DIERR_NOTINITIALIZED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ }
hr = IDirectInputDevice8_EnumObjects( device, NULL, NULL, DIDFT_ALL );
ok( hr == DIERR_INVALIDPARAM, "EnumObjects returned %#x\n", hr );
@@ -4291,7 +4448,8 @@ static void test_simple_joystick(void)
res = 0;
hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, DIDFT_AXIS | DIDFT_PSHBUTTON );
ok( hr == DI_OK, "EnumObjects returned %#x\n", hr );
- ok( res == 8, "got %u expected %u\n", res, 8 );
+ todo_wine_if( version < 0x0700 )
+ ok( res == (version < 0x0700 ? 6 : 8), "got %u objects\n", res );
hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL );
ok( hr == DI_OK, "EnumObjects returned %#x\n", hr );
ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n",
@@ -4307,26 +4465,30 @@ static void test_simple_joystick(void)
res = MAKELONG( HID_USAGE_GENERIC_Z, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE );
- ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DI_OK : DIERR_NOTFOUND), "GetObjectInfo returned: %#x\n", hr );
res = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE );
ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
- check_member( objinst, expect_objects[4], "%u", dwSize );
- check_member_guid( objinst, expect_objects[4], guidType );
- check_member( objinst, expect_objects[4], "%#x", dwOfs );
- check_member( objinst, expect_objects[4], "%#x", dwType );
- check_member( objinst, expect_objects[4], "%#x", dwFlags );
- if (!localized) check_member_wstr( objinst, expect_objects[4], tszName );
- check_member( objinst, expect_objects[4], "%u", dwFFMaxForce );
- check_member( objinst, expect_objects[4], "%u", dwFFForceResolution );
- check_member( objinst, expect_objects[4], "%u", wCollectionNumber );
- check_member( objinst, expect_objects[4], "%u", wDesignatorIndex );
- check_member( objinst, expect_objects[4], "%#04x", wUsagePage );
- check_member( objinst, expect_objects[4], "%#04x", wUsage );
- check_member( objinst, expect_objects[4], "%#04x", dwDimension );
- check_member( objinst, expect_objects[4], "%#04x", wExponent );
- check_member( objinst, expect_objects[4], "%u", wReportId );
+ if (version < 0x0700) expect_obj = expect_objects_5[0];
+ else expect_obj = expect_objects[4];
+ check_member( objinst, expect_obj, "%u", dwSize );
+ check_member_guid( objinst, expect_obj, guidType );
+ todo_wine_if( version < 0x0700 )
+ check_member( objinst, expect_obj, "%#x", dwOfs );
+ check_member( objinst, expect_obj, "%#x", dwType );
+ check_member( objinst, expect_obj, "%#x", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_obj, tszName );
+ check_member( objinst, expect_obj, "%u", dwFFMaxForce );
+ check_member( objinst, expect_obj, "%u", dwFFForceResolution );
+ check_member( objinst, expect_obj, "%u", wCollectionNumber );
+ check_member( objinst, expect_obj, "%u", wDesignatorIndex );
+ check_member( objinst, expect_obj, "%#04x", wUsagePage );
+ check_member( objinst, expect_obj, "%#04x", wUsage );
+ check_member( objinst, expect_obj, "%#04x", dwDimension );
+ check_member( objinst, expect_obj, "%#04x", wExponent );
+ check_member( objinst, expect_obj, "%u", wReportId );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0x14, DIPH_BYOFFSET );
ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
@@ -4339,21 +4501,24 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYID );
ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
- check_member( objinst, expect_objects[8], "%u", dwSize );
- check_member_guid( objinst, expect_objects[8], guidType );
- check_member( objinst, expect_objects[8], "%#x", dwOfs );
- check_member( objinst, expect_objects[8], "%#x", dwType );
- check_member( objinst, expect_objects[8], "%#x", dwFlags );
- if (!localized) check_member_wstr( objinst, expect_objects[8], tszName );
- check_member( objinst, expect_objects[8], "%u", dwFFMaxForce );
- check_member( objinst, expect_objects[8], "%u", dwFFForceResolution );
- check_member( objinst, expect_objects[8], "%u", wCollectionNumber );
- check_member( objinst, expect_objects[8], "%u", wDesignatorIndex );
- check_member( objinst, expect_objects[8], "%#04x", wUsagePage );
- check_member( objinst, expect_objects[8], "%#04x", wUsage );
- check_member( objinst, expect_objects[8], "%#04x", dwDimension );
- check_member( objinst, expect_objects[8], "%#04x", wExponent );
- check_member( objinst, expect_objects[8], "%u", wReportId );
+ if (version < 0x0700) expect_obj = expect_objects_5[6];
+ else expect_obj = expect_objects[8];
+ check_member( objinst, expect_obj, "%u", dwSize );
+ check_member_guid( objinst, expect_obj, guidType );
+ todo_wine_if( version < 0x0700 )
+ check_member( objinst, expect_obj, "%#x", dwOfs );
+ check_member( objinst, expect_obj, "%#x", dwType );
+ check_member( objinst, expect_obj, "%#x", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_obj, tszName );
+ check_member( objinst, expect_obj, "%u", dwFFMaxForce );
+ check_member( objinst, expect_obj, "%u", dwFFForceResolution );
+ check_member( objinst, expect_obj, "%u", wCollectionNumber );
+ check_member( objinst, expect_obj, "%u", wDesignatorIndex );
+ check_member( objinst, expect_obj, "%#04x", wUsagePage );
+ check_member( objinst, expect_obj, "%#04x", wUsage );
+ check_member( objinst, expect_obj, "%#04x", dwDimension );
+ check_member( objinst, expect_obj, "%#04x", wExponent );
+ check_member( objinst, expect_obj, "%u", wReportId );
hr = IDirectInputDevice8_EnumEffects( device, NULL, NULL, DIEFT_ALL );
ok( hr == DIERR_INVALIDPARAM, "EnumEffects returned %#x\n", hr );
@@ -4397,21 +4562,25 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, DIJOFS_Y, DIPH_BYOFFSET );
ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
- check_member( objinst, expect_objects[3], "%u", dwSize );
- check_member_guid( objinst, expect_objects[3], guidType );
- check_member( objinst, expect_objects[3], "%#x", dwOfs );
- check_member( objinst, expect_objects[3], "%#x", dwType );
- check_member( objinst, expect_objects[3], "%#x", dwFlags );
- if (!localized) check_member_wstr( objinst, expect_objects[3], tszName );
- check_member( objinst, expect_objects[3], "%u", dwFFMaxForce );
- check_member( objinst, expect_objects[3], "%u", dwFFForceResolution );
- check_member( objinst, expect_objects[3], "%u", wCollectionNumber );
- check_member( objinst, expect_objects[3], "%u", wDesignatorIndex );
- check_member( objinst, expect_objects[3], "%#04x", wUsagePage );
- check_member( objinst, expect_objects[3], "%#04x", wUsage );
- check_member( objinst, expect_objects[3], "%#04x", dwDimension );
- check_member( objinst, expect_objects[3], "%#04x", wExponent );
- check_member( objinst, expect_objects[3], "%u", wReportId );
+ if (version < 0x0700) expect_obj = expect_objects_5[1];
+ else expect_obj = expect_objects[3];
+ if (version < 0x0800) expect_obj.dwOfs = DIJOFS_Y;
+ check_member( objinst, expect_obj, "%u", dwSize );
+ check_member_guid( objinst, expect_obj, guidType );
+ todo_wine_if( version < 0x0800 )
+ check_member( objinst, expect_obj, "%#x", dwOfs );
+ check_member( objinst, expect_obj, "%#x", dwType );
+ check_member( objinst, expect_obj, "%#x", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_obj, tszName );
+ check_member( objinst, expect_obj, "%u", dwFFMaxForce );
+ check_member( objinst, expect_obj, "%u", dwFFForceResolution );
+ check_member( objinst, expect_obj, "%u", wCollectionNumber );
+ check_member( objinst, expect_obj, "%u", wDesignatorIndex );
+ check_member( objinst, expect_obj, "%#04x", wUsagePage );
+ check_member( objinst, expect_obj, "%#04x", wUsage );
+ check_member( objinst, expect_obj, "%#04x", dwDimension );
+ check_member( objinst, expect_obj, "%#04x", wExponent );
+ check_member( objinst, expect_obj, "%u", wReportId );
hr = IDirectInputDevice8_SetEventNotification( device, (HANDLE)0xdeadbeef );
todo_wine
@@ -4472,7 +4641,8 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
hr = IDirectInputDevice8_Poll( device );
- ok( hr == DI_NOEFFECT, "Poll returned: %#x\n", hr );
+ todo_wine_if( version < 0x0700 )
+ ok( hr == (version < 0x0700 ? DI_OK : DI_NOEFFECT), "Poll returned: %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2) + 1, &state );
ok( hr == DIERR_INVALIDPARAM, "GetDeviceState returned: %#x\n", hr );
@@ -4516,11 +4686,16 @@ static void test_simple_joystick(void)
winetest_pop_context();
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA) - 1, objdata, &res, DIGDD_PEEK );
- todo_wine
- ok( hr == DIERR_INVALIDPARAM, "GetDeviceData returned %#x\n", hr );
+ size = version < 0x0800 ? sizeof(DIDEVICEOBJECTDATA_DX3) : sizeof(DIDEVICEOBJECTDATA);
+ hr = IDirectInputDevice8_GetDeviceData( device, size - 1, objdata, &res, DIGDD_PEEK );
+ if (version < 0x0800) ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
+ else
+ {
+ todo_wine
+ ok( hr == DIERR_INVALIDPARAM, "GetDeviceData returned %#x\n", hr );
+ }
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
ok( hr == DIERR_NOTBUFFERED, "GetDeviceData returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
@@ -4538,7 +4713,7 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
@@ -4548,12 +4723,13 @@ static void test_simple_joystick(void)
ResetEvent( event );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
+ todo_wine_if( version < 0x0800 )
ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
- todo_wine
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
+ todo_wine_if( version >= 0x0800 )
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
@@ -4573,22 +4749,23 @@ static void test_simple_joystick(void)
ResetEvent( event );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 1, "got %u expected %u\n", res, 1 );
check_member( objdata[0], expect_objdata[0], "%#x", dwOfs );
check_member( objdata[0], expect_objdata[0], "%#x", dwData );
- ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 );
+ if (version >= 0x0800) ok( objdata[0].uAppData == -1, "got %p\n", (void *)objdata[0].uAppData );
res = 4;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 4, "got %u expected %u\n", res, 4 );
for (i = 0; i < 4; ++i)
{
+ DIDEVICEOBJECTDATA *ptr = (DIDEVICEOBJECTDATA *)((char *)objdata + size * i);
winetest_push_context( "objdata[%d]", i );
- check_member( objdata[i], expect_objdata[1 + i], "%#x", dwOfs );
- check_member( objdata[i], expect_objdata[1 + i], "%#x", dwData );
- ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 );
+ check_member( *ptr, expect_objdata[1 + i], "%#x", dwOfs );
+ check_member( *ptr, expect_objdata[1 + i], "%#x", dwData );
+ if (version >= 0x0800) ok( ptr->uAppData == -1, "got %p\n", (void *)ptr->uAppData );
winetest_pop_context();
}
@@ -4602,26 +4779,28 @@ static void test_simple_joystick(void)
ResetEvent( event );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
+ todo_wine_if( version < 0x0800 )
ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr );
ok( res == 1, "got %u expected %u\n", res, 1 );
todo_wine
check_member( objdata[0], expect_objdata[5], "%#x", dwOfs );
todo_wine
check_member( objdata[0], expect_objdata[5], "%#x", dwData );
- ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 );
+ if (version >= 0x0800) ok( objdata[0].uAppData == -1, "got %p\n", (void *)objdata[0].uAppData );
res = ARRAY_SIZE(objdata);
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 8, "got %u expected %u\n", res, 8 );
for (i = 0; i < 8; ++i)
{
+ DIDEVICEOBJECTDATA *ptr = (DIDEVICEOBJECTDATA *)((char *)objdata + size * i);
winetest_push_context( "objdata[%d]", i );
todo_wine
- check_member( objdata[i], expect_objdata[6 + i], "%#x", dwOfs );
+ check_member( *ptr, expect_objdata[6 + i], "%#x", dwOfs );
todo_wine_if( i == 1 || i == 2 || i == 6 )
- check_member( objdata[i], expect_objdata[6 + i], "%#x", dwData );
- ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 );
+ check_member( *ptr, expect_objdata[6 + i], "%#x", dwData );
+ if (version >= 0x0800) ok( ptr->uAppData == -1, "got %p\n", (void *)ptr->uAppData );
winetest_pop_context();
}
@@ -4719,7 +4898,9 @@ static void test_simple_joystick(void)
ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr );
objdataformat[1].dwType = DIDFT_AXIS|DIDFT_MAKEINSTANCE( 0xff );
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
- ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr );
+ todo_wine_if( version < 0x0700 )
+ ok( hr == (version < 0x0700 ? DI_OK : DIERR_INVALIDPARAM),
+ "SetDataFormat returned: %#x\n", hr );
objdataformat[1].dwType = DIDFT_AXIS|DIDFT_MAKEINSTANCE( 1 );
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
@@ -4821,9 +5002,13 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
- ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
+ "SetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
- ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
+ "SetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
@@ -4876,13 +5061,17 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, NULL );
ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
+ "SetProperty DIPROP_VIDPID returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DIERR_READONLY, "SetProperty DIPROP_VIDPID returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
+ "SetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
ok( hr == DIERR_READONLY, "SetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
@@ -4903,9 +5092,13 @@ static void test_simple_joystick(void)
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
- ok( hr == DIERR_READONLY, "SetProperty DIPROP_TYPENAME returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
+ "SetProperty DIPROP_TYPENAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- ok( hr == DIERR_READONLY, "SetProperty DIPROP_USERNAME returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
+ "SetProperty DIPROP_USERNAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
ok( hr == DIERR_READONLY, "SetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
@@ -4924,7 +5117,8 @@ static void test_simple_joystick(void)
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
todo_wine
- ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
+ "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
@@ -5039,8 +5233,8 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
winetest_push_context( "state[%d]", i );
- todo_wine
- ok( state.lX == 15, "got lX %d, expected %d\n" , state.lX, 15 );
+ todo_wine_if( version >= 0x0700 )
+ ok( state.lX == (version < 0x0700 ? -9000 : 15), "got lX %d\n", state.lX );
check_member( state, expect_state_abs[0], "%d", lY );
check_member( state, expect_state_abs[0], "%d", lZ );
check_member( state, expect_state_abs[0], "%d", lRx );
@@ -5076,7 +5270,9 @@ static void test_simple_joystick(void)
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_pointer.uData = 0xfeedcafe;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- ok( hr == DI_OK, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph );
@@ -5103,9 +5299,13 @@ static void test_simple_joystick(void)
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- todo_wine
- ok( hr == DI_OK, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
- ok( prop_pointer.uData == 0xfeedcafe, "got %p expected %p\n", (void *)prop_pointer.uData, (void *)0xfeedcafe );
+ if (version < 0x0800) ok( hr == DIERR_UNSUPPORTED, "GetProperty returned %#x\n", hr );
+ else
+ {
+ todo_wine
+ ok( hr == DI_OK, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( prop_pointer.uData == 0xfeedcafe, "got %p expected %p\n", (void *)prop_pointer.uData, (void *)0xfeedcafe );
+ }
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
@@ -5185,15 +5385,15 @@ static void test_simple_joystick(void)
objdata[0].dwOfs = 0xd;
objdata[0].dwData = 0x80;
res = 1;
- hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0xdeadbeef );
+ hr = IDirectInputDevice8_SendDeviceData( device, size, objdata, &res, 0xdeadbeef );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
res = 1;
- hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 1 /*DISDD_CONTINUE*/ );
+ hr = IDirectInputDevice8_SendDeviceData( device, size, objdata, &res, 1 /*DISDD_CONTINUE*/ );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
res = 1;
- hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_SendDeviceData( device, size, objdata, &res, 0 );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
@@ -5249,6 +5449,7 @@ done:
pnp_driver_stop();
cleanup_registry_keys();
SetCurrentDirectoryW( cwd );
+ winetest_pop_context();
}
struct device_desc
@@ -8035,6 +8236,8 @@ static void test_force_feedback_joystick( DWORD version )
{.guid = TRUE, .type = TRUE, .usage = TRUE, .name = TRUE},
{0},
{.guid = TRUE, .type = TRUE, .usage = TRUE, .name = TRUE},
+ {.ofs = TRUE},
+ {.ofs = TRUE},
};
struct check_objects_params check_objects_params =
{
@@ -10014,7 +10217,10 @@ START_TEST( hid )
test_device_types( 0x500 );
test_device_types( 0x700 );
- test_simple_joystick();
+ test_simple_joystick( 0x500 );
+ test_simple_joystick( 0x700 );
+ test_simple_joystick( 0x800 );
+
test_force_feedback_joystick( 0x500 );
test_force_feedback_joystick( 0x700 );
test_force_feedback_joystick( 0x800 );
--
2.34.1
Jan. 3, 2022
Re: [PATCH v2 1/6] dinput: Simplify the internal thread and don't require loader lock.
by Rémi Bernon
On 1/3/22 01:14, Fabian Maurer wrote:
> This leads to a regression, see https://bugs.winehq.org/show_bug.cgi?id=52314
>
> Not sure how that ever worked, since AFAIK shutting down the thread inside dll
> detach should always cause a deadlock.
>
> On Freitag, 10. Dezember 2021 09:44:44 CET Rémi Bernon wrote:
>> When thread shuts down, instead of holding and releasing a module ref.
>>
>> This keeps the thread alive until the module is unloaded, instead of
>> keeping track of live IDirectInput instances.
>>
>> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
>> ---
>
Yes, I intended to send some patches to fix it. It works in most cases
when the DLL is unloaded on process shutdown (where LdrShutdownThread
does nothing), but not when the DLL is manually unloaded.
As we're doing the same thing in XInput, it may cause the same thing
there, although I haven't seen any report about it yet.
However, it'll be much more difficult to fix it here as there's no
device creation / acquire mechanism, and no way to tell exactly when the
thread can safely exit.
--
Rémi Bernon <rbernon(a)codeweavers.com>
Jan. 3, 2022
[PATCH] include: Add SL_ERROR_RETURNED
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
I noticed that this was missing while investigating a testbot failure.
---
include/ddk/wdm.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index b798d339561..d00acf5b782 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -961,6 +961,7 @@ typedef NTSTATUS (WINAPI *PIO_COMPLETION_ROUTINE)(
IN PVOID Context);
#define SL_PENDING_RETURNED 0x01
+#define SL_ERROR_RETURNED 0x02
#define SL_INVOKE_ON_CANCEL 0x20
#define SL_INVOKE_ON_SUCCESS 0x40
#define SL_INVOKE_ON_ERROR 0x80
--
2.34.1
Jan. 3, 2022
[PATCH] d3dx9_36/tests: Add missing call to ID3DXSprite_End
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
I think this will help prevent the testbot from crashing intermittently
in check_release(sprite, 0).
---
dlls/d3dx9_36/tests/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c
index a8477591e87..ea2d1e4465b 100644
--- a/dlls/d3dx9_36/tests/core.c
+++ b/dlls/d3dx9_36/tests/core.c
@@ -319,6 +319,8 @@ static void test_ID3DXSprite(IDirect3DDevice9 *device)
ok (hr == D3D_OK, "Begin returned %#x, expected %#x\n", hr, D3D_OK);
hr = ID3DXSprite_Draw(sprite, tex2, &rect, ¢er, &pos, D3DCOLOR_XRGB(255, 255, 255));
ok (hr == D3D_OK, "Draw returned %#x, expected %#x\n", hr, D3D_OK);
+ hr = ID3DXSprite_End(sprite);
+ ok (hr == D3D_OK, "End returned %#x, expected %#x\n", hr, D3D_OK);
IDirect3DDevice9_EndScene(device);
check_release((IUnknown*)sprite, 0);
--
2.34.1
Jan. 3, 2022