diff --git a/patches/Compiler_Warnings/definition b/patches/Compiler_Warnings/definition new file mode 100644 index 00000000..a51729eb --- /dev/null +++ b/patches/Compiler_Warnings/definition @@ -0,0 +1,2 @@ +Fixes: Fixes compile warnings. +Depends: mailing-list-patches diff --git a/patches/mailing-list-patches/0001-winebus.inf-Add-new-INF-file-and-copy-it-to-the-INF-.patch b/patches/mailing-list-patches/0001-winebus.inf-Add-new-INF-file-and-copy-it-to-the-INF-.patch new file mode 100644 index 00000000..8b6d54f7 --- /dev/null +++ b/patches/mailing-list-patches/0001-winebus.inf-Add-new-INF-file-and-copy-it-to-the-INF-.patch @@ -0,0 +1,67 @@ +From c7768e2ba1a86ba18c78115f2e6306dd2e08abf1 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Thu, 27 Jun 2019 22:30:12 -0500 +Subject: [PATCH] winebus.inf: Add new INF file and copy it to the INF + directory. + +Signed-off-by: Zebediah Figura +--- + loader/Makefile.in | 1 + + loader/wine.inf.in | 1 + + loader/winebus.inf.in | 22 ++++++++++++++++++++++ + 3 files changed, 24 insertions(+) + create mode 100644 loader/winebus.inf.in + +diff --git a/loader/Makefile.in b/loader/Makefile.in +index 3ada656408..11a476103c 100644 +--- a/loader/Makefile.in ++++ b/loader/Makefile.in +@@ -10,6 +10,7 @@ SOURCES = \ + wine.man.in \ + wine.pl.UTF-8.man.in \ + wine_info.plist.in \ ++ winebus.inf.in \ + winehid.inf.in + + PROGRAMS = $(WINELOADER_PROGRAMS) +diff --git a/loader/wine.inf.in b/loader/wine.inf.in +index c3d3b770b5..63f8cb064e 100644 +--- a/loader/wine.inf.in ++++ b/loader/wine.inf.in +@@ -3691,4 +3691,5 @@ inf_section = 17 + l_intl.nls + + [inf_section] ++winebus.inf + winehid.inf +diff --git a/loader/winebus.inf.in b/loader/winebus.inf.in +new file mode 100644 +index 0000000000..3950c3dfc4 +--- /dev/null ++++ b/loader/winebus.inf.in +@@ -0,0 +1,22 @@ ++[Version] ++Signature="$CHICAGO$" ++ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318} ++Class=System ++ ++[Manufacturer] ++Wine=mfg_section ++ ++[mfg_section] ++Wine HID bus driver=device_section,root\winebus ++ ++[device_section.Services] ++AddService = winebus,0x2,svc_section ++ ++[svc_section] ++Description="Wine HID bus driver" ++DisplayName="Wine HID bus" ++ServiceBinary="%12%\winebus.sys" ++LoadOrderGroup="WinePlugPlay" ++ServiceType=1 ++StartType=3 ++ErrorControl=1 +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0002-winebus.sys-Implement-AddDevice.patch b/patches/mailing-list-patches/0002-winebus.sys-Implement-AddDevice.patch new file mode 100644 index 00000000..58aa20f1 --- /dev/null +++ b/patches/mailing-list-patches/0002-winebus.sys-Implement-AddDevice.patch @@ -0,0 +1,127 @@ +From f80abf3ac3b0ddc4937a50217c654af38a839560 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Thu, 27 Jun 2019 22:30:13 -0500 +Subject: [PATCH] winebus.sys: Implement AddDevice(). + +Signed-off-by: Zebediah Figura +--- + dlls/winebus.sys/main.c | 66 ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 65 insertions(+), 1 deletion(-) + +diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c +index 89ea65bba6..d9ceb83760 100644 +--- a/dlls/winebus.sys/main.c ++++ b/dlls/winebus.sys/main.c +@@ -69,8 +69,12 @@ static const WORD PID_XBOX_CONTROLLERS[] = { + + static DRIVER_OBJECT *driver_obj; + ++ + static DEVICE_OBJECT *mouse_obj; + ++/* The root-enumerated device stack. */ ++static DEVICE_OBJECT *bus_pdo, *bus_fdo; ++ + HANDLE driver_key; + + struct pnp_device +@@ -469,7 +473,33 @@ static NTSTATUS handle_IRP_MN_QUERY_ID(DEVICE_OBJECT *device, IRP *irp) + return status; + } + +-static NTSTATUS WINAPI common_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) ++static NTSTATUS fdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) ++{ ++ IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp); ++ NTSTATUS ret; ++ ++ switch (irpsp->MinorFunction) ++ { ++ case IRP_MN_START_DEVICE: ++ case IRP_MN_SURPRISE_REMOVAL: ++ irp->IoStatus.u.Status = STATUS_SUCCESS; ++ break; ++ case IRP_MN_REMOVE_DEVICE: ++ irp->IoStatus.u.Status = STATUS_SUCCESS; ++ IoSkipCurrentIrpStackLocation(irp); ++ ret = IoCallDriver(bus_pdo, irp); ++ IoDetachDevice(bus_pdo); ++ IoDeleteDevice(device); ++ return ret; ++ default: ++ FIXME("Unhandled minor function %#x.\n", irpsp->MinorFunction); ++ } ++ ++ IoSkipCurrentIrpStackLocation(irp); ++ return IoCallDriver(bus_pdo, irp); ++} ++ ++static NTSTATUS pdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) + { + NTSTATUS status = irp->IoStatus.u.Status; + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp); +@@ -498,6 +528,13 @@ static NTSTATUS WINAPI common_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) + return status; + } + ++static NTSTATUS WINAPI common_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) ++{ ++ if (device == bus_fdo) ++ return fdo_pnp_dispatch(device, irp); ++ return pdo_pnp_dispatch(device, irp); ++} ++ + static NTSTATUS deliver_last_report(struct device_extension *ext, DWORD buffer_length, BYTE* buffer, ULONG_PTR *out_length) + { + if (buffer_length < ext->last_report_size) +@@ -522,6 +559,12 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp) + + TRACE("(%p, %p)\n", device, irp); + ++ if (device == bus_fdo) ++ { ++ IoSkipCurrentIrpStackLocation(irp); ++ return IoCallDriver(bus_pdo, irp); ++ } ++ + switch (irpsp->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_HID_GET_DEVICE_ATTRIBUTES: +@@ -764,6 +807,26 @@ BOOL is_xbox_gamepad(WORD vid, WORD pid) + return FALSE; + } + ++static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *pdo) ++{ ++ NTSTATUS ret; ++ ++ TRACE("driver %p, pdo %p.\n", driver, pdo); ++ ++ if ((ret = IoCreateDevice(driver, 0, NULL, FILE_DEVICE_BUS_EXTENDER, 0, FALSE, &bus_fdo))) ++ { ++ ERR("Failed to create FDO, status %#x.\n", ret); ++ return ret; ++ } ++ ++ IoAttachDeviceToDeviceStack(bus_fdo, pdo); ++ bus_pdo = pdo; ++ ++ bus_fdo->Flags &= ~DO_DEVICE_INITIALIZING; ++ ++ return STATUS_SUCCESS; ++} ++ + static void WINAPI driver_unload(DRIVER_OBJECT *driver) + { + udev_driver_unload(); +@@ -861,6 +924,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) + + driver->MajorFunction[IRP_MJ_PNP] = common_pnp_dispatch; + driver->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = hid_internal_dispatch; ++ driver->DriverExtension->AddDevice = driver_add_device; + driver->DriverUnload = driver_unload; + + mouse_device_create(); +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0003-wineboot-Create-a-root-enumerated-device-object-for-.patch b/patches/mailing-list-patches/0003-wineboot-Create-a-root-enumerated-device-object-for-.patch new file mode 100644 index 00000000..97004d83 --- /dev/null +++ b/patches/mailing-list-patches/0003-wineboot-Create-a-root-enumerated-device-object-for-.patch @@ -0,0 +1,108 @@ +From 34c20aa62799b2e08cb751d040a4f1cc3b0b6894 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Thu, 27 Jun 2019 22:30:14 -0500 +Subject: [PATCH] wineboot: Create a root-enumerated device object for winebus. + +Signed-off-by: Zebediah Figura +--- + programs/wineboot/Makefile.in | 2 +- + programs/wineboot/wineboot.c | 56 +++++++++++++++++++++++++++++++++++ + 2 files changed, 57 insertions(+), 1 deletion(-) + +diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in +index eaea154057..3921fa9644 100644 +--- a/programs/wineboot/Makefile.in ++++ b/programs/wineboot/Makefile.in +@@ -1,7 +1,7 @@ + MODULE = wineboot.exe + APPMODE = -mconsole + IMPORTS = uuid advapi32 +-DELAYIMPORTS = shell32 shlwapi version user32 ++DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev + + EXTRADLLFLAGS = -mno-cygwin + +diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c +index 55f2c6ca0c..5190dcc701 100644 +--- a/programs/wineboot/wineboot.c ++++ b/programs/wineboot/wineboot.c +@@ -69,6 +69,8 @@ + #include + #include + #include ++#include ++#include + #include "resource.h" + + WINE_DEFAULT_DEBUG_CHANNEL(wineboot); +@@ -1116,6 +1118,57 @@ static HANDLE start_rundll32( const WCHAR *inf_path, BOOL wow64 ) + return pi.hProcess; + } + ++static void install_root_pnp_devices(void) ++{ ++ static const struct ++ { ++ const char *name; ++ const char *hardware_id; ++ const char *infpath; ++ } ++ root_devices[] = ++ { ++ {"root\\wine\\winebus", "root\\winebus\0", "C:\\windows\\inf\\winebus.inf"}, ++ }; ++ SP_DEVINFO_DATA device = {sizeof(device)}; ++ unsigned int i; ++ HDEVINFO set; ++ ++ if ((set = SetupDiCreateDeviceInfoList( NULL, NULL )) == INVALID_HANDLE_VALUE) ++ { ++ WINE_ERR("Failed to create device info list, error %#x.\n", GetLastError()); ++ return; ++ } ++ ++ for (i = 0; i < ARRAY_SIZE(root_devices); ++i) ++ { ++ if (!SetupDiCreateDeviceInfoA( set, root_devices[i].name, &GUID_NULL, NULL, NULL, 0, &device)) ++ { ++ if (GetLastError() != ERROR_DEVINST_ALREADY_EXISTS) ++ WINE_ERR("Failed to create device %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); ++ continue; ++ } ++ ++ if (!SetupDiSetDeviceRegistryPropertyA(set, &device, SPDRP_HARDWAREID, ++ (const BYTE *)root_devices[i].hardware_id, (strlen(root_devices[i].hardware_id) + 2) * sizeof(WCHAR))) ++ { ++ WINE_ERR("Failed to set hardware id for %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); ++ continue; ++ } ++ ++ if (!SetupDiCallClassInstaller(DIF_REGISTERDEVICE, set, &device)) ++ { ++ WINE_ERR("Failed to register device %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); ++ continue; ++ } ++ ++ if (!UpdateDriverForPlugAndPlayDevicesA(NULL, root_devices[i].hardware_id, root_devices[i].infpath, 0, NULL)) ++ WINE_ERR("Failed to install drivers for %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); ++ } ++ ++ SetupDiDestroyDeviceInfoList(set); ++} ++ + /* execute rundll32 on the wine.inf file if necessary */ + static void update_wineprefix( BOOL force ) + { +@@ -1159,6 +1212,9 @@ static void update_wineprefix( BOOL force ) + } + DestroyWindow( hwnd ); + } ++ ++ install_root_pnp_devices(); ++ + WINE_MESSAGE( "wine: configuration in '%s' has been updated.\n", prettyprint_configdir() ); + } + +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0004-winebus.sys-Initialize-and-teardown-the-HID-backends.patch b/patches/mailing-list-patches/0004-winebus.sys-Initialize-and-teardown-the-HID-backends.patch new file mode 100644 index 00000000..bbbc2132 --- /dev/null +++ b/patches/mailing-list-patches/0004-winebus.sys-Initialize-and-teardown-the-HID-backends.patch @@ -0,0 +1,85 @@ +From cf2328c46895754b40bf6017d2c300f7a153d0c4 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Thu, 27 Jun 2019 22:30:16 -0500 +Subject: [PATCH] winebus.sys: Initialize and teardown the HID backends while + the bus FDO is still extant. + +Signed-off-by: Zebediah Figura +--- + dlls/winebus.sys/main.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c +index d9ceb83760..b96e38c538 100644 +--- a/dlls/winebus.sys/main.c ++++ b/dlls/winebus.sys/main.c +@@ -475,16 +475,31 @@ static NTSTATUS handle_IRP_MN_QUERY_ID(DEVICE_OBJECT *device, IRP *irp) + + static NTSTATUS fdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) + { ++ static const WCHAR SDL_enabledW[] = {'E','n','a','b','l','e',' ','S','D','L',0}; ++ static const UNICODE_STRING SDL_enabled = {sizeof(SDL_enabledW) - sizeof(WCHAR), sizeof(SDL_enabledW), (WCHAR*)SDL_enabledW}; + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp); + NTSTATUS ret; + + switch (irpsp->MinorFunction) + { + case IRP_MN_START_DEVICE: ++ if (check_bus_option(&SDL_enabled, 1)) ++ { ++ if (sdl_driver_init() == STATUS_SUCCESS) ++ return STATUS_SUCCESS; ++ } ++ udev_driver_init(); ++ iohid_driver_init(); ++ irp->IoStatus.u.Status = STATUS_SUCCESS; ++ break; + case IRP_MN_SURPRISE_REMOVAL: + irp->IoStatus.u.Status = STATUS_SUCCESS; + break; + case IRP_MN_REMOVE_DEVICE: ++ udev_driver_unload(); ++ iohid_driver_unload(); ++ sdl_driver_unload(); ++ + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoSkipCurrentIrpStackLocation(irp); + ret = IoCallDriver(bus_pdo, irp); +@@ -829,9 +844,6 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *p + + static void WINAPI driver_unload(DRIVER_OBJECT *driver) + { +- udev_driver_unload(); +- iohid_driver_unload(); +- sdl_driver_unload(); + NtClose(driver_key); + } + +@@ -907,8 +919,6 @@ static void mouse_device_create(void) + + NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) + { +- static const WCHAR SDL_enabledW[] = {'E','n','a','b','l','e',' ','S','D','L',0}; +- static const UNICODE_STRING SDL_enabled = {sizeof(SDL_enabledW) - sizeof(WCHAR), sizeof(SDL_enabledW), (WCHAR*)SDL_enabledW}; + OBJECT_ATTRIBUTES attr = {0}; + NTSTATUS ret; + +@@ -927,15 +937,5 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) + driver->DriverExtension->AddDevice = driver_add_device; + driver->DriverUnload = driver_unload; + +- mouse_device_create(); +- +- if (check_bus_option(&SDL_enabled, 1)) +- { +- if (sdl_driver_init() == STATUS_SUCCESS) +- return STATUS_SUCCESS; +- } +- udev_driver_init(); +- iohid_driver_init(); +- + return STATUS_SUCCESS; + } +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0005-ntoskrnl.exe-IoInvalidateDeviceRelations-receives-th.patch b/patches/mailing-list-patches/0005-ntoskrnl.exe-IoInvalidateDeviceRelations-receives-th.patch new file mode 100644 index 00000000..a7638b63 --- /dev/null +++ b/patches/mailing-list-patches/0005-ntoskrnl.exe-IoInvalidateDeviceRelations-receives-th.patch @@ -0,0 +1,285 @@ +From cdc9b0c079ab9001800e97d2b6303f743f8c2175 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Thu, 27 Jun 2019 22:30:17 -0500 +Subject: [PATCH] ntoskrnl.exe: IoInvalidateDeviceRelations() receives the + parent PDO. + +Signed-off-by: Zebediah Figura +--- + dlls/ntoskrnl.exe/ntoskrnl.c | 8 ++- + dlls/ntoskrnl.exe/ntoskrnl_private.h | 6 ++ + dlls/ntoskrnl.exe/pnp.c | 86 ++++++++++++++++++++++++---- + dlls/winebus.sys/bus.h | 1 + + dlls/winebus.sys/bus_iohid.c | 2 +- + dlls/winebus.sys/bus_sdl.c | 2 +- + dlls/winebus.sys/bus_udev.c | 2 +- + dlls/winebus.sys/main.c | 11 ++-- + 8 files changed, 97 insertions(+), 21 deletions(-) + +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c +index 92f9afab33..620f9572da 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.c ++++ b/dlls/ntoskrnl.exe/ntoskrnl.c +@@ -1469,6 +1469,7 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size, + { + static const WCHAR auto_format[] = {'\\','D','e','v','i','c','e','\\','%','0','8','x',0}; + NTSTATUS status; ++ struct wine_device *wine_device; + DEVICE_OBJECT *device; + HANDLE manager = get_device_manager(); + static unsigned int auto_idx = 0; +@@ -1477,11 +1478,12 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size, + TRACE( "(%p, %u, %s, %u, %x, %u, %p)\n", + driver, ext_size, debugstr_us(name), type, characteristics, exclusive, ret_device ); + +- if (!(device = alloc_kernel_object( IoDeviceObjectType, NULL, sizeof(DEVICE_OBJECT) + ext_size, 1 ))) ++ if (!(wine_device = alloc_kernel_object( IoDeviceObjectType, NULL, sizeof(struct wine_device) + ext_size, 1 ))) + return STATUS_NO_MEMORY; ++ device = &wine_device->device_obj; + + device->DriverObject = driver; +- device->DeviceExtension = device + 1; ++ device->DeviceExtension = wine_device + 1; + device->DeviceType = type; + device->StackSize = 1; + +@@ -1547,9 +1549,11 @@ void WINAPI IoDeleteDevice( DEVICE_OBJECT *device ) + + if (status == STATUS_SUCCESS) + { ++ struct wine_device *wine_device = CONTAINING_RECORD(device, struct wine_device, device_obj); + DEVICE_OBJECT **prev = &device->DriverObject->DeviceObject; + while (*prev && *prev != device) prev = &(*prev)->NextDevice; + if (*prev) *prev = (*prev)->NextDevice; ++ ExFreePool( wine_device->children ); + ObDereferenceObject( device ); + } + } +diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h +index b5244ef164..256e945e6f 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl_private.h ++++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h +@@ -86,4 +86,10 @@ static const WCHAR servicesW[] = {'\\','R','e','g','i','s','t','r','y', + '\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t', + '\\','S','e','r','v','i','c','e','s', + '\\',0}; ++ ++struct wine_device ++{ ++ DEVICE_OBJECT device_obj; ++ DEVICE_RELATIONS *children; ++}; + #endif +diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c +index 30865a05dc..c618885d42 100644 +--- a/dlls/ntoskrnl.exe/pnp.c ++++ b/dlls/ntoskrnl.exe/pnp.c +@@ -316,25 +316,18 @@ static void start_device( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVINFO_DATA * + } + } + +-static void handle_bus_relations( DEVICE_OBJECT *device ) ++static void enumerate_new_device( DEVICE_OBJECT *device, HDEVINFO set ) + { + static const WCHAR infpathW[] = {'I','n','f','P','a','t','h',0}; + + SP_DEVINFO_DATA sp_device = {sizeof(sp_device)}; + WCHAR device_instance_id[MAX_DEVICE_ID_LEN]; + BOOL need_driver = TRUE; +- HDEVINFO set; + HKEY key; + +- /* We could (should?) do a full IRP_MN_QUERY_DEVICE_RELATIONS query, +- * but we don't have to, we have the DEVICE_OBJECT of the new device +- * so we can simply handle the process here */ +- + if (get_device_instance_id( device, device_instance_id )) + return; + +- set = SetupDiCreateDeviceInfoList( NULL, NULL ); +- + if (!SetupDiCreateDeviceInfoW( set, device_instance_id, &GUID_NULL, NULL, NULL, 0, &sp_device ) + && !SetupDiOpenDeviceInfoW( set, device_instance_id, NULL, 0, &sp_device )) + { +@@ -362,19 +355,92 @@ static void handle_bus_relations( DEVICE_OBJECT *device ) + } + + start_device( device, set, &sp_device ); +- +- SetupDiDestroyDeviceInfoList( set ); + } + + static void remove_device( DEVICE_OBJECT *device ) + { ++ struct wine_device *wine_device = CONTAINING_RECORD(device, struct wine_device, device_obj); ++ + TRACE("Removing device %p.\n", device); + ++ if (wine_device->children) ++ { ++ ULONG i; ++ for (i = 0; i < wine_device->children->Count; ++i) ++ remove_device( wine_device->children->Objects[i] ); ++ } ++ + send_power_irp( device, PowerDeviceD3 ); + send_pnp_irp( device, IRP_MN_SURPRISE_REMOVAL ); + send_pnp_irp( device, IRP_MN_REMOVE_DEVICE ); + } + ++static BOOL device_in_list( const DEVICE_RELATIONS *list, const DEVICE_OBJECT *device ) ++{ ++ ULONG i; ++ for (i = 0; i < list->Count; ++i) ++ { ++ if (list->Objects[i] == device) ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++static void handle_bus_relations( DEVICE_OBJECT *parent ) ++{ ++ struct wine_device *wine_parent = CONTAINING_RECORD(parent, struct wine_device, device_obj); ++ SP_DEVINFO_DATA sp_device = {sizeof(sp_device)}; ++ DEVICE_RELATIONS *relations; ++ IO_STATUS_BLOCK irp_status; ++ IO_STACK_LOCATION *irpsp; ++ NTSTATUS status; ++ HDEVINFO set; ++ IRP *irp; ++ ULONG i; ++ ++ TRACE( "(%p)\n", parent ); ++ ++ set = SetupDiCreateDeviceInfoList( NULL, NULL ); ++ ++ parent = IoGetAttachedDevice( parent ); ++ ++ if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, parent, NULL, 0, NULL, NULL, &irp_status ))) ++ { ++ SetupDiDestroyDeviceInfoList( set ); ++ return; ++ } ++ ++ irpsp = IoGetNextIrpStackLocation( irp ); ++ irpsp->MinorFunction = IRP_MN_QUERY_DEVICE_RELATIONS; ++ irpsp->Parameters.QueryDeviceRelations.Type = BusRelations; ++ if ((status = send_device_irp( parent, irp, (ULONG_PTR *)&relations ))) ++ { ++ ERR("Failed to enumerate child devices, status %#x.\n", status); ++ SetupDiDestroyDeviceInfoList( set ); ++ return; ++ } ++ ++ TRACE("Got %u devices.\n", relations->Count); ++ ++ for (i = 0; i < relations->Count; ++i) ++ { ++ DEVICE_OBJECT *child = relations->Objects[i]; ++ ++ TRACE("%p, %p\n", wine_parent, wine_parent->children); ++ ++ if (!wine_parent->children || !device_in_list( wine_parent->children, child )) ++ { ++ TRACE("Adding new device %p.\n", child); ++ enumerate_new_device( child, set ); ++ } ++ } ++ ++ ExFreePool( wine_parent->children ); ++ wine_parent->children = relations; ++ ++ SetupDiDestroyDeviceInfoList( set ); ++} ++ + /*********************************************************************** + * IoInvalidateDeviceRelations (NTOSKRNL.EXE.@) + */ +diff --git a/dlls/winebus.sys/bus.h b/dlls/winebus.sys/bus.h +index de8ddf7ad9..a250878489 100644 +--- a/dlls/winebus.sys/bus.h ++++ b/dlls/winebus.sys/bus.h +@@ -54,3 +54,4 @@ DWORD check_bus_option(const UNICODE_STRING *option, DWORD default_value) DECLSP + BOOL is_xbox_gamepad(WORD vid, WORD pid) DECLSPEC_HIDDEN; + + HANDLE driver_key DECLSPEC_HIDDEN; ++DEVICE_OBJECT *bus_pdo DECLSPEC_HIDDEN; +diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c +index 7933374007..e992db8376 100644 +--- a/dlls/winebus.sys/bus_iohid.c ++++ b/dlls/winebus.sys/bus_iohid.c +@@ -357,7 +357,7 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void * + struct platform_private *private = impl_from_DEVICE_OBJECT(device); + private->device = IOHIDDevice; + private->buffer = NULL; +- IoInvalidateDeviceRelations(device, BusRelations); ++ IoInvalidateDeviceRelations(bus_pdo, BusRelations); + } + } + +diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c +index d24e21cff8..781deda767 100644 +--- a/dlls/winebus.sys/bus_sdl.c ++++ b/dlls/winebus.sys/bus_sdl.c +@@ -988,7 +988,7 @@ static void try_add_device(SDL_JoystickID index) + HeapFree(GetProcessHeap(), 0, serial); + return; + } +- IoInvalidateDeviceRelations(device, BusRelations); ++ IoInvalidateDeviceRelations(bus_pdo, BusRelations); + } + else + { +diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c +index 08ad8765af..9a3df9ea6b 100644 +--- a/dlls/winebus.sys/bus_udev.c ++++ b/dlls/winebus.sys/bus_udev.c +@@ -1241,7 +1241,7 @@ static void try_add_device(struct udev_device *dev) + return; + } + #endif +- IoInvalidateDeviceRelations(device, BusRelations); ++ IoInvalidateDeviceRelations(bus_pdo, BusRelations); + } + else + { +diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c +index b96e38c538..26200bde3e 100644 +--- a/dlls/winebus.sys/main.c ++++ b/dlls/winebus.sys/main.c +@@ -73,7 +73,8 @@ static DRIVER_OBJECT *driver_obj; + static DEVICE_OBJECT *mouse_obj; + + /* The root-enumerated device stack. */ +-static DEVICE_OBJECT *bus_pdo, *bus_fdo; ++DEVICE_OBJECT *bus_pdo; ++static DEVICE_OBJECT *bus_fdo; + + HANDLE driver_key; + +@@ -482,6 +483,9 @@ static NTSTATUS fdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) + + switch (irpsp->MinorFunction) + { ++ case IRP_MN_QUERY_DEVICE_RELATIONS: ++ irp->IoStatus.u.Status = handle_IRP_MN_QUERY_DEVICE_RELATIONS(irp); ++ break; + case IRP_MN_START_DEVICE: + if (check_bus_option(&SDL_enabled, 1)) + { +@@ -521,11 +525,6 @@ static NTSTATUS pdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) + + switch (irpsp->MinorFunction) + { +- case IRP_MN_QUERY_DEVICE_RELATIONS: +- TRACE("IRP_MN_QUERY_DEVICE_RELATIONS\n"); +- status = handle_IRP_MN_QUERY_DEVICE_RELATIONS(irp); +- irp->IoStatus.u.Status = status; +- break; + case IRP_MN_QUERY_ID: + TRACE("IRP_MN_QUERY_ID\n"); + status = handle_IRP_MN_QUERY_ID(device, irp); +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0006-cryptext-Implement-CryptExtOpenCER.patch b/patches/mailing-list-patches/0006-cryptext-Implement-CryptExtOpenCER.patch new file mode 100644 index 00000000..1cd59639 --- /dev/null +++ b/patches/mailing-list-patches/0006-cryptext-Implement-CryptExtOpenCER.patch @@ -0,0 +1,218 @@ +From 43d1b91c72b4151422bfd642ddf538f71935a78b Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Fri, 5 Jul 2019 13:20:23 +0800 +Subject: [PATCH] cryptext: Implement CryptExtOpenCER. + +Signed-off-by: Dmitry Timoshkov +--- + configure.ac | 1 + + dlls/cryptext/Makefile.in | 3 +- + dlls/cryptext/cryptext.spec | 4 +-- + dlls/cryptext/cryptext_main.c | 64 +++++++++++++++++++++++++++++++++ + dlls/cryptext/tests/Makefile.in | 4 +++ + dlls/cryptext/tests/cryptext.c | 61 +++++++++++++++++++++++++++++++ + 6 files changed, 134 insertions(+), 3 deletions(-) + create mode 100644 dlls/cryptext/tests/Makefile.in + create mode 100644 dlls/cryptext/tests/cryptext.c + +diff --git a/configure.ac b/configure.ac +index a7c45ace73..e801c35c46 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3049,6 +3049,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests) + WINE_CONFIG_MAKEFILE(dlls/cryptdlg) + WINE_CONFIG_MAKEFILE(dlls/cryptdll) + WINE_CONFIG_MAKEFILE(dlls/cryptext) ++WINE_CONFIG_MAKEFILE(dlls/cryptext/tests) + WINE_CONFIG_MAKEFILE(dlls/cryptnet) + WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests) + WINE_CONFIG_MAKEFILE(dlls/cryptui) +diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in +index 9c9f84cee8..0e817ffda6 100644 +--- a/dlls/cryptext/Makefile.in ++++ b/dlls/cryptext/Makefile.in +@@ -1,4 +1,5 @@ +-MODULE = cryptext.dll ++MODULE = cryptext.dll ++IMPORTS = crypt32 cryptui user32 + + EXTRADLLFLAGS = -mno-cygwin + +diff --git a/dlls/cryptext/cryptext.spec b/dlls/cryptext/cryptext.spec +index 0dba38e393..911ab2f4ba 100644 +--- a/dlls/cryptext/cryptext.spec ++++ b/dlls/cryptext/cryptext.spec +@@ -12,8 +12,8 @@ + @ stub CryptExtAddSPCW + @ stub CryptExtOpenCAT + @ stub CryptExtOpenCATW +-@ stub CryptExtOpenCER +-@ stub CryptExtOpenCERW ++@ stdcall CryptExtOpenCER(long ptr str long) ++@ stdcall CryptExtOpenCERW(long ptr wstr long) + @ stub CryptExtOpenCRL + @ stub CryptExtOpenCRLW + @ stub CryptExtOpenCTL +diff --git a/dlls/cryptext/cryptext_main.c b/dlls/cryptext/cryptext_main.c +index f7c7bd1f55..2a381782d6 100644 +--- a/dlls/cryptext/cryptext_main.c ++++ b/dlls/cryptext/cryptext_main.c +@@ -22,10 +22,29 @@ + + #include "windef.h" + #include "winbase.h" ++#include "winnls.h" ++#include "wincrypt.h" ++#include "winuser.h" ++#include "cryptuiapi.h" ++ ++#include "wine/heap.h" + #include "wine/debug.h" + + WINE_DEFAULT_DEBUG_CHANNEL(cryptext); + ++static WCHAR *heap_strdupAtoW(const char *str) ++{ ++ WCHAR *ret; ++ INT len; ++ ++ if (!str) return NULL; ++ 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; ++} ++ + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) + { + TRACE("(%p, %u, %p)\n", instance, reason, reserved); +@@ -59,3 +78,48 @@ HRESULT WINAPI CryptExtAddPFXW(LPCWSTR filename) + FIXME("stub: %s\n", debugstr_w(filename)); + return E_NOTIMPL; + } ++ ++/*********************************************************************** ++ * CryptExtOpenCERW (CRYPTEXT.@) ++ */ ++HRESULT WINAPI CryptExtOpenCERW(HWND hwnd, HINSTANCE hinst, LPCWSTR filename, DWORD showcmd) ++{ ++ PCCERT_CONTEXT ctx; ++ CRYPTUI_VIEWCERTIFICATE_STRUCTW info; ++ ++ TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_w(filename), showcmd); ++ ++ if (!CryptQueryObject(CERT_QUERY_OBJECT_FILE, filename, CERT_QUERY_CONTENT_FLAG_CERT, ++ CERT_QUERY_FORMAT_FLAG_ALL, 0, NULL, NULL, NULL, NULL, NULL, ++ (const void **)&ctx)) ++ { ++ /* FIXME: move to the resources */ ++ static const WCHAR msg[] = {'T','h','i','s',' ','i','s',' ','n','o','t',' ','a',' ','v','a','l','i','d',' ','c','e','r','t','i','f','i','c','a','t','e',0}; ++ MessageBoxW(NULL, msg, filename, MB_OK | MB_ICONERROR); ++ return S_OK; /* according to the tests */ ++ } ++ ++ memset(&info, 0, sizeof(info)); ++ info.dwSize = sizeof(info); ++ info.pCertContext = ctx; ++ CryptUIDlgViewCertificateW(&info, NULL); ++ CertFreeCertificateContext(ctx); ++ ++ return S_OK; ++} ++ ++/*********************************************************************** ++ * CryptExtOpenCER (CRYPTEXT.@) ++ */ ++HRESULT WINAPI CryptExtOpenCER(HWND hwnd, HINSTANCE hinst, LPCSTR filename, DWORD showcmd) ++{ ++ HRESULT hr; ++ LPWSTR filenameW; ++ ++ TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_a(filename), showcmd); ++ ++ filenameW = heap_strdupAtoW(filename); ++ hr = CryptExtOpenCERW(hwnd, hinst, filenameW, showcmd); ++ heap_free(filenameW); ++ return hr; ++} +diff --git a/dlls/cryptext/tests/Makefile.in b/dlls/cryptext/tests/Makefile.in +new file mode 100644 +index 0000000000..522fc60a4a +--- /dev/null ++++ b/dlls/cryptext/tests/Makefile.in +@@ -0,0 +1,4 @@ ++TESTDLL = cryptext.dll ++ ++C_SRCS = \ ++ cryptext.c +diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c +new file mode 100644 +index 0000000000..cc62a772b5 +--- /dev/null ++++ b/dlls/cryptext/tests/cryptext.c +@@ -0,0 +1,61 @@ ++/* ++ * Copyright 2019 Dmitry Timoshkov ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "wine/test.h" ++ ++static HRESULT (WINAPI *pCryptExtOpenCER)(HWND,HINSTANCE,LPCSTR,DWORD); ++ ++static void test_CryptExtOpenCER(void) ++{ ++ HRESULT hr; ++ ++ if (!pCryptExtOpenCER) ++ { ++ win_skip("CryptExtOpenCER is not available on this platform\n"); ++ return; ++ } ++ ++ if (!winetest_interactive) ++ { ++ skip("CryptExtOpenCER test needs user interaction\n"); ++ return; ++ } ++ ++ SetLastError(0xdeadbeef); ++ hr = pCryptExtOpenCER(0, 0, "dead.beef", SW_HIDE); ++ ok(hr == S_OK, "got %#x\n", hr); ++ ++ hr = pCryptExtOpenCER(0, 0, "VeriSign Class 3 Public Primary Certification Authority - G4.txt", SW_SHOW); ++ ok(hr == S_OK, "got %#x\n", hr); ++} ++ ++START_TEST(cryptext) ++{ ++ HMODULE hmod = LoadLibraryA("cryptext.dll"); ++ ++ pCryptExtOpenCER = (void *)GetProcAddress(hmod, "CryptExtOpenCER"); ++ ++ test_CryptExtOpenCER(); ++} +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0007-dxgi-tests-Test-output-after-using-Alt-Enter-to-swit.patch b/patches/mailing-list-patches/0007-dxgi-tests-Test-output-after-using-Alt-Enter-to-swit.patch new file mode 100644 index 00000000..e3a9c3fa --- /dev/null +++ b/patches/mailing-list-patches/0007-dxgi-tests-Test-output-after-using-Alt-Enter-to-swit.patch @@ -0,0 +1,48 @@ +From d8c945b3d420e284fd4a8eda4879202ace7e712e Mon Sep 17 00:00:00 2001 +From: Zhiyi Zhang +Date: Mon, 8 Jul 2019 22:15:59 +0800 +Subject: [PATCH] dxgi/tests: Test output after using Alt+Enter to switch + fullscreen. + +Signed-off-by: Henri Verbeet +Signed-off-by: Zhiyi Zhang +--- + dlls/dxgi/tests/dxgi.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c +index d8176bb1c0..38aeba17bd 100644 +--- a/dlls/dxgi/tests/dxgi.c ++++ b/dlls/dxgi/tests/dxgi.c +@@ -5306,6 +5306,7 @@ static void test_window_association(void) + LONG_PTR original_wndproc, wndproc; + IDXGIFactory *factory, *factory2; + IDXGISwapChain *swapchain; ++ IDXGIOutput *output; + IDXGIAdapter *adapter; + IDXGIDevice *device; + HWND hwnd, hwnd2; +@@ -5449,14 +5450,18 @@ static void test_window_association(void) + PostMessageA(swapchain_desc.OutputWindow, WM_SYSKEYDOWN, VK_RETURN, + (MapVirtualKeyA(VK_RETURN, MAPVK_VK_TO_VSC) << 16) | 0x20000001); + flush_events(); +- hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); ++ output = NULL; ++ hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, &output); + ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(fullscreen == tests[i].expect_fullscreen + || broken(tests[i].broken_d3d10 && fullscreen), + "Test %u: Got unexpected fullscreen %#x.\n", i, fullscreen); ++ todo_wine_if(fullscreen) ok(fullscreen ? !!output : !output, "Test %u: Got wrong output.\n", i); ++ if (output) ++ IDXGIOutput_Release(output); + + wndproc = GetWindowLongPtrW(swapchain_desc.OutputWindow, GWLP_WNDPROC); +- ok(wndproc == original_wndproc, "Text %u: Got unexpected wndproc %#lx, expected %#lx.\n", ++ ok(wndproc == original_wndproc, "Test %u: Got unexpected wndproc %#lx, expected %#lx.\n", + i, wndproc, original_wndproc); + } + } +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0008-dxgi-Fix-possible-null-output-from-d3d11_swapchain_G.patch b/patches/mailing-list-patches/0008-dxgi-Fix-possible-null-output-from-d3d11_swapchain_G.patch new file mode 100644 index 00000000..cecf6a69 --- /dev/null +++ b/patches/mailing-list-patches/0008-dxgi-Fix-possible-null-output-from-d3d11_swapchain_G.patch @@ -0,0 +1,76 @@ +From a26681c535b622ef02ae588fa58b86e95b2a581c Mon Sep 17 00:00:00 2001 +From: Zhiyi Zhang +Date: Mon, 8 Jul 2019 22:16:41 +0800 +Subject: [PATCH] dxgi: Fix possible null output from + d3d11_swapchain_GetFullscreenState. + +When swapchain is created in windowed mode, and then enter fullscreen +via Alt+Enter. Calling d3d11_swapchain_GetFullscreenState will return +a null output because swapchain->target wasn't initialized. + +Signed-off-by: Henri Verbeet +Signed-off-by: Zhiyi Zhang +--- + dlls/dxgi/swapchain.c | 20 ++++++++++++++++---- + dlls/dxgi/tests/dxgi.c | 2 +- + 2 files changed, 17 insertions(+), 5 deletions(-) + +diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c +index 8dbbfab805..caf0863609 100644 +--- a/dlls/dxgi/swapchain.c ++++ b/dlls/dxgi/swapchain.c +@@ -407,22 +407,34 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapCha + { + struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain1(iface); + struct wined3d_swapchain_desc swapchain_desc; ++ HRESULT hr; + + TRACE("iface %p, fullscreen %p, target %p.\n", iface, fullscreen, target); + +- if (fullscreen) ++ if (fullscreen || target) + { + wined3d_mutex_lock(); + wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &swapchain_desc); + wined3d_mutex_unlock(); +- *fullscreen = !swapchain_desc.windowed; + } + ++ if (fullscreen) ++ *fullscreen = !swapchain_desc.windowed; ++ + if (target) + { +- *target = swapchain->target; +- if (*target) ++ if (!swapchain_desc.windowed) ++ { ++ if (!swapchain->target && FAILED(hr = IDXGISwapChain1_GetContainingOutput(iface, &swapchain->target))) ++ return hr; ++ ++ *target = swapchain->target; + IDXGIOutput_AddRef(*target); ++ } ++ else ++ { ++ *target = NULL; ++ } + } + + return S_OK; +diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c +index 38aeba17bd..ab33caf2e2 100644 +--- a/dlls/dxgi/tests/dxgi.c ++++ b/dlls/dxgi/tests/dxgi.c +@@ -5456,7 +5456,7 @@ static void test_window_association(void) + ok(fullscreen == tests[i].expect_fullscreen + || broken(tests[i].broken_d3d10 && fullscreen), + "Test %u: Got unexpected fullscreen %#x.\n", i, fullscreen); +- todo_wine_if(fullscreen) ok(fullscreen ? !!output : !output, "Test %u: Got wrong output.\n", i); ++ ok(fullscreen ? !!output : !output, "Test %u: Got wrong output.\n", i); + if (output) + IDXGIOutput_Release(output); + +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0009-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch b/patches/mailing-list-patches/0009-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch new file mode 100644 index 00000000..61f59342 --- /dev/null +++ b/patches/mailing-list-patches/0009-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch @@ -0,0 +1,61 @@ +From 0dd59c5e94d27a1d16a85807c03ff6f54bb55fbc Mon Sep 17 00:00:00 2001 +From: Jeff Smith +Date: Mon, 8 Jul 2019 10:19:43 -0500 +Subject: [PATCH] d3drm: Check for NULL pointer in d3drm_viewport2_GetDevice(). + +Signed-off-by: Henri Verbeet +Signed-off-by: Jeff Smith +--- + dlls/d3drm/tests/d3drm.c | 4 ++++ + dlls/d3drm/viewport.c | 6 ++++++ + 2 files changed, 10 insertions(+) + +diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c +index 86678193ba..67696d5583 100644 +--- a/dlls/d3drm/tests/d3drm.c ++++ b/dlls/d3drm/tests/d3drm.c +@@ -2153,6 +2153,8 @@ static void test_Viewport(void) + + hr = IDirect3DRMViewport_Init(viewport, device1, frame, rc.left, rc.top, rc.right, rc.bottom); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); ++ hr = IDirect3DRMViewport_GetDevice(viewport, NULL); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + IDirect3DRMViewport_Release(viewport); + ref4 = get_refcount((IUnknown *)d3drm1); +@@ -2241,6 +2243,8 @@ static void test_Viewport(void) + + hr = IDirect3DRMViewport2_Init(viewport2, device3, frame3, rc.left, rc.top, rc.right, rc.bottom); + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); ++ hr = IDirect3DRMViewport2_GetDevice(viewport2, NULL); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + IDirect3DRMViewport2_Release(viewport2); + ref4 = get_refcount((IUnknown *)d3drm1); +diff --git a/dlls/d3drm/viewport.c b/dlls/d3drm/viewport.c +index 51174cd59e..d049f37213 100644 +--- a/dlls/d3drm/viewport.c ++++ b/dlls/d3drm/viewport.c +@@ -683,6 +683,9 @@ static HRESULT WINAPI d3drm_viewport2_GetDevice(IDirect3DRMViewport2 *iface, IDi + + TRACE("iface %p, device %p.\n", iface, device); + ++ if (!device) ++ return D3DRMERR_BADVALUE; ++ + if (!viewport->device) + return D3DRMERR_BADOBJECT; + +@@ -698,6 +701,9 @@ static HRESULT WINAPI d3drm_viewport1_GetDevice(IDirect3DRMViewport *iface, IDir + + TRACE("iface %p, device %p.\n\n", iface, device); + ++ if (!device) ++ return D3DRMERR_BADVALUE; ++ + if (!viewport->device) + return D3DRMERR_BADOBJECT; + +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0010-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch b/patches/mailing-list-patches/0010-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch new file mode 100644 index 00000000..4f5fc8ff --- /dev/null +++ b/patches/mailing-list-patches/0010-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch @@ -0,0 +1,52 @@ +From 7ba4285719eb9592437ff0b4481f89238b035064 Mon Sep 17 00:00:00 2001 +From: Jeff Smith +Date: Mon, 8 Jul 2019 10:19:44 -0500 +Subject: [PATCH] d3drm: Check for NULL pointer in + d3drm_viewport2_GetDirect3DViewport(). + +Signed-off-by: Henri Verbeet +Signed-off-by: Jeff Smith +--- + dlls/d3drm/tests/d3drm.c | 4 ++++ + dlls/d3drm/viewport.c | 3 +++ + 2 files changed, 7 insertions(+) + +diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c +index 67696d5583..88f3db819d 100644 +--- a/dlls/d3drm/tests/d3drm.c ++++ b/dlls/d3drm/tests/d3drm.c +@@ -2155,6 +2155,8 @@ static void test_Viewport(void) + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMViewport_GetDevice(viewport, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); ++ hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, NULL); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + IDirect3DRMViewport_Release(viewport); + ref4 = get_refcount((IUnknown *)d3drm1); +@@ -2245,6 +2247,8 @@ static void test_Viewport(void) + ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr); + hr = IDirect3DRMViewport2_GetDevice(viewport2, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); ++ hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, NULL); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + IDirect3DRMViewport2_Release(viewport2); + ref4 = get_refcount((IUnknown *)d3drm1); +diff --git a/dlls/d3drm/viewport.c b/dlls/d3drm/viewport.c +index d049f37213..430c9d470b 100644 +--- a/dlls/d3drm/viewport.c ++++ b/dlls/d3drm/viewport.c +@@ -896,6 +896,9 @@ static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 * + + TRACE("iface %p, viewport %p.\n", iface, viewport); + ++ if (!viewport) ++ return D3DRMERR_BADVALUE; ++ + if (!viewport_object->d3d_viewport) + return D3DRMERR_BADOBJECT; + +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0011-d3drm-Return-error-if-setting-viewport-field-of-view.patch b/patches/mailing-list-patches/0011-d3drm-Return-error-if-setting-viewport-field-of-view.patch new file mode 100644 index 00000000..71d04dd0 --- /dev/null +++ b/patches/mailing-list-patches/0011-d3drm-Return-error-if-setting-viewport-field-of-view.patch @@ -0,0 +1,56 @@ +From e12b2ca2f2ff5fdcc93a310c5391210f71c90e5a Mon Sep 17 00:00:00 2001 +From: Jeff Smith +Date: Mon, 8 Jul 2019 10:19:45 -0500 +Subject: [PATCH] d3drm: Return error if setting viewport field-of-view to zero + or negative value. + +Signed-off-by: Henri Verbeet +Signed-off-by: Jeff Smith +--- + dlls/d3drm/tests/d3drm.c | 8 ++++++++ + dlls/d3drm/viewport.c | 3 +++ + 2 files changed, 11 insertions(+) + +diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c +index 88f3db819d..dbba859215 100644 +--- a/dlls/d3drm/tests/d3drm.c ++++ b/dlls/d3drm/tests/d3drm.c +@@ -2157,6 +2157,10 @@ static void test_Viewport(void) + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); ++ hr = IDirect3DRMViewport_SetField(viewport, 0.0f); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); ++ hr = IDirect3DRMViewport_SetField(viewport, -1.0f); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + IDirect3DRMViewport_Release(viewport); + ref4 = get_refcount((IUnknown *)d3drm1); +@@ -2249,6 +2253,10 @@ static void test_Viewport(void) + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, NULL); + ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); ++ hr = IDirect3DRMViewport2_SetField(viewport2, 0.0f); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); ++ hr = IDirect3DRMViewport2_SetField(viewport2, -1.0f); ++ ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr); + + IDirect3DRMViewport2_Release(viewport2); + ref4 = get_refcount((IUnknown *)d3drm1); +diff --git a/dlls/d3drm/viewport.c b/dlls/d3drm/viewport.c +index 430c9d470b..c2fa189742 100644 +--- a/dlls/d3drm/viewport.c ++++ b/dlls/d3drm/viewport.c +@@ -523,6 +523,9 @@ static HRESULT WINAPI d3drm_viewport2_SetField(IDirect3DRMViewport2 *iface, D3DV + + TRACE("iface %p, field %.8e.\n", iface, field); + ++ if (field <= 0.0f) ++ return D3DRMERR_BADVALUE; ++ + viewport->field = field; + + return D3DRM_OK; +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0012-strmbase-Remove-unused-wine-unicode.h-import.patch b/patches/mailing-list-patches/0012-strmbase-Remove-unused-wine-unicode.h-import.patch new file mode 100644 index 00000000..a08129d5 --- /dev/null +++ b/patches/mailing-list-patches/0012-strmbase-Remove-unused-wine-unicode.h-import.patch @@ -0,0 +1,25 @@ +From 616ad4e053abdc48810064993caef067a3452587 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Mon, 8 Jul 2019 11:24:39 -0500 +Subject: [PATCH] strmbase: Remove unused wine/unicode.h import. + +Signed-off-by: Zebediah Figura +--- + dlls/strmbase/strmbase_private.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/dlls/strmbase/strmbase_private.h b/dlls/strmbase/strmbase_private.h +index 439ab9aefa..06fbe62a42 100644 +--- a/dlls/strmbase/strmbase_private.h ++++ b/dlls/strmbase/strmbase_private.h +@@ -31,7 +31,6 @@ + #include "wine/heap.h" + #include "wine/list.h" + #include "wine/strmbase.h" +-#include "wine/unicode.h" + + /* Quality Control */ + typedef struct QualityControlImpl { +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0013-qedit-Build-with-msvcrt.patch b/patches/mailing-list-patches/0013-qedit-Build-with-msvcrt.patch new file mode 100644 index 00000000..32f6f686 --- /dev/null +++ b/patches/mailing-list-patches/0013-qedit-Build-with-msvcrt.patch @@ -0,0 +1,26 @@ +From b263d3d0958c18b2b8f105b87c27f9cbee176503 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Mon, 8 Jul 2019 11:24:43 -0500 +Subject: [PATCH] qedit: Build with msvcrt. + +Signed-off-by: Zebediah Figura +--- + dlls/qedit/Makefile.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/dlls/qedit/Makefile.in b/dlls/qedit/Makefile.in +index b47ee260ab..4891328c7a 100644 +--- a/dlls/qedit/Makefile.in ++++ b/dlls/qedit/Makefile.in +@@ -1,6 +1,8 @@ + MODULE = qedit.dll + IMPORTS = strmiids strmbase uuid oleaut32 ole32 advapi32 + ++EXTRADLLFLAGS = -mno-cygwin ++ + C_SRCS = \ + main.c \ + mediadet.c \ +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0014-qedit-Share-source-with-strmbase.patch b/patches/mailing-list-patches/0014-qedit-Share-source-with-strmbase.patch new file mode 100644 index 00000000..5b2cf280 --- /dev/null +++ b/patches/mailing-list-patches/0014-qedit-Share-source-with-strmbase.patch @@ -0,0 +1,40 @@ +From 4018f0ee2e502ded20bc907e3baa47ca348a61b8 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Mon, 8 Jul 2019 11:24:42 -0500 +Subject: [PATCH] qedit: Share source with strmbase. + +Signed-off-by: Zebediah Figura +--- + dlls/qedit/Makefile.in | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/dlls/qedit/Makefile.in b/dlls/qedit/Makefile.in +index 4891328c7a..c5bf8f9cac 100644 +--- a/dlls/qedit/Makefile.in ++++ b/dlls/qedit/Makefile.in +@@ -1,12 +1,21 @@ + MODULE = qedit.dll +-IMPORTS = strmiids strmbase uuid oleaut32 ole32 advapi32 ++IMPORTS = strmiids uuid oleaut32 ole32 advapi32 ++PARENTSRC = ../strmbase + + EXTRADLLFLAGS = -mno-cygwin + + C_SRCS = \ ++ dispatch.c \ ++ enumpins.c \ ++ filter.c \ + main.c \ + mediadet.c \ ++ mediatype.c \ + nullrenderer.c \ ++ pin.c \ ++ pospass.c \ ++ qualitycontrol.c \ ++ renderer.c \ + samplegrabber.c \ + timeline.c + +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0015-evr-Build-with-msvcrt.patch b/patches/mailing-list-patches/0015-evr-Build-with-msvcrt.patch new file mode 100644 index 00000000..573db0b1 --- /dev/null +++ b/patches/mailing-list-patches/0015-evr-Build-with-msvcrt.patch @@ -0,0 +1,53 @@ +From 4b3eebfae7a5a03f3c1644c65d5f1c00af0c4ae3 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Mon, 8 Jul 2019 11:24:41 -0500 +Subject: [PATCH] evr: Build with msvcrt. + +Signed-off-by: Zebediah Figura +--- + dlls/evr/Makefile.in | 2 ++ + dlls/evr/evr.c | 1 - + dlls/evr/main.c | 2 -- + 3 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/dlls/evr/Makefile.in b/dlls/evr/Makefile.in +index dc7989e835..053d80e61d 100644 +--- a/dlls/evr/Makefile.in ++++ b/dlls/evr/Makefile.in +@@ -1,6 +1,8 @@ + MODULE = evr.dll + IMPORTS = mfuuid strmiids strmbase uuid ole32 oleaut32 + ++EXTRADLLFLAGS = -mno-cygwin ++ + C_SRCS = \ + evr.c \ + main.c +diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c +index b64b0468ac..655ca79b0d 100644 +--- a/dlls/evr/evr.c ++++ b/dlls/evr/evr.c +@@ -18,7 +18,6 @@ + + #define COBJMACROS + +-#include "config.h" + #include "wine/debug.h" + + #include +diff --git a/dlls/evr/main.c b/dlls/evr/main.c +index ba48207326..000ed7c55b 100644 +--- a/dlls/evr/main.c ++++ b/dlls/evr/main.c +@@ -18,8 +18,6 @@ + + #define COBJMACROS + +-#include "config.h" +- + #include + + #include "windef.h" +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0016-evr-Share-source-with-strmbase.patch b/patches/mailing-list-patches/0016-evr-Share-source-with-strmbase.patch new file mode 100644 index 00000000..081ebdf0 --- /dev/null +++ b/patches/mailing-list-patches/0016-evr-Share-source-with-strmbase.patch @@ -0,0 +1,39 @@ +From 29294a8ce4ae5114396464e8aa177e267881e734 Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Mon, 8 Jul 2019 11:24:40 -0500 +Subject: [PATCH] evr: Share source with strmbase. + +Signed-off-by: Zebediah Figura +--- + dlls/evr/Makefile.in | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/dlls/evr/Makefile.in b/dlls/evr/Makefile.in +index 053d80e61d..e605ce227c 100644 +--- a/dlls/evr/Makefile.in ++++ b/dlls/evr/Makefile.in +@@ -1,10 +1,19 @@ + MODULE = evr.dll +-IMPORTS = mfuuid strmiids strmbase uuid ole32 oleaut32 ++IMPORTS = mfuuid strmiids uuid ole32 oleaut32 ++PARENTSRC = ../strmbase + + EXTRADLLFLAGS = -mno-cygwin + + C_SRCS = \ ++ dispatch.c \ ++ enumpins.c \ + evr.c \ +- main.c ++ filter.c \ ++ main.c \ ++ mediatype.c \ ++ pin.c \ ++ pospass.c \ ++ qualitycontrol.c \ ++ renderer.c + + IDL_SRCS = evr_classes.idl +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0017-user32-Also-scan-for-mouse-devices-in-GetRawInputDev.patch b/patches/mailing-list-patches/0017-user32-Also-scan-for-mouse-devices-in-GetRawInputDev.patch new file mode 100644 index 00000000..0e11b16d --- /dev/null +++ b/patches/mailing-list-patches/0017-user32-Also-scan-for-mouse-devices-in-GetRawInputDev.patch @@ -0,0 +1,311 @@ +From cefe28f14b32726d67fcc17e0c5195c1f8d3f61e Mon Sep 17 00:00:00 2001 +From: Zebediah Figura +Date: Mon, 8 Jul 2019 11:32:27 -0500 +Subject: [PATCH] user32: Also scan for mouse devices in + GetRawInputDeviceList(). + +Signed-off-by: Zebediah Figura +--- + dlls/user32/rawinput.c | 124 ++++++++++++++++++++++---------------- + dlls/user32/tests/input.c | 2 +- + 2 files changed, 74 insertions(+), 52 deletions(-) + +diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c +index 49cf9f73a0..e83da29009 100644 +--- a/dlls/user32/rawinput.c ++++ b/dlls/user32/rawinput.c +@@ -36,27 +36,30 @@ + + #include "user_private.h" + ++#include "initguid.h" ++#include "ntddmou.h" ++ + WINE_DEFAULT_DEBUG_CHANNEL(rawinput); + +-struct hid_device ++struct device + { + WCHAR *path; + HANDLE file; +- RID_DEVICE_INFO_HID info; ++ RID_DEVICE_INFO info; + PHIDP_PREPARSED_DATA data; + }; + +-static struct hid_device *hid_devices; +-static unsigned int hid_devices_count, hid_devices_max; ++static struct device *rawinput_devices; ++static unsigned int rawinput_devices_count, rawinput_devices_max; + +-static CRITICAL_SECTION hid_devices_cs; +-static CRITICAL_SECTION_DEBUG hid_devices_cs_debug = ++static CRITICAL_SECTION rawinput_devices_cs; ++static CRITICAL_SECTION_DEBUG rawinput_devices_cs_debug = + { +- 0, 0, &hid_devices_cs, +- { &hid_devices_cs_debug.ProcessLocksList, &hid_devices_cs_debug.ProcessLocksList }, +- 0, 0, { (DWORD_PTR)(__FILE__ ": hid_devices_cs") } ++ 0, 0, &rawinput_devices_cs, ++ { &rawinput_devices_cs_debug.ProcessLocksList, &rawinput_devices_cs_debug.ProcessLocksList }, ++ 0, 0, { (DWORD_PTR)(__FILE__ ": rawinput_devices_cs") } + }; +-static CRITICAL_SECTION hid_devices_cs = { &hid_devices_cs_debug, -1, 0, 0, 0, 0 }; ++static CRITICAL_SECTION rawinput_devices_cs = { &rawinput_devices_cs_debug, -1, 0, 0, 0, 0 }; + + static BOOL array_reserve(void **elements, unsigned int *capacity, unsigned int count, unsigned int size) + { +@@ -85,10 +88,10 @@ static BOOL array_reserve(void **elements, unsigned int *capacity, unsigned int + return TRUE; + } + +-static struct hid_device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface) ++static struct device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface) + { + SP_DEVICE_INTERFACE_DETAIL_DATA_W *detail; +- struct hid_device *device; ++ struct device *device; + HANDLE file; + WCHAR *path; + DWORD size; +@@ -126,7 +129,8 @@ static struct hid_device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *ifa + return NULL; + } + +- if (!array_reserve((void **)&hid_devices, &hid_devices_max, hid_devices_count + 1, sizeof(*hid_devices))) ++ if (!array_reserve((void **)&rawinput_devices, &rawinput_devices_max, ++ rawinput_devices_count + 1, sizeof(*rawinput_devices))) + { + ERR("Failed to allocate memory.\n"); + CloseHandle(file); +@@ -134,19 +138,20 @@ static struct hid_device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *ifa + return NULL; + } + +- device = &hid_devices[hid_devices_count++]; ++ device = &rawinput_devices[rawinput_devices_count++]; + device->path = path; + device->file = file; ++ device->info.cbSize = sizeof(RID_DEVICE_INFO); + + return device; + } + +-static void find_hid_devices(void) ++static void find_devices(void) + { + static ULONGLONG last_check; + + SP_DEVICE_INTERFACE_DATA iface = { sizeof(iface) }; +- struct hid_device *device; ++ struct device *device; + HIDD_ATTRIBUTES attr; + HIDP_CAPS caps; + GUID hid_guid; +@@ -159,18 +164,18 @@ static void find_hid_devices(void) + + HidD_GetHidGuid(&hid_guid); + +- set = SetupDiGetClassDevsW(&hid_guid, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT); +- +- EnterCriticalSection(&hid_devices_cs); ++ EnterCriticalSection(&rawinput_devices_cs); + + /* destroy previous list */ +- for (idx = 0; idx < hid_devices_count; ++idx) ++ for (idx = 0; idx < rawinput_devices_count; ++idx) + { +- CloseHandle(hid_devices[idx].file); +- heap_free(hid_devices[idx].path); ++ CloseHandle(rawinput_devices[idx].file); ++ heap_free(rawinput_devices[idx].path); + } ++ rawinput_devices_count = 0; ++ ++ set = SetupDiGetClassDevsW(&hid_guid, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT); + +- hid_devices_count = 0; + for (idx = 0; SetupDiEnumDeviceInterfaces(set, NULL, &hid_guid, idx, &iface); ++idx) + { + if (!(device = add_device(set, &iface))) +@@ -179,9 +184,11 @@ static void find_hid_devices(void) + attr.Size = sizeof(HIDD_ATTRIBUTES); + if (!HidD_GetAttributes(device->file, &attr)) + WARN("Failed to get attributes.\n"); +- device->info.dwVendorId = attr.VendorID; +- device->info.dwProductId = attr.ProductID; +- device->info.dwVersionNumber = attr.VersionNumber; ++ ++ device->info.dwType = RIM_TYPEHID; ++ device->info.u.hid.dwVendorId = attr.VendorID; ++ device->info.u.hid.dwProductId = attr.ProductID; ++ device->info.u.hid.dwVersionNumber = attr.VersionNumber; + + if (!HidD_GetPreparsedData(device->file, &device->data)) + WARN("Failed to get preparsed data.\n"); +@@ -189,12 +196,28 @@ static void find_hid_devices(void) + if (!HidP_GetCaps(device->data, &caps)) + WARN("Failed to get caps.\n"); + +- device->info.usUsagePage = caps.UsagePage; +- device->info.usUsage = caps.Usage; ++ device->info.u.hid.usUsagePage = caps.UsagePage; ++ device->info.u.hid.usUsage = caps.Usage; + } + +- LeaveCriticalSection(&hid_devices_cs); + SetupDiDestroyDeviceInfoList(set); ++ ++ set = SetupDiGetClassDevsW(&GUID_DEVINTERFACE_MOUSE, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT); ++ ++ for (idx = 0; SetupDiEnumDeviceInterfaces(set, NULL, &GUID_DEVINTERFACE_MOUSE, idx, &iface); ++idx) ++ { ++ static const RID_DEVICE_INFO_MOUSE mouse_info = {1, 5, 0, FALSE}; ++ ++ if (!(device = add_device(set, &iface))) ++ continue; ++ ++ device->info.dwType = RIM_TYPEMOUSE; ++ device->info.u.mouse = mouse_info; ++ } ++ ++ SetupDiDestroyDeviceInfoList(set); ++ ++ LeaveCriticalSection(&rawinput_devices_cs); + } + + /*********************************************************************** +@@ -218,18 +241,18 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun + return ~0U; + } + +- find_hid_devices(); ++ find_devices(); + + if (!devices) + { +- *device_count = 2 + hid_devices_count; ++ *device_count = 2 + rawinput_devices_count; + return 0; + } + +- if (*device_count < 2 + hid_devices_count) ++ if (*device_count < 2 + rawinput_devices_count) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); +- *device_count = 2 + hid_devices_count; ++ *device_count = 2 + rawinput_devices_count; + return ~0U; + } + +@@ -238,13 +261,13 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun + devices[1].hDevice = WINE_KEYBOARD_HANDLE; + devices[1].dwType = RIM_TYPEKEYBOARD; + +- for (i = 0; i < hid_devices_count; ++i) ++ for (i = 0; i < rawinput_devices_count; ++i) + { +- devices[2 + i].hDevice = &hid_devices[i]; +- devices[2 + i].dwType = RIM_TYPEHID; ++ devices[2 + i].hDevice = &rawinput_devices[i]; ++ devices[2 + i].dwType = rawinput_devices[i].info.dwType; + } + +- return 2 + hid_devices_count; ++ return 2 + rawinput_devices_count; + } + + /*********************************************************************** +@@ -386,41 +409,41 @@ UINT WINAPI GetRawInputDeviceInfoA(HANDLE device, UINT command, void *data, UINT + /*********************************************************************** + * GetRawInputDeviceInfoW (USER32.@) + */ +-UINT WINAPI GetRawInputDeviceInfoW(HANDLE device, UINT command, void *data, UINT *data_size) ++UINT WINAPI GetRawInputDeviceInfoW(HANDLE handle, UINT command, void *data, UINT *data_size) + { + /* FIXME: Most of this is made up. */ + static const WCHAR keyboard_name[] = {'\\','\\','?','\\','W','I','N','E','_','K','E','Y','B','O','A','R','D',0}; + static const WCHAR mouse_name[] = {'\\','\\','?','\\','W','I','N','E','_','M','O','U','S','E',0}; + static const RID_DEVICE_INFO_KEYBOARD keyboard_info = {0, 0, 1, 12, 3, 101}; + static const RID_DEVICE_INFO_MOUSE mouse_info = {1, 5, 0, FALSE}; +- struct hid_device *hid_device; + const WCHAR *name = NULL; + RID_DEVICE_INFO *info; ++ struct device *device; + UINT s; + +- TRACE("device %p, command %#x, data %p, data_size %p.\n", +- device, command, data, data_size); ++ TRACE("handle %p, command %#x, data %p, data_size %p.\n", ++ handle, command, data, data_size); + + if (!data_size) return ~0U; + + switch (command) + { + case RIDI_DEVICENAME: +- if (device == WINE_MOUSE_HANDLE) ++ if (handle == WINE_MOUSE_HANDLE) + { + s = ARRAY_SIZE(mouse_name); + name = mouse_name; + } +- else if (device == WINE_KEYBOARD_HANDLE) ++ else if (handle == WINE_KEYBOARD_HANDLE) + { + s = ARRAY_SIZE(keyboard_name); + name = keyboard_name; + } + else + { +- hid_device = device; +- s = strlenW(hid_device->path) + 1; +- name = hid_device->path; ++ device = handle; ++ s = strlenW(device->path) + 1; ++ name = device->path; + } + break; + case RIDI_DEVICEINFO: +@@ -450,21 +473,20 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE device, UINT command, void *data, UINT + + info = data; + info->cbSize = sizeof(*info); +- if (device == WINE_MOUSE_HANDLE) ++ if (handle == WINE_MOUSE_HANDLE) + { + info->dwType = RIM_TYPEMOUSE; + info->u.mouse = mouse_info; + } +- else if (device == WINE_KEYBOARD_HANDLE) ++ else if (handle == WINE_KEYBOARD_HANDLE) + { + info->dwType = RIM_TYPEKEYBOARD; + info->u.keyboard = keyboard_info; + } + else + { +- hid_device = device; +- info->dwType = RIM_TYPEHID; +- info->u.hid = hid_device->info; ++ device = handle; ++ *info = device->info; + } + return s; + } +diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c +index d0dc4a8bcf..78f46bb6ba 100644 +--- a/dlls/user32/tests/input.c ++++ b/dlls/user32/tests/input.c +@@ -1670,7 +1670,7 @@ static void test_GetRawInputDeviceList(void) + * understand that; so use the \\?\ prefix instead */ + name[1] = '\\'; + file = CreateFileW(name, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); +- todo_wine_if(info.dwType != RIM_TYPEHID) ++ todo_wine_if(i == 0 || i == 1) + ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %u\n", wine_dbgstr_w(name), GetLastError()); + CloseHandle(file); + } +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0018-d3drm-Correct-paramater-count-of-several-interface-d.patch b/patches/mailing-list-patches/0018-d3drm-Correct-paramater-count-of-several-interface-d.patch new file mode 100644 index 00000000..ea5e9fdd --- /dev/null +++ b/patches/mailing-list-patches/0018-d3drm-Correct-paramater-count-of-several-interface-d.patch @@ -0,0 +1,72 @@ +From 79c6b2c90c4935a648db1320fb0c354ca3adc138 Mon Sep 17 00:00:00 2001 +From: Jeff Smith +Date: Mon, 8 Jul 2019 14:40:23 -0500 +Subject: [PATCH] d3drm: Correct paramater count of several interface defines. + +Signed-off-by: Henri Verbeet +--- + include/d3drm.h | 16 ++++++++-------- + include/d3drmobj.h | 6 +++--- + 2 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/include/d3drm.h b/include/d3drm.h +index 126695cea1..c10b9ed18c 100644 +--- a/include/d3drm.h ++++ b/include/d3drm.h +@@ -322,7 +322,7 @@ DECLARE_INTERFACE_(IDirect3DRM2,IUnknown) + #define IDirect3DRM2_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b) + #define IDirect3DRM2_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j) + #define IDirect3DRM2_Tick(p,a) (p)->Tick(a) +-#define IDirect3DRM2_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(p,a) ++#define IDirect3DRM2_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(a) + #endif + + /***************************************************************************** +@@ -434,7 +434,7 @@ DECLARE_INTERFACE_(IDirect3DRM3,IUnknown) + #define IDirect3DRM3_CreateProgressiveMesh(p,a) (p)->lpVtbl->CreateProgressiveMesh(p,a) + #define IDirect3DRM3_RegisterClient(p,a,b) (p)->lpVtbl->RegisterClient(p,a,b) + #define IDirect3DRM3_UnregisterClient(p,a) (p)->lpVtbl->UnregisterClient(p,a) +-#define IDirect3DRM3_CreateClippedVisual(p,ab) (p)->lpVtbl->CreateClippedVisual(p,a,b) ++#define IDirect3DRM3_CreateClippedVisual(p,a,b) (p)->lpVtbl->CreateClippedVisual(p,a,b) + #define IDirect3DRM3_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) + #define IDirect3DRM3_GetOptions(p,a) (p)->lpVtbl->GetOptions(p,a) + #else +@@ -475,12 +475,12 @@ DECLARE_INTERFACE_(IDirect3DRM3,IUnknown) + #define IDirect3DRM3_EnumerateObjects(p,a,b) (p)->EnumerateObjects(a,b) + #define IDirect3DRM3_Load(p,a,b,c,d,e,f,g,h,i,j) (p)->Load(a,b,c,d,e,f,g,h,i,j) + #define IDirect3DRM3_Tick(p,a) (p)->Tick(a) +-#define IDirect3DRM3_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(p,a) +-#define IDirect3DRM3_RegisterClient(p,a,b) (p)->RegisterClient(p,a,b) +-#define IDirect3DRM3_UnregisterClient(p,a) (p)->UnregisterClient(p,a) +-#define IDirect3DRM3_CreateClippedVisual(p,ab) (p)->CreateClippedVisual(p,a,b) +-#define IDirect3DRM3_SetOptions(p,a) (p)->SetOptions(p,a) +-#define IDirect3DRM3_GetOptions(p,a) (p)->GetOptions(p,a) ++#define IDirect3DRM3_CreateProgressiveMesh(p,a) (p)->CreateProgressiveMesh(a) ++#define IDirect3DRM3_RegisterClient(p,a,b) (p)->RegisterClient(a,b) ++#define IDirect3DRM3_UnregisterClient(p,a) (p)->UnregisterClient(a) ++#define IDirect3DRM3_CreateClippedVisual(p,a,b) (p)->CreateClippedVisual(a,b) ++#define IDirect3DRM3_SetOptions(p,a) (p)->SetOptions(a) ++#define IDirect3DRM3_GetOptions(p,a) (p)->GetOptions(a) + #endif + + #define D3DRM_OK DD_OK +diff --git a/include/d3drmobj.h b/include/d3drmobj.h +index 5ff33fea01..7e48d9891d 100644 +--- a/include/d3drmobj.h ++++ b/include/d3drmobj.h +@@ -3616,9 +3616,9 @@ DECLARE_INTERFACE_(IDirect3DRMWrap, IDirect3DRMObject) + #define IDirect3DRMWrap_GetName(p,a,b) (p)->GetName(a,b) + #define IDirect3DRMWrap_GetClassName(p,a,b) (p)->GetClassName(a,b) + /*** IDirect3DRMWrap methods ***/ +-#define IDirect3DRMWrap_Init(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) (p)->Init(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) +-#define IDirect3DRMWrap_Apply(p,a) (p)->Apply(p,a) +-#define IDirect3DRMWrap_ApplyRelative(p,a,b) (p)->ApplyRelative(p,a,b) ++#define IDirect3DRMWrap_Init(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) (p)->Init(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) ++#define IDirect3DRMWrap_Apply(p,a) (p)->Apply(a) ++#define IDirect3DRMWrap_ApplyRelative(p,a,b) (p)->ApplyRelative(a,b) + #endif + + /***************************************************************************** +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0019-shell32-add-SHMultiFileProperties-stub.patch b/patches/mailing-list-patches/0019-shell32-add-SHMultiFileProperties-stub.patch new file mode 100644 index 00000000..3625f3f7 --- /dev/null +++ b/patches/mailing-list-patches/0019-shell32-add-SHMultiFileProperties-stub.patch @@ -0,0 +1,48 @@ +From 79d72547489b6420aba533c4fb6a513e8854fcd4 Mon Sep 17 00:00:00 2001 +From: Austin English +Date: Tue, 9 Jul 2019 01:07:21 -0500 +Subject: [PATCH] shell32: add SHMultiFileProperties stub + +Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47411 +Signed-off-by: Austin English +--- + dlls/shell32/shell32.spec | 1 + + dlls/shell32/shlfileop.c | 10 ++++++++++ + 2 files changed, 11 insertions(+) + +diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec +index 7ed7bb531d..5331ffff94 100644 +--- a/dlls/shell32/shell32.spec ++++ b/dlls/shell32/shell32.spec +@@ -409,6 +409,7 @@ + @ stdcall SHIsFileAvailableOffline(wstr ptr) + @ stdcall SHLoadInProc(ptr) + @ stdcall SHLoadNonloadedIconOverlayIdentifiers() ++@ stdcall SHMultiFileProperties(ptr long) + @ stdcall SHOpenFolderAndSelectItems(ptr long ptr long) + @ stdcall SHOpenWithDialog(long ptr) + @ stdcall SHParseDisplayName(wstr ptr ptr long ptr) +diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c +index 1515ad3891..22e1b523e0 100644 +--- a/dlls/shell32/shlfileop.c ++++ b/dlls/shell32/shlfileop.c +@@ -1727,6 +1727,16 @@ int WINAPI RealDriveType(int drive, BOOL bQueryNet) + return GetDriveTypeA(root); + } + ++/************************************************************************* ++ * SHMultiFileProperties [SHELL32.@] ++ */ ++ ++HRESULT WINAPI SHMultiFileProperties(IDataObject *pdtobj, DWORD flags) ++{ ++ FIXME("stub: %p %u\n", pdtobj, flags); ++ return E_NOTIMPL; ++} ++ + /*********************************************************************** + * SHPathPrepareForWriteA (SHELL32.@) + */ +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0020-winebus.sys-Report-the-native-product-string-for-som.patch b/patches/mailing-list-patches/0020-winebus.sys-Report-the-native-product-string-for-som.patch new file mode 100644 index 00000000..22b7f698 --- /dev/null +++ b/patches/mailing-list-patches/0020-winebus.sys-Report-the-native-product-string-for-som.patch @@ -0,0 +1,157 @@ +From a4fda32d2dc0115017f3fa87413d84a08d193328 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Bernon?= +Date: Tue, 9 Jul 2019 11:12:07 +0200 +Subject: [PATCH] winebus.sys: Report the native product string for some Xbox + gamepads +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some games are checking the hid product string of connected gamepads in +order to decide whether or not to activate rumble. + +Wine usually delegates these queries to the backend driver, but they +don't always report the same product strings as on Windows. This will +allow to override backend strings with the actual strings as reported +by native drivers. + +Signed-off-by: Rémi Bernon +--- + dlls/winebus.sys/main.c | 98 ++++++++++++++++++++++++++++++++++------- + 1 file changed, 81 insertions(+), 17 deletions(-) + +diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c +index 26200bde3e..12ff0b3e15 100644 +--- a/dlls/winebus.sys/main.c ++++ b/dlls/winebus.sys/main.c +@@ -49,22 +49,39 @@ WINE_DECLARE_DEBUG_CHANNEL(hid_report); + + static const WCHAR backslashW[] = {'\\',0}; + ++struct product_desc ++{ ++ WORD vid; ++ WORD pid; ++ const WCHAR* manufacturer; ++ const WCHAR* product; ++ const WCHAR* serialnumber; ++}; ++ + #define VID_MICROSOFT 0x045e + +-static const WORD PID_XBOX_CONTROLLERS[] = { +- 0x0202, /* Xbox Controller */ +- 0x0285, /* Xbox Controller S */ +- 0x0289, /* Xbox Controller S */ +- 0x028e, /* Xbox360 Controller */ +- 0x028f, /* Xbox360 Wireless Controller */ +- 0x02d1, /* Xbox One Controller */ +- 0x02dd, /* Xbox One Controller (Covert Forces/Firmware 2015) */ +- 0x02e0, /* Xbox One X Controller */ +- 0x02e3, /* Xbox One Elite Controller */ +- 0x02e6, /* Wireless XBox Controller Dongle */ +- 0x02ea, /* Xbox One S Controller */ +- 0x02fd, /* Xbox One S Controller (Firmware 2017) */ +- 0x0719, /* Xbox 360 Wireless Adapter */ ++static const WCHAR xbox360_product_string[] = { ++ 'C','o','n','t','r','o','l','l','e','r',' ','(','X','B','O','X',' ','3','6','0',' ','F','o','r',' ','W','i','n','d','o','w','s',')',0 ++}; ++ ++static const WCHAR xboxone_product_string[] = { ++ 'C','o','n','t','r','o','l','l','e','r',' ','(','X','B','O','X',' ','O','n','e',' ','F','o','r',' ','W','i','n','d','o','w','s',')',0 ++}; ++ ++static const struct product_desc XBOX_CONTROLLERS[] = { ++ {VID_MICROSOFT, 0x0202, NULL, NULL, NULL}, /* Xbox Controller */ ++ {VID_MICROSOFT, 0x0285, NULL, NULL, NULL}, /* Xbox Controller S */ ++ {VID_MICROSOFT, 0x0289, NULL, NULL, NULL}, /* Xbox Controller S */ ++ {VID_MICROSOFT, 0x028e, NULL, xbox360_product_string, NULL}, /* Xbox360 Controller */ ++ {VID_MICROSOFT, 0x028f, NULL, xbox360_product_string, NULL}, /* Xbox360 Wireless Controller */ ++ {VID_MICROSOFT, 0x02d1, NULL, xboxone_product_string, NULL}, /* Xbox One Controller */ ++ {VID_MICROSOFT, 0x02dd, NULL, xboxone_product_string, NULL}, /* Xbox One Controller (Covert Forces/Firmware 2015) */ ++ {VID_MICROSOFT, 0x02e0, NULL, NULL, NULL}, /* Xbox One X Controller */ ++ {VID_MICROSOFT, 0x02e3, NULL, xboxone_product_string, NULL}, /* Xbox One Elite Controller */ ++ {VID_MICROSOFT, 0x02e6, NULL, NULL, NULL}, /* Wireless XBox Controller Dongle */ ++ {VID_MICROSOFT, 0x02ea, NULL, xboxone_product_string, NULL}, /* Xbox One S Controller */ ++ {VID_MICROSOFT, 0x02fd, NULL, xboxone_product_string, NULL}, /* Xbox One S Controller (Firmware 2017) */ ++ {VID_MICROSOFT, 0x0719, NULL, xbox360_product_string, NULL}, /* Xbox 360 Wireless Adapter */ + }; + + static DRIVER_OBJECT *driver_obj; +@@ -565,6 +582,51 @@ static NTSTATUS deliver_last_report(struct device_extension *ext, DWORD buffer_l + } + } + ++static NTSTATUS hid_get_native_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length) ++{ ++ struct device_extension *ext = (struct device_extension *)device->DeviceExtension; ++ int i; ++ ++ if (ext->vid == VID_MICROSOFT) ++ { ++ for (i = 0; i < ARRAY_SIZE(XBOX_CONTROLLERS); i++) ++ { ++ if (ext->pid == XBOX_CONTROLLERS[i].pid) ++ break; ++ } ++ ++ if (i >= ARRAY_SIZE(XBOX_CONTROLLERS)) ++ return STATUS_UNSUCCESSFUL; ++ ++ switch (index) ++ { ++ case HID_STRING_ID_IPRODUCT: ++ if (XBOX_CONTROLLERS[i].product) ++ { ++ strcpyW(buffer, XBOX_CONTROLLERS[i].product); ++ return STATUS_SUCCESS; ++ } ++ break; ++ case HID_STRING_ID_IMANUFACTURER: ++ if (XBOX_CONTROLLERS[i].manufacturer) ++ { ++ strcpyW(buffer, XBOX_CONTROLLERS[i].manufacturer); ++ return STATUS_SUCCESS; ++ } ++ break; ++ case HID_STRING_ID_ISERIALNUMBER: ++ if (XBOX_CONTROLLERS[i].serialnumber) ++ { ++ strcpyW(buffer, XBOX_CONTROLLERS[i].serialnumber); ++ return STATUS_SUCCESS; ++ } ++ break; ++ } ++ } ++ ++ return STATUS_UNSUCCESSFUL; ++} ++ + static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp) + { + NTSTATUS status = irp->IoStatus.u.Status; +@@ -650,7 +712,9 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp) + DWORD index = (ULONG_PTR)irpsp->Parameters.DeviceIoControl.Type3InputBuffer; + TRACE("IOCTL_HID_GET_STRING[%08x]\n", index); + +- irp->IoStatus.u.Status = status = ext->vtbl->get_string(device, index, (WCHAR *)irp->UserBuffer, length); ++ irp->IoStatus.u.Status = status = hid_get_native_string(device, index, (WCHAR *)irp->UserBuffer, length); ++ if (status != STATUS_SUCCESS) ++ irp->IoStatus.u.Status = status = ext->vtbl->get_string(device, index, (WCHAR *)irp->UserBuffer, length); + if (status == STATUS_SUCCESS) + irp->IoStatus.Information = (strlenW((WCHAR *)irp->UserBuffer) + 1) * sizeof(WCHAR); + break; +@@ -815,8 +879,8 @@ BOOL is_xbox_gamepad(WORD vid, WORD pid) + if (vid != VID_MICROSOFT) + return FALSE; + +- for (i = 0; i < ARRAY_SIZE(PID_XBOX_CONTROLLERS); i++) +- if (pid == PID_XBOX_CONTROLLERS[i]) return TRUE; ++ for (i = 0; i < ARRAY_SIZE(XBOX_CONTROLLERS); i++) ++ if (pid == XBOX_CONTROLLERS[i].pid) return TRUE; + + return FALSE; + } +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0021-Define-AT_NO_AUTOMOUNT-if-needed.patch b/patches/mailing-list-patches/0021-Define-AT_NO_AUTOMOUNT-if-needed.patch new file mode 100644 index 00000000..83dbffcd --- /dev/null +++ b/patches/mailing-list-patches/0021-Define-AT_NO_AUTOMOUNT-if-needed.patch @@ -0,0 +1,34 @@ +From e5074e5038ec7f41752133a35c0f36ef9c25d719 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= +Date: Tue, 9 Jul 2019 14:19:01 +0300 +Subject: [PATCH] Define AT_NO_AUTOMOUNT if needed. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Old kernel headers don't define this flag, so we do it ourselves in that case. + +Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47445 +Signed-off-by: Gabriel Ivăncescu +--- + dlls/ntdll/directory.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c +index b50d41bb80..e3f805a48f 100644 +--- a/dlls/ntdll/directory.c ++++ b/dlls/ntdll/directory.c +@@ -142,6 +142,10 @@ typedef struct + # define O_DIRECTORY 0200000 /* must be directory */ + #endif + ++#ifndef AT_NO_AUTOMOUNT ++#define AT_NO_AUTOMOUNT 0x800 ++#endif ++ + #endif /* linux */ + + #define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1') +-- +2.17.1 + diff --git a/patches/mailing-list-patches/0022-gdi32-Use-the-correct-type-for-the-final-parameter-o.patch b/patches/mailing-list-patches/0022-gdi32-Use-the-correct-type-for-the-final-parameter-o.patch new file mode 100644 index 00000000..79bc94eb --- /dev/null +++ b/patches/mailing-list-patches/0022-gdi32-Use-the-correct-type-for-the-final-parameter-o.patch @@ -0,0 +1,29 @@ +From 6d875bc78fbd10ff70a51d8c1a937711d0b32f25 Mon Sep 17 00:00:00 2001 +From: Huw Davies +Date: Wed, 10 Jul 2019 09:50:17 +0100 +Subject: [PATCH] gdi32: Use the correct type for the final parameter of + FSOpenResourceFile(). + +This is SInt16 for 32-bit, but int for 64-bit. + +Signed-off-by: Huw Davies +--- + dlls/gdi32/freetype.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c +index 1162ea790d..e3cff25b76 100644 +--- a/dlls/gdi32/freetype.c ++++ b/dlls/gdi32/freetype.c +@@ -818,7 +818,7 @@ static char *find_cache_dir(void) + static char **expand_mac_font(const char *path) + { + FSRef ref; +- SInt16 res_ref; ++ ResFileRefNum res_ref; + OSStatus s; + unsigned int idx; + const char *out_dir; +-- +2.17.1 + diff --git a/patches/mailing-list-patches/definition b/patches/mailing-list-patches/definition new file mode 100644 index 00000000..332a89d8 --- /dev/null +++ b/patches/mailing-list-patches/definition @@ -0,0 +1,3 @@ +# These patches will either be dropped or moved to there own directoryes by wine release 4.14. +Fixes: Mailing list patches + diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index bbba37e7..180c2649 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -168,6 +168,7 @@ patch_enable_all () enable_libs_Debug_Channel="$1" enable_libs_Unicode_Collation="$1" enable_loader_KeyboardLayouts="$1" + enable_mailing_list_patches="$1" enable_mmsystem_dll16_MIDIHDR_Refcount="$1" enable_mountmgr_DosDevices="$1" enable_mscoree_CorValidateImage="$1" @@ -634,6 +635,9 @@ patch_enable () loader-KeyboardLayouts) enable_loader_KeyboardLayouts="$2" ;; + mailing-list-patches) + enable_mailing_list_patches="$2" + ;; mmsystem.dll16-MIDIHDR_Refcount) enable_mmsystem_dll16_MIDIHDR_Refcount="$2" ;; @@ -2033,6 +2037,13 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then enable_advapi32_CreateRestrictedToken=1 fi +if test "$enable_Compiler_Warnings" -eq 1; then + if test "$enable_mailing_list_patches" -gt 1; then + abort "Patchset mailing-list-patches disabled, but Compiler_Warnings depends on that." + fi + enable_mailing_list_patches=1 +fi + # If autoupdate is enabled then create a tempfile to keep track of all patches if test "$enable_patchlist" -eq 1; then @@ -2049,8 +2060,73 @@ if test "$enable_patchlist" -eq 1; then fi +# Patchset mailing-list-patches +# | +# | Modified files: +# | * configure.ac, dlls/cryptext/Makefile.in, dlls/cryptext/cryptext.spec, dlls/cryptext/cryptext_main.c, +# | dlls/cryptext/tests/Makefile.in, dlls/cryptext/tests/cryptext.c, dlls/d3drm/tests/d3drm.c, dlls/d3drm/viewport.c, +# | dlls/dxgi/swapchain.c, dlls/dxgi/tests/dxgi.c, dlls/evr/Makefile.in, dlls/evr/evr.c, dlls/evr/main.c, +# | dlls/gdi32/freetype.c, dlls/ntdll/directory.c, dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl_private.h, +# | dlls/ntoskrnl.exe/pnp.c, dlls/qedit/Makefile.in, dlls/shell32/shell32.spec, dlls/shell32/shlfileop.c, +# | dlls/strmbase/strmbase_private.h, dlls/user32/rawinput.c, dlls/user32/tests/input.c, dlls/winebus.sys/bus.h, +# | dlls/winebus.sys/bus_iohid.c, dlls/winebus.sys/bus_sdl.c, dlls/winebus.sys/bus_udev.c, dlls/winebus.sys/main.c, +# | include/d3drm.h, include/d3drmobj.h, loader/Makefile.in, loader/wine.inf.in, loader/winebus.inf.in, +# | programs/wineboot/Makefile.in, programs/wineboot/wineboot.c +# | +if test "$enable_mailing_list_patches" -eq 1; then + patch_apply mailing-list-patches/0001-winebus.inf-Add-new-INF-file-and-copy-it-to-the-INF-.patch + patch_apply mailing-list-patches/0002-winebus.sys-Implement-AddDevice.patch + patch_apply mailing-list-patches/0003-wineboot-Create-a-root-enumerated-device-object-for-.patch + patch_apply mailing-list-patches/0004-winebus.sys-Initialize-and-teardown-the-HID-backends.patch + patch_apply mailing-list-patches/0005-ntoskrnl.exe-IoInvalidateDeviceRelations-receives-th.patch + patch_apply mailing-list-patches/0006-cryptext-Implement-CryptExtOpenCER.patch + patch_apply mailing-list-patches/0007-dxgi-tests-Test-output-after-using-Alt-Enter-to-swit.patch + patch_apply mailing-list-patches/0008-dxgi-Fix-possible-null-output-from-d3d11_swapchain_G.patch + patch_apply mailing-list-patches/0009-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch + patch_apply mailing-list-patches/0010-d3drm-Check-for-NULL-pointer-in-d3drm_viewport2_GetD.patch + patch_apply mailing-list-patches/0011-d3drm-Return-error-if-setting-viewport-field-of-view.patch + patch_apply mailing-list-patches/0012-strmbase-Remove-unused-wine-unicode.h-import.patch + patch_apply mailing-list-patches/0013-qedit-Build-with-msvcrt.patch + patch_apply mailing-list-patches/0014-qedit-Share-source-with-strmbase.patch + patch_apply mailing-list-patches/0015-evr-Build-with-msvcrt.patch + patch_apply mailing-list-patches/0016-evr-Share-source-with-strmbase.patch + patch_apply mailing-list-patches/0017-user32-Also-scan-for-mouse-devices-in-GetRawInputDev.patch + patch_apply mailing-list-patches/0018-d3drm-Correct-paramater-count-of-several-interface-d.patch + patch_apply mailing-list-patches/0019-shell32-add-SHMultiFileProperties-stub.patch + patch_apply mailing-list-patches/0020-winebus.sys-Report-the-native-product-string-for-som.patch + patch_apply mailing-list-patches/0021-Define-AT_NO_AUTOMOUNT-if-needed.patch + patch_apply mailing-list-patches/0022-gdi32-Use-the-correct-type-for-the-final-parameter-o.patch + ( + printf '%s\n' '+ { "Zebediah Figura", "winebus.inf: Add new INF file and copy it to the INF directory.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "winebus.sys: Implement AddDevice().", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "wineboot: Create a root-enumerated device object for winebus.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "winebus.sys: Initialize and teardown the HID backends while the bus FDO is still extant.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "ntoskrnl.exe: IoInvalidateDeviceRelations() receives the parent PDO.", 1 },'; + printf '%s\n' '+ { "Dmitry Timoshkov", "cryptext: Implement CryptExtOpenCER.", 1 },'; + printf '%s\n' '+ { "Zhiyi Zhang", "dxgi/tests: Test output after using Alt+Enter to switch fullscreen.", 1 },'; + printf '%s\n' '+ { "Zhiyi Zhang", "dxgi: Fix possible null output from d3d11_swapchain_GetFullscreenState.", 1 },'; + printf '%s\n' '+ { "Jeff Smith", "d3drm: Check for NULL pointer in d3drm_viewport2_GetDevice().", 1 },'; + printf '%s\n' '+ { "Jeff Smith", "d3drm: Check for NULL pointer in d3drm_viewport2_GetDirect3DViewport().", 1 },'; + printf '%s\n' '+ { "Jeff Smith", "d3drm: Return error if setting viewport field-of-view to zero or negative value.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "strmbase: Remove unused wine/unicode.h import.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "qedit: Build with msvcrt.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "qedit: Share source with strmbase.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "evr: Build with msvcrt.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "evr: Share source with strmbase.", 1 },'; + printf '%s\n' '+ { "Zebediah Figura", "user32: Also scan for mouse devices in GetRawInputDeviceList().", 1 },'; + printf '%s\n' '+ { "Jeff Smith", "d3drm: Correct paramater count of several interface defines.", 1 },'; + printf '%s\n' '+ { "Austin English", "shell32: Add SHMultiFileProperties stub.", 1 },'; + printf '%s\n' '+ { "Rémi Bernon", "winebus.sys: Report the native product string for some Xbox gamepads.", 1 },'; + printf '%s\n' '+ { "Gabriel Ivăncescu", "Define AT_NO_AUTOMOUNT if needed.", 1 },'; + printf '%s\n' '+ { "Huw Davies", "gdi32: Use the correct type for the final parameter of FSOpenResourceFile().", 1 },'; + ) >> "$patchlist" +fi + # Patchset Compiler_Warnings # | +# | This patchset has the following (direct or indirect) dependencies: +# | * mailing-list-patches +# | # | Modified files: # | * dlls/d2d1/bitmap.c, dlls/d2d1/brush.c, dlls/d2d1/dc_render_target.c, dlls/d2d1/geometry.c, # | dlls/d2d1/hwnd_render_target.c, dlls/d2d1/state_block.c, dlls/d3d11/view.c, dlls/d3d8/texture.c, dlls/d3d9/texture.c, @@ -6503,7 +6579,7 @@ fi # | * [#17823] Assign a drive serial number during prefix creation/update # | # | Modified files: -# | * programs/wineboot/wineboot.c +# | * programs/wineboot/Makefile.in, programs/wineboot/wineboot.c # | if test "$enable_wineboot_DriveSerial" -eq 1; then patch_apply wineboot-DriveSerial/0001-wineboot-Assign-a-drive-serial-number-during-prefix-.patch @@ -6551,7 +6627,7 @@ fi # | * [#42024] Create ProxyEnable key on wineprefix update # | # | Modified files: -# | * programs/wineboot/Makefile.in, programs/wineboot/wineboot.c +# | * programs/wineboot/wineboot.c # | if test "$enable_wineboot_ProxySettings" -eq 1; then patch_apply wineboot-ProxySettings/0001-wineboot-Initialize-proxy-settings-registry-key.patch diff --git a/patches/wineboot-DriveSerial/0001-wineboot-Assign-a-drive-serial-number-during-prefix-.patch b/patches/wineboot-DriveSerial/0001-wineboot-Assign-a-drive-serial-number-during-prefix-.patch index 224052b4..7b044dff 100644 --- a/patches/wineboot-DriveSerial/0001-wineboot-Assign-a-drive-serial-number-during-prefix-.patch +++ b/patches/wineboot-DriveSerial/0001-wineboot-Assign-a-drive-serial-number-during-prefix-.patch @@ -1,4 +1,4 @@ -From d2e7f4fe7e71d2bba84f26e8055b0e0ca8cd1005 Mon Sep 17 00:00:00 2001 +From 58c943a9d3ffc3bd9feae35682710d408448d78a Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 25 May 2015 06:07:50 +0200 Subject: [PATCH] wineboot: Assign a drive serial number during prefix @@ -9,18 +9,18 @@ Subject: [PATCH] wineboot: Assign a drive serial number during prefix 1 file changed, 32 insertions(+) diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c -index 834bf92730f..af45f7ff9a9 100644 +index 5190dcc701..6e54bff187 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c -@@ -69,6 +69,7 @@ - #include +@@ -70,6 +70,7 @@ #include #include + #include +#include + #include #include "resource.h" - WINE_DEFAULT_DEBUG_CHANNEL(wineboot); -@@ -287,6 +288,36 @@ static void get_namestring( WCHAR *buf ) +@@ -293,6 +294,36 @@ static void get_namestring( WCHAR *buf ) for (i = lstrlenW(buf) - 1; i >= 0 && buf[i] == ' '; i--) buf[i] = 0; } @@ -57,7 +57,7 @@ index 834bf92730f..af45f7ff9a9 100644 /* create the volatile hardware registry keys */ static void create_hardware_registry_keys(void) { -@@ -1360,6 +1391,7 @@ int __cdecl main( int argc, char *argv[] ) +@@ -1420,6 +1451,7 @@ int __cdecl main( int argc, char *argv[] ) ResetEvent( event ); /* in case this is a restart */ @@ -66,5 +66,5 @@ index 834bf92730f..af45f7ff9a9 100644 create_dynamic_registry_keys(); create_environment_registry_keys(); -- -2.20.1 +2.17.1 diff --git a/patches/wineboot-ProxySettings/0001-wineboot-Initialize-proxy-settings-registry-key.patch b/patches/wineboot-ProxySettings/0001-wineboot-Initialize-proxy-settings-registry-key.patch index d714268e..f2e4c108 100644 --- a/patches/wineboot-ProxySettings/0001-wineboot-Initialize-proxy-settings-registry-key.patch +++ b/patches/wineboot-ProxySettings/0001-wineboot-Initialize-proxy-settings-registry-key.patch @@ -1,4 +1,4 @@ -From d22de677b47898569530c3989ed560e26075c027 Mon Sep 17 00:00:00 2001 +From 709d05ddf763bcfbcb708158a5302ba4e2587ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 26 Dec 2016 16:37:40 +0100 Subject: [PATCH] wineboot: Initialize proxy settings registry key. @@ -9,31 +9,31 @@ Subject: [PATCH] wineboot: Initialize proxy settings registry key. 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in -index eaea154057f..517010b6823 100644 +index 3921fa9644..9575b45bec 100644 --- a/programs/wineboot/Makefile.in +++ b/programs/wineboot/Makefile.in @@ -1,7 +1,7 @@ MODULE = wineboot.exe APPMODE = -mconsole IMPORTS = uuid advapi32 --DELAYIMPORTS = shell32 shlwapi version user32 -+DELAYIMPORTS = shell32 shlwapi version user32 wininet +-DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev ++DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev wininet EXTRADLLFLAGS = -mno-cygwin diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c -index fb67051e7d0..9302f8703a9 100644 +index ab255ac107..d85be900e0 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c -@@ -70,6 +70,7 @@ - #include +@@ -71,6 +71,7 @@ #include + #include #include +#include + #include #include "resource.h" - WINE_DEFAULT_DEBUG_CHANNEL(wineboot); -@@ -690,6 +691,13 @@ static void create_volatile_environment_registry_key(void) +@@ -595,6 +596,13 @@ static void create_volatile_environment_registry_key(void) RegCloseKey( hkey ); } @@ -47,7 +47,7 @@ index fb67051e7d0..9302f8703a9 100644 static void create_etc_stub_files(void) { static const WCHAR drivers_etcW[] = {'\\','d','r','i','v','e','r','s','\\','e','t','c',0}; -@@ -1548,6 +1556,7 @@ int __cdecl main( int argc, char *argv[] ) +@@ -1505,6 +1513,7 @@ int __cdecl main( int argc, char *argv[] ) if (init || update) update_wineprefix( update ); create_volatile_environment_registry_key(); @@ -56,5 +56,5 @@ index fb67051e7d0..9302f8703a9 100644 ProcessRunKeys( HKEY_LOCAL_MACHINE, RunOnceW, TRUE, TRUE ); -- -2.20.1 +2.17.1 diff --git a/patches/wineboot-drivers_etc_Stubs/0001-wineboot-Init-system32-drivers-etc-host-networks-pro.patch b/patches/wineboot-drivers_etc_Stubs/0001-wineboot-Init-system32-drivers-etc-host-networks-pro.patch index e3340134..33ea2805 100644 --- a/patches/wineboot-drivers_etc_Stubs/0001-wineboot-Init-system32-drivers-etc-host-networks-pro.patch +++ b/patches/wineboot-drivers_etc_Stubs/0001-wineboot-Init-system32-drivers-etc-host-networks-pro.patch @@ -1,4 +1,4 @@ -From 8502098a799563ce96eaa0ecc891f0ec3b905511 Mon Sep 17 00:00:00 2001 +From f1ad4754966ca722ec8f119e15ad789efaadb275 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 13 May 2015 06:58:16 +0200 Subject: [PATCH] wineboot: Init @@ -6,14 +6,14 @@ Subject: [PATCH] wineboot: Init Based on a patch by Jactry Zeng. --- - programs/wineboot/wineboot.c | 38 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) + programs/wineboot/wineboot.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c -index 0fc762096df..fb67051e7d0 100644 +index fc3211c9fd0..374ad3b0479 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c -@@ -690,6 +690,41 @@ static void create_volatile_environment_registry_key(void) +@@ -696,6 +696,41 @@ static void create_volatile_environment_registry_key(void) RegCloseKey( hkey ); } @@ -55,16 +55,14 @@ index 0fc762096df..fb67051e7d0 100644 /* Performs the rename operations dictated in %SystemRoot%\Wininit.ini. * Returns FALSE if there was an error, or otherwise if all is ok. */ -@@ -1287,6 +1322,9 @@ static void update_wineprefix( BOOL force ) - } - DestroyWindow( hwnd ); +@@ -1346,6 +1381,7 @@ static void update_wineprefix( BOOL force ) } -+ + + install_root_pnp_devices(); + create_etc_stub_files(); -+ + WINE_MESSAGE( "wine: configuration in '%s' has been updated.\n", prettyprint_configdir() ); } - -- -2.20.1 +2.17.1