Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 22 participants
- 84527 discussions
[PATCH resend 1/5] ntoskrnl.exe/tests: Add tests with and without report IDs.
by Rémi Bernon June 16, 2021
by Rémi Bernon June 16, 2021
June 16, 2021
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
Resending to run the tests again. The w864 crash should be fixed but I
still expect spurious test failures on w7u_qxl, which sometimes misses
bus message arrival, in the PnP driver test so unrelated to these
changes, as well as some even less frequent spurious failures.
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 +-
dlls/ntoskrnl.exe/tests/driver_hid.c | 108 +++++++++++++++++----------
dlls/ntoskrnl.exe/tests/ntoskrnl.c | 56 +++++++++++---
3 files changed, 114 insertions(+), 54 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index 2f7e27e0d87..5fdaa922f45 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -1436,7 +1436,7 @@
@ stdcall -private ZwOpenEvent(ptr long ptr) NtOpenEvent
@ stdcall ZwOpenFile(ptr long ptr ptr long long) NtOpenFile
@ stdcall -private ZwOpenJobObject(ptr long ptr) NtOpenJobObject
-@ stdcall -private ZwOpenKey(ptr long ptr) NtOpenKey
+@ stdcall ZwOpenKey(ptr long ptr) NtOpenKey
@ stdcall -private ZwOpenKeyEx(ptr long ptr long) NtOpenKeyEx
@ stdcall -private ZwOpenKeyTransacted(ptr long ptr long) NtOpenKeyTransacted
@ stdcall -private ZwOpenKeyTransactedEx(ptr long ptr long long) NtOpenKeyTransactedEx
@@ -1476,7 +1476,7 @@
@ stdcall -private ZwQuerySystemInformation(long ptr long ptr) NtQuerySystemInformation
@ stdcall -private ZwQuerySystemInformationEx(long ptr long ptr long ptr) NtQuerySystemInformationEx
@ stdcall -private ZwQueryTimerResolution(ptr ptr ptr) NtQueryTimerResolution
-@ stdcall -private ZwQueryValueKey(long ptr long ptr long ptr) NtQueryValueKey
+@ stdcall ZwQueryValueKey(long ptr long ptr long ptr) NtQueryValueKey
@ stdcall -private ZwQueryVirtualMemory(long ptr long ptr long ptr) NtQueryVirtualMemory
@ stdcall -private ZwQueryVolumeInformationFile(long ptr ptr long long) NtQueryVolumeInformationFile
@ stdcall -private ZwReadFile(long long ptr ptr ptr ptr long ptr ptr) NtReadFile
diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c
index 1fe644250f7..3a9f4867de4 100644
--- a/dlls/ntoskrnl.exe/tests/driver_hid.c
+++ b/dlls/ntoskrnl.exe/tests/driver_hid.c
@@ -40,6 +40,7 @@
static UNICODE_STRING control_symlink;
static unsigned int got_start_device;
+static DWORD report_id;
static NTSTATUS WINAPI driver_pnp(DEVICE_OBJECT *device, IRP *irp)
{
@@ -85,49 +86,54 @@ static NTSTATUS WINAPI driver_power(DEVICE_OBJECT *device, IRP *irp)
return PoCallDriver(ext->NextDeviceObject, irp);
}
-#include "psh_hid_macros.h"
-
-static const unsigned char report_descriptor[] =
+static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
{
- USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
- USAGE(1, HID_USAGE_GENERIC_JOYSTICK),
- COLLECTION(1, Application),
- USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
- USAGE(1, HID_USAGE_GENERIC_X),
- USAGE(1, HID_USAGE_GENERIC_Y),
- LOGICAL_MINIMUM(1, -128),
- LOGICAL_MAXIMUM(1, 127),
- REPORT_SIZE(1, 8),
- REPORT_COUNT(1, 2),
- INPUT(1, Data|Var|Abs),
-
- USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON),
- USAGE_MINIMUM(1, 1),
- USAGE_MAXIMUM(1, 8),
- LOGICAL_MINIMUM(1, 0),
- LOGICAL_MAXIMUM(1, 1),
- PHYSICAL_MINIMUM(1, 0),
- PHYSICAL_MAXIMUM(1, 1),
- REPORT_COUNT(1, 8),
- REPORT_SIZE(1, 1),
- INPUT(1, Data|Var|Abs),
-
+#include "psh_hid_macros.h"
+/* Replace REPORT_ID with USAGE_PAGE when id is 0 */
+#define REPORT_ID_OR_USAGE_PAGE(size, id) SHORT_ITEM_1((id ? 8 : 0), 1, id)
+ const unsigned char report_descriptor[] =
+ {
USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
- USAGE(1, HID_USAGE_GENERIC_HATSWITCH),
- LOGICAL_MINIMUM(1, 1),
- LOGICAL_MAXIMUM(1, 8),
- PHYSICAL_MINIMUM(1, 0),
- PHYSICAL_MAXIMUM(1, 8),
- REPORT_SIZE(1, 4),
- REPORT_COUNT(1, 2),
- INPUT(1, Data|Var|Abs),
- END_COLLECTION,
-};
-
+ USAGE(1, HID_USAGE_GENERIC_JOYSTICK),
+ COLLECTION(1, Application),
+ USAGE(1, HID_USAGE_GENERIC_JOYSTICK),
+ COLLECTION(1, Logical),
+ REPORT_ID_OR_USAGE_PAGE(1, report_id),
+ USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
+ USAGE(1, HID_USAGE_GENERIC_X),
+ USAGE(1, HID_USAGE_GENERIC_Y),
+ LOGICAL_MINIMUM(1, -128),
+ LOGICAL_MAXIMUM(1, 127),
+ REPORT_SIZE(1, 8),
+ REPORT_COUNT(1, 2),
+ INPUT(1, Data|Var|Abs),
+
+ USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON),
+ USAGE_MINIMUM(1, 1),
+ USAGE_MAXIMUM(1, 8),
+ LOGICAL_MINIMUM(1, 0),
+ LOGICAL_MAXIMUM(1, 1),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 1),
+ REPORT_COUNT(1, 8),
+ REPORT_SIZE(1, 1),
+ INPUT(1, Data|Var|Abs),
+
+ USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC),
+ USAGE(1, HID_USAGE_GENERIC_HATSWITCH),
+ LOGICAL_MINIMUM(1, 1),
+ LOGICAL_MAXIMUM(1, 8),
+ PHYSICAL_MINIMUM(1, 0),
+ PHYSICAL_MAXIMUM(1, 8),
+ REPORT_SIZE(1, 4),
+ REPORT_COUNT(1, 2),
+ INPUT(1, Data|Var|Abs),
+ END_COLLECTION,
+ END_COLLECTION,
+ };
+#undef REPORT_ID_OR_USAGE_PAGE
#include "pop_hid_macros.h"
-static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
-{
static BOOL test_failed;
IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp);
const ULONG in_size = stack->Parameters.DeviceIoControl.InputBufferLength;
@@ -202,9 +208,13 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
case IOCTL_HID_READ_REPORT:
{
- ULONG expected_size = 4;
+ ULONG expected_size = report_id ? 5 : 4;
ok(!in_size, "got input size %u\n", in_size);
- if (!test_failed) todo_wine ok(out_size == expected_size, "got output size %u\n", out_size);
+ if (!test_failed)
+ {
+ todo_wine_if(!report_id)
+ ok(out_size == expected_size, "got output size %u\n", out_size);
+ }
if (out_size != expected_size) test_failed = TRUE;
ret = STATUS_NOT_IMPLEMENTED;
@@ -278,17 +288,33 @@ static void WINAPI driver_unload(DRIVER_OBJECT *driver)
NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *registry)
{
+ static const int info_size = offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data );
+ char buffer[offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data ) + sizeof(DWORD)];
HID_MINIDRIVER_REGISTRATION params =
{
.Revision = HID_REVISION,
.DriverObject = driver,
.RegistryPath = registry,
};
+ UNICODE_STRING name_str;
+ OBJECT_ATTRIBUTES attr;
NTSTATUS ret;
+ HANDLE hkey;
+ DWORD size;
if ((ret = winetest_init()))
return ret;
+ InitializeObjectAttributes(&attr, registry, 0, NULL, NULL);
+ ret = ZwOpenKey(&hkey, KEY_ALL_ACCESS, &attr);
+ ok(!ret, "ZwOpenKey returned %#x\n", ret);
+
+ RtlInitUnicodeString(&name_str, L"ReportID");
+ size = info_size + sizeof(report_id);
+ ret = ZwQueryValueKey(hkey, &name_str, KeyValuePartialInformation, buffer, size, &size);
+ ok(!ret, "ZwQueryValueKey returned %#x\n", ret);
+ memcpy(&report_id, buffer + info_size, size - info_size);
+
driver->DriverExtension->AddDevice = driver_add_device;
driver->DriverUnload = driver_unload;
driver->MajorFunction[IRP_MJ_PNP] = driver_pnp;
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
index 4b744d813d8..e9390698fc6 100644
--- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c
@@ -1634,25 +1634,27 @@ static inline void check_hidp_value_caps_(int line, HIDP_VALUE_CAPS *caps, const
}
}
-static void test_hidp(HANDLE file)
+static void test_hidp(HANDLE file, int report_id)
{
- static const HIDP_CAPS expect_hidp_caps =
+ const HIDP_CAPS expect_hidp_caps =
{
.Usage = HID_USAGE_GENERIC_JOYSTICK,
.UsagePage = HID_USAGE_PAGE_GENERIC,
.InputReportByteLength = 5,
- .NumberLinkCollectionNodes = 1,
+ .NumberLinkCollectionNodes = 2,
.NumberInputButtonCaps = 1,
.NumberInputValueCaps = 3,
.NumberInputDataIndices = 11,
};
- static const HIDP_BUTTON_CAPS expect_button_caps[] =
+ const HIDP_BUTTON_CAPS expect_button_caps[] =
{
{
.UsagePage = HID_USAGE_PAGE_BUTTON,
+ .ReportID = report_id,
.BitField = 2,
.LinkUsage = HID_USAGE_GENERIC_JOYSTICK,
.LinkUsagePage = HID_USAGE_PAGE_GENERIC,
+ .LinkCollection = 1,
.IsRange = TRUE,
.IsAbsolute = TRUE,
.Range.UsageMin = 1,
@@ -1661,13 +1663,15 @@ static void test_hidp(HANDLE file)
.Range.DataIndexMax = 9,
},
};
- static const HIDP_VALUE_CAPS expect_value_caps[] =
+ const HIDP_VALUE_CAPS expect_value_caps[] =
{
{
.UsagePage = HID_USAGE_PAGE_GENERIC,
+ .ReportID = report_id,
.BitField = 2,
.LinkUsage = HID_USAGE_GENERIC_JOYSTICK,
.LinkUsagePage = HID_USAGE_PAGE_GENERIC,
+ .LinkCollection = 1,
.IsAbsolute = TRUE,
.BitSize = 8,
.ReportCount = 1,
@@ -1677,9 +1681,11 @@ static void test_hidp(HANDLE file)
},
{
.UsagePage = HID_USAGE_PAGE_GENERIC,
+ .ReportID = report_id,
.BitField = 2,
.LinkUsage = HID_USAGE_GENERIC_JOYSTICK,
.LinkUsagePage = HID_USAGE_PAGE_GENERIC,
+ .LinkCollection = 1,
.IsAbsolute = TRUE,
.BitSize = 8,
.ReportCount = 1,
@@ -1690,9 +1696,11 @@ static void test_hidp(HANDLE file)
},
{
.UsagePage = HID_USAGE_PAGE_GENERIC,
+ .ReportID = report_id,
.BitField = 2,
.LinkUsage = HID_USAGE_GENERIC_JOYSTICK,
.LinkUsagePage = HID_USAGE_PAGE_GENERIC,
+ .LinkCollection = 1,
.IsAbsolute = TRUE,
.BitSize = 4,
.ReportCount = 2,
@@ -1709,6 +1717,13 @@ static void test_hidp(HANDLE file)
.LinkUsage = HID_USAGE_GENERIC_JOYSTICK,
.LinkUsagePage = HID_USAGE_PAGE_GENERIC,
.CollectionType = 1,
+ .NumberOfChildren = 1,
+ .FirstChild = 1,
+ },
+ {
+ .LinkUsage = HID_USAGE_GENERIC_JOYSTICK,
+ .LinkUsagePage = HID_USAGE_PAGE_GENERIC,
+ .CollectionType = 2,
},
};
@@ -1956,20 +1971,26 @@ static void test_hidp(HANDLE file)
ok(status == HIDP_STATUS_INVALID_REPORT_LENGTH, "HidP_InitializeReportForID returned %#x\n", status);
status = HidP_InitializeReportForID(HidP_Input, 0, preparsed_data, report, caps.InputReportByteLength + 1);
ok(status == HIDP_STATUS_INVALID_REPORT_LENGTH, "HidP_InitializeReportForID returned %#x\n", status);
+ status = HidP_InitializeReportForID(HidP_Input, 1 - report_id, preparsed_data, report, caps.InputReportByteLength);
+ todo_wine_if(!report_id)
+ ok(status == HIDP_STATUS_REPORT_DOES_NOT_EXIST, "HidP_InitializeReportForID returned %#x\n", status);
memset(report, 0xcd, sizeof(report));
- status = HidP_InitializeReportForID(HidP_Input, 0, preparsed_data, report, caps.InputReportByteLength);
+ status = HidP_InitializeReportForID(HidP_Input, report_id, preparsed_data, report, caps.InputReportByteLength);
+ todo_wine_if(report_id)
ok(status == HIDP_STATUS_SUCCESS, "HidP_InitializeReportForID returned %#x\n", status);
memset(buffer, 0xcd, sizeof(buffer));
memset(buffer, 0, caps.InputReportByteLength);
+ buffer[0] = report_id;
+ todo_wine_if(report_id)
ok(!memcmp(buffer, report, sizeof(buffer)), "unexpected report data\n");
HidD_FreePreparsedData(preparsed_data);
CloseHandle(file);
}
-static void test_hid_device(void)
+static void test_hid_device(DWORD report_id)
{
char buffer[200];
SP_DEVICE_INTERFACE_DETAIL_DATA_A *iface_detail = (void *)buffer;
@@ -1984,6 +2005,8 @@ static void test_hid_device(void)
HDEVINFO set;
HANDLE file;
+ winetest_push_context("report %d", report_id);
+
set = SetupDiGetClassDevsA(&GUID_DEVINTERFACE_HID, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
ok(set != INVALID_HANDLE_VALUE, "failed to get device list, error %#x\n", GetLastError());
@@ -2014,7 +2037,7 @@ static void test_hid_device(void)
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError());
- test_hidp(file);
+ test_hidp(file, report_id);
CloseHandle(file);
@@ -2022,9 +2045,11 @@ static void test_hid_device(void)
InitializeObjectAttributes(&attr, &string, OBJ_CASE_INSENSITIVE, NULL, NULL);
status = NtOpenFile(&file, SYNCHRONIZE, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT);
todo_wine ok(status == STATUS_UNSUCCESSFUL, "got %#x\n", status);
+
+ winetest_pop_context();
}
-static void test_hid_driver(struct testsign_context *ctx)
+static void test_hid_driver(struct testsign_context *ctx, DWORD report_id)
{
static const char hardware_id[] = "test_hardware_id\0";
char path[MAX_PATH], dest[MAX_PATH], *filepart;
@@ -2034,13 +2059,21 @@ static void test_hid_driver(struct testsign_context *ctx)
SC_HANDLE manager, service;
BOOL ret, need_reboot;
HANDLE catalog, file;
+ LSTATUS status;
HDEVINFO set;
+ HKEY hkey;
FILE *f;
GetCurrentDirectoryA(ARRAY_SIZE(cwd), cwd);
GetTempPathA(ARRAY_SIZE(tempdir), tempdir);
SetCurrentDirectoryA(tempdir);
+ status = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Services\\winetest", 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL);
+ ok(!status, "RegCreateKeyExW returned %#x\n", status);
+
+ status = RegSetValueExW(hkey, L"ReportID", 0, REG_DWORD, (void *)&report_id, sizeof(report_id));
+ ok(!status, "RegSetValueExW returned %#x\n", status);
+
load_resource(L"driver_hid.dll", driver_filename);
ret = MoveFileExW(driver_filename, L"winetest.sys", MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);
ok(ret, "failed to move file, error %u\n", GetLastError());
@@ -2088,7 +2121,7 @@ static void test_hid_driver(struct testsign_context *ctx)
/* Tests. */
- test_hid_device();
+ test_hid_device(report_id);
/* Clean up. */
@@ -2219,7 +2252,8 @@ START_TEST(ntoskrnl)
test_pnp_driver(&ctx);
subtest("driver_hid");
- test_hid_driver(&ctx);
+ test_hid_driver(&ctx, 0);
+ test_hid_driver(&ctx, 1);
out:
testsign_cleanup(&ctx);
--
2.31.0
3
12
June 16, 2021
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
include/urlmon.idl | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/include/urlmon.idl b/include/urlmon.idl
index 867d3ebc959..0aab6588658 100644
--- a/include/urlmon.idl
+++ b/include/urlmon.idl
@@ -404,6 +404,37 @@ interface IAuthenticate : IUnknown
[out] LPWSTR *pszPassword);
}
+/*****************************************************************************
+ * IAuthenticateEx interface
+ */
+[
+ object,
+ uuid(2ad1edaf-d83d-48b5-9adf-03dbe19f53bd),
+ pointer_default(unique)
+]
+
+interface IAuthenticateEx : IAuthenticate
+{
+ typedef [unique] IAuthenticateEx *LPAUTHENTICATIONEX;
+
+ typedef enum {
+ AUTHENTICATEF_PROXY = 0x00000001,
+ AUTHENTICATEF_BASIC = 0x00000002,
+ AUTHENTICATEF_HTTP = 0x00000004
+ } AUTHENTICATEF;
+
+ typedef struct _tagAUTHENTICATEINFO {
+ DWORD dwFlags;
+ DWORD dwReserved;
+ } AUTHENTICATEINFO;
+
+ HRESULT AuthenticateEx(
+ [out] HWND *phwnd,
+ [out] LPWSTR *pszUsername,
+ [out] LPWSTR *pszPassword,
+ [in] AUTHENTICATEINFO *pauthinfo);
+}
+
/*****************************************************************************
* IHttpNegotiate interface
*/
--
2.31.1
1
0
June 16, 2021
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
tests/d3d12.c | 332 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 332 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index f289a10d..55c9ca4d 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -41,6 +41,11 @@ struct ivec4
int x, y, z, w;
};
+struct dvec2
+{
+ double x, y;
+};
+
static bool compare_uvec4(const struct uvec4* v1, const struct uvec4 *v2)
{
return v1->x == v2->x && v1->y == v2->y && v1->z == v2->z && v1->w == v2->w;
@@ -651,6 +656,21 @@ static bool is_memory_pool_L1_supported(ID3D12Device *device)
return !architecture.UMA;
}
+static bool is_shader_float64_supported(ID3D12Device *device)
+{
+ D3D12_FEATURE_DATA_D3D12_OPTIONS options;
+ HRESULT hr;
+
+ if (FAILED(hr = ID3D12Device_CheckFeatureSupport(device,
+ D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options))))
+ {
+ trace("Failed to check feature support, hr %#x.\n", hr);
+ return false;
+ }
+
+ return options.DoublePrecisionFloatShaderOps;
+}
+
#define create_cb_root_signature(a, b, c, e) create_cb_root_signature_(__LINE__, a, b, c, e)
static ID3D12RootSignature *create_cb_root_signature_(unsigned int line,
ID3D12Device *device, unsigned int reg_idx, D3D12_SHADER_VISIBILITY shader_visibility,
@@ -7510,6 +7530,7 @@ static void test_shader_instructions(void)
D3D12_SHADER_BYTECODE shader;
struct test_context context;
ID3D12CommandQueue *queue;
+ bool test_shader_float64;
ID3D12Resource *cb;
unsigned int i;
HRESULT hr;
@@ -9054,6 +9075,278 @@ static void test_shader_instructions(void)
0x00100e46, 0x00000001, 0x0100003e,
};
static struct named_shader ps_swapc5 = {"swapc5", ps_swapc5_code, sizeof(ps_swapc5_code)};
+ static const DWORD ps_dmov_code[] =
+ {
+#if 0
+ double2 src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ asuint(-src0.y, dst.x, dst.y);
+ asuint(-src0.x, dst.z, dst.w);
+ }
+#endif
+ 0x43425844, 0x16bd7e63, 0x6b535ab7, 0xb7f182c2, 0x6f3819a8, 0x00000001, 0x000000f0, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x000000e0, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000064, 0x00000050,
+ 0x00000019, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x070000c7, 0x001000f2, 0x00000000, 0x802084e6, 0x00000041,
+ 0x00000000, 0x00000000, 0x05000036, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x0100003e,
+ 0x30494653, 0x00000008, 0x00000001, 0x00000000,
+ };
+ static struct named_shader ps_dmov = {"dmov", ps_dmov_code, sizeof(ps_dmov_code)};
+ static const DWORD ps_dadd_code[] =
+ {
+ /* Also test constant double2 vector. */
+#if 0
+ double src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ double2 a = double2(src0 + 1.0000002433080226l, src0 + 2.000000481493771l);
+ asuint(a.x, dst.x, dst.y);
+ asuint(a.y, dst.z, dst.w);
+ }
+#endif
+ 0x43425844, 0x23e20252, 0xf4d2708e, 0x87956944, 0xc61e7052, 0x00000001, 0x00000100, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x000000f0, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000074, 0x00000050,
+ 0x0000001d, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x0b0000bf, 0x001000f2, 0x00000000, 0x00208446, 0x00000000,
+ 0x00000000, 0x00005002, 0x41500000, 0x3ff00000, 0x40a00000, 0x40000000, 0x05000036, 0x001020f2,
+ 0x00000000, 0x00100e46, 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000,
+ };
+ static struct named_shader ps_dadd = {"dadd", ps_dadd_code, sizeof(ps_dadd_code)};
+ static const DWORD ps_dmin_dmax_code[] =
+ {
+#if 0
+ double2 src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ asuint(min(src0.x, src0.y), dst.x, dst.y);
+ asuint(max(src0.x, src0.y), dst.z, dst.w);
+ }
+#endif
+ 0x43425844, 0x6f8b547e, 0x3552757c, 0x92a81fa1, 0x00990b21, 0x00000001, 0x00000130, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000120, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x000000a4, 0x00000050,
+ 0x00000029, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x090000c1, 0x00100032, 0x00000000, 0x00208ee6, 0x00000000,
+ 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x05000036, 0x00102032, 0x00000000, 0x00100046,
+ 0x00000000, 0x090000c0, 0x00100032, 0x00000000, 0x00208ee6, 0x00000000, 0x00000000, 0x00208446,
+ 0x00000000, 0x00000000, 0x05000036, 0x001020c2, 0x00000000, 0x00100406, 0x00000000, 0x0100003e,
+ 0x30494653, 0x00000008, 0x00000001, 0x00000000,
+ };
+ static struct named_shader ps_dmin_dmax = {"dmin_dmax", ps_dmin_dmax_code, sizeof(ps_dmin_dmax_code)};
+ static const DWORD ps_dmovc_code[] =
+ {
+#if 0
+ double src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ asuint(src0 > 1.0 ? src0 : 4.5, dst.x, dst.y);
+ dst.zw = 0;
+ }
+#endif
+ 0x43425844, 0x43c017c3, 0x117edcff, 0xd44d42dc, 0xb3affdd5, 0x00000001, 0x00000154, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000144, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x000000c8, 0x00000050,
+ 0x00000032, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x0b0000c5, 0x00100012, 0x00000000, 0x00005002, 0x00000000,
+ 0x3ff00000, 0x00000000, 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x0d0000c8, 0x00100032,
+ 0x00000000, 0x00100006, 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x00005002, 0x00000000,
+ 0x40120000, 0x00000000, 0x00000000, 0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000,
+ 0x08000036, 0x001020c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000,
+ };
+ static struct named_shader ps_dmovc = {"dmovc", ps_dmovc_code, sizeof(ps_dmovc_code)};
+ static const DWORD ps_dmodifier_code[] =
+ {
+ /* Already tested negation in the dmov test. */
+#if 0
+ double src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ asuint(abs(src0), dst.x, dst.y);
+ asuint(saturate(src0) + 1.5, dst.z, dst.w);
+ }
+#endif
+ 0x43425844, 0x15bb537e, 0x47ef3ae3, 0xba88acf7, 0x0b3624e0, 0x00000001, 0x00000144, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000134, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x000000b8, 0x00000050,
+ 0x0000002e, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x060020c7, 0x00100032, 0x00000000, 0x00208446, 0x00000000,
+ 0x00000000, 0x0a0000bf, 0x00100032, 0x00000000, 0x00100446, 0x00000000, 0x00005002, 0x00000000,
+ 0x3ff80000, 0x00000000, 0x00000000, 0x05000036, 0x001020c2, 0x00000000, 0x00100406, 0x00000000,
+ 0x070000c7, 0x00100032, 0x00000000, 0x80208446, 0x00000081, 0x00000000, 0x00000000, 0x05000036,
+ 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000001,
+ 0x00000000,
+ };
+ static struct named_shader ps_dmodifier = {"dmodifier", ps_dmodifier_code, sizeof(ps_dmodifier_code)};
+ static const DWORD ps_deq_code[] =
+ {
+#if 0
+ double2 src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ dst = (uint4)0;
+ if (src0.x == src0.y)
+ dst.x = 0xffffffff;
+ }
+#endif
+ 0x43425844, 0x24c9cee6, 0xd38c521f, 0xcde7c8b6, 0xc173a8e3, 0x00000001, 0x00000118, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000108, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000008c, 0x00000050,
+ 0x00000023, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x090000c3, 0x00100012, 0x00000000, 0x00208ee6, 0x00000000,
+ 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x05000036, 0x00102012, 0x00000000, 0x0010000a,
+ 0x00000000, 0x08000036, 0x001020e2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000,
+ };
+ static struct named_shader ps_deq = {"deq", ps_deq_code, sizeof(ps_deq_code)};
+ static const DWORD ps_dne_code[] =
+ {
+#if 0
+ double2 src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ dst = (uint4)0;
+ if (src0.x != src0.y)
+ dst.x = 0xffffffff;
+ }
+#endif
+ 0x43425844, 0x99700929, 0x3b743000, 0xdfc89958, 0xfc2b89ab, 0x00000001, 0x00000118, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000108, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000008c, 0x00000050,
+ 0x00000023, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x090000c6, 0x00100012, 0x00000000, 0x00208ee6, 0x00000000,
+ 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x05000036, 0x00102012, 0x00000000, 0x0010000a,
+ 0x00000000, 0x08000036, 0x001020e2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000,
+ };
+ static struct named_shader ps_dne = {"dne", ps_dne_code, sizeof(ps_dne_code)};
+ static const DWORD ps_dtou_code[] =
+ {
+#if 0
+ double src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ dst = uint4(src0, -src0, 0, 0);
+ }
+#endif
+ 0x43425844, 0x6ca74abd, 0xe970e02d, 0xa65b35db, 0xd2f58586, 0x00000001, 0x00000128, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050,
+ 0x00000027, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x060000d7, 0x00100012, 0x00000000, 0x00208446, 0x00000000,
+ 0x00000000, 0x070000d7, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000,
+ 0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000,
+ 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
+ 0x00000021, 0x00000000,
+ };
+ static struct named_shader ps_dtou = {"dtou", ps_dtou_code, sizeof(ps_dtou_code)};
+ static const DWORD ps_dtoi_code[] =
+ {
+#if 0
+ double src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ dst = int4(src0, -src0, 0, 0);
+ }
+#endif
+ 0x43425844, 0x38d82727, 0x8666b36c, 0x91954b7e, 0xf376163a, 0x00000001, 0x00000128, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050,
+ 0x00000027, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x060000d6, 0x00100012, 0x00000000, 0x00208446, 0x00000000,
+ 0x00000000, 0x070000d6, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000,
+ 0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000,
+ 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
+ 0x00000021, 0x00000000,
+ };
+ static const struct named_shader ps_dtoi = {"dtoi", ps_dtoi_code, sizeof(ps_dtoi_code)};
+ static const DWORD ps_ftod_code[] =
+ {
+#if 0
+ float2 src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ double2 a = double2(src0.x, src0.y);
+ asuint(a.x, dst.x, dst.y);
+ asuint(a.y, dst.z, dst.w);
+ }
+#endif
+ 0x43425844, 0xad43f67d, 0x04a1aba0, 0x253502f1, 0x2c9c1735, 0x00000001, 0x000000ec, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
+ 0x00000018, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x060000ca, 0x001000f2, 0x00000000, 0x00208046, 0x00000000,
+ 0x00000000, 0x05000036, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x0100003e, 0x30494653,
+ 0x00000008, 0x00000001, 0x00000000,
+ };
+ static struct named_shader ps_ftod = {"ftod", ps_ftod_code, sizeof(ps_ftod_code)};
+ static const DWORD ps_ddiv_code[] =
+ {
+#if 0
+ double2 src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ asuint(src0.x / src0.y, dst.x, dst.y);
+ dst.zw = 0;
+ }
+#endif
+ 0x43425844, 0x1c8a3236, 0x400a6b3b, 0x5554bf56, 0x4ff834b8, 0x00000001, 0x00000118, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x00000108, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000008c, 0x00000050,
+ 0x00000023, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x090000d2, 0x00100032, 0x00000000, 0x00208446, 0x00000000,
+ 0x00000000, 0x00208ee6, 0x00000000, 0x00000000, 0x05000036, 0x00102032, 0x00000000, 0x00100046,
+ 0x00000000, 0x08000036, 0x001020c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x0100003e, 0x30494653, 0x00000008, 0x00000021, 0x00000000,
+ };
+ static const struct named_shader ps_ddiv = {"ddiv", ps_ddiv_code, sizeof(ps_ddiv_code)};
+ static const DWORD ps_drcp_code[] =
+ {
+#if 0
+ double2 src0;
+
+ void main(out uint4 dst : SV_Target)
+ {
+ double2 a = rcp(src0);
+ asuint(a.x, dst.x, dst.y);
+ asuint(a.y, dst.z, dst.w);
+ }
+#endif
+ 0x43425844, 0xdcbd25ba, 0x2d5cccb9, 0x84ed8028, 0x3d62632a, 0x00000001, 0x000000ec, 0x00000004,
+ 0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
+ 0x00000018, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000000, 0x02000068, 0x00000001, 0x060000d4, 0x001000f2, 0x00000000, 0x00208e46, 0x00000000,
+ 0x00000000, 0x05000036, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x0100003e, 0x30494653,
+ 0x00000008, 0x00000021, 0x00000000,
+ };
+ static struct named_shader ps_drcp = {"drcp", ps_drcp_code, sizeof(ps_drcp_code)};
static const struct
{
const struct named_shader *ps;
@@ -9290,13 +9583,21 @@ static void test_shader_instructions(void)
struct vec4 src1;
struct vec4 src2;
} f;
+ struct
+ {
+ struct dvec2 src0;
+ struct dvec2 src1;
+ struct dvec2 src2;
+ } d;
} input;
union
{
struct uvec4 u;
struct ivec4 i;
struct vec4 f;
+ struct dvec2 d;
} output;
+ bool is_float64;
bool skip_on_warp;
}
uint_tests[] =
@@ -9526,6 +9827,29 @@ static void test_shader_instructions(void)
{&ps_movc, {{{0, 1, 1, 0}, {1, 2, 3, 4}, {5, 6, 7, 8}}}, {{5, 2, 3, 8}}},
{&ps_movc, {{{1, 1, 1, 1}, {1, 2, 3, 4}, {5, 6, 7, 8}}}, {{1, 2, 3, 4}}},
+ {&ps_dmov, {.d = {{2.5 + 1.0e-9, -3.5 - 1.0e-9}}}, {.d = {3.5 + 1.0e-9, -2.5 - 1.0e-9}}, true},
+ {&ps_dadd, {.d = {{2.5, 0.0}}}, {.d = {2.5 + 1.0000002433080226, 2.5 + 2.000000481493771}}, true},
+ {&ps_dmin_dmax, {.d = {{-1.0, 1.0}}}, {.d = {-1.0, 1.0}}, true},
+ {&ps_dmovc, {.d = {{0.5, 0.0}}}, {.d = {4.5}}, true},
+ {&ps_dmovc, {.d = {{1.5, 0.0}}}, {.d = {1.5}}, true},
+ {&ps_dmodifier, {.d = {{1.5, 0.0}}}, {.d = {1.5f, 2.5f}}, true},
+ {&ps_dmodifier, {.d = {{-1.5, 0.0}}}, {.d = {1.5f, 1.5f}}, true},
+ {&ps_deq, {.d = {{0.0, 0.0}}}, {{0xffffffff}}, true},
+ {&ps_deq, {.d = {{1.0, 0.0}}}, {{0x00000000}}, true},
+ {&ps_dne, {.d = {{0.0, 0.0}}}, {{0x00000000}}, true},
+ {&ps_dne, {.d = {{1.0, 0.0}}}, {{0xffffffff}}, true},
+ {&ps_dtou, {.d = {{ -NAN}}}, {{ 0, 0 }}, true},
+ {&ps_dtou, {.d = {{ NAN}}}, {{ 0, 0 }}, true},
+ {&ps_dtou, {.d = {{-INFINITY}}}, {{ 0, ~0u}}, true},
+ {&ps_dtou, {.d = {{ INFINITY}}}, {{~0u, 0 }}, true},
+ {&ps_dtou, {.d = {{ -1.0}}}, {{ 0, 1 }}, true},
+ {&ps_dtou, {.d = {{ 1.0}}}, {{ 1, 0 }}, true},
+ {&ps_dtoi, {.d = {{ 1.0}}}, {.i = {1, -1}}, true},
+ {&ps_ftod, {.f = {{-2.5f, 2.5f}}}, {.d = {-2.5, 2.5}}, true},
+ {&ps_ddiv, {.d = {{ 2.0, 4.0}}}, {.d = {0.5}}, true},
+ {&ps_ddiv, {.d = {{ 2.0, -4.0}}}, {.d = {-0.5}}, true},
+ {&ps_drcp, {.d = {{ 2.0, -0.5}}}, {.d = {0.5, -2.0}}, true},
+
{
&ps_swapc0,
{{{0, 0, 0, 0}, {0xdead, 0xc0de, 0xffff, 0xeeee}, {0xaaaa, 0xbbbb, 0xcccc, 0xdddd}}},
@@ -9818,6 +10142,8 @@ static void test_shader_instructions(void)
return;
command_list = context.list;
queue = context.queue;
+ /* Float64 instructions are not supported and pipeline state creation will fail. */
+ test_shader_float64 = is_shader_float64_supported(context.device) && vkd3d_test_platform_is_windows();
context.root_signature = create_cb_root_signature(context.device,
0, D3D12_SHADER_VISIBILITY_PIXEL, D3D12_ROOT_SIGNATURE_FLAG_NONE);
@@ -9888,6 +10214,12 @@ static void test_shader_instructions(void)
continue;
}
+ if (uint_tests[i].is_float64 && !test_shader_float64)
+ {
+ skip("Skipping shader '%s' float64 test.\n", uint_tests[i].ps->name);
+ continue;
+ }
+
if (current_ps != uint_tests[i].ps)
{
if (context.pipeline_state)
--
2.31.1
4
18
[PATCH 1/6] reg/tests: Modify delete_key() to support use of RegDeleteKeyEx()
by Hugh McMaster June 16, 2021
by Hugh McMaster June 16, 2021
June 16, 2021
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
---
programs/reg/tests/add.c | 35 +++++++++++++++++++-------------
programs/reg/tests/copy.c | 32 ++++++++++++++---------------
programs/reg/tests/export.c | 14 ++++++-------
programs/reg/tests/import.c | 38 +++++++++++++++++------------------
programs/reg/tests/reg_test.h | 4 ++--
5 files changed, 65 insertions(+), 58 deletions(-)
diff --git a/programs/reg/tests/add.c b/programs/reg/tests/add.c
index 7fad8333ed5..d2548c7d170 100644
--- a/programs/reg/tests/add.c
+++ b/programs/reg/tests/add.c
@@ -138,15 +138,22 @@ void add_key_(const char *file, unsigned line, const HKEY hkey, const char *path
RegCloseKey(new_key);
}
-void delete_key_(const char *file, unsigned line, const HKEY hkey, const char *path)
+void delete_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam)
{
- if (path && *path)
- {
- LONG err;
+ LONG err;
- err = RegDeleteKeyA(hkey, path);
+ if (!path) return;
+
+ if (!sam)
+ {
+ err = RegDeleteKeyA(root, path);
lok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got error %d\n", err);
}
+ else
+ {
+ err = RegDeleteKeyExA(root, path, sam, 0);
+ lok(err == ERROR_SUCCESS, "RegDeleteKeyExA failed: got error %d\n", err);
+ }
}
LONG delete_tree(const HKEY key, const char *subkey)
@@ -345,7 +352,7 @@ static void test_add(void)
verify_reg(hkey, NULL, REG_SZ, "", 1, 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Specifying a value name doesn't initialize the Default value in a new key */
run_reg_exe("reg add HKCU\\" KEY_BASE " /v Test /t REG_SZ /d \"Just me here\" /f", &r);
@@ -357,7 +364,7 @@ static void test_add(void)
verify_reg_nonexist(hkey, NULL);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Adding a registry key via WinAPI doesn't initialize the Default value... */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
@@ -423,7 +430,7 @@ static void test_reg_none(void)
verify_reg(hkey, "none1", REG_NONE, "\0", 2, 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_reg_sz(void)
@@ -501,7 +508,7 @@ static void test_reg_sz(void)
verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_reg_expand_sz(void)
@@ -542,7 +549,7 @@ static void test_reg_expand_sz(void)
verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1, 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_reg_binary(void)
@@ -606,7 +613,7 @@ static void test_reg_binary(void)
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_reg_dword(void)
@@ -709,7 +716,7 @@ static void test_reg_dword(void)
verify_reg(hkey, "DWORD_LE", REG_DWORD_LITTLE_ENDIAN, &dword, sizeof(dword), 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
/* REG_DWORD_BIG_ENDIAN is broken in every version of Windows. It behaves
@@ -742,7 +749,7 @@ static void test_reg_dword_big_endian(void)
verify_reg(hkey, "Test4", REG_DWORD_BIG_ENDIAN, &dword, sizeof(dword), 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_reg_multi_sz(void)
@@ -841,7 +848,7 @@ static void test_reg_multi_sz(void)
verify_reg(hkey, "multi21", REG_MULTI_SZ, "two\\0\\0strings\0", 16, 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
START_TEST(add)
diff --git a/programs/reg/tests/copy.c b/programs/reg/tests/copy.c
index 763135c2a0f..dafd0e90a3a 100644
--- a/programs/reg/tests/copy.c
+++ b/programs/reg/tests/copy.c
@@ -143,7 +143,7 @@ static void test_copy_empty_key(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r);
@@ -154,7 +154,7 @@ static void test_copy_empty_key(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r);
@@ -165,7 +165,7 @@ static void test_copy_empty_key(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r);
@@ -213,7 +213,7 @@ static void test_copy_simple_data(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r);
@@ -224,7 +224,7 @@ static void test_copy_simple_data(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r);
@@ -235,7 +235,7 @@ static void test_copy_simple_data(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r);
@@ -406,8 +406,8 @@ static void test_copy_hex_data(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, COPY_SRC);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, COPY_SRC, 0);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Try copying after importing alternative registry data types */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@@ -425,8 +425,8 @@ static void test_copy_hex_data(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, COPY_SRC);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, COPY_SRC, 0);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Try copying more complex hex data */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@@ -531,8 +531,8 @@ static void test_copy_escaped_null_values(void)
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", escaped_null_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, COPY_SRC);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, COPY_SRC, 0);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_copy_key_class(void)
@@ -573,8 +573,8 @@ static void test_copy_key_class(void)
RegCloseKey(hkey);
- delete_key(HKEY_CURRENT_USER, COPY_SRC);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, COPY_SRC, 0);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_copy_overwrite(void)
@@ -611,8 +611,8 @@ static void test_copy_overwrite(void)
verify_reg(hkey, NULL, REG_SZ, "Constant value", 15, 0);
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, COPY_SRC);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, COPY_SRC, 0);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
START_TEST(copy)
diff --git a/programs/reg/tests/export.c b/programs/reg/tests/export.c
index 1348b8eebdb..b45660a0e6e 100644
--- a/programs/reg/tests/export.c
+++ b/programs/reg/tests/export.c
@@ -297,8 +297,8 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n");
- delete_key(hkey, "Subkey1");
- delete_key(hkey, "Subkey2");
+ delete_key(hkey, "Subkey1", 0);
+ delete_key(hkey, "Subkey2", 0);
/* Test the export order of registry values. Windows exports registry values
* in order of creation; Wine uses alphabetical order.
@@ -310,7 +310,7 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", value_order_test, TODO_REG_COMPARE), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Test registry export with empty hex data */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
@@ -327,7 +327,7 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Test registry export after importing alternative registry data types */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@@ -345,7 +345,7 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@@ -364,7 +364,7 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Test registry export with embedded null characters */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@@ -401,7 +401,7 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n");
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
/* Test registry export with forward and back slashes */
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
diff --git a/programs/reg/tests/import.c b/programs/reg/tests/import.c
index 06f9cb05f6c..5d673ede8c1 100644
--- a/programs/reg/tests/import.c
+++ b/programs/reg/tests/import.c
@@ -860,7 +860,7 @@ static void test_import(void)
open_key(hkey, "Subkey\"1", 0, &subkey);
verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
+ delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1", 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
@@ -869,7 +869,7 @@ static void test_import(void)
open_key(hkey, "Subkey/2", 0, &subkey);
verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
+ delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2", 0);
/* Test key creation */
test_import_str("REGEDIT4\n\n"
@@ -896,13 +896,13 @@ static void test_import(void)
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1c ");
- delete_key(hkey, "Subkey1c ");
+ delete_key(hkey, "Subkey1c ", 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1d\t");
- delete_key(hkey, "Subkey1d\t");
+ delete_key(hkey, "Subkey1d\t", 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n"
@@ -913,7 +913,7 @@ static void test_import(void)
open_key(hkey, "Subkey1e", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(hkey, "Subkey1e");
+ delete_key(hkey, "Subkey1e", 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n"
@@ -925,7 +925,7 @@ static void test_import(void)
open_key(hkey, "Subkey1f\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(hkey, "Subkey1f\\\\");
+ delete_key(hkey, "Subkey1f\\\\", 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n"
@@ -938,7 +938,7 @@ static void test_import(void)
open_key(hkey, "Subkey1g\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(hkey, "Subkey1g\\\\");
+ delete_key(hkey, "Subkey1g\\\\", 0);
/* Test key deletion. We start by creating some registry keys. */
test_import_str("REGEDIT4\n\n"
@@ -1183,7 +1183,7 @@ static void test_import(void)
verify_reg_nonexist(hkey, "Wine54b");
verify_key(hkey, "Subkey2");
- delete_key(hkey, "Subkey2");
+ delete_key(hkey, "Subkey2", 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@@ -2399,7 +2399,7 @@ static void test_unicode_import(void)
open_key(hkey, "Subkey\"1", 0, &subkey);
verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
+ delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1", 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
@@ -2408,7 +2408,7 @@ static void test_unicode_import(void)
open_key(hkey, "Subkey/2", 0, &subkey);
verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
+ delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2", 0);
/* Test key creation */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@@ -2435,13 +2435,13 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1c ");
- delete_key(hkey, "Subkey1c ");
+ delete_key(hkey, "Subkey1c ", 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_key(hkey, "Subkey1d\t");
- delete_key(hkey, "Subkey1d\t");
+ delete_key(hkey, "Subkey1d\t", 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n"
@@ -2452,7 +2452,7 @@ static void test_unicode_import(void)
open_key(hkey, "Subkey1e", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(hkey, "Subkey1e");
+ delete_key(hkey, "Subkey1e", 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n"
@@ -2464,7 +2464,7 @@ static void test_unicode_import(void)
open_key(hkey, "Subkey1f\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(hkey, "Subkey1f\\\\");
+ delete_key(hkey, "Subkey1f\\\\", 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n"
@@ -2477,7 +2477,7 @@ static void test_unicode_import(void)
open_key(hkey, "Subkey1g\\\\", 0, &subkey);
verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
close_key(subkey);
- delete_key(hkey, "Subkey1g\\\\");
+ delete_key(hkey, "Subkey1g\\\\", 0);
/* Test key deletion. We start by creating some registry keys. */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@@ -2725,7 +2725,7 @@ static void test_unicode_import(void)
verify_reg_nonexist(hkey, "Wine54b");
verify_key(hkey, "Subkey2");
- delete_key(hkey, "Subkey2");
+ delete_key(hkey, "Subkey2", 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@@ -3315,7 +3315,7 @@ static void test_import_with_whitespace(void)
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_unicode_import_with_whitespace(void)
@@ -3461,7 +3461,7 @@ static void test_unicode_import_with_whitespace(void)
close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
+ delete_key(HKEY_CURRENT_USER, KEY_BASE, 0);
}
static void test_import_win31(void)
@@ -3585,7 +3585,7 @@ static void test_import_win31(void)
close_key(hkey);
- delete_key(HKEY_CLASSES_ROOT, KEY_BASE);
+ delete_key(HKEY_CLASSES_ROOT, KEY_BASE, 0);
}
START_TEST(import)
diff --git a/programs/reg/tests/reg_test.h b/programs/reg/tests/reg_test.h
index 28e2d8e3abe..140f01580e8 100644
--- a/programs/reg/tests/reg_test.h
+++ b/programs/reg/tests/reg_test.h
@@ -62,8 +62,8 @@ void verify_key_nonexist_(const char *file, unsigned line, HKEY key_base, const
#define add_key(k,p,s) add_key_(__FILE__,__LINE__,k,p,s)
void add_key_(const char *file, unsigned line, const HKEY hkey, const char *path, HKEY *subkey);
-#define delete_key(k,p) delete_key_(__FILE__,__LINE__,k,p)
-void delete_key_(const char *file, unsigned line, const HKEY hkey, const char *path);
+#define delete_key(r,p,s) delete_key_(__FILE__,__LINE__,r,p,s)
+void delete_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam);
LONG delete_tree(const HKEY key, const char *subkey);
--
2.32.0
1
5
[PATCH] winegstreamer: Expose the MF_MT_VIDEO_ROTATION attribute.
by Giovanni Mascellani June 16, 2021
by Giovanni Mascellani June 16, 2021
June 16, 2021
The stricter checks imposed by commit
ac39b313b618ab8d1613302c3604ba505afff0df, while being valid in general,
require that media source attaches to media types the attributes that
application can request.
This patch exposes the MF_MT_VIDEO_ROTATION attribute, which is for
example requested by Legend of Keepers.
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
The same attribute is also set by Windows for media sources obtained
from the standard source resolver.
Currently MFVideoRotationFormat_0 is always set, because I couldn't find
anyway to query this property in GStreamer. The obvious place for this
metadata item would probably be GstVideoInfo, but I cannot see anything
related there. Can some GStreamer wizard help?
dlls/winegstreamer/mfplat.c | 1 +
include/mfapi.h | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index bb632c2cc2c..dfa448afcfe 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -596,6 +596,7 @@ static IMFMediaType *mf_media_type_from_wg_format_video(const struct wg_format *
make_uint64(format->u.video.fps_n, format->u.video.fps_d));
IMFMediaType_SetUINT32(type, &MF_MT_COMPRESSED, FALSE);
IMFMediaType_SetUINT32(type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
+ IMFMediaType_SetUINT32(type, &MF_MT_VIDEO_ROTATION, MFVideoRotationFormat_0);
return type;
}
diff --git a/include/mfapi.h b/include/mfapi.h
index e4a1f6a3dc0..788b267845e 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -449,6 +449,13 @@ typedef enum _MFWaveFormatExConvertFlags
MFWaveFormatExConvertFlag_ForceExtensible = 1,
} MFWaveFormatExConvertFlags;
+typedef enum _MFVideoRotationFormat {
+ MFVideoRotationFormat_0,
+ MFVideoRotationFormat_90,
+ MFVideoRotationFormat_180,
+ MFVideoRotationFormat_270
+} MFVideoRotationFormat;
+
enum _MFT_ENUM_FLAG
{
MFT_ENUM_FLAG_SYNCMFT = 0x00000001,
--
2.32.0
2
1
[PATCH vkd3d v2 1/3] tests: Add test for uniform dynamic indexing of bounded descriptor arrays.
by Conor McCarthy June 16, 2021
by Conor McCarthy June 16, 2021
June 16, 2021
From: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
tests/d3d12.c | 195 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 194 insertions(+), 1 deletion(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index f289a10d..0cdb22e0 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -740,7 +740,7 @@ static ID3D12PipelineState *create_compute_pipeline_state_(unsigned int line, ID
ID3D12RootSignature *root_signature, const D3D12_SHADER_BYTECODE cs)
{
D3D12_COMPUTE_PIPELINE_STATE_DESC pipeline_state_desc;
- ID3D12PipelineState *pipeline_state;
+ ID3D12PipelineState *pipeline_state = NULL;
HRESULT hr;
memset(&pipeline_state_desc, 0, sizeof(pipeline_state_desc));
@@ -33817,6 +33817,198 @@ static void test_hull_shader_patch_constant_inputs(void)
destroy_test_context(&context);
}
+static void test_resource_arrays(void)
+{
+ ID3D12Resource *input_buffers[8], *output_buffers[6];
+ D3D12_ROOT_SIGNATURE_DESC root_signature_desc;
+ D3D12_UNORDERED_ACCESS_VIEW_DESC uav_desc;
+ D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc;
+ ID3D12GraphicsCommandList *command_list;
+ unsigned int descriptor_count;
+ struct test_context context;
+ ID3D12DescriptorHeap *heap;
+ ID3D12CommandQueue *queue;
+ ID3D12Device *device;
+ unsigned int i;
+ HRESULT hr;
+
+ static const D3D12_DESCRIPTOR_RANGE descriptor_ranges[] =
+ {
+ {D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 8, 2, 2, 0},
+ {D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 6, 1, 3, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND},
+ };
+
+ static const struct uvec4 cb_data[] =
+ {
+ {0, 0},
+ {1, 1},
+ {0, 5},
+ {1, 4},
+ {2, 0},
+ {3, 1},
+ };
+
+ static const D3D12_ROOT_PARAMETER root_parameters[] =
+ {
+ {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE,
+ .DescriptorTable = {ARRAY_SIZE(descriptor_ranges), descriptor_ranges}},
+ {D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS, .Constants = {2, 1, ARRAY_SIZE(cb_data) * 4}},
+ };
+
+ static const DWORD cs_code[] =
+ {
+#if 0
+ cbuffer cb : register(b2, space1)
+ {
+ uint2 c[6];
+ }
+
+ Buffer<uint> t1[2] : register(t2, space2);
+ Buffer<uint> t2[] : register(t4, space2);
+
+ RWBuffer<uint> u1[2] : register(u1, space3);
+ RWBuffer<uint> u2[] : register(u3, space3);
+
+ [numthreads(1, 1, 1)]
+ void main()
+ {
+ u1[c[0].x][0] = t1[c[0].y][0];
+ u1[c[1].x][0] = t1[c[1].y][0];
+ u2[c[2].x][0] = t2[c[2].y][0];
+ u2[c[3].x][0] = t2[c[3].y][0];
+ u2[c[4].x][0] = t2[c[4].y][0];
+ u2[c[5].x][0] = t2[c[5].y][0];
+ }
+#endif
+ 0x43425844, 0xef615fd3, 0x708c1d93, 0xdb9908b4, 0xb1853d57, 0x00000001, 0x000004c8, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000474, 0x00050051, 0x0000011d, 0x0100086a,
+ 0x07000059, 0x00308e46, 0x00000000, 0x00000002, 0x00000002, 0x00000006, 0x00000001, 0x07000858,
+ 0x00307e46, 0x00000000, 0x00000002, 0x00000003, 0x00004444, 0x00000002, 0x07000858, 0x00307e46,
+ 0x00000001, 0x00000004, 0xffffffff, 0x00004444, 0x00000002, 0x0700089c, 0x0031ee46, 0x00000000,
+ 0x00000001, 0x00000002, 0x00004444, 0x00000003, 0x0700089c, 0x0031ee46, 0x00000001, 0x00000003,
+ 0xffffffff, 0x00004444, 0x00000003, 0x02000068, 0x00000001, 0x0400009b, 0x00000001, 0x00000001,
+ 0x00000001, 0x07000036, 0x00100012, 0x00000000, 0x0030801a, 0x00000000, 0x00000002, 0x00000000,
+ 0x0d00002d, 0x00100012, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x06207e46, 0x00000000, 0x00000002, 0x0010000a, 0x00000000, 0x07000036, 0x00100022, 0x00000000,
+ 0x0030800a, 0x00000000, 0x00000002, 0x00000000, 0x0d0000a4, 0x0621e0f2, 0x00000000, 0x00000001,
+ 0x0010001a, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100006,
+ 0x00000000, 0x07000036, 0x00100012, 0x00000000, 0x0030801a, 0x00000000, 0x00000002, 0x00000001,
+ 0x0d00002d, 0x00100012, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x06207e46, 0x00000000, 0x00000002, 0x0010000a, 0x00000000, 0x07000036, 0x00100022, 0x00000000,
+ 0x0030800a, 0x00000000, 0x00000002, 0x00000001, 0x0d0000a4, 0x0621e0f2, 0x00000000, 0x00000001,
+ 0x0010001a, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100006,
+ 0x00000000, 0x07000036, 0x00100012, 0x00000000, 0x0030801a, 0x00000000, 0x00000002, 0x00000002,
+ 0x0d00002d, 0x00100012, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x06207e46, 0x00000001, 0x00000004, 0x0010000a, 0x00000000, 0x07000036, 0x00100022, 0x00000000,
+ 0x0030800a, 0x00000000, 0x00000002, 0x00000002, 0x0d0000a4, 0x0621e0f2, 0x00000001, 0x00000003,
+ 0x0010001a, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100006,
+ 0x00000000, 0x07000036, 0x00100012, 0x00000000, 0x0030801a, 0x00000000, 0x00000002, 0x00000003,
+ 0x0d00002d, 0x00100012, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x06207e46, 0x00000001, 0x00000004, 0x0010000a, 0x00000000, 0x07000036, 0x00100022, 0x00000000,
+ 0x0030800a, 0x00000000, 0x00000002, 0x00000003, 0x0d0000a4, 0x0621e0f2, 0x00000001, 0x00000003,
+ 0x0010001a, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100006,
+ 0x00000000, 0x07000036, 0x00100012, 0x00000000, 0x0030801a, 0x00000000, 0x00000002, 0x00000004,
+ 0x0d00002d, 0x00100012, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x06207e46, 0x00000001, 0x00000004, 0x0010000a, 0x00000000, 0x07000036, 0x00100022, 0x00000000,
+ 0x0030800a, 0x00000000, 0x00000002, 0x00000004, 0x0d0000a4, 0x0621e0f2, 0x00000001, 0x00000003,
+ 0x0010001a, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100006,
+ 0x00000000, 0x07000036, 0x00100012, 0x00000000, 0x0030801a, 0x00000000, 0x00000002, 0x00000005,
+ 0x0d00002d, 0x00100012, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x06207e46, 0x00000001, 0x00000004, 0x0010000a, 0x00000000, 0x07000036, 0x00100022, 0x00000000,
+ 0x0030800a, 0x00000000, 0x00000002, 0x00000005, 0x0d0000a4, 0x0621e0f2, 0x00000001, 0x00000003,
+ 0x0010001a, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100006,
+ 0x00000000, 0x0100003e,
+ };
+
+ static const uint32_t srv_data[] = {0x1, 0x4, 0x9, 0x10, 0x19, 0x24, 0x31, 0x40};
+ static const uint32_t uav_data[] = {0x1, 0x4, 0x40, 0x31, 0x9, 0x10};
+
+ if (!init_compute_test_context(&context))
+ return;
+ device = context.device;
+ command_list = context.list;
+ queue = context.queue;
+
+ memset(&root_signature_desc, 0, sizeof(root_signature_desc));
+ root_signature_desc.NumParameters = ARRAY_SIZE(root_parameters);
+ root_signature_desc.pParameters = root_parameters;
+ hr = create_root_signature(device, &root_signature_desc, &context.root_signature);
+ ok(hr == S_OK, "Failed to create root signature, hr %#x.\n", hr);
+
+ for (i = 0, descriptor_count = 0; i < ARRAY_SIZE(descriptor_ranges); ++i)
+ {
+ descriptor_count += descriptor_ranges[i].NumDescriptors;
+ }
+ heap = create_gpu_descriptor_heap(device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, descriptor_count);
+
+ for (i = 0; i < ARRAY_SIZE(input_buffers); ++i)
+ {
+ input_buffers[i] = create_default_buffer(device, sizeof(uint32_t),
+ D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST);
+ upload_buffer_data(input_buffers[i], 0, sizeof(srv_data[i]), &srv_data[i], queue, command_list);
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, input_buffers[i],
+ D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
+
+ memset(&srv_desc, 0, sizeof(srv_desc));
+ srv_desc.Format = DXGI_FORMAT_R32_UINT;
+ srv_desc.ViewDimension = D3D12_SRV_DIMENSION_BUFFER;
+ srv_desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
+ srv_desc.Buffer.FirstElement = 0;
+ srv_desc.Buffer.NumElements = 1;
+ ID3D12Device_CreateShaderResourceView(device, input_buffers[i], &srv_desc,
+ get_cpu_descriptor_handle(&context, heap, i));
+ }
+
+ for (i = 0; i < ARRAY_SIZE(output_buffers); ++i)
+ {
+ output_buffers[i] = create_default_buffer(device, sizeof(uint32_t),
+ D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+
+ memset(&uav_desc, 0, sizeof(uav_desc));
+ uav_desc.Format = DXGI_FORMAT_R32_UINT;
+ uav_desc.ViewDimension = D3D12_UAV_DIMENSION_BUFFER;
+ uav_desc.Buffer.FirstElement = 0;
+ uav_desc.Buffer.NumElements = 1;
+ ID3D12Device_CreateUnorderedAccessView(device, output_buffers[i], NULL, &uav_desc,
+ get_cpu_descriptor_handle(&context, heap, ARRAY_SIZE(input_buffers) + i));
+ }
+
+ todo
+ context.pipeline_state = create_compute_pipeline_state(device, context.root_signature,
+ shader_bytecode(cs_code, sizeof(cs_code)));
+ if (!context.pipeline_state)
+ {
+ skip("Shader descriptor arrays are not supported.\n");
+ goto done;
+ }
+
+ ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
+ ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, context.root_signature);
+ ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(command_list,
+ 0, get_gpu_descriptor_handle(&context, heap, 0));
+ ID3D12GraphicsCommandList_SetComputeRoot32BitConstants(command_list, 1, ARRAY_SIZE(cb_data) * 4, cb_data, 0);
+
+ ID3D12GraphicsCommandList_Dispatch(command_list, 1, 1, 1);
+
+ for (i = 0; i < ARRAY_SIZE(output_buffers); ++i)
+ {
+ transition_sub_resource_state(command_list, output_buffers[i], 0,
+ D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ check_buffer_uint(output_buffers[i], queue, command_list, uav_data[i], 0);
+ reset_command_list(command_list, context.allocator);
+ }
+
+done:
+ for (i = 0; i < ARRAY_SIZE(output_buffers); ++i)
+ ID3D12Resource_Release(output_buffers[i]);
+ for (i = 0; i < ARRAY_SIZE(input_buffers); ++i)
+ ID3D12Resource_Release(input_buffers[i]);
+ ID3D12DescriptorHeap_Release(heap);
+ destroy_test_context(&context);
+}
+
START_TEST(d3d12)
{
parse_args(argc, argv);
@@ -33985,4 +34177,5 @@ START_TEST(d3d12)
run_test(test_sampler_register_space);
run_test(test_hull_shader_relative_addressing);
run_test(test_hull_shader_patch_constant_inputs);
+ run_test(test_resource_arrays);
}
--
2.31.1
2
12
[PATCH v5] iphlpapi: Fix the field 'AdapterName' of IP_ADAPTER_INFO returned by GetAdaptersInfo.
by Yeshun Ye June 16, 2021
by Yeshun Ye June 16, 2021
June 16, 2021
Signed-off-by: Yeshun Ye <yeyeshun(a)uniontech.com>
---
dlls/iphlpapi/iphlpapi_main.c | 9 ++++++++-
dlls/iphlpapi/tests/iphlpapi.c | 10 ++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index 09414d26dde..21edd9ee128 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -706,9 +706,16 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
DWORD i;
PIP_ADDR_STRING currentIPAddr = &ptr->IpAddressList;
BOOL firstIPAddr = TRUE;
+ NET_LUID luid;
+ GUID guid;
/* on Win98 this is left empty, but whatever */
- getInterfaceNameByIndex(table->indexes[ndx], ptr->AdapterName);
+ ConvertInterfaceIndexToLuid(table->indexes[ndx], &luid);
+ ConvertInterfaceLuidToGuid(&luid, &guid);
+ sprintf(ptr->AdapterName, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
+ guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5],
+ guid.Data4[6], guid.Data4[7]);
getInterfaceNameByIndex(table->indexes[ndx], ptr->Description);
ptr->AddressLength = sizeof(ptr->Address);
getInterfacePhysicalByIndex(table->indexes[ndx],
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c
index 358084fde68..e61f2cbd382 100644
--- a/dlls/iphlpapi/tests/iphlpapi.c
+++ b/dlls/iphlpapi/tests/iphlpapi.c
@@ -1115,6 +1115,9 @@ static void testGetAdaptersInfo(void)
; /* no adapter's, that's okay */
else if (apiReturn == ERROR_BUFFER_OVERFLOW) {
PIP_ADAPTER_INFO ptr, buf = HeapAlloc(GetProcessHeap(), 0, len);
+ NET_LUID luid;
+ GUID guid;
+ char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
apiReturn = GetAdaptersInfo(buf, &len);
ok(apiReturn == NO_ERROR,
@@ -1122,6 +1125,13 @@ static void testGetAdaptersInfo(void)
apiReturn);
ptr = buf;
while (ptr) {
+ ConvertInterfaceIndexToLuid(ptr->Index, &luid);
+ ConvertInterfaceLuidToGuid(&luid, &guid);
+ sprintf(AdapterName, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+ guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
+ guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5],
+ guid.Data4[6], guid.Data4[7]);
+ ok(!strcasecmp(ptr->AdapterName, AdapterName), "expected '%s' got '%s'\n", ptr->AdapterName, AdapterName);
ok(ptr->IpAddressList.IpAddress.String[0], "A valid IP address must be present\n");
ok(ptr->IpAddressList.IpMask.String[0], "A valid mask must be present\n");
ok(ptr->GatewayList.IpAddress.String[0], "A valid IP address must be present\n");
--
2.20.1
2
1
June 16, 2021
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/dpnet/Makefile.in | 2 +-
dlls/dpnet/address.c | 115 ++++++++++++++++++++++++++---
dlls/dpnet/tests/address.c | 143 +++++++++++++++++++++++++++++++++++++
3 files changed, 249 insertions(+), 11 deletions(-)
diff --git a/dlls/dpnet/Makefile.in b/dlls/dpnet/Makefile.in
index bcf07772e39..9d979a34f22 100644
--- a/dlls/dpnet/Makefile.in
+++ b/dlls/dpnet/Makefile.in
@@ -1,6 +1,6 @@
MODULE = dpnet.dll
IMPORTLIB = dpnet
-IMPORTS = dxguid uuid ole32 advapi32 ws2_32
+IMPORTS = dxguid uuid ole32 advapi32 ws2_32 user32
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/dpnet/address.c b/dlls/dpnet/address.c
index 6aa62a97785..6819638a2b8 100644
--- a/dlls/dpnet/address.c
+++ b/dlls/dpnet/address.c
@@ -45,6 +45,22 @@ static char *heap_strdupA( const char *str )
return ret;
}
+static inline WCHAR *heap_strdupAtoW(const char *str)
+{
+ LPWSTR ret = NULL;
+
+ if(str) {
+ DWORD len;
+
+ len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
+ ret = heap_alloc(len*sizeof(WCHAR));
+ if(ret)
+ MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
+ }
+
+ return ret;
+}
+
static BOOL add_component(IDirectPlay8AddressImpl *This, struct component *item)
{
if(This->comp_count == This->comp_array_size)
@@ -256,20 +272,99 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_Clear(IDirectPlay8Address *iface)
return DPN_OK;
}
-static HRESULT WINAPI IDirectPlay8AddressImpl_GetURLW(IDirectPlay8Address *iface, WCHAR *pwszURL,
- DWORD *pdwNumChars)
+static HRESULT WINAPI IDirectPlay8AddressImpl_GetURLW(IDirectPlay8Address *iface, WCHAR *url, DWORD *length)
{
- IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface);
- TRACE("(%p): stub\n", This);
- return DPN_OK;
+ IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface);
+ HRESULT hr = DPNERR_BUFFERTOOSMALL;
+ int i;
+ WCHAR buffer[1024] = {0};
+ int position = 0;
+
+ TRACE("(%p, %p, %p)\n", This, url, length);
+
+ if(!length || (!url && *length != 0))
+ return DPNERR_INVALIDPOINTER;
+
+ for(i=0; i < This->comp_count; i++)
+ {
+ struct component *entry = This->components[i];
+
+ if(position)
+ lstrcatW(&buffer[position++], L";");
+
+ switch(entry->type)
+ {
+ case DPNA_DATATYPE_GUID:
+ position += wsprintfW( &buffer[position], L"%s=%%7B%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X%%7D",
+ entry->name, entry->data.guid.Data1, entry->data.guid.Data2, entry->data.guid.Data3,
+ entry->data.guid.Data4[0], entry->data.guid.Data4[1], entry->data.guid.Data4[2],
+ entry->data.guid.Data4[3], entry->data.guid.Data4[4], entry->data.guid.Data4[5],
+ entry->data.guid.Data4[6], entry->data.guid.Data4[7] );
+
+ break;
+ case DPNA_DATATYPE_STRING:
+ position += wsprintfW(&buffer[position], L"%s=%s", entry->name, entry->data.string);
+ break;
+ case DPNA_DATATYPE_DWORD:
+ position += wsprintfW(&buffer[position], L"%s=%d", entry->name, entry->data.value);
+ break;
+ case DPNA_DATATYPE_STRING_ANSI:
+ {
+ WCHAR *str = heap_strdupAtoW(entry->data.ansi);
+ position += wsprintfW(&buffer[position], L"%s=%s", entry->name, str);
+ heap_free(str);
+ break;
+ }
+ case DPNA_DATATYPE_BINARY:
+ default:
+ FIXME("Unsupported type %d\n", entry->type);
+ }
+ }
+
+ if(url && *length >= lstrlenW(buffer) + lstrlenW(DPNA_HEADER) + 1)
+ {
+ lstrcpyW(url, DPNA_HEADER);
+ lstrcatW(url, buffer);
+ hr = DPN_OK;
+ }
+
+ *length = lstrlenW(buffer) + lstrlenW(DPNA_HEADER) + 1;
+
+ return hr;
}
-static HRESULT WINAPI IDirectPlay8AddressImpl_GetURLA(IDirectPlay8Address *iface, CHAR *pszURL,
- DWORD *pdwNumChars)
+static HRESULT WINAPI IDirectPlay8AddressImpl_GetURLA(IDirectPlay8Address *iface, char *url, DWORD *length)
{
- IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface);
- TRACE("(%p): stub\n", This);
- return DPN_OK;
+ IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface);
+ HRESULT hr;
+ WCHAR *buffer = NULL;
+
+ TRACE("(%p, %p %p)\n", This, url, length);
+
+ if(!length || (!url && *length != 0))
+ return DPNERR_INVALIDPOINTER;
+
+ if(url && *length)
+ {
+ url[0] = '\0';
+ buffer = heap_alloc(*length * sizeof(WCHAR));
+ }
+
+ hr = IDirectPlay8Address_GetURLW(iface, buffer, length);
+ if(hr == DPN_OK)
+ {
+ DWORD size;
+ size = WideCharToMultiByte(CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL);
+ if(size <= *length)
+ WideCharToMultiByte(CP_ACP, 0, buffer, -1, url, *length, NULL, NULL);
+ else
+ {
+ *length = size;
+ hr = DPNERR_BUFFERTOOSMALL;
+ }
+ }
+ heap_free(buffer);
+ return hr;
}
static HRESULT WINAPI IDirectPlay8AddressImpl_GetSP(IDirectPlay8Address *iface, GUID *pguidSP)
diff --git a/dlls/dpnet/tests/address.c b/dlls/dpnet/tests/address.c
index a8d31c9854a..0e8b8da3b09 100644
--- a/dlls/dpnet/tests/address.c
+++ b/dlls/dpnet/tests/address.c
@@ -304,6 +304,147 @@ static void address_setsp(void)
}
}
+static void address_urlW(void)
+{
+ HRESULT hr;
+ IDirectPlay8Address *localaddr = NULL;
+
+ hr = CoCreateInstance( &CLSID_DirectPlay8Address, NULL, CLSCTX_ALL, &IID_IDirectPlay8Address, (LPVOID*)&localaddr);
+ ok(hr == S_OK, "Failed to create IDirectPlay8Address object\n");
+ if(SUCCEEDED(hr))
+ {
+ WCHAR *buffer = NULL;
+ DWORD bufflen = 0, bufflen2;
+ DWORD port = 4321;
+
+ hr = IDirectPlay8Address_SetSP(localaddr, &CLSID_DP8SP_TCPIP);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IDirectPlay8Address_GetURLW(localaddr, buffer, NULL);
+ ok(hr == DPNERR_INVALIDPOINTER, "got 0x%08x\n", hr);
+
+ bufflen = 10;
+ hr = IDirectPlay8Address_GetURLW(localaddr, NULL, &bufflen);
+ ok(hr == DPNERR_INVALIDPOINTER, "got 0x%08x\n", hr);
+
+ bufflen = 0;
+ hr = IDirectPlay8Address_GetURLW(localaddr, NULL, &bufflen);
+ ok(bufflen == 66, "got %d\n", bufflen);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufflen * sizeof(WCHAR));
+
+ hr = IDirectPlay8Address_GetURLW(localaddr, buffer, &bufflen);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!lstrcmpW(L"x-directplay:/provider=%7BEBFE7BA0-628D-11D2-AE0F-006097B01411%7D", buffer), "got %s\n", wine_dbgstr_w(buffer));
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_PORT, &port, sizeof(DWORD), DPNA_DATATYPE_DWORD);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ bufflen = 0;
+ hr = IDirectPlay8Address_GetURLW(localaddr, NULL, &bufflen);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufflen * sizeof(WCHAR));
+
+ bufflen2 = bufflen/2;
+ hr = IDirectPlay8Address_GetURLW(localaddr, buffer, &bufflen2);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ ok(!lstrlenW(buffer), "wrong length\n");
+
+ hr = IDirectPlay8Address_GetURLW(localaddr, buffer, &bufflen);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!lstrcmpW(L"x-directplay:/provider=%7BEBFE7BA0-628D-11D2-AE0F-006097B01411%7D;port=4321", buffer), "got %s\n", wine_dbgstr_w(buffer));
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_HOSTNAME, &localhost, sizeof(localhost), DPNA_DATATYPE_STRING);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ bufflen = 0;
+ hr = IDirectPlay8Address_GetURLW(localaddr, NULL, &bufflen);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufflen * sizeof(WCHAR));
+
+ hr = IDirectPlay8Address_GetURLW(localaddr, buffer, &bufflen);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!lstrcmpW(L"x-directplay:/provider=%7BEBFE7BA0-628D-11D2-AE0F-006097B01411%7D;port=4321;hostname=localhost", buffer), "got %s\n", wine_dbgstr_w(buffer));
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ IDirectPlay8Address_Release(localaddr);
+ }
+}
+
+static void address_urlA(void)
+{
+ HRESULT hr;
+ IDirectPlay8Address *localaddr = NULL;
+ static const char urlA1[] = "x-directplay:/provider=%7BEBFE7BA0-628D-11D2-AE0F-006097B01411%7D";
+ static const char urlA2[] = "x-directplay:/provider=%7BEBFE7BA0-628D-11D2-AE0F-006097B01411%7D;port=4321";
+ static const char urlA3[] = "x-directplay:/provider=%7BEBFE7BA0-628D-11D2-AE0F-006097B01411%7D;port=4321;hostname=localhost";
+ static const char localhostA[] = "localhost";
+
+ hr = CoCreateInstance( &CLSID_DirectPlay8Address, NULL, CLSCTX_ALL, &IID_IDirectPlay8Address, (LPVOID*)&localaddr);
+ ok(hr == S_OK, "Failed to create IDirectPlay8Address object\n");
+ if(SUCCEEDED(hr))
+ {
+ char *buffer = NULL;
+ DWORD bufflen = 0, bufflen2;
+ DWORD port = 4321;
+
+ hr = IDirectPlay8Address_SetSP(localaddr, &CLSID_DP8SP_TCPIP);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IDirectPlay8Address_GetURLA(localaddr, buffer, NULL);
+ ok(hr == DPNERR_INVALIDPOINTER, "got 0x%08x\n", hr);
+
+ bufflen = 10;
+ hr = IDirectPlay8Address_GetURLA(localaddr, NULL, &bufflen);
+ ok(hr == DPNERR_INVALIDPOINTER, "got 0x%08x\n", hr);
+
+ bufflen = 0;
+ hr = IDirectPlay8Address_GetURLA(localaddr, NULL, &bufflen);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufflen);
+
+ bufflen2 = bufflen/2;
+ hr = IDirectPlay8Address_GetURLA(localaddr, buffer, &bufflen2);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ ok(!strlen(buffer), "wrong length\n");
+
+ hr = IDirectPlay8Address_GetURLA(localaddr, buffer, &bufflen);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!lstrcmpA(urlA1, buffer), "got %s\n", buffer);
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_PORT, &port, sizeof(DWORD), DPNA_DATATYPE_DWORD);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ bufflen = 0;
+ hr = IDirectPlay8Address_GetURLA(localaddr, NULL, &bufflen);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufflen);
+
+ hr = IDirectPlay8Address_GetURLA(localaddr, buffer, &bufflen);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!lstrcmpA(urlA2, buffer), "got %s\n", buffer);
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ hr = IDirectPlay8Address_AddComponent(localaddr, DPNA_KEY_HOSTNAME, &localhostA, sizeof(localhostA), DPNA_DATATYPE_STRING_ANSI);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ bufflen = 0;
+ hr = IDirectPlay8Address_GetURLA(localaddr, NULL, &bufflen);
+ ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
+ buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufflen);
+
+ hr = IDirectPlay8Address_GetURLA(localaddr, buffer, &bufflen);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!lstrcmpA(urlA3, buffer), "got %s\n", buffer);
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ IDirectPlay8Address_Release(localaddr);
+ }
+}
+
static void address_duplicate(void)
{
HRESULT hr;
@@ -381,6 +522,8 @@ START_TEST(address)
address_addcomponents();
address_setsp();
address_duplicate();
+ address_urlW();
+ address_urlA();
CoUninitialize();
}
--
2.30.2
1
0
[PATCH v2 1/7] ws2_32/tests: Add a couple more tests for getsockname().
by Zebediah Figura June 16, 2021
by Zebediah Figura June 16, 2021
June 16, 2021
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/ws2_32/tests/sock.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 76d0a3f3b19..c8ac0d0ad8a 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3592,6 +3592,7 @@ static void test_getsockname(void)
ok(sock != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError());
sa_get = sa_set;
+ WSASetLastError(0xdeadbeef);
ret = getsockname(sock, (struct sockaddr *)&sa_get, &sa_get_len);
ok(ret == SOCKET_ERROR, "expected failure\n");
ok(WSAGetLastError() == WSAEINVAL, "got error %u\n", WSAGetLastError());
@@ -3600,12 +3601,21 @@ static void test_getsockname(void)
ret = bind(sock, (struct sockaddr *) &sa_set, sa_set_len);
ok(!ret, "failed to bind, error %u\n", WSAGetLastError());
+ WSASetLastError(0xdeadbeef);
ret = getsockname(sock, (struct sockaddr *) &sa_get, &sa_get_len);
- ok(!ret, "failed to get address, error %u\n", WSAGetLastError());
+ ok(!ret, "got %d\n", ret);
+ ok(!WSAGetLastError() || WSAGetLastError() == 0xdeadbeef /* < 7 */, "got error %u\n", WSAGetLastError());
ret = memcmp(sa_get.sin_zero, null_padding, 8);
ok(ret == 0, "getsockname did not zero the sockaddr_in structure\n");
+ sa_get_len = sizeof(sa_get) - 1;
+ WSASetLastError(0xdeadbeef);
+ ret = getsockname(sock, (struct sockaddr *)&sa_get, &sa_get_len);
+ ok(ret == -1, "expected failure\n");
+ ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError());
+ ok(sa_get_len == sizeof(sa_get) - 1, "got size %d\n", sa_get_len);
+
closesocket(sock);
h = gethostbyname("");
@@ -5546,11 +5556,11 @@ todo_wine
static void test_WSASendTo(void)
{
SOCKET s;
- struct sockaddr_in addr;
+ struct sockaddr_in addr, ret_addr;
char buf[12] = "hello world";
WSABUF data_buf;
DWORD bytesSent;
- int ret;
+ int ret, len;
addr.sin_family = AF_INET;
addr.sin_port = htons(139);
@@ -5566,6 +5576,11 @@ static void test_WSASendTo(void)
ok(ret == SOCKET_ERROR && WSAGetLastError() == WSAENOTSOCK,
"WSASendTo() failed: %d/%d\n", ret, WSAGetLastError());
+ len = sizeof(ret_addr);
+ ret = getsockname(s, (struct sockaddr *)&ret_addr, &len);
+ ok(ret == -1, "expected failure\n");
+ ok(WSAGetLastError() == WSAEINVAL, "got error %u\n", WSAGetLastError());
+
WSASetLastError(12345);
ret = WSASendTo(s, &data_buf, 1, NULL, 0, (struct sockaddr*)&addr, sizeof(addr), NULL, NULL);
ok(ret == SOCKET_ERROR && WSAGetLastError() == WSAEFAULT,
@@ -5575,6 +5590,12 @@ static void test_WSASendTo(void)
ret = WSASendTo(s, &data_buf, 1, &bytesSent, 0, (struct sockaddr *)&addr, sizeof(addr), NULL, NULL);
ok(!ret, "expected success\n");
ok(!WSAGetLastError(), "got error %u\n", WSAGetLastError());
+
+ len = sizeof(ret_addr);
+ ret = getsockname(s, (struct sockaddr *)&ret_addr, &len);
+ ok(!ret, "got error %u\n", WSAGetLastError());
+ ok(ret_addr.sin_family == AF_INET, "got family %u\n", ret_addr.sin_family);
+ ok(ret_addr.sin_port, "expected nonzero port\n");
}
static DWORD WINAPI recv_thread(LPVOID arg)
--
2.30.2
2
8
[PATCH 1/7] ws2_32/tests: Add a couple more tests for getsockname().
by Zebediah Figura June 16, 2021
by Zebediah Figura June 16, 2021
June 16, 2021
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/ws2_32/tests/sock.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 76d0a3f3b19..2d2b4c40141 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3592,6 +3592,7 @@ static void test_getsockname(void)
ok(sock != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError());
sa_get = sa_set;
+ WSASetLastError(0xdeadbeef);
ret = getsockname(sock, (struct sockaddr *)&sa_get, &sa_get_len);
ok(ret == SOCKET_ERROR, "expected failure\n");
ok(WSAGetLastError() == WSAEINVAL, "got error %u\n", WSAGetLastError());
@@ -3600,12 +3601,21 @@ static void test_getsockname(void)
ret = bind(sock, (struct sockaddr *) &sa_set, sa_set_len);
ok(!ret, "failed to bind, error %u\n", WSAGetLastError());
+ WSASetLastError(0xdeadbeef);
ret = getsockname(sock, (struct sockaddr *) &sa_get, &sa_get_len);
- ok(!ret, "failed to get address, error %u\n", WSAGetLastError());
+ ok(!ret, "got %d\n", ret);
+ todo_wine ok(!WSAGetLastError(), "got error %u\n", WSAGetLastError());
ret = memcmp(sa_get.sin_zero, null_padding, 8);
ok(ret == 0, "getsockname did not zero the sockaddr_in structure\n");
+ sa_get_len = sizeof(sa_get) - 1;
+ WSASetLastError(0xdeadbeef);
+ ret = getsockname(sock, (struct sockaddr *)&sa_get, &sa_get_len);
+ ok(ret == -1, "expected failure\n");
+ ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError());
+ ok(sa_get_len == sizeof(sa_get) - 1, "got size %d\n", sa_get_len);
+
closesocket(sock);
h = gethostbyname("");
@@ -5546,11 +5556,11 @@ todo_wine
static void test_WSASendTo(void)
{
SOCKET s;
- struct sockaddr_in addr;
+ struct sockaddr_in addr, ret_addr;
char buf[12] = "hello world";
WSABUF data_buf;
DWORD bytesSent;
- int ret;
+ int ret, len;
addr.sin_family = AF_INET;
addr.sin_port = htons(139);
@@ -5566,6 +5576,11 @@ static void test_WSASendTo(void)
ok(ret == SOCKET_ERROR && WSAGetLastError() == WSAENOTSOCK,
"WSASendTo() failed: %d/%d\n", ret, WSAGetLastError());
+ len = sizeof(ret_addr);
+ ret = getsockname(s, (struct sockaddr *)&ret_addr, &len);
+ ok(ret == -1, "expected failure\n");
+ ok(WSAGetLastError() == WSAEINVAL, "got error %u\n", WSAGetLastError());
+
WSASetLastError(12345);
ret = WSASendTo(s, &data_buf, 1, NULL, 0, (struct sockaddr*)&addr, sizeof(addr), NULL, NULL);
ok(ret == SOCKET_ERROR && WSAGetLastError() == WSAEFAULT,
@@ -5575,6 +5590,12 @@ static void test_WSASendTo(void)
ret = WSASendTo(s, &data_buf, 1, &bytesSent, 0, (struct sockaddr *)&addr, sizeof(addr), NULL, NULL);
ok(!ret, "expected success\n");
ok(!WSAGetLastError(), "got error %u\n", WSAGetLastError());
+
+ len = sizeof(ret_addr);
+ ret = getsockname(s, (struct sockaddr *)&ret_addr, &len);
+ ok(!ret, "got error %u\n", WSAGetLastError());
+ ok(ret_addr.sin_family == AF_INET, "got family %u\n", ret_addr.sin_family);
+ ok(ret_addr.sin_port, "expected nonzero port\n");
}
static DWORD WINAPI recv_thread(LPVOID arg)
--
2.30.2
2
10