Wine-devel
Threads by month
- ----- 2026 -----
- 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
April 2022
- 87 participants
- 938 discussions
21 Apr '22
This takes advantage of the fact that all of the @Headers parts are
joined with linebreaks.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/Submit.pl | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 9292d387b..ca225b615 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -620,14 +620,13 @@ sub GetHeaderText($)
}
if ($self->{Page} == 2 or $self->{Page} == 4)
{
- my $HeaderText = "Select the VMs on which you want to run your test.";
+ push @Headers, "Select the VMs on which you want to run your test.";
my $VMs = CreateVMs();
$VMs->AddFilter("Status", ["offline", "maintenance"]);
if (!$VMs->IsEmpty())
{
- $HeaderText .= "<br>NOTE: Offline VMs and those undergoing maintenance will not be able to run your tests right away.";
+ push @Headers, "NOTE: Offline VMs and those undergoing maintenance will not be able to run your tests right away.";
}
- push @Headers, $HeaderText;
}
if (($self->{Page} == 3 or $self->{Page} == 0) and $self->{Impacts})
{
@@ -652,7 +651,7 @@ sub GetHeaderText($)
}
push @TestExecutables, "$ModuleName: ". join(" ", @TestUnits) if (@TestUnits);
}
- push @Headers, join("<br>\n", "Here is a list of the test executables impacted by the patch (patched test units, if any, are in italics).", @TestExecutables);
+ push @Headers, "Here is a list of the test executables impacted by the patch (patched test units, if any, are in italics).", @TestExecutables;
}
return join("<br>\n", @Headers);
--
2.30.2
1
0
[tools] testbot/web: Tweak the Login and ResetPassword GetInputType() formatting.
by Francois Gouget 21 Apr '22
by Francois Gouget 21 Apr '22
21 Apr '22
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/Login.pl | 9 +++------
testbot/web/ResetPassword.pl | 9 +++------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/testbot/web/Login.pl b/testbot/web/Login.pl
index 837617d8d..7b9a6ffeb 100644
--- a/testbot/web/Login.pl
+++ b/testbot/web/Login.pl
@@ -65,12 +65,9 @@ sub GetInputType($$)
{
my ($self, $PropertyDescriptor) = @_;
- if ($PropertyDescriptor->GetName() eq "Password")
- {
- return "password";
- }
-
- return $self->SUPER::GetInputType($PropertyDescriptor);
+ my $PropertyName = $PropertyDescriptor->GetName();
+ return $PropertyName eq "Password" ? "password" :
+ $self->SUPER::GetInputType($PropertyDescriptor);
}
sub GenerateFields($)
diff --git a/testbot/web/ResetPassword.pl b/testbot/web/ResetPassword.pl
index 4f672ea94..081e27f19 100644
--- a/testbot/web/ResetPassword.pl
+++ b/testbot/web/ResetPassword.pl
@@ -63,12 +63,9 @@ sub GetInputType($$)
{
my ($self, $PropertyDescriptor) = @_;
- if (substr($PropertyDescriptor->GetName(), 0, 8) eq "Password")
- {
- return "password";
- }
-
- return $self->SUPER::GetInputType($PropertyDescriptor);
+ my $PropertyName = substr($PropertyDescriptor->GetName(), 0, 8);
+ return $PropertyName eq "Password" ? "password" :
+ $self->SUPER::GetInputType($PropertyDescriptor);
}
sub GetActions($)
--
2.30.2
1
0
21 Apr '22
---
v2: [PATCH 5/5] ~0u -> 0xffffff
"if (glyph_ptr[x] == ~0u) { dst_ptr[x] = text_pixel; continue; }"
I realized that this line is not working. I'm sorry that didn't review it
more carefully.
I got 10% additional performance improvement, so re-tested the entire test.
---
After commit 649dd12, I propose some improvements related to the dibdrv
FontSmoothingGamma code. Using pre-computed value and Removing branches
in the inline function can provide some performance improvements.
CrystalMark2004R7 GDI Text Bench result(5times average) [1][2]:
- OLD : 6673 (100%) pre 649dd12
- CURRENT : 5584 ( 84%) with gamma == 1000
- CURRENT : 4989 ( 75%) with gamma != 1000
- PATCH v2 1/5: 5125 ( 77%)
- PATCH v2 2/5: 5528 ( 83%)
- PATCH v2 5/5: 6772 (101%)
Please, Note that OLD and CURRENT(gamma == 1000) doesn't have
FontSmoothingGamma ability.
These improvements allow to change the gamma default value to 1400(MS
GDI32 default value), while reducing performance losses.
[1]
If the dibdrv glyph caching code is turned off, the CrystalMark result
value is reduced by 10 times!
With the dibdrv glyph cache ON, the performance factors in the pre-caching
phase are hidden. This indicates that dibdrv::draw_glyph() performance is
the dominant factor of the CrystalMark result value.
The result does not represent GDI32 text engine performance in all situations,
but it can be referred to in the current situation.
[2]
CrystalMark apply different weights to the result value calculation depending
on the fontsmoothing type. And current Wine does not synchronize the xrdb
resource values and the SystemParametersInfo() results.
Therefore, required some attention in the configuration of the test
environment and the result analysis. I tested it under the conditions below:
$ xrdb -remove
$ winetricks fontsmooth=rgb
Byeong-Sik Jeon (5):
win32u: Remove gamma == 1000 special case code.
win32u: Use pre-calculated decoded_text value.
win32u: Remove the gamma value calibration code.
win32u: Set the default gamma value to 1400.
win32u: Remove the branches in blend_color_gamma().
dlls/win32u/dibdrv/primitives.c | 74 +++++++++++++++++----------------
dlls/win32u/font.c | 13 ++----
dlls/win32u/freetype.c | 4 +-
3 files changed, 43 insertions(+), 48 deletions(-)
--
2.36.0
1
5
[PATCH 1/4] dinput/tests: Add tests for joystick with many axes and units.
by Rémi Bernon 21 Apr '22
by Rémi Bernon 21 Apr '22
21 Apr '22
Checking that only a few axes get really mapped to the slider axes, and
that we shouldn't use HID_USAGE_SIMULATION_RUDDER if there's already an
Rz mapped axis.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/tests/joystick8.c | 572 ++++++++++++++++++++++++++++++++++
1 file changed, 572 insertions(+)
diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c
index 597846d9f57..32d03a603c3 100644
--- a/dlls/dinput/tests/joystick8.c
+++ b/dlls/dinput/tests/joystick8.c
@@ -2621,6 +2621,577 @@ static BOOL test_device_types( DWORD version )
return success;
}
+static void test_many_axes_joystick(void)
+{
+#include "psh_hid_macros.h"
+ static const unsigned char report_desc[] =
+ {
+ USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
+ USAGE(1, HID_USAGE_GENERIC_JOYSTICK),
+ COLLECTION(1, Application),
+ USAGE(1, HID_USAGE_GENERIC_JOYSTICK),
+ COLLECTION(1, Report),
+ REPORT_ID(1, 1),
+
+ USAGE(1, HID_USAGE_GENERIC_DIAL),
+ USAGE(1, HID_USAGE_GENERIC_SLIDER),
+ USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_RUDDER),
+ USAGE(4, (HID_USAGE_PAGE_SIMULATION<<16)|HID_USAGE_SIMULATION_THROTTLE),
+ USAGE(1, HID_USAGE_GENERIC_RZ),
+ USAGE(1, HID_USAGE_GENERIC_RY),
+ USAGE(1, HID_USAGE_GENERIC_RX),
+ USAGE(1, HID_USAGE_GENERIC_Z),
+ USAGE(1, HID_USAGE_GENERIC_Y),
+ USAGE(1, HID_USAGE_GENERIC_X),
+ LOGICAL_MINIMUM(1, 0),
+ LOGICAL_MAXIMUM(1, 0x7f),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 0x7f),
+ REPORT_SIZE(1, 8),
+ REPORT_COUNT(1, 10),
+ INPUT(1, Data|Var|Abs),
+
+ USAGE(1, HID_USAGE_GENERIC_Z),
+ USAGE(1, HID_USAGE_GENERIC_Y),
+ USAGE(1, HID_USAGE_GENERIC_X),
+ LOGICAL_MINIMUM(1, 0),
+ LOGICAL_MAXIMUM(1, 0x7f),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 0x7f),
+ UNIT(4, 0xf011), /* cm * s^-1 */
+ REPORT_SIZE(1, 8),
+ REPORT_COUNT(1, 3),
+ INPUT(1, Data|Var|Abs),
+
+ USAGE(1, HID_USAGE_GENERIC_Z),
+ USAGE(1, HID_USAGE_GENERIC_Y),
+ USAGE(1, HID_USAGE_GENERIC_X),
+ LOGICAL_MINIMUM(1, 0),
+ LOGICAL_MAXIMUM(1, 0x7f),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 0x7f),
+ UNIT(4, 0xe011), /* cm * s^-2 */
+ REPORT_SIZE(1, 8),
+ REPORT_COUNT(1, 3),
+ INPUT(1, Data|Var|Abs),
+
+ USAGE(1, HID_USAGE_GENERIC_Z),
+ USAGE(1, HID_USAGE_GENERIC_Y),
+ USAGE(1, HID_USAGE_GENERIC_X),
+ LOGICAL_MINIMUM(1, 0),
+ LOGICAL_MAXIMUM(1, 0x7f),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 0x7f),
+ UNIT(4, 0xe111), /* g * cm * s^-2 */
+ REPORT_SIZE(1, 8),
+ REPORT_COUNT(1, 3),
+ INPUT(1, Data|Var|Abs),
+ UNIT(1, 0), /* None */
+ END_COLLECTION,
+ END_COLLECTION,
+ };
+#undef REPORT_ID_OR_USAGE_PAGE
+#include "pop_hid_macros.h"
+
+ struct hid_device_desc desc =
+ {
+ .use_report_id = TRUE,
+ .caps = { .InputReportByteLength = 20 },
+ .attributes = default_attributes,
+ };
+ const DIDEVCAPS expect_caps =
+ {
+ .dwSize = sizeof(DIDEVCAPS),
+ .dwFlags = DIDC_ATTACHED | DIDC_EMULATED,
+ .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPE1STPERSON_LIMITED << 8) | DI8DEVTYPE_1STPERSON,
+ .dwAxes = 19,
+ };
+ const DIDEVICEINSTANCEW expect_devinst =
+ {
+ .dwSize = sizeof(DIDEVICEINSTANCEW),
+ .guidInstance = expect_guid_product,
+ .guidProduct = expect_guid_product,
+ .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPE1STPERSON_LIMITED << 8) | DI8DEVTYPE_1STPERSON,
+ .tszInstanceName = L"Wine Test",
+ .tszProductName = L"Wine Test",
+ .guidFFDriver = GUID_NULL,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_JOYSTICK,
+ };
+ const DIDEVICEOBJECTINSTANCEW expect_objects[] =
+ {
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_XAxis,
+ .dwOfs = 0,
+ .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 = 0x4,
+ .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 = 0x8,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(2),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Z Axis",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Z,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_RxAxis,
+ .dwOfs = 0xc,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(3),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"X Rotation",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_RX,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_RyAxis,
+ .dwOfs = 0x10,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(4),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Y Rotation",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_RY,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_RzAxis,
+ .dwOfs = 0x14,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(5),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Z Rotation",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_RZ,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Slider,
+ .dwOfs = 0x18,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(6),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Throttle",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_SIMULATION,
+ .wUsage = HID_USAGE_SIMULATION_THROTTLE,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_RzAxis,
+ .dwOfs = 0x1c,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(7),
+ .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_Slider,
+ .dwOfs = 0x20,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(8),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Slider",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_SLIDER,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Slider,
+ .dwOfs = 0x24,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(9),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Dial",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_DIAL,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_XAxis,
+ .dwOfs = 0x28,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(10),
+ .dwFlags = DIDOI_ASPECTVELOCITY,
+ .tszName = L"X Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xf011,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_X,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_YAxis,
+ .dwOfs = 0x2c,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(11),
+ .dwFlags = DIDOI_ASPECTVELOCITY,
+ .tszName = L"Y Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xf011,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Y,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_ZAxis,
+ .dwOfs = 0x30,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(12),
+ .dwFlags = DIDOI_ASPECTVELOCITY,
+ .tszName = L"Z Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xf011,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Z,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_XAxis,
+ .dwOfs = 0x34,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(13),
+ .dwFlags = DIDOI_ASPECTACCEL,
+ .tszName = L"X Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xe011,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_X,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_YAxis,
+ .dwOfs = 0x38,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(14),
+ .dwFlags = DIDOI_ASPECTACCEL,
+ .tszName = L"Y Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xe011,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Y,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_ZAxis,
+ .dwOfs = 0x3c,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(15),
+ .dwFlags = DIDOI_ASPECTACCEL,
+ .tszName = L"Z Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xe011,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Z,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_XAxis,
+ .dwOfs = 0x40,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(16),
+ .dwFlags = DIDOI_ASPECTFORCE,
+ .tszName = L"X Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xe111,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_X,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_YAxis,
+ .dwOfs = 0x44,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(17),
+ .dwFlags = DIDOI_ASPECTFORCE,
+ .tszName = L"Y Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xe111,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Y,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_ZAxis,
+ .dwOfs = 0x48,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(18),
+ .dwFlags = DIDOI_ASPECTFORCE,
+ .tszName = L"Z Axis",
+ .wCollectionNumber = 1,
+ .dwDimension = 0xe111,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Z,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Unknown,
+ .dwType = DIDFT_COLLECTION|DIDFT_NODATA|DIDFT_MAKEINSTANCE(0),
+ .tszName = L"Collection 0 - Joystick",
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_JOYSTICK,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Unknown,
+ .dwType = DIDFT_COLLECTION|DIDFT_NODATA|DIDFT_MAKEINSTANCE(1),
+ .tszName = L"Collection 1 - Joystick",
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_JOYSTICK,
+ },
+ };
+ struct check_objects_todos todo_objects[ARRAY_SIZE(expect_objects)] =
+ {
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {0},
+ {.name = TRUE},
+ {.name = TRUE, .guid = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ {.flags = TRUE},
+ };
+ struct check_objects_params check_objects_params =
+ {
+ .version = DIRECTINPUT_VERSION,
+ .expect_count = ARRAY_SIZE(expect_objects),
+ .expect_objs = expect_objects,
+ .todo_objs = todo_objects,
+ };
+
+ DIDEVICEOBJECTINSTANCEW objinst = {.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW)};
+ DIDEVICEINSTANCEW devinst = {0};
+ IDirectInputDevice8W *device;
+ DIDEVCAPS caps = {0};
+ HRESULT hr;
+ ULONG ref;
+
+ cleanup_registry_keys();
+
+ desc.report_descriptor_len = sizeof(report_desc);
+ memcpy( desc.report_descriptor_buf, report_desc, sizeof(report_desc) );
+ fill_context( __LINE__, desc.context, ARRAY_SIZE(desc.context) );
+
+ if (!hid_device_start( &desc )) goto done;
+ if (FAILED(hr = dinput_test_create_device( DIRECTINPUT_VERSION, &devinst, &device ))) goto done;
+
+ check_dinput_devices( DIRECTINPUT_VERSION, &devinst );
+
+ memset( &devinst, 0, sizeof(devinst) );
+ devinst.dwSize = sizeof(DIDEVICEINSTANCEW);
+ hr = IDirectInputDevice8_GetDeviceInfo( device, &devinst );
+ ok( hr == DI_OK, "GetDeviceInfo returned %#lx\n", hr );
+ check_member( devinst, expect_devinst, "%lu", dwSize );
+ todo_wine
+ check_member_guid( devinst, expect_devinst, guidInstance );
+ check_member_guid( devinst, expect_devinst, guidProduct );
+ todo_wine
+ check_member( devinst, expect_devinst, "%#lx", dwDevType );
+ check_member_wstr( devinst, expect_devinst, tszInstanceName );
+ check_member_wstr( devinst, expect_devinst, tszProductName );
+ check_member_guid( devinst, expect_devinst, guidFFDriver );
+ check_member( devinst, expect_devinst, "%04x", wUsagePage );
+ check_member( devinst, expect_devinst, "%04x", wUsage );
+
+ hr = IDirectInputDevice8_GetCapabilities( device, NULL );
+ ok( hr == E_POINTER, "GetCapabilities returned %#lx\n", hr );
+ hr = IDirectInputDevice8_GetCapabilities( device, &caps );
+ ok( hr == DIERR_INVALIDPARAM, "GetCapabilities returned %#lx\n", hr );
+ caps.dwSize = sizeof(DIDEVCAPS);
+ hr = IDirectInputDevice8_GetCapabilities( device, &caps );
+ ok( hr == DI_OK, "GetCapabilities returned %#lx\n", hr );
+ check_member( caps, expect_caps, "%lu", dwSize );
+ check_member( caps, expect_caps, "%#lx", dwFlags );
+ todo_wine
+ check_member( caps, expect_caps, "%#lx", dwDevType );
+ check_member( caps, expect_caps, "%lu", dwAxes );
+ check_member( caps, expect_caps, "%lu", dwButtons );
+ check_member( caps, expect_caps, "%lu", dwPOVs );
+ check_member( caps, expect_caps, "%lu", dwFFSamplePeriod );
+ check_member( caps, expect_caps, "%lu", dwFFMinTimeResolution );
+ check_member( caps, expect_caps, "%lu", dwFirmwareRevision );
+ check_member( caps, expect_caps, "%lu", dwHardwareRevision );
+ check_member( caps, expect_caps, "%lu", dwFFDriverVersion );
+
+ hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL );
+ ok( hr == DI_OK, "EnumObjects returned %#lx\n", hr );
+ ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n",
+ check_objects_params.expect_count - check_objects_params.index );
+
+ hr = IDirectInputDevice8_SetDataFormat( device, &c_dfDIJoystick2 );
+ ok( hr == DI_OK, "SetDataFormat returned: %#lx\n", hr );
+
+ hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, DIJOFS_RZ, DIPH_BYOFFSET );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#lx\n", hr );
+
+ check_member( objinst, expect_objects[5], "%lu", dwSize );
+ check_member_guid( objinst, expect_objects[5], guidType );
+ check_member( objinst, expect_objects[5], "%#lx", dwOfs );
+ check_member( objinst, expect_objects[5], "%#lx", dwType );
+ check_member( objinst, expect_objects[5], "%#lx", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_objects[5], tszName );
+ check_member( objinst, expect_objects[5], "%lu", dwFFMaxForce );
+ check_member( objinst, expect_objects[5], "%lu", dwFFForceResolution );
+ check_member( objinst, expect_objects[5], "%u", wCollectionNumber );
+ check_member( objinst, expect_objects[5], "%u", wDesignatorIndex );
+ check_member( objinst, expect_objects[5], "%#04x", wUsagePage );
+ check_member( objinst, expect_objects[5], "%#04x", wUsage );
+ check_member( objinst, expect_objects[5], "%#lx", dwDimension );
+ check_member( objinst, expect_objects[5], "%#04x", wExponent );
+ check_member( objinst, expect_objects[5], "%u", wReportId );
+
+ hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, offsetof(DIJOYSTATE2, rglSlider[0]), DIPH_BYOFFSET );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#lx\n", hr );
+
+ check_member( objinst, expect_objects[6], "%lu", dwSize );
+ check_member_guid( objinst, expect_objects[6], guidType );
+ check_member( objinst, expect_objects[6], "%#lx", dwOfs );
+ check_member( objinst, expect_objects[6], "%#lx", dwType );
+ check_member( objinst, expect_objects[6], "%#lx", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_objects[6], tszName );
+ check_member( objinst, expect_objects[6], "%lu", dwFFMaxForce );
+ check_member( objinst, expect_objects[6], "%lu", dwFFForceResolution );
+ check_member( objinst, expect_objects[6], "%u", wCollectionNumber );
+ check_member( objinst, expect_objects[6], "%u", wDesignatorIndex );
+ check_member( objinst, expect_objects[6], "%#04x", wUsagePage );
+ check_member( objinst, expect_objects[6], "%#04x", wUsage );
+ check_member( objinst, expect_objects[6], "%#lx", dwDimension );
+ check_member( objinst, expect_objects[6], "%#04x", wExponent );
+ check_member( objinst, expect_objects[6], "%u", wReportId );
+
+ hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, offsetof(DIJOYSTATE2, rglSlider[1]), DIPH_BYOFFSET );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#lx\n", hr );
+
+ check_member( objinst, expect_objects[8], "%lu", dwSize );
+ check_member_guid( objinst, expect_objects[8], guidType );
+ check_member( objinst, expect_objects[8], "%#lx", dwOfs );
+ check_member( objinst, expect_objects[8], "%#lx", dwType );
+ check_member( objinst, expect_objects[8], "%#lx", dwFlags );
+ if (!localized) todo_wine check_member_wstr( objinst, expect_objects[8], tszName );
+ check_member( objinst, expect_objects[8], "%lu", dwFFMaxForce );
+ check_member( objinst, expect_objects[8], "%lu", 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], "%#lx", dwDimension );
+ check_member( objinst, expect_objects[8], "%#04x", wExponent );
+ check_member( objinst, expect_objects[8], "%u", wReportId );
+
+ hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, offsetof(DIJOYSTATE2, lVX), DIPH_BYOFFSET );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#lx\n", hr );
+
+ check_member( objinst, expect_objects[10], "%lu", dwSize );
+ check_member_guid( objinst, expect_objects[10], guidType );
+ check_member( objinst, expect_objects[10], "%#lx", dwOfs );
+ check_member( objinst, expect_objects[10], "%#lx", dwType );
+ todo_wine
+ check_member( objinst, expect_objects[10], "%#lx", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_objects[10], tszName );
+ check_member( objinst, expect_objects[10], "%lu", dwFFMaxForce );
+ check_member( objinst, expect_objects[10], "%lu", dwFFForceResolution );
+ check_member( objinst, expect_objects[10], "%u", wCollectionNumber );
+ check_member( objinst, expect_objects[10], "%u", wDesignatorIndex );
+ check_member( objinst, expect_objects[10], "%#04x", wUsagePage );
+ check_member( objinst, expect_objects[10], "%#04x", wUsage );
+ check_member( objinst, expect_objects[10], "%#lx", dwDimension );
+ check_member( objinst, expect_objects[10], "%#04x", wExponent );
+ check_member( objinst, expect_objects[10], "%u", wReportId );
+
+ hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, offsetof(DIJOYSTATE2, lAX), DIPH_BYOFFSET );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#lx\n", hr );
+
+ check_member( objinst, expect_objects[13], "%lu", dwSize );
+ check_member_guid( objinst, expect_objects[13], guidType );
+ check_member( objinst, expect_objects[13], "%#lx", dwOfs );
+ check_member( objinst, expect_objects[13], "%#lx", dwType );
+ todo_wine
+ check_member( objinst, expect_objects[13], "%#lx", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_objects[13], tszName );
+ check_member( objinst, expect_objects[13], "%lu", dwFFMaxForce );
+ check_member( objinst, expect_objects[13], "%lu", dwFFForceResolution );
+ check_member( objinst, expect_objects[13], "%u", wCollectionNumber );
+ check_member( objinst, expect_objects[13], "%u", wDesignatorIndex );
+ check_member( objinst, expect_objects[13], "%#04x", wUsagePage );
+ check_member( objinst, expect_objects[13], "%#04x", wUsage );
+ check_member( objinst, expect_objects[13], "%#lx", dwDimension );
+ check_member( objinst, expect_objects[13], "%#04x", wExponent );
+ check_member( objinst, expect_objects[13], "%u", wReportId );
+
+ hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, offsetof(DIJOYSTATE2, lFX), DIPH_BYOFFSET );
+ ok( hr == DI_OK, "GetObjectInfo returned: %#lx\n", hr );
+
+ check_member( objinst, expect_objects[16], "%lu", dwSize );
+ check_member_guid( objinst, expect_objects[16], guidType );
+ check_member( objinst, expect_objects[16], "%#lx", dwOfs );
+ check_member( objinst, expect_objects[16], "%#lx", dwType );
+ todo_wine
+ check_member( objinst, expect_objects[16], "%#lx", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_objects[16], tszName );
+ check_member( objinst, expect_objects[16], "%lu", dwFFMaxForce );
+ check_member( objinst, expect_objects[16], "%lu", dwFFForceResolution );
+ check_member( objinst, expect_objects[16], "%u", wCollectionNumber );
+ check_member( objinst, expect_objects[16], "%u", wDesignatorIndex );
+ check_member( objinst, expect_objects[16], "%#04x", wUsagePage );
+ check_member( objinst, expect_objects[16], "%#04x", wUsage );
+ check_member( objinst, expect_objects[16], "%#lx", dwDimension );
+ check_member( objinst, expect_objects[16], "%#04x", wExponent );
+ check_member( objinst, expect_objects[16], "%u", wReportId );
+
+ ref = IDirectInputDevice8_Release( device );
+ ok( ref == 0, "Release returned %ld\n", ref );
+
+done:
+ hid_device_stop( &desc );
+ cleanup_registry_keys();
+ winetest_pop_context();
+}
+
static void test_driving_wheel_axes(void)
{
#include "psh_hid_macros.h"
@@ -3488,6 +4059,7 @@ START_TEST( joystick8 )
test_simple_joystick( 0x700 );
test_simple_joystick( 0x800 );
+ test_many_axes_joystick();
test_driving_wheel_axes();
test_windows_gaming_input();
}
--
2.35.1
2
4
[PATCH v2] include: Add Windows.Gaming.Input.FlightStick runtimeclass declaration.
by Rémi Bernon 21 Apr '22
by Rémi Bernon 21 Apr '22
21 Apr '22
From: Biswapriyo Nath <nathbappai(a)gmail.com>
Signed-off-by: Biswapriyo Nath <nathbappai(a)gmail.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
include/windows.gaming.input.idl | 77 ++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl
index 6f557883167..fdae3aa70b1 100644
--- a/include/windows.gaming.input.idl
+++ b/include/windows.gaming.input.idl
@@ -34,18 +34,22 @@ import "windows.devices.power.idl";
namespace Windows.Gaming.Input {
typedef enum ArcadeStickButtons ArcadeStickButtons;
+ typedef enum FlightStickButtons FlightStickButtons;
typedef enum GamepadButtons GamepadButtons;
typedef enum GameControllerButtonLabel GameControllerButtonLabel;
typedef enum GameControllerSwitchKind GameControllerSwitchKind;
typedef enum GameControllerSwitchPosition GameControllerSwitchPosition;
typedef enum RacingWheelButtons RacingWheelButtons;
typedef struct ArcadeStickReading ArcadeStickReading;
+ typedef struct FlightStickReading FlightStickReading;
typedef struct GamepadReading GamepadReading;
typedef struct GamepadVibration GamepadVibration;
typedef struct RacingWheelReading RacingWheelReading;
interface IArcadeStick;
interface IArcadeStickStatics;
interface IArcadeStickStatics2;
+ interface IFlightStick;
+ interface IFlightStickStatics;
interface IGameController;
interface IGameControllerBatteryInfo;
interface IGamepad;
@@ -58,6 +62,7 @@ namespace Windows.Gaming.Input {
interface IRawGameController;
interface IRawGameController2;
runtimeclass ArcadeStick;
+ runtimeclass FlightStick;
runtimeclass Gamepad;
runtimeclass Headset;
runtimeclass RacingWheel;
@@ -65,6 +70,7 @@ namespace Windows.Gaming.Input {
declare {
interface Windows.Foundation.EventHandler<Windows.Gaming.Input.ArcadeStick *>;
+ interface Windows.Foundation.EventHandler<Windows.Gaming.Input.FlightStick *>;
interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad *>;
interface Windows.Foundation.EventHandler<Windows.Gaming.Input.RacingWheel *>;
interface Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController *>;
@@ -73,6 +79,9 @@ namespace Windows.Gaming.Input {
interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.ArcadeStick *>;
interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.ArcadeStick *>;
interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ArcadeStick *>;
+ interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.FlightStick *>;
+ interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.FlightStick *>;
+ interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.FlightStick *>;
interface Windows.Foundation.Collections.IIterator<Windows.Gaming.Input.Gamepad *>;
interface Windows.Foundation.Collections.IIterable<Windows.Gaming.Input.Gamepad *>;
interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.Gamepad *>;
@@ -108,6 +117,17 @@ namespace Windows.Gaming.Input {
Special2 = 0x800
};
+ [
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
+ flags
+ ]
+ enum FlightStickButtons
+ {
+ None = 0x0,
+ FirePrimary = 0x1,
+ FireSecondary = 0x2,
+ };
+
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
flags
@@ -273,6 +293,18 @@ namespace Windows.Gaming.Input {
Windows.Gaming.Input.ArcadeStickButtons Buttons;
};
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)]
+ struct FlightStickReading
+ {
+ UINT64 Timestamp;
+ Windows.Gaming.Input.FlightStickButtons Buttons;
+ Windows.Gaming.Input.GameControllerSwitchPosition HatSwitch;
+ DOUBLE Roll;
+ DOUBLE Pitch;
+ DOUBLE Yaw;
+ DOUBLE Throttle;
+ };
+
[contract(Windows.Foundation.UniversalApiContract, 1.0)]
struct GamepadReading
{
@@ -349,6 +381,38 @@ namespace Windows.Gaming.Input {
[out, retval] Windows.Gaming.Input.ArcadeStick **value);
}
+ [
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
+ exclusiveto(Windows.Gaming.Input.FlightStick),
+ uuid(b4a2c01c-b83b-4459-a1a9-97b03c33da7c)
+ ]
+ interface IFlightStick : IInspectable
+ requires Windows.Gaming.Input.IGameController
+ {
+ [propget] HRESULT HatSwitchKind([out, retval] Windows.Gaming.Input.GameControllerSwitchKind *value);
+ HRESULT GetButtonLabel([in] Windows.Gaming.Input.FlightStickButtons button,
+ [out, retval] Windows.Gaming.Input.GameControllerButtonLabel *value);
+ HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.FlightStickReading *value);
+ }
+
+ [
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
+ exclusiveto(Windows.Gaming.Input.FlightStick),
+ uuid(5514924a-fecc-435e-83dc-5cec8a18a520)
+ ]
+ interface IFlightStickStatics : IInspectable
+ {
+ [eventadd] HRESULT FlightStickAdded([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.FlightStick *> *value,
+ [out, retval] EventRegistrationToken *token);
+ [eventremove] HRESULT FlightStickAdded([in] EventRegistrationToken token);
+ [eventadd] HRESULT FlightStickRemoved([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.FlightStick *> *value,
+ [out, retval] EventRegistrationToken *token);
+ [eventremove] HRESULT FlightStickRemoved([in] EventRegistrationToken token);
+ [propget] HRESULT FlightSticks([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.FlightStick *> **value);
+ HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *controller,
+ [out, retval] Windows.Gaming.Input.FlightStick **value);
+ }
+
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
uuid(1baf6522-5f64-42c5-8267-b9fe2215bfbd)
@@ -537,6 +601,19 @@ namespace Windows.Gaming.Input {
[contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
}
+ [
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
+ marshaling_behavior(agile),
+ static(Windows.Gaming.Input.IFlightStickStatics, Windows.Foundation.UniversalApiContract, 4.0),
+ threading(both)
+ ]
+ runtimeclass FlightStick
+ {
+ [default] interface Windows.Gaming.Input.IFlightStick;
+ interface Windows.Gaming.Input.IGameController;
+ interface Windows.Gaming.Input.IGameControllerBatteryInfo;
+ }
+
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
marshaling_behavior(agile),
--
2.35.1
1
0
21 Apr '22
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/ddraw/tests/ddraw1.c | 28 +++++++++--------
dlls/ddraw/tests/ddraw2.c | 57 ++++++++++++++++++----------------
dlls/ddraw/tests/ddraw4.c | 56 ++++++++++++++++++---------------
dlls/ddraw/tests/ddraw7.c | 65 +++++++++++++++++++++++----------------
4 files changed, 116 insertions(+), 90 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index e0393a3a591..84bdda82978 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -386,7 +386,7 @@ static void fill_surface(IDirectDrawSurface *surface, D3DCOLOR color)
ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr);
}
-static void check_rect(IDirectDrawSurface *surface, RECT r, const char *message)
+static void check_rect(IDirectDrawSurface *surface, RECT r)
{
LONG x_coords[2][2] =
{
@@ -417,8 +417,7 @@ static void check_rect(IDirectDrawSurface *surface, RECT r, const char *message)
if (x < 0 || x >= 640 || y < 0 || y >= 480)
continue;
color = get_surface_color(surface, x, y);
- ok(color == expected, "%s: Pixel (%d, %d) has color %08x, expected %08x\n",
- message, x, y, color, expected);
+ ok(color == expected, "Pixel (%d, %d) has color %08x, expected %08x.\n", x, y, color, expected);
}
}
}
@@ -13277,11 +13276,13 @@ static void test_viewport(void)
for (j = 0; j < ARRAY_SIZE(tests); ++j)
{
+ winetest_push_context(tests[j].message);
+
hr = IDirect3DViewport_Clear(full_viewport, 1, &clear_rect, D3DCLEAR_TARGET);
- ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x (j %u).\n", hr, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3D_CreateViewport(d3d, &viewport, NULL);
- ok(SUCCEEDED(hr), "Failed to create viewport, hr %#x (j %u).\n", hr, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
memset(&vp, 0, sizeof(vp));
vp.dwSize = sizeof(vp);
vp.dwX = tests[j].vp.dwX;
@@ -13295,26 +13296,27 @@ static void test_viewport(void)
vp.dvMinZ = 0.0f;
vp.dvMaxZ = 1.0f;
hr = IDirect3DViewport_SetViewport(viewport, &vp);
- ok(hr == D3DERR_VIEWPORTHASNODEVICE,
- "Setting viewport data returned unexpected hr %#x (j %u).\n", hr, j);
+ ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice_AddViewport(device, viewport);
- ok(SUCCEEDED(hr), "Failed to add viewport, hr %#x (j %u).\n", hr, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DViewport_SetViewport(viewport, &vp);
- ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x (j %u).\n", hr, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice_BeginScene(device);
- ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x (j %u).\n", hr, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
set_execute_data(execute_buffer, 4, sizeof(quad), inst_length);
hr = IDirect3DDevice_Execute(device, execute_buffer, viewport, D3DEXECUTE_CLIPPED);
- ok(SUCCEEDED(hr), "Failed to execute exec buffer, hr %#x (j %u).\n", hr, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice_EndScene(device);
- ok(SUCCEEDED(hr), "Failed to end scene, hr %#x (j %u).\n", hr, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
- check_rect(rt, tests[j].expected_rect, tests[j].message);
+ check_rect(rt, tests[j].expected_rect);
destroy_viewport(device, viewport);
+
+ winetest_pop_context();
}
destroy_viewport(device, full_viewport);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 03f1d488673..f67aae9db5b 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -388,7 +388,7 @@ static void fill_surface(IDirectDrawSurface *surface, D3DCOLOR color)
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
-static void check_rect(IDirectDrawSurface *surface, RECT r, const char *message)
+static void check_rect(IDirectDrawSurface *surface, RECT r)
{
LONG x_coords[2][2] =
{
@@ -419,8 +419,7 @@ static void check_rect(IDirectDrawSurface *surface, RECT r, const char *message)
if (x < 0 || x >= 640 || y < 0 || y >= 480)
continue;
color = get_surface_color(surface, x, y);
- ok(color == expected, "%s: Pixel (%d, %d) has color %08x, expected %08x\n",
- message, x, y, color, expected);
+ ok(color == expected, "Pixel (%d, %d) has color %08x, expected %08x.\n", x, y, color, expected);
}
}
}
@@ -14154,7 +14153,11 @@ static void test_viewport(void)
{{100, 100, 640, 480}, {100, 220, 579, 459}, "Viewport (100, 100) - (640, 480)"},
{{ 0, 0, 8192, 8192}, {-10, -10, -10, -10}, "Viewport (0, 0) - (8192, 8192)"},
};
- static const struct vec2 rt_sizes[] =
+ static const struct
+ {
+ unsigned int x, y;
+ }
+ rt_sizes[] =
{
{640, 480}, {1280, 960}, {320, 240}, {800, 600},
};
@@ -14225,6 +14228,8 @@ static void test_viewport(void)
for (i = 0; i < ARRAY_SIZE(rt_sizes); ++i)
{
+ winetest_push_context("Size %ux%u", rt_sizes[i].x, rt_sizes[i].y);
+
if (i)
{
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -14234,23 +14239,23 @@ static void test_viewport(void)
surface_desc.dwHeight = rt_sizes[i].y;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &rt, NULL);
- ok(SUCCEEDED(hr), "Failed to create render target, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
surface_desc.ddpfPixelFormat = z_fmt;
hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &ds, NULL);
- ok(SUCCEEDED(hr), "Failed to create depth buffer, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_AddAttachedSurface(rt, ds);
- ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0);
- ok(SUCCEEDED(hr), "Failed to set render target, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
else
{
hr = IDirect3DDevice2_GetRenderTarget(device, &rt);
- ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
full_viewport = create_viewport(device, 0, 0, rt_sizes[i].x, rt_sizes[i].y);
@@ -14262,17 +14267,18 @@ static void test_viewport(void)
for (j = 0; j < ARRAY_SIZE(tests); ++j)
{
+ winetest_push_context(tests[j].message);
+
expected_failure = tests[j].vp.dwX + tests[j].vp.dwWidth > rt_sizes[i].x
|| tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y;
hr = IDirect3DViewport2_Clear(full_viewport, 1, &clear_rect, D3DCLEAR_TARGET);
- ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3D2_CreateViewport(d3d, &viewport, NULL);
- ok(SUCCEEDED(hr), "Failed to create viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DViewport2_SetViewport2(viewport, NULL);
- ok(hr == E_INVALIDARG, "Setting NULL viewport data returned unexpected hr %#x (i %u, j %u).\n",
- hr, i, j);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
memset(&vp, 0, sizeof(vp));
vp.dwSize = sizeof(vp);
vp.dwX = tests[j].vp.dwX;
@@ -14284,35 +14290,32 @@ static void test_viewport(void)
vp.dvMinZ = 0.0f;
vp.dvMaxZ = 1.0f;
hr = IDirect3DViewport2_SetViewport(viewport, &vp);
- ok(hr == D3DERR_VIEWPORTHASNODEVICE,
- "Setting viewport data returned unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice2_AddViewport(device, viewport);
- ok(SUCCEEDED(hr), "Failed to add viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DViewport2_SetViewport(viewport, &vp);
- if (expected_failure)
- ok(hr == E_INVALIDARG, "Setting viewport data returned unexpected hr %#x (i %u, j %u).\n",
- hr, i, j);
- else
- ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == (expected_failure ? E_INVALIDARG : DD_OK), "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice2_SetCurrentViewport(device, viewport);
- ok(SUCCEEDED(hr), "Failed to set the viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
if (expected_failure)
{
destroy_viewport(device, viewport);
+ winetest_pop_context();
continue;
}
hr = IDirect3DDevice2_BeginScene(device);
- ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, 4, 0);
- ok(SUCCEEDED(hr), "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice2_EndScene(device);
- ok(SUCCEEDED(hr), "Failed to end scene, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
- check_rect(rt, tests[j].expected_rect, tests[j].message);
+ check_rect(rt, tests[j].expected_rect);
destroy_viewport(device, viewport);
+ winetest_pop_context();
}
destroy_viewport(device, full_viewport);
@@ -14322,6 +14325,8 @@ static void test_viewport(void)
IDirectDrawSurface_Release(ds);
IDirectDrawSurface_Release(rt);
+
+ winetest_pop_context();
}
destroy_material(black_background);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 858d39e6f8e..8f85c5bc01b 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -389,7 +389,7 @@ static void fill_surface(IDirectDrawSurface4 *surface, D3DCOLOR color)
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
-static void check_rect(IDirectDrawSurface4 *surface, RECT r, const char *message)
+static void check_rect(IDirectDrawSurface4 *surface, RECT r)
{
LONG x_coords[2][2] =
{
@@ -420,8 +420,7 @@ static void check_rect(IDirectDrawSurface4 *surface, RECT r, const char *message
if (x < 0 || x >= 640 || y < 0 || y >= 480)
continue;
color = get_surface_color(surface, x, y);
- ok(color == expected, "%s: Pixel (%d, %d) has color %08x, expected %08x\n",
- message, x, y, color, expected);
+ ok(color == expected, "Pixel (%d, %d) has color %08x, expected %08x.\n", x, y, color, expected);
}
}
}
@@ -16758,7 +16757,11 @@ static void test_viewport(void)
{{100, 100, 640, 480}, {100, 220, 579, 459}, "Viewport (100, 100) - (640, 480)"},
{{ 0, 0, 8192, 8192}, {-10, -10, -10, -10}, "Viewport (0, 0) - (8192, 8192)"},
};
- static const struct vec2 rt_sizes[] =
+ static const struct
+ {
+ unsigned int x, y;
+ }
+ rt_sizes[] =
{
{640, 480}, {1280, 960}, {320, 240}, {800, 600},
};
@@ -16825,6 +16828,8 @@ static void test_viewport(void)
for (i = 0; i < ARRAY_SIZE(rt_sizes); ++i)
{
+ winetest_push_context("Size %ux%u", rt_sizes[i].x, rt_sizes[i].y);
+
if (i)
{
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -16834,23 +16839,23 @@ static void test_viewport(void)
surface_desc.dwHeight = rt_sizes[i].y;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &rt, NULL);
- ok(SUCCEEDED(hr), "Failed to create render target, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U4(surface_desc).ddpfPixelFormat = z_fmt;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &ds, NULL);
- ok(SUCCEEDED(hr), "Failed to create depth buffer, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface4_AddAttachedSurface(rt, ds);
- ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice3_SetRenderTarget(device, rt, 0);
- ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
else
{
hr = IDirect3DDevice3_GetRenderTarget(device, &rt);
- ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
full_viewport = create_viewport(device, 0, 0, rt_sizes[i].x, rt_sizes[i].y);
@@ -16861,16 +16866,18 @@ static void test_viewport(void)
for (j = 0; j < ARRAY_SIZE(tests); ++j)
{
+ winetest_push_context(tests[j].message);
+
expected_failure = tests[j].vp.dwX + tests[j].vp.dwWidth > rt_sizes[i].x
|| tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y;
hr = IDirect3DViewport3_Clear2(full_viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff000000, 0.0f, 0);
- ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3D3_CreateViewport(d3d, &viewport, NULL);
- ok(SUCCEEDED(hr), "Failed to create viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DViewport3_SetViewport2(viewport, NULL);
- ok(hr == E_INVALIDARG, "Setting NULL viewport data returned unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
memset(&vp, 0, sizeof(vp));
vp.dwSize = sizeof(vp);
vp.dwX = tests[j].vp.dwX;
@@ -16884,35 +16891,32 @@ static void test_viewport(void)
vp.dvMinZ = 0.0f;
vp.dvMaxZ = 1.0f;
hr = IDirect3DViewport3_SetViewport2(viewport, &vp);
- ok(hr == D3DERR_VIEWPORTHASNODEVICE,
- "Setting viewport data returned unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == D3DERR_VIEWPORTHASNODEVICE, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice3_AddViewport(device, viewport);
- ok(SUCCEEDED(hr), "Failed to add viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DViewport3_SetViewport2(viewport, &vp);
- if (expected_failure)
- ok(hr == E_INVALIDARG,
- "Setting viewport data returned unexpected hr %#x (i %u, j %u).\n", hr, i, j);
- else
- ok(SUCCEEDED(hr), "Failed to set viewport data, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == (expected_failure ? E_INVALIDARG : DD_OK), "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice3_SetCurrentViewport(device, viewport);
- ok(SUCCEEDED(hr), "Failed to set the viewport, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
if (expected_failure)
{
destroy_viewport(device, viewport);
+ winetest_pop_context();
continue;
}
hr = IDirect3DDevice3_BeginScene(device);
- ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0);
- ok(SUCCEEDED(hr), "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice3_EndScene(device);
- ok(SUCCEEDED(hr), "Failed to end scene, hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
- check_rect(rt, tests[j].expected_rect, tests[j].message);
+ check_rect(rt, tests[j].expected_rect);
destroy_viewport(device, viewport);
+ winetest_pop_context();
}
destroy_viewport(device, full_viewport);
@@ -16922,6 +16926,8 @@ static void test_viewport(void)
IDirectDrawSurface4_Release(ds);
IDirectDrawSurface4_Release(rt);
+
+ winetest_pop_context();
}
refcount = IDirect3DDevice3_Release(device);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index d448bd76c01..3dfd590c42c 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -411,8 +411,8 @@ static void fill_surface(IDirectDrawSurface7 *surface, D3DCOLOR color)
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
-#define check_rect(a, b, c) check_rect_(__LINE__, a, b, c)
-static void check_rect_(unsigned int line, IDirectDrawSurface7 *surface, RECT r, const char *message)
+#define check_rect(a, b) check_rect_(__LINE__, a, b)
+static void check_rect_(unsigned int line, IDirectDrawSurface7 *surface, RECT r)
{
LONG x_coords[2][2] =
{
@@ -443,8 +443,8 @@ static void check_rect_(unsigned int line, IDirectDrawSurface7 *surface, RECT r,
if (x < 0 || x >= 640 || y < 0 || y >= 480)
continue;
color = get_surface_color(surface, x, y);
- ok_(__FILE__, line)(color == expected, "%s: Pixel (%d, %d) has color %08x, expected %08x.\n",
- message, x, y, color, expected);
+ ok_(__FILE__, line)(color == expected, "Pixel (%d, %d) has color %08x, expected %08x.\n",
+ x, y, color, expected);
}
}
}
@@ -16200,7 +16200,11 @@ static void test_viewport(void)
{ 0.5f, -0.5f, 1.0f},
{ 0.5f, 0.5f, 1.0f},
};
- static const struct vec2 rt_sizes[] =
+ static const struct
+ {
+ unsigned int x, y;
+ }
+ rt_sizes[] =
{
{640, 480}, {1280, 960}, {320, 240}, {800, 600},
};
@@ -16255,6 +16259,8 @@ static void test_viewport(void)
for (i = 0; i < ARRAY_SIZE(rt_sizes); ++i)
{
+ winetest_push_context("Size %ux%u", rt_sizes[i].x, rt_sizes[i].y);
+
if (i)
{
memset(&surface_desc, 0, sizeof(surface_desc));
@@ -16264,80 +16270,87 @@ static void test_viewport(void)
surface_desc.dwHeight = rt_sizes[i].y;
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &rt, NULL);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U4(surface_desc).ddpfPixelFormat = z_fmt;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &ds, NULL);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface7_AddAttachedSurface(rt, ds);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderTarget(device, rt, 0);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
else
{
hr = IDirect3DDevice7_GetRenderTarget(device, &rt);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
for (j = 0; j < ARRAY_SIZE(tests); ++j)
{
+ winetest_push_context(tests[j].message);
+
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000,
tests[j].expected_z - z_eps, 0);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_GREATER);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, !i);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetViewport(device, &tests[j].vp);
if (tests[j].vp.dwX + tests[j].vp.dwWidth > rt_sizes[i].x
|| tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y)
{
- ok(hr == E_INVALIDARG, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ winetest_pop_context();
continue;
}
else
{
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
}
hr = IDirect3DDevice7_BeginScene(device);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_EndScene(device);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
- check_rect(rt, tests[j].expected_rect, tests[j].message);
+ check_rect(rt, tests[j].expected_rect);
if (!i)
{
hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000,
tests[j].expected_z + z_eps, 0);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZFUNC, D3DCMP_LESS);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_BeginScene(device);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_EndScene(device);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
- check_rect(rt, tests[j].expected_rect, tests[j].message);
+ check_rect(rt, tests[j].expected_rect);
}
+
+ winetest_pop_context();
}
hr = IDirectDrawSurface7_DeleteAttachedSurface(rt, 0, ds);
- ok(hr == DD_OK, "Got unexpected hr %#x (i %u).\n", hr, i);
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface7_Release(ds);
IDirectDrawSurface7_Release(rt);
+
+ winetest_pop_context();
}
refcount = IDirect3DDevice7_Release(device);
--
2.35.1
3
2
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ddraw/ddraw.c | 2 +-
dlls/ddraw/device.c | 2 +-
dlls/ddraw/executebuffer.c | 16 ++++++++--------
dlls/ddraw/material.c | 2 +-
dlls/ddraw/utils.c | 12 ++++++------
dlls/ddraw/viewport.c | 8 ++++----
6 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 10086a1bae7..f6770e59fb6 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2496,7 +2496,7 @@ static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags,
callback_sd.u1.lPitch = (callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount / 8) * mode.width;
callback_sd.u1.lPitch = (callback_sd.u1.lPitch + 3) & ~3;
- TRACE("Enumerating %ldx%ldx%ld @%ld\n", callback_sd.dwWidth, callback_sd.dwHeight, callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount,
+ TRACE("Enumerating %lux%lux%lu @%lu\n", callback_sd.dwWidth, callback_sd.dwHeight, callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount,
callback_sd.u2.dwRefreshRate);
if(cb(&callback_sd, Context) == DDENUMRET_CANCEL)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 0795d0e3552..27b650036cf 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -1350,7 +1350,7 @@ static HRESULT WINAPI d3d_device1_CreateMatrix(IDirect3DDevice *iface, D3DMATRIX
*D3DMatHandle = h + 1;
- TRACE(" returning matrix handle %lx\n", *D3DMatHandle);
+ TRACE(" returning matrix handle %#lx\n", *D3DMatHandle);
wined3d_mutex_unlock();
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c
index a6c367bd8ef..2f4c121789d 100644
--- a/dlls/ddraw/executebuffer.c
+++ b/dlls/ddraw/executebuffer.c
@@ -31,17 +31,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
*****************************************************************************/
static void _dump_executedata(const D3DEXECUTEDATA *lpData) {
- TRACE("dwSize : %ld\n", lpData->dwSize);
- TRACE("Vertex Offset : %ld Count : %ld\n", lpData->dwVertexOffset, lpData->dwVertexCount);
- TRACE("Instruction Offset : %ld Length : %ld\n", lpData->dwInstructionOffset, lpData->dwInstructionLength);
- TRACE("HVertex Offset : %ld\n", lpData->dwHVertexOffset);
+ TRACE("dwSize : %lu\n", lpData->dwSize);
+ TRACE("Vertex Offset : %lu Count : %lu\n", lpData->dwVertexOffset, lpData->dwVertexCount);
+ TRACE("Instruction Offset : %lu Length : %lu\n", lpData->dwInstructionOffset, lpData->dwInstructionLength);
+ TRACE("HVertex Offset : %lu\n", lpData->dwHVertexOffset);
}
static void _dump_D3DEXECUTEBUFFERDESC(const D3DEXECUTEBUFFERDESC *lpDesc) {
- TRACE("dwSize : %ld\n", lpDesc->dwSize);
- TRACE("dwFlags : %lx\n", lpDesc->dwFlags);
- TRACE("dwCaps : %lx\n", lpDesc->dwCaps);
- TRACE("dwBufferSize : %ld\n", lpDesc->dwBufferSize);
+ TRACE("dwSize : %lu\n", lpDesc->dwSize);
+ TRACE("dwFlags : %#lx\n", lpDesc->dwFlags);
+ TRACE("dwCaps : %#lx\n", lpDesc->dwCaps);
+ TRACE("dwBufferSize : %lu\n", lpDesc->dwBufferSize);
TRACE("lpData : %p\n", lpDesc->lpData);
}
diff --git a/dlls/ddraw/material.c b/dlls/ddraw/material.c
index 755c9923597..5bf2fcc7f9b 100644
--- a/dlls/ddraw/material.c
+++ b/dlls/ddraw/material.c
@@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
static void dump_material(const D3DMATERIAL *mat)
{
- TRACE(" dwSize : %ld\n", mat->dwSize);
+ TRACE(" dwSize : %lu\n", mat->dwSize);
}
static inline struct d3d_material *impl_from_IDirect3DMaterial(IDirect3DMaterial *iface)
diff --git a/dlls/ddraw/utils.c b/dlls/ddraw/utils.c
index 663f97760ef..c2794824e9e 100644
--- a/dlls/ddraw/utils.c
+++ b/dlls/ddraw/utils.c
@@ -469,7 +469,7 @@ enum wined3d_format_id wined3dformat_from_ddrawformat(const DDPIXELFORMAT *DDPix
return WINED3DFMT_L8_UNORM;
default:
- WARN("Unknown luminance-only bit depth 0x%lx.\n", DDPixelFormat->u1.dwLuminanceBitCount);
+ WARN("Unknown luminance-only bit depth %lu.\n", DDPixelFormat->u1.dwLuminanceBitCount);
return WINED3DFMT_UNKNOWN;
}
}
@@ -1138,7 +1138,7 @@ void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps)
FE(DDSVCAPS_STEREOSEQUENTIAL),
};
- TRACE(" - dwSize : %ld\n", lpcaps->dwSize);
+ TRACE(" - dwSize : %lu\n", lpcaps->dwSize);
TRACE(" - dwCaps : "); DDRAW_dump_flags(lpcaps->dwCaps, flags1, ARRAY_SIZE(flags1));
TRACE(" - dwCaps2 : "); DDRAW_dump_flags(lpcaps->dwCaps2, flags2, ARRAY_SIZE(flags2));
TRACE(" - dwCKeyCaps : "); DDRAW_dump_flags(lpcaps->dwCKeyCaps, flags3, ARRAY_SIZE(flags3));
@@ -1147,10 +1147,10 @@ void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps)
TRACE(" - dwPalCaps : "); DDRAW_dump_flags(lpcaps->dwPalCaps, flags6, ARRAY_SIZE(flags6));
TRACE(" - dwSVCaps : "); DDRAW_dump_flags(lpcaps->dwSVCaps, flags7, ARRAY_SIZE(flags7));
TRACE("...\n");
- TRACE(" - dwNumFourCCCodes : %ld\n", lpcaps->dwNumFourCCCodes);
- TRACE(" - dwCurrVisibleOverlays : %ld\n", lpcaps->dwCurrVisibleOverlays);
- TRACE(" - dwMinOverlayStretch : %ld\n", lpcaps->dwMinOverlayStretch);
- TRACE(" - dwMaxOverlayStretch : %ld\n", lpcaps->dwMaxOverlayStretch);
+ TRACE(" - dwNumFourCCCodes : %lu\n", lpcaps->dwNumFourCCCodes);
+ TRACE(" - dwCurrVisibleOverlays : %lu\n", lpcaps->dwCurrVisibleOverlays);
+ TRACE(" - dwMinOverlayStretch : %lu\n", lpcaps->dwMinOverlayStretch);
+ TRACE(" - dwMaxOverlayStretch : %lu\n", lpcaps->dwMaxOverlayStretch);
TRACE("...\n");
TRACE(" - ddsCaps : "); DDRAW_dump_DDSCAPS2(&lpcaps->ddsCaps);
}
diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c
index 77b85118a4a..83c88f48691 100644
--- a/dlls/ddraw/viewport.c
+++ b/dlls/ddraw/viewport.c
@@ -181,9 +181,9 @@ void viewport_free_active_light_index(struct d3d_light *light)
*****************************************************************************/
static void _dump_D3DVIEWPORT(const D3DVIEWPORT *lpvp)
{
- TRACE(" - dwSize = %ld dwX = %ld dwY = %ld\n",
+ TRACE(" - dwSize = %lu dwX = %lu dwY = %lu\n",
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
- TRACE(" - dwWidth = %ld dwHeight = %ld\n",
+ TRACE(" - dwWidth = %lu dwHeight = %lu\n",
lpvp->dwWidth, lpvp->dwHeight);
TRACE(" - dvScaleX = %f dvScaleY = %f\n",
lpvp->dvScaleX, lpvp->dvScaleY);
@@ -195,9 +195,9 @@ static void _dump_D3DVIEWPORT(const D3DVIEWPORT *lpvp)
static void _dump_D3DVIEWPORT2(const D3DVIEWPORT2 *lpvp)
{
- TRACE(" - dwSize = %ld dwX = %ld dwY = %ld\n",
+ TRACE(" - dwSize = %lu dwX = %lu dwY = %lu\n",
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
- TRACE(" - dwWidth = %ld dwHeight = %ld\n",
+ TRACE(" - dwWidth = %lu dwHeight = %lu\n",
lpvp->dwWidth, lpvp->dwHeight);
TRACE(" - dvClipX = %f dvClipY = %f\n",
lpvp->dvClipX, lpvp->dvClipY);
--
2.35.1
3
2
[PATCH v2 1/4] wined3d: Clear the texture BO when loading textures into WINED3D_LOCATION_BUFFER.
by Zebediah Figura 21 Apr '22
by Zebediah Figura 21 Apr '22
21 Apr '22
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
v2: Restructure.
dlls/wined3d/texture.c | 51 +++++++++++++++++++++++++-----------------
1 file changed, 31 insertions(+), 20 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index eaa7cdf3ea5..0e4170f0022 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -799,23 +799,6 @@ BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
return TRUE;
}
- if (current & WINED3D_LOCATION_CLEARED)
- {
- struct wined3d_bo_address addr;
-
- /* FIXME: Clear textures on the GPU if possible. */
-
- if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, WINED3D_LOCATION_SYSMEM))
- return FALSE;
- wined3d_texture_get_bo_address(texture, sub_resource_idx, &addr, WINED3D_LOCATION_SYSMEM);
- memset(addr.addr, 0, texture->sub_resources[sub_resource_idx].size);
- wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_SYSMEM);
- current |= WINED3D_LOCATION_SYSMEM;
-
- if (current & location)
- return TRUE;
- }
-
if (!current)
{
ERR("Sub-resource %u of texture %p does not have any up to date location.\n",
@@ -824,22 +807,50 @@ BOOL wined3d_texture_load_location(struct wined3d_texture *texture,
return wined3d_texture_load_location(texture, sub_resource_idx, context, location);
}
- if ((location & wined3d_texture_sysmem_locations) && (current & wined3d_texture_sysmem_locations))
+ if ((location & wined3d_texture_sysmem_locations)
+ && (current & (wined3d_texture_sysmem_locations | WINED3D_LOCATION_CLEARED)))
{
struct wined3d_bo_address source, destination;
struct wined3d_range range;
+ void *map_ptr;
if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, location))
return FALSE;
- wined3d_texture_get_bo_address(texture, sub_resource_idx, &source, (current & wined3d_texture_sysmem_locations));
wined3d_texture_get_bo_address(texture, sub_resource_idx, &destination, location);
range.offset = 0;
range.size = texture->sub_resources[sub_resource_idx].size;
- wined3d_context_copy_bo_address(context, &destination, &source, 1, &range);
+ if (current & WINED3D_LOCATION_CLEARED)
+ {
+ map_ptr = wined3d_context_map_bo_address(context, &destination, range.size,
+ WINED3D_MAP_WRITE | WINED3D_MAP_DISCARD);
+ memset(map_ptr, 0, range.size);
+ wined3d_context_unmap_bo_address(context, &destination, 1, &range);
+ }
+ else
+ {
+ wined3d_texture_get_bo_address(texture, sub_resource_idx,
+ &source, (current & wined3d_texture_sysmem_locations));
+ wined3d_context_copy_bo_address(context, &destination, &source, 1, &range);
+ }
ret = TRUE;
}
else
+ {
+ if (current & WINED3D_LOCATION_CLEARED)
+ {
+ struct wined3d_bo_address addr;
+
+ /* FIXME: Clear textures on the GPU if possible. */
+
+ if (!wined3d_texture_prepare_location(texture, sub_resource_idx, context, WINED3D_LOCATION_SYSMEM))
+ return FALSE;
+ wined3d_texture_get_bo_address(texture, sub_resource_idx, &addr, WINED3D_LOCATION_SYSMEM);
+ memset(addr.addr, 0, texture->sub_resources[sub_resource_idx].size);
+ wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_SYSMEM);
+ }
+
ret = texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
+ }
if (ret)
wined3d_texture_validate_location(texture, sub_resource_idx, location);
--
2.35.1
2
4
some improvement for createprocess tests:
- no longer assuming using Win7 console handles
- fixed regression introduced by shell-no-window type of consoles
- added some more tests around CreateProcess
V3 -> V4: removed skip part
Marvin will report errors for the 3 tests, until this bug is fixed
https://bugs.winehq.org/show_bug.cgi?id=52847
I'll let the NLS Guru(s) take care of it
This testbot run (all patches in this serie + ugly UTF8 support in TranslateCharsetInfo
to partially implement) show that fixing above bug is the only remaining
generator of failures
https://testbot.winehq.org/JobDetails.pl?Key=113102S
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
Eric Pouech (3):
dlls/kernel32/tests: let the console tests pass if current console is shell-no-window
dlls/kernel32/tests: adapt dup console handle test to non Win7 handles
dlls/kernel32/tests: test when passing non inheritable handles in CreateProcess
dlls/kernel32/tests/process.c | 115 +++++++++++++++++++++++++++++-----
1 file changed, 100 insertions(+), 15 deletions(-)
2
6
[PATCH v2 4/4] winepulse: Implement Wow64 entry points in the Unix library.
by Huw Davies 21 Apr '22
by Huw Davies 21 Apr '22
21 Apr '22
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/winepulse.drv/pulse.c | 383 +++++++++++++++++++++++++++++++++++++
1 file changed, 383 insertions(+)
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c
index 9a205915b70..f685e2047e7 100644
--- a/dlls/winepulse.drv/pulse.c
+++ b/dlls/winepulse.drv/pulse.c
@@ -2239,3 +2239,386 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
pulse_is_started,
pulse_get_prop_value,
};
+
+#ifdef _WIN64
+
+typedef UINT PTR32;
+
+static NTSTATUS pulse_wow64_main_loop(void *args)
+{
+ struct
+ {
+ PTR32 event;
+ } *params32 = args;
+ struct main_loop_params params =
+ {
+ .event = ULongToHandle(params32->event)
+ };
+ return pulse_main_loop(¶ms);
+}
+
+static NTSTATUS pulse_wow64_get_endpoint_ids(void *args)
+{
+ struct
+ {
+ EDataFlow flow;
+ PTR32 endpoints;
+ unsigned int size;
+ HRESULT result;
+ unsigned int num;
+ unsigned int default_idx;
+ } *params32 = args;
+ struct get_endpoint_ids_params params =
+ {
+ .flow = params32->flow,
+ .endpoints = ULongToPtr(params32->endpoints),
+ .size = params32->size
+ };
+ pulse_get_endpoint_ids(¶ms);
+ params32->size = params.size;
+ params32->result = params.result;
+ params32->num = params.num;
+ params32->default_idx = params.default_idx;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_create_stream(void *args)
+{
+ struct
+ {
+ PTR32 name;
+ PTR32 pulse_name;
+ EDataFlow dataflow;
+ AUDCLNT_SHAREMODE mode;
+ DWORD flags;
+ REFERENCE_TIME duration;
+ PTR32 fmt;
+ HRESULT result;
+ PTR32 channel_count;
+ PTR32 stream;
+ } *params32 = args;
+ struct create_stream_params params =
+ {
+ .name = ULongToPtr(params32->name),
+ .pulse_name = ULongToPtr(params32->pulse_name),
+ .dataflow = params32->dataflow,
+ .mode = params32->mode,
+ .flags = params32->flags,
+ .duration = params32->duration,
+ .fmt = ULongToPtr(params32->fmt),
+ .channel_count = ULongToPtr(params32->channel_count),
+ .stream = ULongToPtr(params32->stream)
+ };
+ pulse_create_stream(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_release_stream(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ PTR32 timer;
+ HRESULT result;
+ } *params32 = args;
+ struct release_stream_params params =
+ {
+ .stream = params32->stream,
+ .timer = ULongToHandle(params32->timer)
+ };
+ pulse_release_stream(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_render_buffer(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ UINT32 frames;
+ HRESULT result;
+ PTR32 data;
+ } *params32 = args;
+ BYTE *data = NULL;
+ struct get_render_buffer_params params =
+ {
+ .stream = params32->stream,
+ .frames = params32->frames,
+ .data = &data
+ };
+ pulse_get_render_buffer(¶ms);
+ params32->result = params.result;
+ *(unsigned int *)ULongToPtr(params32->data) = PtrToUlong(data);
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_capture_buffer(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ HRESULT result;
+ PTR32 data;
+ PTR32 frames;
+ PTR32 flags;
+ PTR32 devpos;
+ PTR32 qpcpos;
+ } *params32 = args;
+ BYTE *data = NULL;
+ struct get_capture_buffer_params params =
+ {
+ .stream = params32->stream,
+ .data = &data,
+ .frames = ULongToPtr(params32->frames),
+ .flags = ULongToPtr(params32->flags),
+ .devpos = ULongToPtr(params32->devpos),
+ .qpcpos = ULongToPtr(params32->qpcpos)
+ };
+ pulse_get_capture_buffer(¶ms);
+ params32->result = params.result;
+ *(unsigned int *)ULongToPtr(params32->data) = PtrToUlong(data);
+ return STATUS_SUCCESS;
+};
+
+static NTSTATUS pulse_wow64_get_buffer_size(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ HRESULT result;
+ PTR32 size;
+ } *params32 = args;
+ struct get_buffer_size_params params =
+ {
+ .stream = params32->stream,
+ .size = ULongToPtr(params32->size)
+ };
+ pulse_get_buffer_size(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_latency(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ HRESULT result;
+ PTR32 latency;
+ } *params32 = args;
+ struct get_latency_params params =
+ {
+ .stream = params32->stream,
+ .latency = ULongToPtr(params32->latency)
+ };
+ pulse_get_latency(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_current_padding(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ HRESULT result;
+ PTR32 padding;
+ } *params32 = args;
+ struct get_current_padding_params params =
+ {
+ .stream = params32->stream,
+ .padding = ULongToPtr(params32->padding)
+ };
+ pulse_get_current_padding(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_next_packet_size(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ HRESULT result;
+ PTR32 frames;
+ } *params32 = args;
+ struct get_next_packet_size_params params =
+ {
+ .stream = params32->stream,
+ .frames = ULongToPtr(params32->frames)
+ };
+ pulse_get_next_packet_size(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_frequency(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ HRESULT result;
+ PTR32 freq;
+ } *params32 = args;
+ struct get_frequency_params params =
+ {
+ .stream = params32->stream,
+ .freq = ULongToPtr(params32->freq)
+ };
+ pulse_get_frequency(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_position(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ BOOL device;
+ HRESULT result;
+ PTR32 pos;
+ PTR32 qpctime;
+ } *params32 = args;
+ struct get_position_params params =
+ {
+ .stream = params32->stream,
+ .device = params32->device,
+ .pos = ULongToPtr(params32->pos),
+ .qpctime = ULongToPtr(params32->qpctime)
+ };
+ pulse_get_position(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_set_volumes(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ float master_volume;
+ PTR32 volumes;
+ PTR32 session_volumes;
+ } *params32 = args;
+ struct set_volumes_params params =
+ {
+ .stream = params32->stream,
+ .master_volume = params32->master_volume,
+ .volumes = ULongToPtr(params32->volumes),
+ .session_volumes = ULongToPtr(params32->session_volumes)
+ };
+ return pulse_set_volumes(¶ms);
+}
+
+static NTSTATUS pulse_wow64_set_event_handle(void *args)
+{
+ struct
+ {
+ stream_handle stream;
+ PTR32 event;
+ HRESULT result;
+ } *params32 = args;
+ struct set_event_handle_params params =
+ {
+ .stream = params32->stream,
+ .event = ULongToHandle(params32->event)
+ };
+ pulse_set_event_handle(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_test_connect(void *args)
+{
+ struct
+ {
+ PTR32 name;
+ HRESULT result;
+ PTR32 config;
+ } *params32 = args;
+ struct test_connect_params params =
+ {
+ .name = ULongToPtr(params32->name),
+ .config = ULongToPtr(params32->config), /* struct pulse_config is identical */
+ };
+ pulse_test_connect(¶ms);
+ params32->result = params.result;
+ return STATUS_SUCCESS;
+}
+
+static NTSTATUS pulse_wow64_get_prop_value(void *args)
+{
+ struct
+ {
+ PTR32 pulse_name;
+ PTR32 guid;
+ PTR32 prop;
+ EDataFlow flow;
+ HRESULT result;
+ VARTYPE vt;
+ union
+ {
+ WCHAR wstr[128];
+ ULONG ulVal;
+ };
+ } *params32 = args;
+ struct get_prop_value_params params =
+ {
+ .pulse_name = ULongToPtr(params32->pulse_name),
+ .guid = ULongToPtr(params32->guid),
+ .prop = ULongToPtr(params32->prop),
+ .flow = params32->flow,
+ };
+ pulse_get_prop_value(¶ms);
+ params32->result = params.result;
+ params32->vt = params.vt;
+ if (SUCCEEDED(params.result))
+ {
+ switch (params.vt)
+ {
+ case VT_UI4:
+ params32->ulVal = params.ulVal;
+ break;
+ case VT_LPWSTR:
+ wcscpy(params32->wstr, params.wstr);
+ break;
+ default:
+ FIXME("Unhandled vt %04x\n", params.vt);
+ }
+ }
+ return STATUS_SUCCESS;
+}
+
+const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
+{
+ pulse_process_attach,
+ pulse_process_detach,
+ pulse_wow64_main_loop,
+ pulse_wow64_get_endpoint_ids,
+ pulse_wow64_create_stream,
+ pulse_wow64_release_stream,
+ pulse_start,
+ pulse_stop,
+ pulse_reset,
+ pulse_timer_loop,
+ pulse_wow64_get_render_buffer,
+ pulse_release_render_buffer,
+ pulse_wow64_get_capture_buffer,
+ pulse_release_capture_buffer,
+ pulse_wow64_get_buffer_size,
+ pulse_wow64_get_latency,
+ pulse_wow64_get_current_padding,
+ pulse_wow64_get_next_packet_size,
+ pulse_wow64_get_frequency,
+ pulse_wow64_get_position,
+ pulse_wow64_set_volumes,
+ pulse_wow64_set_event_handle,
+ pulse_wow64_test_connect,
+ pulse_is_started,
+ pulse_wow64_get_prop_value,
+};
+
+#endif /* _WIN64 */
--
2.25.1
2
1