Rebase against 744f7b69bf4692265588e10650090ca2f5129ccd.

This commit is contained in:
Sebastian Lackner 2015-07-10 16:27:10 +02:00
parent 174139f1ea
commit fb6baf5e83
11 changed files with 31 additions and 984 deletions

View File

@ -69,7 +69,7 @@ for more details.*
* Add stub for D3DXFrameFind ([Wine Bug #38334](https://bugs.winehq.org/show_bug.cgi?id=38334))
* Add stub for D3DXIntersect
* Add stub for NtSetLdtEntries/ZwSetLdtEntries ([Wine Bug #26268](https://bugs.winehq.org/show_bug.cgi?id=26268))
* Add stub for d3d11.D3D11CreateDeviceAndSwapChain ([Wine Bug #33153](https://bugs.winehq.org/show_bug.cgi?id=33153))
* ~~Add stub for d3d11.D3D11CreateDeviceAndSwapChain~~ ([Wine Bug #33153](https://bugs.winehq.org/show_bug.cgi?id=33153))
* Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163))
* Add stub for ntoskrnl.ExAcquireResourceExclusiveLite
* Add stub for ntoskrnl.ExDeleteResourceLite
@ -122,7 +122,7 @@ for more details.*
* Exception during start of fr-043 caused by missing DXTn support ([Wine Bug #37391](https://bugs.winehq.org/show_bug.cgi?id=37391))
* Expose PKEY_AudioEndpoint_PhysicalSpeakers device property in PulseAudio driver
* FEAR 1 installer expects basic_string_wchar_dtor to return NULL ([Wine Bug #37358](https://bugs.winehq.org/show_bug.cgi?id=37358))
* Fallback to global key state for threads without a queue ([Wine Bug #27238](https://bugs.winehq.org/show_bug.cgi?id=27238))
* ~~Fallback to global key state for threads without a queue~~ ([Wine Bug #27238](https://bugs.winehq.org/show_bug.cgi?id=27238))
* Fallback to system ping command when CAP_NET_RAW is not available ([Wine Bug #8332](https://bugs.winehq.org/show_bug.cgi?id=8332))
* Fix NULL dereference in ICSeqCompressFrameStart ([Wine Bug #27595](https://bugs.winehq.org/show_bug.cgi?id=27595))
* ~~Fix black screen on startup introduced by pixelformat changes.~~ ([Wine Bug #35950](https://bugs.winehq.org/show_bug.cgi?id=35950))
@ -258,7 +258,7 @@ for more details.*
* Support for NtSetInformationFile class FileLinkInformation
* Support for NtSetInformationFile class FileRenameInformation ([Wine Bug #30399](https://bugs.winehq.org/show_bug.cgi?id=30399))
* Support for PulseAudio backend for audio ([Wine Bug #10495](https://bugs.winehq.org/show_bug.cgi?id=10495))
* Support for RtlDecompressBuffer ([Wine Bug #37449](https://bugs.winehq.org/show_bug.cgi?id=37449))
* ~~Support for RtlDecompressBuffer~~ ([Wine Bug #37449](https://bugs.winehq.org/show_bug.cgi?id=37449))
* Support for SHCreateSessionKey ([Wine Bug #35630](https://bugs.winehq.org/show_bug.cgi?id=35630))
* Support for TransmitFile ([Wine Bug #5048](https://bugs.winehq.org/show_bug.cgi?id=5048))
* Support for WTSEnumerateProcessesW ([Wine Bug #29903](https://bugs.winehq.org/show_bug.cgi?id=29903))

View File

@ -1,46 +0,0 @@
From 84ef0e10eed439613ce503470eb000f79628fe6c Mon Sep 17 00:00:00 2001
From: Austin English <austinenglish@gmail.com>
Date: Tue, 23 Dec 2014 18:30:51 -0600
Subject: d3d11: add a stub for D3D11CreateDeviceAndSwapChain
---
dlls/d3d11/d3d11.spec | 2 +-
dlls/d3d11/d3d11_main.c | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/d3d11.spec b/dlls/d3d11/d3d11.spec
index 52d7bcb..2d6c877 100644
--- a/dlls/d3d11/d3d11.spec
+++ b/dlls/d3d11/d3d11.spec
@@ -3,7 +3,7 @@
@ stub D3D11CoreGetLayeredDeviceSize
@ stub D3D11CoreRegisterLayers
@ stdcall D3D11CreateDevice(ptr long ptr long ptr long long ptr ptr ptr)
-@ stub D3D11CreateDeviceAndSwapChain
+@ stdcall D3D11CreateDeviceAndSwapChain(ptr long ptr long ptr long long ptr ptr ptr ptr ptr)
@ stub D3DKMTCloseAdapter
@ stub D3DKMTCreateAllocation
@ stub D3DKMTCreateContext
diff --git a/dlls/d3d11/d3d11_main.c b/dlls/d3d11/d3d11_main.c
index ec8236f..bf8f42f 100644
--- a/dlls/d3d11/d3d11_main.c
+++ b/dlls/d3d11/d3d11_main.c
@@ -54,3 +54,15 @@ HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_t
flags, feature_levels, levels, sdk_version, device, feature_level, context);
return E_OUTOFMEMORY;
}
+
+HRESULT WINAPI D3D11CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_type,
+ HMODULE swrast, UINT flags, const D3D_FEATURE_LEVEL *feature_levels, UINT levels,
+ UINT sdk_version, const DXGI_SWAP_CHAIN_DESC *swapchain_desc, IDXGISwapChain **swapchain,
+ ID3D11Device **device, D3D_FEATURE_LEVEL *feature_level, ID3D11DeviceContext **immediate_context)
+{
+ FIXME("adapter %p, driver_type %s, swrast %p, flags %#x, feature_levels %p, levels %#x, sdk_version %d, "
+ "swapchain_desc %p, swapchain %p, device %p, feature_level %p, immediate_context %p stub!\n",
+ adapter, debug_d3d_driver_type(driver_type), swrast, flags, feature_levels, levels, sdk_version,
+ swapchain_desc, swapchain, device, feature_level, immediate_context);
+ return E_INVALIDARG;
+}
--
2.3.5

View File

@ -1,2 +0,0 @@
Fixes: [33153] Add stub for d3d11.D3D11CreateDeviceAndSwapChain
Category: stable

View File

@ -1,293 +0,0 @@
From 0955227f8eddd188b2c953d82224fc7c9de34ecd Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 9 Jul 2015 03:07:03 +0200
Subject: ntdll: Implement RtlDecompressFragment.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Based on a patch by Michael Müller.
For https://bugs.winehq.org/show_bug.cgi?id=37449
---
dlls/ntdll/ntdll.spec | 2 +-
dlls/ntdll/rtl.c | 214 +++++++++++++++++++++++++++++++++++-
dlls/ntdll/tests/rtl.c | 3 -
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +-
4 files changed, 210 insertions(+), 11 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 75dc647..ca3561d 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -513,7 +513,7 @@
@ stdcall RtlDecodePointer(ptr)
# @ stub RtlDecodeSystemPointer
@ stdcall RtlDecompressBuffer(long ptr long ptr long ptr)
-@ stub RtlDecompressFragment
+@ stdcall RtlDecompressFragment(long ptr long ptr long long ptr ptr)
@ stub RtlDefaultNpAcl
@ stub RtlDelete
@ stdcall RtlDeleteAce(ptr long)
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
index d9e448a..9a196d2 100644
--- a/dlls/ntdll/rtl.c
+++ b/dlls/ntdll/rtl.c
@@ -1309,17 +1309,219 @@ NTSTATUS WINAPI RtlCompressBuffer(USHORT format, PUCHAR uncompressed, ULONG unco
}
}
+/* decompress a single LZNT1 chunk */
+static PUCHAR lznt1_decompress_chunk(UCHAR *dst, ULONG dst_size, UCHAR *src, ULONG src_size)
+{
+ UCHAR *src_cur = src, *src_end = src + src_size;
+ UCHAR *dst_cur = dst, *dst_end = dst + dst_size;
+ ULONG displacement_bits, length_bits;
+ ULONG code_displacement, code_length;
+ WORD flags, code;
+
+ while (src_cur < src_end && dst_cur < dst_end)
+ {
+ flags = 0x8000 | *src_cur++;
+ while ((flags & 0xFF00) && src_cur < src_end)
+ {
+ if (flags & 1)
+ {
+ /* backwards reference */
+ if (src_cur + sizeof(WORD) > src_end)
+ return NULL;
+
+ code = *(WORD *)src_cur;
+ src_cur += sizeof(WORD);
+
+ /* find length / displacement bits */
+ for (displacement_bits = 12; displacement_bits > 4; displacement_bits--)
+ if ((1 << (displacement_bits - 1)) < dst_cur - dst) break;
+
+ length_bits = 16 - displacement_bits;
+ code_length = (code & ((1 << length_bits) - 1)) + 3;
+ code_displacement = (code >> length_bits) + 1;
+
+ if (dst_cur < dst + code_displacement)
+ return NULL;
+
+ /* copy bytes of chunk - we can't use memcpy()
+ * since source and dest can be overlapping */
+ while (code_length--)
+ {
+ if (dst_cur >= dst_end) return dst_cur;
+ *dst_cur = *(dst_cur - code_displacement);
+ dst_cur++;
+ }
+ }
+ else
+ {
+ /* uncompressed data */
+ if (dst_cur >= dst_end) return dst_cur;
+ *dst_cur++ = *src_cur++;
+ }
+ flags >>= 1;
+ }
+ }
+
+ return dst_cur;
+}
+
+/* decompress data encoded with LZNT1 */
+static NTSTATUS lznt1_decompress(UCHAR *dst, ULONG dst_size, UCHAR *src, ULONG src_size,
+ ULONG offset, ULONG *final_size, UCHAR *workspace)
+{
+ UCHAR *src_cur = src, *src_end = src + src_size;
+ UCHAR *dst_cur = dst, *dst_end = dst + dst_size;
+ ULONG chunk_size, block_size;
+ WORD chunk_header;
+ UCHAR *ptr;
+
+ if (src_cur + sizeof(WCHAR) > src_end)
+ return STATUS_BAD_COMPRESSION_BUFFER;
+
+ /* skip over chunks which have a distance >= 0x1000 to the destination offset */
+ while (offset >= 0x1000 && src_cur + sizeof(WCHAR) <= src_end)
+ {
+ chunk_header = *(WORD *)src_cur;
+ src_cur += sizeof(WCHAR);
+ if (!chunk_header) goto out;
+ chunk_size = (chunk_header & 0xFFF) + 1;
+
+ if (src_cur + chunk_size > src_end)
+ return STATUS_BAD_COMPRESSION_BUFFER;
+
+ src_cur += chunk_size;
+ offset -= 0x1000;
+ }
+
+ /* check if a chunk is included partially */
+ if (offset && src_cur + sizeof(WCHAR) <= src_end)
+ {
+ chunk_header = *(WORD *)src_cur;
+ src_cur += sizeof(WCHAR);
+ if (!chunk_header) goto out;
+ chunk_size = (chunk_header & 0xFFF) + 1;
+
+ if (src_cur + chunk_size > src_end)
+ return STATUS_BAD_COMPRESSION_BUFFER;
+
+ if (dst_cur >= dst_end)
+ goto out;
+
+ if (chunk_header & 0x8000)
+ {
+ /* compressed chunk */
+ if (!workspace) return STATUS_ACCESS_VIOLATION;
+ ptr = lznt1_decompress_chunk(workspace, 0x1000, src_cur, chunk_size);
+ if (!ptr) return STATUS_BAD_COMPRESSION_BUFFER;
+ if (ptr - workspace > offset)
+ {
+ block_size = min((ptr - workspace) - offset, dst_end - dst_cur);
+ memcpy(dst_cur, workspace + offset, block_size);
+ dst_cur += block_size;
+ }
+ }
+ else
+ {
+ /* uncompressed chunk */
+ if (chunk_size > offset)
+ {
+ block_size = min(chunk_size - offset, dst_end - dst_cur);
+ memcpy(dst_cur, src_cur + offset, block_size);
+ dst_cur += block_size;
+ }
+ }
+
+ src_cur += chunk_size;
+ }
+
+ /* remaining blocks */
+ while (src_cur + sizeof(WCHAR) <= src_end)
+ {
+ chunk_header = *(WORD *)src_cur;
+ src_cur += sizeof(WCHAR);
+ if (!chunk_header) goto out;
+ chunk_size = (chunk_header & 0xFFF) + 1;
+
+ if (src_cur + chunk_size > src_end)
+ return STATUS_BAD_COMPRESSION_BUFFER;
+
+ /* fill space with padding */
+ block_size = ((dst_cur - dst) + offset) & 0xFFF;
+ if (block_size)
+ {
+ block_size = 0x1000 - block_size;
+ if (dst_cur + block_size >= dst_end)
+ goto out;
+ memset(dst_cur, 0, block_size);
+ dst_cur += block_size;
+ }
+
+ if (dst_cur >= dst_end)
+ goto out;
+
+ if (chunk_header & 0x8000)
+ {
+ /* compressed chunk */
+ dst_cur = lznt1_decompress_chunk(dst_cur, dst_end - dst_cur, src_cur, chunk_size);
+ if (!dst_cur) return STATUS_BAD_COMPRESSION_BUFFER;
+ }
+ else
+ {
+ /* uncompressed chunk */
+ block_size = min(chunk_size, dst_end - dst_cur);
+ memcpy(dst_cur, src_cur, block_size);
+ dst_cur += block_size;
+ }
+
+ src_cur += chunk_size;
+ }
+
+out:
+ if (final_size)
+ *final_size = dst_cur - dst;
+
+ return STATUS_SUCCESS;
+
+}
+
+/******************************************************************************
+ * RtlDecompressFragment [NTDLL.@]
+ */
+NTSTATUS RtlDecompressFragment(USHORT format, PUCHAR uncompressed, ULONG uncompressed_size,
+ PUCHAR compressed, ULONG compressed_size, ULONG offset,
+ PULONG final_size, PVOID workspace)
+{
+ TRACE("0x%04x, %p, %u, %p, %u, %u, %p, %p\n", format, uncompressed,
+ uncompressed_size, compressed, compressed_size, offset, final_size, workspace);
+
+ switch (format & ~COMPRESSION_ENGINE_MAXIMUM)
+ {
+ case COMPRESSION_FORMAT_LZNT1:
+ return lznt1_decompress(uncompressed, uncompressed_size, compressed,
+ compressed_size, offset, final_size, workspace);
+
+ case COMPRESSION_FORMAT_NONE:
+ case COMPRESSION_FORMAT_DEFAULT:
+ return STATUS_INVALID_PARAMETER;
+
+ default:
+ FIXME("format %u not implemented\n", format);
+ return STATUS_UNSUPPORTED_COMPRESSION;
+ }
+}
+
+
/******************************************************************************
* RtlDecompressBuffer [NTDLL.@]
*/
-NTSTATUS WINAPI RtlDecompressBuffer(USHORT CompressionFormat, PUCHAR UncompressedBuffer,
- ULONG UncompressedBufferSize, PUCHAR CompressedBuffer,
- ULONG CompressedBufferSize, PULONG FinalUncompressedSize)
+NTSTATUS WINAPI RtlDecompressBuffer(USHORT format, PUCHAR uncompressed, ULONG uncompressed_size,
+ PUCHAR compressed, ULONG compressed_size, PULONG final_size)
{
- FIXME("0x%04x, %p, %u, %p, %u, %p :stub\n", CompressionFormat, UncompressedBuffer, UncompressedBufferSize,
- CompressedBuffer, CompressedBufferSize, FinalUncompressedSize);
+ TRACE("0x%04x, %p, %u, %p, %u, %p\n", format, uncompressed,
+ uncompressed_size, compressed, compressed_size, final_size);
- return STATUS_NOT_IMPLEMENTED;
+ return RtlDecompressFragment(format, uncompressed, uncompressed_size,
+ compressed, compressed_size, 0, final_size, NULL);
}
/***********************************************************************
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
index c6a7023..99fd413 100644
--- a/dlls/ntdll/tests/rtl.c
+++ b/dlls/ntdll/tests/rtl.c
@@ -1663,11 +1663,8 @@ static void test_RtlCompressBuffer(void)
memset(buf2, 0x11, sizeof(buf2));
status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf2, sizeof(buf2),
buf1, buf_size, &final_size);
- todo_wine
ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- todo_wine
ok(final_size == sizeof(test_buffer), "got wrong final_size %u\n", final_size);
- todo_wine
ok(!memcmp(buf2, test_buffer, sizeof(test_buffer)), "got wrong decoded data\n");
ok(buf2[sizeof(test_buffer)] == 0x11, "too many bytes written\n");
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index 11d1c62..0bb7d04 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -977,7 +977,7 @@
@ stub RtlCustomCPToUnicodeN
@ stdcall RtlDecompressBuffer(long ptr long ptr long ptr) ntdll.RtlDecompressBuffer
@ stub RtlDecompressChunks
-@ stub RtlDecompressFragment
+@ stdcall RtlDecompressFragment(long ptr long ptr long long ptr ptr) ntdll.RtlDecompressFragment
@ stub RtlDelete
@ stdcall RtlDeleteAce(ptr long) ntdll.RtlDeleteAce
@ stdcall RtlDeleteAtomFromAtomTable(ptr long) ntdll.RtlDeleteAtomFromAtomTable
--
2.4.5

View File

@ -1,389 +0,0 @@
From 2609aa20f4eea473a574d19d5a7d60598a8cc98e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 9 Jul 2015 03:07:40 +0200
Subject: ntdll/tests: Add tests for RtlDecompressBuffer.
---
dlls/ntdll/tests/rtl.c | 361 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 361 insertions(+)
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
index 99fd413..a1b9327 100644
--- a/dlls/ntdll/tests/rtl.c
+++ b/dlls/ntdll/tests/rtl.c
@@ -1717,6 +1717,366 @@ static void test_RtlGetCompressionWorkSpaceSize(void)
ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %u\n", decompress_workspace);
}
+/* helper for test_RtlDecompressBuffer, checks if a chunk is incomplete */
+static BOOL is_incomplete_chunk(const UCHAR *compressed, ULONG compressed_size, BOOL check_all)
+{
+ ULONG chunk_size;
+
+ if (compressed_size <= sizeof(WORD))
+ return TRUE;
+
+ while (compressed_size >= sizeof(WORD))
+ {
+ chunk_size = (*(WORD *)compressed & 0xFFF) + 1;
+ if (compressed_size < sizeof(WORD) + chunk_size)
+ return TRUE;
+ if (!check_all)
+ break;
+ compressed += sizeof(WORD) + chunk_size;
+ compressed_size -= sizeof(WORD) + chunk_size;
+ }
+
+ return FALSE;
+}
+
+#define DECOMPRESS_BROKEN_FRAGMENT 1 /* < Win 7 */
+#define DECOMPRESS_BROKEN_TRUNCATED 2 /* broken on all machines */
+
+static void test_RtlDecompressBuffer(void)
+{
+ static const struct
+ {
+ UCHAR compressed[32];
+ ULONG compressed_size;
+ NTSTATUS status;
+ UCHAR uncompressed[32];
+ ULONG uncompressed_size;
+ DWORD broken_flags;
+ }
+ test_lznt[] =
+ {
+ /* 4 byte uncompressed chunk */
+ {
+ {0x03, 0x30, 'W', 'i', 'n', 'e'},
+ 6,
+ STATUS_SUCCESS,
+ "Wine",
+ 4,
+ DECOMPRESS_BROKEN_FRAGMENT
+ },
+ /* 8 byte uncompressed chunk */
+ {
+ {0x07, 0x30, 'W', 'i', 'n', 'e', 'W', 'i', 'n', 'e'},
+ 10,
+ STATUS_SUCCESS,
+ "WineWine",
+ 8,
+ DECOMPRESS_BROKEN_FRAGMENT
+ },
+ /* 4 byte compressed chunk */
+ {
+ {0x04, 0xB0, 0x00, 'W', 'i', 'n', 'e'},
+ 7,
+ STATUS_SUCCESS,
+ "Wine",
+ 4
+ },
+ /* 8 byte compressed chunk */
+ {
+ {0x08, 0xB0, 0x00, 'W', 'i', 'n', 'e', 'W', 'i', 'n', 'e'},
+ 11,
+ STATUS_SUCCESS,
+ "WineWine",
+ 8
+ },
+ /* compressed chunk using backwards reference */
+ {
+ {0x06, 0xB0, 0x10, 'W', 'i', 'n', 'e', 0x01, 0x30},
+ 9,
+ STATUS_SUCCESS,
+ "WineWine",
+ 8,
+ DECOMPRESS_BROKEN_TRUNCATED
+ },
+ /* compressed chunk using backwards reference with length > bytes_read */
+ {
+ {0x06, 0xB0, 0x10, 'W', 'i', 'n', 'e', 0x05, 0x30},
+ 9,
+ STATUS_SUCCESS,
+ "WineWineWine",
+ 12,
+ DECOMPRESS_BROKEN_TRUNCATED
+ },
+ /* same as above, but unused bits != 0 */
+ {
+ {0x06, 0xB0, 0x30, 'W', 'i', 'n', 'e', 0x01, 0x30},
+ 9,
+ STATUS_SUCCESS,
+ "WineWine",
+ 8,
+ DECOMPRESS_BROKEN_TRUNCATED
+ },
+ /* compressed chunk without backwards reference and unused bits != 0 */
+ {
+ {0x01, 0xB0, 0x02, 'W'},
+ 4,
+ STATUS_SUCCESS,
+ "W",
+ 1
+ },
+ /* termination sequence after first chunk */
+ {
+ {0x03, 0x30, 'W', 'i', 'n', 'e', 0x00, 0x00, 0x03, 0x30, 'W', 'i', 'n', 'e'},
+ 14,
+ STATUS_SUCCESS,
+ "Wine",
+ 4,
+ DECOMPRESS_BROKEN_FRAGMENT
+ },
+ /* compressed chunk using backwards reference with 4 bit offset, 12 bit length */
+ {
+ {0x14, 0xB0, 0x00, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
+ 0x00, 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+ 0x01, 0x01, 0xF0},
+ 23,
+ STATUS_SUCCESS,
+ "ABCDEFGHIJKLMNOPABCD",
+ 20,
+ DECOMPRESS_BROKEN_TRUNCATED
+ },
+ /* compressed chunk using backwards reference with 5 bit offset, 11 bit length */
+ {
+ {0x15, 0xB0, 0x00, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
+ 0x00, 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+ 0x02, 'A', 0x00, 0x78},
+ 24,
+ STATUS_SUCCESS,
+ "ABCDEFGHIJKLMNOPABCD",
+ 20,
+ DECOMPRESS_BROKEN_TRUNCATED
+ },
+ /* uncompressed chunk with invalid magic */
+ {
+ {0x03, 0x20, 'W', 'i', 'n', 'e'},
+ 6,
+ STATUS_SUCCESS,
+ "Wine",
+ 4,
+ DECOMPRESS_BROKEN_FRAGMENT
+ },
+ /* compressed chunk with invalid magic */
+ {
+ {0x04, 0xA0, 0x00, 'W', 'i', 'n', 'e'},
+ 7,
+ STATUS_SUCCESS,
+ "Wine",
+ 4
+ },
+ /* garbage byte after end of buffer */
+ {
+ {0x00, 0xB0, 0x02, 0x01},
+ 4,
+ STATUS_SUCCESS,
+ "",
+ 0
+ },
+ /* empty compressed chunk */
+ {
+ {0x00, 0xB0, 0x00},
+ 3,
+ STATUS_SUCCESS,
+ "",
+ 0
+ },
+ /* empty compressed chunk with unused bits != 0 */
+ {
+ {0x00, 0xB0, 0x01},
+ 3,
+ STATUS_SUCCESS,
+ "",
+ 0
+ },
+ /* empty input buffer */
+ {
+ {},
+ 0,
+ STATUS_BAD_COMPRESSION_BUFFER,
+ },
+ /* incomplete chunk header */
+ {
+ {0x01},
+ 1,
+ STATUS_BAD_COMPRESSION_BUFFER
+ },
+ /* incomplete chunk header */
+ {
+ {0x00, 0x30},
+ 2,
+ STATUS_BAD_COMPRESSION_BUFFER
+ },
+ /* compressed chunk with invalid backwards reference */
+ {
+ {0x06, 0xB0, 0x10, 'W', 'i', 'n', 'e', 0x05, 0x40},
+ 9,
+ STATUS_BAD_COMPRESSION_BUFFER
+ },
+ /* compressed chunk with incomplete backwards reference */
+ {
+ {0x05, 0xB0, 0x10, 'W', 'i', 'n', 'e', 0x05},
+ 8,
+ STATUS_BAD_COMPRESSION_BUFFER
+ },
+ /* incomplete uncompressed chunk */
+ {
+ {0x07, 0x30, 'W', 'i', 'n', 'e'},
+ 6,
+ STATUS_BAD_COMPRESSION_BUFFER
+ },
+ /* incomplete compressed chunk */
+ {
+ {0x08, 0xB0, 0x00, 'W', 'i', 'n', 'e'},
+ 7,
+ STATUS_BAD_COMPRESSION_BUFFER
+ },
+ /* two compressed chunks, the second one incomplete */
+ {
+ {0x00, 0xB0, 0x02, 0x00, 0xB0},
+ 5,
+ STATUS_BAD_COMPRESSION_BUFFER,
+ }
+ };
+
+ static UCHAR buf[0x2000];
+ NTSTATUS status;
+ ULONG final_size;
+ int i;
+
+ if (!pRtlDecompressBuffer)
+ {
+ win_skip("RtlDecompressBuffer is not available\n");
+ return;
+ }
+
+ /* test compression format / engine */
+ final_size = 0xdeadbeef;
+ status = pRtlDecompressBuffer(COMPRESSION_FORMAT_NONE, buf, sizeof(buf), test_lznt[0].compressed,
+ test_lznt[0].compressed_size, &final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+
+ final_size = 0xdeadbeef;
+ status = pRtlDecompressBuffer(COMPRESSION_FORMAT_DEFAULT, buf, sizeof(buf), test_lznt[0].compressed,
+ test_lznt[0].compressed_size, &final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+
+ final_size = 0xdeadbeef;
+ status = pRtlDecompressBuffer(0xFF, buf, sizeof(buf), test_lznt[0].compressed,
+ test_lznt[0].compressed_size, &final_size);
+ ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+
+ /* regular tests for RtlDecompressBuffer */
+ for (i = 0; i < sizeof(test_lznt) / sizeof(test_lznt[0]); i++)
+ {
+ trace("Running test %d (compressed_size=%u, uncompressed_size=%u, status=0x%08x)\n",
+ i, test_lznt[i].compressed_size, test_lznt[i].uncompressed_size, test_lznt[i].status);
+
+ /* test with very big buffer */
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed,
+ test_lznt[i].compressed_size, &final_size);
+ ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER &&
+ (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status);
+ if (!status)
+ {
+ ok(final_size == test_lznt[i].uncompressed_size,
+ "%d: got wrong final_size %u\n", i, final_size);
+ ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
+ "%d: got wrong decoded data\n", i);
+ ok(buf[test_lznt[i].uncompressed_size] == 0x11,
+ "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ }
+
+ /* test that modifier for compression engine is ignored */
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1 | COMPRESSION_ENGINE_MAXIMUM, buf, sizeof(buf),
+ test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
+ ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER &&
+ (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status);
+ if (!status)
+ {
+ ok(final_size == test_lznt[i].uncompressed_size,
+ "%d: got wrong final_size %u\n", i, final_size);
+ ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
+ "%d: got wrong decoded data\n", i);
+ ok(buf[test_lznt[i].uncompressed_size] == 0x11,
+ "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ }
+
+ /* test with expected output size */
+ if (test_lznt[i].uncompressed_size > 0)
+ {
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, test_lznt[i].uncompressed_size,
+ test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ if (!status)
+ {
+ ok(final_size == test_lznt[i].uncompressed_size,
+ "%d: got wrong final_size %u\n", i, final_size);
+ ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
+ "%d: got wrong decoded data\n", i);
+ ok(buf[test_lznt[i].uncompressed_size] == 0x11,
+ "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ }
+ }
+
+ /* test with smaller output size */
+ if (test_lznt[i].uncompressed_size > 1)
+ {
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, test_lznt[i].uncompressed_size - 1,
+ test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
+ if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_TRUNCATED)
+ todo_wine
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ else
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ if (!status)
+ {
+ ok(final_size == test_lznt[i].uncompressed_size - 1,
+ "%d: got wrong final_size %u\n", i, final_size);
+ ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size - 1),
+ "%d: got wrong decoded data\n", i);
+ ok(buf[test_lznt[i].uncompressed_size - 1] == 0x11,
+ "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size - 1);
+ }
+ }
+
+ /* test with zero output size */
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, 0, test_lznt[i].compressed,
+ test_lznt[i].compressed_size, &final_size);
+ if (is_incomplete_chunk(test_lznt[i].compressed, test_lznt[i].compressed_size, FALSE))
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ else
+ {
+ ok(status == STATUS_SUCCESS, "%d: got wrong status 0x%08x\n", i, status);
+ ok(final_size == 0, "%d: got wrong final_size %u\n", i, final_size);
+ ok(buf[0] == 0x11, "%d: buf[0] was modified\n", i);
+ }
+ }
+}
+
+#undef DECOMPRESS_BROKEN_FRAGMENT
+#undef DECOMPRESS_BROKEN_TRUNCATED
+
START_TEST(rtl)
{
InitFunctionPtrs();
@@ -1745,4 +2105,5 @@ START_TEST(rtl)
test_LdrLockLoaderLock();
test_RtlCompressBuffer();
test_RtlGetCompressionWorkSpaceSize();
+ test_RtlDecompressBuffer();
}
--
2.4.5

View File

@ -1,141 +0,0 @@
From 6546dabdc504eb340167404ca66364a536e65cdc Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 9 Jul 2015 03:08:09 +0200
Subject: ntdll/tests: Add tests for RtlDecompressFragment.
---
dlls/ntdll/tests/rtl.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 89 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
index a1b9327..4903790 100644
--- a/dlls/ntdll/tests/rtl.c
+++ b/dlls/ntdll/tests/rtl.c
@@ -94,6 +94,7 @@ static NTSTATUS (WINAPI *pLdrLockLoaderLock)(ULONG, ULONG*, ULONG_PTR*);
static NTSTATUS (WINAPI *pLdrUnlockLoaderLock)(ULONG, ULONG_PTR);
static NTSTATUS (WINAPI *pRtlGetCompressionWorkSpaceSize)(USHORT, PULONG, PULONG);
static NTSTATUS (WINAPI *pRtlDecompressBuffer)(USHORT, PUCHAR, ULONG, const UCHAR*, ULONG, PULONG);
+static NTSTATUS (WINAPI *pRtlDecompressFragment)(USHORT, PUCHAR, ULONG, const UCHAR*, ULONG, ULONG, PULONG, PVOID);
static NTSTATUS (WINAPI *pRtlCompressBuffer)(USHORT, const UCHAR*, ULONG, PUCHAR, ULONG, ULONG, PULONG, PVOID);
static HMODULE hkernel32 = 0;
@@ -144,6 +145,7 @@ static void InitFunctionPtrs(void)
pLdrUnlockLoaderLock = (void *)GetProcAddress(hntdll, "LdrUnlockLoaderLock");
pRtlGetCompressionWorkSpaceSize = (void *)GetProcAddress(hntdll, "RtlGetCompressionWorkSpaceSize");
pRtlDecompressBuffer = (void *)GetProcAddress(hntdll, "RtlDecompressBuffer");
+ pRtlDecompressFragment = (void *)GetProcAddress(hntdll, "RtlDecompressFragment");
pRtlCompressBuffer = (void *)GetProcAddress(hntdll, "RtlCompressBuffer");
}
hkernel32 = LoadLibraryA("kernel32.dll");
@@ -1946,14 +1948,14 @@ static void test_RtlDecompressBuffer(void)
}
};
- static UCHAR buf[0x2000];
- NTSTATUS status;
+ static UCHAR buf[0x2000], workspace[0x1000];
+ NTSTATUS status, expected_status;
ULONG final_size;
int i;
- if (!pRtlDecompressBuffer)
+ if (!pRtlDecompressBuffer || !pRtlDecompressFragment)
{
- win_skip("RtlDecompressBuffer is not available\n");
+ win_skip("RtlDecompressBuffer or RtlDecompressFragment is not available\n");
return;
}
@@ -2071,6 +2073,89 @@ static void test_RtlDecompressBuffer(void)
ok(final_size == 0, "%d: got wrong final_size %u\n", i, final_size);
ok(buf[0] == 0x11, "%d: buf[0] was modified\n", i);
}
+
+ /* test RtlDecompressFragment with offset = 0 */
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressFragment(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed,
+ test_lznt[i].compressed_size, 0, &final_size, workspace);
+ if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
+ todo_wine
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ else
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ if (!status)
+ {
+ ok(final_size == test_lznt[i].uncompressed_size,
+ "%d: got wrong final_size %u\n", i, final_size);
+ ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
+ "%d: got wrong decoded data\n", i);
+ ok(buf[test_lznt[i].uncompressed_size] == 0x11,
+ "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ }
+
+ /* test RtlDecompressFragment with offset = 1 */
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressFragment(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed,
+ test_lznt[i].compressed_size, 1, &final_size, workspace);
+ if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
+ todo_wine
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ else
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ if (!status)
+ {
+ if (test_lznt[i].uncompressed_size == 0)
+ {
+ todo_wine
+ ok(final_size == 4095, "%d: got wrong final_size %u\n", i, final_size);
+ /* Buffer doesn't contain any useful value on Windows */
+ ok(buf[4095] == 0x11, "%d: buf[4095] was modified\n", i);
+ }
+ else
+ {
+ ok(final_size == test_lznt[i].uncompressed_size - 1,
+ "%d: got wrong final_size %u\n", i, final_size);
+ ok(!memcmp(buf, test_lznt[i].uncompressed + 1, test_lznt[i].uncompressed_size - 1),
+ "%d: got wrong decoded data\n", i);
+ ok(buf[test_lznt[i].uncompressed_size - 1] == 0x11,
+ "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size - 1);
+ }
+ }
+
+ /* test RtlDecompressFragment with offset = 4095 */
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressFragment(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed,
+ test_lznt[i].compressed_size, 4095, &final_size, workspace);
+ if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
+ todo_wine
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ else
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ if (!status)
+ {
+ todo_wine
+ ok(final_size == 1, "%d: got wrong final_size %u\n", i, final_size);
+ todo_wine
+ ok(buf[0] == 0, "%d: padding is not zero\n", i);
+ ok(buf[1] == 0x11, "%d: buf[1] was modified\n", i);
+ }
+
+ /* test RtlDecompressFragment with offset = 4096 */
+ final_size = 0xdeadbeef;
+ memset(buf, 0x11, sizeof(buf));
+ status = pRtlDecompressFragment(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed,
+ test_lznt[i].compressed_size, 4096, &final_size, workspace);
+ expected_status = is_incomplete_chunk(test_lznt[i].compressed, test_lznt[i].compressed_size, TRUE) ?
+ test_lznt[i].status : STATUS_SUCCESS;
+ ok(status == expected_status, "%d: got wrong status 0x%08x, expected 0x%08x\n", i, status, expected_status);
+ if (!status)
+ {
+ ok(final_size == 0, "%d: got wrong final_size %u\n", i, final_size);
+ ok(buf[0] == 0x11, "%d: buf[4096] was modified\n", i);
+ }
}
}
--
2.4.5

View File

@ -1,2 +0,0 @@
Fixes: [37449] Support for RtlDecompressBuffer
Category: stable

View File

@ -1,2 +1 @@
Depends: ntdll-LZNT1_Compression
Category: stable

View File

@ -55,7 +55,7 @@ version()
echo "Copyright (C) 2014-2015 the Wine Staging project authors."
echo ""
echo "Patchset to be applied on upstream Wine:"
echo " commit cf7a118a9e5922d819f216c21c3a0984c7bde5dd"
echo " commit 744f7b69bf4692265588e10650090ca2f5129ccd"
echo ""
}
@ -87,7 +87,6 @@ patch_enable_all ()
enable_configure_Absolute_RPATH="$1"
enable_configure_Crosscompiling="$1"
enable_crypt32_CMS_Certificates="$1"
enable_d3d11_D3D11CreateDeviceAndSwapChain="$1"
enable_d3d9_DesktopWindow="$1"
enable_d3d9_Skip_Tests="$1"
enable_d3d9_Surface_Refcount="$1"
@ -165,7 +164,6 @@ patch_enable_all ()
enable_ntdll_Heap_FreeLists="$1"
enable_ntdll_Hide_Wine_Exports="$1"
enable_ntdll_Junction_Points="$1"
enable_ntdll_LZNT1_Compression="$1"
enable_ntdll_NtQueryEaFile="$1"
enable_ntdll_NtQuerySection="$1"
enable_ntdll_NtSetLdtEntries="$1"
@ -335,9 +333,6 @@ patch_enable ()
crypt32-CMS_Certificates)
enable_crypt32_CMS_Certificates="$2"
;;
d3d11-D3D11CreateDeviceAndSwapChain)
enable_d3d11_D3D11CreateDeviceAndSwapChain="$2"
;;
d3d9-DesktopWindow)
enable_d3d9_DesktopWindow="$2"
;;
@ -569,9 +564,6 @@ patch_enable ()
ntdll-Junction_Points)
enable_ntdll_Junction_Points="$2"
;;
ntdll-LZNT1_Compression)
enable_ntdll_LZNT1_Compression="$2"
;;
ntdll-NtQueryEaFile)
enable_ntdll_NtQueryEaFile="$2"
;;
@ -1289,9 +1281,6 @@ if test "$enable_category_stable" -eq 1; then
if test "$enable_configure_Absolute_RPATH" -gt 1; then
abort "Patchset configure-Absolute_RPATH disabled, but category-stable depends on that."
fi
if test "$enable_d3d11_D3D11CreateDeviceAndSwapChain" -gt 1; then
abort "Patchset d3d11-D3D11CreateDeviceAndSwapChain disabled, but category-stable depends on that."
fi
if test "$enable_d3d9_Skip_Tests" -gt 1; then
abort "Patchset d3d9-Skip_Tests disabled, but category-stable depends on that."
fi
@ -1397,9 +1386,6 @@ if test "$enable_category_stable" -eq 1; then
if test "$enable_ntdll_Heap_FreeLists" -gt 1; then
abort "Patchset ntdll-Heap_FreeLists disabled, but category-stable depends on that."
fi
if test "$enable_ntdll_LZNT1_Compression" -gt 1; then
abort "Patchset ntdll-LZNT1_Compression disabled, but category-stable depends on that."
fi
if test "$enable_ntdll_NtSetLdtEntries" -gt 1; then
abort "Patchset ntdll-NtSetLdtEntries disabled, but category-stable depends on that."
fi
@ -1521,7 +1507,6 @@ if test "$enable_category_stable" -eq 1; then
enable_Staging=1
enable_combase_String=1
enable_configure_Absolute_RPATH=1
enable_d3d11_D3D11CreateDeviceAndSwapChain=1
enable_d3d9_Skip_Tests=1
enable_d3d9_Surface_Refcount=1
enable_d3dx9_24_ID3DXEffect=1
@ -1557,7 +1542,6 @@ if test "$enable_category_stable" -eq 1; then
enable_ntdll_Fix_Alignment=1
enable_ntdll_FreeBSD_Directory=1
enable_ntdll_Heap_FreeLists=1
enable_ntdll_LZNT1_Compression=1
enable_ntdll_NtSetLdtEntries=1
enable_ntdll_Pipe_SpecialCharacters=1
enable_ntdll_RtlIpStringToAddress=1
@ -1737,13 +1721,6 @@ if test "$enable_ntdll_WriteWatches" -eq 1; then
enable_ws2_32_WriteWatches=1
fi
if test "$enable_ntdll_RtlIpStringToAddress" -eq 1; then
if test "$enable_ntdll_LZNT1_Compression" -gt 1; then
abort "Patchset ntdll-LZNT1_Compression disabled, but ntdll-RtlIpStringToAddress depends on that."
fi
enable_ntdll_LZNT1_Compression=1
fi
if test "$enable_ntdll_Junction_Points" -eq 1; then
if test "$enable_ntdll_Fix_Free" -gt 1; then
abort "Patchset ntdll-Fix_Free disabled, but ntdll-Junction_Points depends on that."
@ -1991,23 +1968,6 @@ if test "$enable_Staging" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
# | * [#15980] GetSecurityInfo returns NULL DACL for process object
# |
# | Modified files:
# | * dlls/advapi32/tests/security.c, server/process.c, server/security.h, server/token.c
# |
if test "$enable_server_Misc_ACL" -eq 1; then
patch_apply server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch
patch_apply server-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch
(
echo '+ { "Erich E. Hoover", "server: Add default security descriptor ownership for processes.", 1 },';
echo '+ { "Erich E. Hoover", "server: Add default security descriptor DACL for processes.", 1 },';
) >> "$patchlist"
fi
# Patchset server-CreateProcess_ACLs
# |
# | This patchset fixes the following Wine bugs:
@ -2027,6 +1987,23 @@ if test "$enable_server_CreateProcess_ACLs" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
# | * [#15980] GetSecurityInfo returns NULL DACL for process object
# |
# | Modified files:
# | * dlls/advapi32/tests/security.c, server/process.c, server/security.h, server/token.c
# |
if test "$enable_server_Misc_ACL" -eq 1; then
patch_apply server-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch
patch_apply server-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch
(
echo '+ { "Erich E. Hoover", "server: Add default security descriptor ownership for processes.", 1 },';
echo '+ { "Erich E. Hoover", "server: Add default security descriptor DACL for processes.", 1 },';
) >> "$patchlist"
fi
# Patchset advapi32-LsaLookupSids
# |
# | Modified files:
@ -2140,21 +2117,6 @@ if test "$enable_crypt32_CMS_Certificates" -eq 1; then
) >> "$patchlist"
fi
# Patchset d3d11-D3D11CreateDeviceAndSwapChain
# |
# | This patchset fixes the following Wine bugs:
# | * [#33153] Add stub for d3d11.D3D11CreateDeviceAndSwapChain
# |
# | Modified files:
# | * dlls/d3d11/d3d11.spec, dlls/d3d11/d3d11_main.c
# |
if test "$enable_d3d11_D3D11CreateDeviceAndSwapChain" -eq 1; then
patch_apply d3d11-D3D11CreateDeviceAndSwapChain/0001-d3d11-add-a-stub-for-D3D11CreateDeviceAndSwapChain.patch
(
echo '+ { "Austin English", "d3d11: add a stub for D3D11CreateDeviceAndSwapChain.", 1 },';
) >> "$patchlist"
fi
# Patchset d3d9-DesktopWindow
# |
# | Modified files:
@ -3541,25 +3503,6 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-LZNT1_Compression
# |
# | This patchset fixes the following Wine bugs:
# | * [#37449] Support for RtlDecompressBuffer
# |
# | Modified files:
# | * dlls/ntdll/ntdll.spec, dlls/ntdll/rtl.c, dlls/ntdll/tests/rtl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec
# |
if test "$enable_ntdll_LZNT1_Compression" -eq 1; then
patch_apply ntdll-LZNT1_Compression/0001-ntdll-Implement-RtlDecompressFragment.patch
patch_apply ntdll-LZNT1_Compression/0002-ntdll-tests-Add-tests-for-RtlDecompressBuffer.patch
patch_apply ntdll-LZNT1_Compression/0003-ntdll-tests-Add-tests-for-RtlDecompressFragment.patch
(
echo '+ { "Sebastian Lackner", "ntdll: Implement RtlDecompressFragment.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll/tests: Add tests for RtlDecompressBuffer.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll/tests: Add tests for RtlDecompressFragment.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-NtQuerySection
# |
# | This patchset fixes the following Wine bugs:
@ -4138,7 +4081,6 @@ fi
# Patchset server-Key_State
# |
# | This patchset fixes the following Wine bugs:
# | * [#27238] Fallback to global key state for threads without a queue
# | * [#31899] Implement locking and synchronization of key states
# | * [#35907] Fix caps lock state issues with multiple processes
# |

View File

@ -1,13 +1,13 @@
From 786c3fd3cfc26cb0eb116ca0f8d28a9640722404 Mon Sep 17 00:00:00 2001
From 8be0b58eb1712de2f8ca04842fbd22cf5faa5f38 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 12 Mar 2015 02:56:21 +0100
Date: Fri, 10 Jul 2015 16:13:53 +0200
Subject: server: Implement locking and synchronization of keystate buffer.
(rev 2)
---
dlls/comctl32/tests/listview.c | 1 +
server/queue.c | 58 +++++++++++++++++++++++++++++++++++++++++-
2 files changed, 58 insertions(+), 1 deletion(-)
server/queue.c | 43 +++++++++++++++++++++++++++++++++++++++++-
2 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 3edb25a..3ec4181 100644
@ -22,7 +22,7 @@ index 3edb25a..3ec4181 100644
/* Set SHIFT key released */
diff --git a/server/queue.c b/server/queue.c
index 35ee532..f278861 100644
index e4b2969..ab8bb29 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -113,6 +113,7 @@ struct thread_input
@ -129,11 +129,7 @@ index 35ee532..f278861 100644
/* first check for sent messages */
if ((ptr = list_head( &queue->msg_list[SEND_MESSAGE] )))
{
@@ -2857,13 +2893,33 @@ DECL_HANDLER(get_key_state)
}
else
{
+ unsigned char *keystate;
@@ -2861,7 +2897,12 @@ DECL_HANDLER(get_key_state)
if (!(thread = get_thread_from_id( req->tid ))) return;
if (thread->queue)
{
@ -145,25 +141,8 @@ index 35ee532..f278861 100644
+ reply->state = thread->queue->input->keystate[req->key & 0xff];
+ }
set_reply_data( thread->queue->input->keystate, size );
+ release_object( thread );
+ return;
}
release_object( thread );
+
+ /* fallback to desktop keystate */
+ if (!(desktop = get_thread_desktop( current, 0 ))) return;
+ if (req->key >= 0)
+ reply->state = desktop->keystate[req->key & 0xff] & ~0x40;
+ if ((keystate = set_reply_data_size( size )))
+ {
+ unsigned int i;
+ for (i = 0; i < size; i++)
+ keystate[i] = desktop->keystate[i] & ~0x40;
+ }
+ release_object( desktop );
}
}
release_object( thread );
return;
--
2.4.2
2.4.5

View File

@ -1,3 +1,3 @@
Fixes: [27238] Fallback to global key state for threads without a queue
# Fixes: [27238] Fallback to global key state for threads without a queue
Fixes: [31899] Implement locking and synchronization of key states
Fixes: [35907] Fix caps lock state issues with multiple processes