From b594ebe2e7535741bc52b1da27a4dfa8647c52e4 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Mon, 22 Dec 2014 20:36:56 -0700 Subject: [PATCH] Added patch to expect the correct buffer size for different IOCTL_DVD_READ_STRUCTURE requests. --- README.md | 3 +- debian/changelog | 1 + patches/Makefile | 13 +++++ ...ed-IOCTL_DVD_READ_STRUCTURE-expected.patch | 51 +++++++++++++++++++ patches/ntdll-DVD_Read_Size/definition | 1 + 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch create mode 100644 patches/ntdll-DVD_Read_Size/definition diff --git a/README.md b/README.md index 04e949dc..44162bcb 100644 --- a/README.md +++ b/README.md @@ -37,13 +37,14 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [8]:** +**Bugfixes and features included in the next upcoming release [9]:** * Add stub for D3DXComputeTangentFrameEx ([Wine Bug #31984](https://bugs.winehq.org/show_bug.cgi?id=31984)) * Add stub for D3DXIntersect * Ensure X11 input events are handled even without explicit message loop ([Wine Bug #8854](https://bugs.winehq.org/show_bug.cgi?id=8854)) * Fix handling of subdirectory in FtpFindFirstFile ([Wine Bug #16526](https://bugs.winehq.org/show_bug.cgi?id=16526)) * GetMonitorInfo returns the same name for all monitors ([Wine Bug #37709](https://bugs.winehq.org/show_bug.cgi?id=37709)) +* IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests * Implement ID3DXEffect::FindNextValidTechnique ([Wine Bug #34101](https://bugs.winehq.org/show_bug.cgi?id=34101)) * Implement IDXGIOutput::GetDesc * Support for SLGetWindowsInformationDWORD ([Wine Bug #36709](https://bugs.winehq.org/show_bug.cgi?id=36709)) diff --git a/debian/changelog b/debian/changelog index ce22df49..c12f5415 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,5 @@ wine-staging (1.7.34) UNRELEASED; urgency=low + * Added patch to expect the correct buffer size for different IOCTL_DVD_READ_STRUCTURE requests. * Rename debian package from 'wine-compholio' to 'wine-staging' and provide compatibility package. * Avoid duplicate wined3d specfile by adding PARENTSPEC Makefile argument. * Fix issue in DOS Attributes patch which broke ./configure on systems with alternative shells. diff --git a/patches/Makefile b/patches/Makefile index c47751a3..012df272 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -64,6 +64,7 @@ PATCHLIST := \ msvcp90-basic_string_wchar_dtor.ok \ msvcrt-atof_strtod.ok \ ntdll-DOS_Attributes.ok \ + ntdll-DVD_Read_Size.ok \ ntdll-DllRedirects.ok \ ntdll-Dynamic_DST.ok \ ntdll-Exception.ok \ @@ -941,6 +942,18 @@ ntdll-DOS_Attributes.ok: echo '+ { "Erich E. Hoover", "ntdll: Perform the Unix-style hidden file check within the unified file info grabbing routine.", 1 },'; \ ) > ntdll-DOS_Attributes.ok +# Patchset ntdll-DVD_Read_Size +# | +# | Modified files: +# | * dlls/ntdll/cdrom.c +# | +.INTERMEDIATE: ntdll-DVD_Read_Size.ok +ntdll-DVD_Read_Size.ok: + $(call APPLY_FILE,ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch) + @( \ + echo '+ { "Erich E. Hoover", "ntdll: Fix expected IOCTL_DVD_READ_STRUCTURE expected output size.", 1 },'; \ + ) > ntdll-DVD_Read_Size.ok + # Patchset ntdll-DllRedirects # | # | Modified files: diff --git a/patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch b/patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch new file mode 100644 index 00000000..7bbc1278 --- /dev/null +++ b/patches/ntdll-DVD_Read_Size/0001-ntdll-Fix-expected-IOCTL_DVD_READ_STRUCTURE-expected.patch @@ -0,0 +1,51 @@ +From 162a8926d371810046a9b651675672a4e9f6aeb2 Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Mon, 22 Dec 2014 20:32:29 -0700 +Subject: ntdll: Fix expected IOCTL_DVD_READ_STRUCTURE expected output size. + +--- + dlls/ntdll/cdrom.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c +index 62c3d16..7101e43 100644 +--- a/dlls/ntdll/cdrom.c ++++ b/dlls/ntdll/cdrom.c +@@ -2492,6 +2492,25 @@ static NTSTATUS DVD_GetRegion(int fd, PDVD_REGION region) + #endif + } + ++static DWORD DVD_ReadStructureSize(const DVD_READ_STRUCTURE *structure) ++{ ++ switch (structure->Format) ++ { ++ case DvdPhysicalDescriptor: ++ return sizeof(DVD_LAYER_DESCRIPTOR); ++ case DvdCopyrightDescriptor: ++ return sizeof(DVD_COPYRIGHT_DESCRIPTOR); ++ case DvdDiskKeyDescriptor: ++ return sizeof(DVD_DISK_KEY_DESCRIPTOR); ++ case DvdBCADescriptor: ++ return sizeof(DVD_BCA_DESCRIPTOR); ++ case DvdManufacturerDescriptor: ++ return sizeof(DVD_MANUFACTURER_DESCRIPTOR); ++ default: ++ return 0; ++ } ++} ++ + /****************************************************************** + * DVD_ReadStructure + * +@@ -3095,7 +3114,7 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice, + status = DVD_GetRegion(fd, lpOutBuffer); + break; + case IOCTL_DVD_READ_STRUCTURE: +- sz = sizeof(DVD_LAYER_DESCRIPTOR); ++ sz = DVD_ReadStructureSize(lpInBuffer); + if (lpInBuffer == NULL || nInBufferSize != sizeof(DVD_READ_STRUCTURE)) status = STATUS_INVALID_PARAMETER; + else if (nOutBufferSize < sz || !lpOutBuffer) status = STATUS_BUFFER_TOO_SMALL; + else +-- +1.9.1 + diff --git a/patches/ntdll-DVD_Read_Size/definition b/patches/ntdll-DVD_Read_Size/definition new file mode 100644 index 00000000..1a6f0478 --- /dev/null +++ b/patches/ntdll-DVD_Read_Size/definition @@ -0,0 +1 @@ +Fixes: IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests