mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Added patch to implement RtlDecompressBuffer.
This commit is contained in:
parent
9c9639f3ae
commit
621ece3c6f
@ -35,10 +35,11 @@ Wine. All those differences are also documented on the
|
||||
Included bugfixes and improvements
|
||||
==================================
|
||||
|
||||
**Bugfixes and features included in the next upcoming release [4]:**
|
||||
**Bugfixes and features included in the next upcoming release [5]:**
|
||||
|
||||
* Cinema 4D needs NotifyIpInterfaceChange ([Wine Bug #34573](http://bugs.winehq.org/show_bug.cgi?id=34573))
|
||||
* D3DCompileShader should filter specific warning messages ([Wine Bug #33770](http://bugs.winehq.org/show_bug.cgi?id=33770))
|
||||
* Support for RtlDecompressBuffer ([Wine Bug #37449](http://bugs.winehq.org/show_bug.cgi?id=37449))
|
||||
* Support for pasting HTML from Unix applications ([Wine Bug #7372](http://bugs.winehq.org/show_bug.cgi?id=7372))
|
||||
* Tumblebugs 2 requires DXTn software encoding support ([Wine Bug #29586](http://bugs.winehq.org/show_bug.cgi?id=29586))
|
||||
|
||||
|
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -4,6 +4,7 @@ wine-compholio (1.7.30) UNRELEASED; urgency=low
|
||||
* Added patch to filter specific warning messages for D3DCompileShader.
|
||||
* Added patch to implement iphlpapi stub functions.
|
||||
* Added patch to implement support for pasting HTML from native Unix applications.
|
||||
* Added patch to implement RtlDecompressBuffer.
|
||||
* Removed patch to avoid Clang compiler warning because of unused Vtable (accepted upstream).
|
||||
* Removed patch for additional ATL thunks (accepted upstream).
|
||||
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 20 Oct 2014 19:53:47 +0200
|
||||
|
@ -57,6 +57,7 @@ PATCHLIST := \
|
||||
ntdll-Fix_Free.ok \
|
||||
ntdll-Heap_FreeLists.ok \
|
||||
ntdll-Junction_Points.ok \
|
||||
ntdll-LZNT1_Compression.ok \
|
||||
ntdll-NtQuerySection.ok \
|
||||
ntdll-Pipe_SpecialCharacters.ok \
|
||||
ntdll-WRITECOPY.ok \
|
||||
@ -884,6 +885,27 @@ ntdll-Junction_Points.ok: ntdll-Fix_Free.ok
|
||||
echo '+ { "ntdll-Junction_Points", "Erich E. Hoover", "Support for junction points/reparse points." },'; \
|
||||
) > ntdll-Junction_Points.ok
|
||||
|
||||
# Patchset ntdll-LZNT1_Compression
|
||||
# |
|
||||
# | Included patches:
|
||||
# | * Implement Rtl[Decompress|Compress]Buffer and RtlGetCompressionWorkSpaceSize. [by Sebastian Lackner / Michael Müller]
|
||||
# |
|
||||
# | 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, include/winnt.h
|
||||
# |
|
||||
.INTERMEDIATE: ntdll-LZNT1_Compression.ok
|
||||
ntdll-LZNT1_Compression.ok:
|
||||
$(call APPLY_FILE,ntdll-LZNT1_Compression/0001-ntdll-Implement-semi-stub-for-RtlGetCompressionWorkS.patch)
|
||||
$(call APPLY_FILE,ntdll-LZNT1_Compression/0002-ntdll-Implement-semi-stub-for-RtlCompressBuffer.patch)
|
||||
$(call APPLY_FILE,ntdll-LZNT1_Compression/0003-ntdll-Implement-LZNT1-algorithm-for-RtlDecompressBuf.patch)
|
||||
$(call APPLY_FILE,ntdll-LZNT1_Compression/0004-ntdll-tests-Add-tests-for-Rtl-Decompress-Compress-Bu.patch)
|
||||
@( \
|
||||
echo '+ { "ntdll-LZNT1_Compression", "Sebastian Lackner / Michael Müller", "Implement Rtl[Decompress|Compress]Buffer and RtlGetCompressionWorkSpaceSize." },'; \
|
||||
) > ntdll-LZNT1_Compression.ok
|
||||
|
||||
# Patchset ntdll-NtQuerySection
|
||||
# |
|
||||
# | Included patches:
|
||||
|
@ -0,0 +1,69 @@
|
||||
From 8f2dbbc47749542a135c5410c94097d8b14e0a84 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 30 Oct 2014 17:19:42 +0100
|
||||
Subject: ntdll: Implement semi-stub for RtlGetCompressionWorkSpaceSize.
|
||||
|
||||
---
|
||||
dlls/ntdll/rtl.c | 26 ++++++++++++++++++++------
|
||||
include/winnt.h | 6 ++++++
|
||||
2 files changed, 26 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
|
||||
index 8f6f386..884a14a 100644
|
||||
--- a/dlls/ntdll/rtl.c
|
||||
+++ b/dlls/ntdll/rtl.c
|
||||
@@ -1215,14 +1215,28 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushListSList(PSLIST_HEADER list, PSLIST_ENTRY
|
||||
/******************************************************************************
|
||||
* RtlGetCompressionWorkSpaceSize [NTDLL.@]
|
||||
*/
|
||||
-NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT CompressionFormatAndEngine,
|
||||
- PULONG CompressBufferWorkSpaceSize,
|
||||
- PULONG CompressFragmentWorkSpaceSize)
|
||||
+NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT format, PULONG compress_workspace,
|
||||
+ PULONG decompress_workspace)
|
||||
{
|
||||
- FIXME("0x%04x, %p, %p: stub!\n", CompressionFormatAndEngine, CompressBufferWorkSpaceSize,
|
||||
- CompressFragmentWorkSpaceSize);
|
||||
+ FIXME("0x%04x, %p, %p: semi-stub\n", format, compress_workspace, decompress_workspace);
|
||||
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
+ switch (format & ~COMPRESSION_ENGINE_MAXIMUM)
|
||||
+ {
|
||||
+ case COMPRESSION_FORMAT_LZNT1:
|
||||
+ if (compress_workspace)
|
||||
+ *compress_workspace = 16; /* FIXME */
|
||||
+ if (decompress_workspace)
|
||||
+ *decompress_workspace = 0x1000;
|
||||
+ return STATUS_SUCCESS;
|
||||
+
|
||||
+ case COMPRESSION_FORMAT_NONE:
|
||||
+ case COMPRESSION_FORMAT_DEFAULT:
|
||||
+ return STATUS_INVALID_PARAMETER;
|
||||
+
|
||||
+ default:
|
||||
+ FIXME("format %d not implemented\n", format);
|
||||
+ return STATUS_UNSUPPORTED_COMPRESSION;
|
||||
+ }
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
diff --git a/include/winnt.h b/include/winnt.h
|
||||
index 709a93f..401e3ad 100644
|
||||
--- a/include/winnt.h
|
||||
+++ b/include/winnt.h
|
||||
@@ -4722,6 +4722,12 @@ typedef struct _QUOTA_LIMITS_EX {
|
||||
#define FILE_256_BYTE_ALIGNMENT 0x000000ff
|
||||
#define FILE_512_BYTE_ALIGNMENT 0x000001ff
|
||||
|
||||
+#define COMPRESSION_FORMAT_NONE 0
|
||||
+#define COMPRESSION_FORMAT_DEFAULT 1
|
||||
+#define COMPRESSION_FORMAT_LZNT1 2
|
||||
+#define COMPRESSION_ENGINE_STANDARD 0
|
||||
+#define COMPRESSION_ENGINE_MAXIMUM 256
|
||||
+
|
||||
#define MAILSLOT_NO_MESSAGE ((DWORD)-1)
|
||||
#define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
|
||||
|
||||
--
|
||||
2.1.2
|
||||
|
@ -0,0 +1,90 @@
|
||||
From e487c879736038053aac64aa728ba35c78888e71 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 30 Oct 2014 17:24:26 +0100
|
||||
Subject: ntdll: Implement semi-stub for RtlCompressBuffer.
|
||||
|
||||
---
|
||||
dlls/ntdll/rtl.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 54 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
|
||||
index 884a14a..b790910 100644
|
||||
--- a/dlls/ntdll/rtl.c
|
||||
+++ b/dlls/ntdll/rtl.c
|
||||
@@ -1239,19 +1239,65 @@ NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT format, PULONG compress_wo
|
||||
}
|
||||
}
|
||||
|
||||
+/* compress data using LZNT1, currently only a stub */
|
||||
+static NTSTATUS lznt1_compress(UCHAR *src, ULONG src_size, UCHAR *dst, ULONG dst_size,
|
||||
+ ULONG chunk_size, ULONG *final_size, UCHAR *workspace)
|
||||
+{
|
||||
+ UCHAR *src_cur, *src_end, *dst_cur, *dst_end;
|
||||
+ ULONG block_size;
|
||||
+
|
||||
+ src_cur = src;
|
||||
+ src_end = src + src_size;
|
||||
+ dst_cur = dst;
|
||||
+ dst_end = dst + dst_size;
|
||||
+
|
||||
+ while (src_cur < src_end)
|
||||
+ {
|
||||
+ /* determine size of current chunk */
|
||||
+ block_size = min(0x1000, src_end - src_cur);
|
||||
+ if (dst_cur + sizeof(WORD) + block_size > dst_end)
|
||||
+ return STATUS_BUFFER_TOO_SMALL;
|
||||
+
|
||||
+ /* write (uncompressed) chunk header */
|
||||
+ *(WORD *)dst_cur = 0x3000 | (block_size - 1);
|
||||
+ dst_cur += sizeof(WORD);
|
||||
+
|
||||
+ /* write chunk content */
|
||||
+ memcpy(dst_cur, src_cur, block_size);
|
||||
+ dst_cur += block_size;
|
||||
+ src_cur += block_size;
|
||||
+ }
|
||||
+
|
||||
+ if (final_size)
|
||||
+ *final_size = dst_cur - dst;
|
||||
+
|
||||
+ return STATUS_SUCCESS;
|
||||
+}
|
||||
+
|
||||
/******************************************************************************
|
||||
* RtlCompressBuffer [NTDLL.@]
|
||||
*/
|
||||
-NTSTATUS WINAPI RtlCompressBuffer(USHORT CompressionFormatAndEngine, PUCHAR UncompressedBuffer,
|
||||
- ULONG UncompressedBufferSize, PUCHAR CompressedBuffer,
|
||||
- ULONG CompressedBufferSize, ULONG UncompressedChunkSize,
|
||||
- PULONG FinalCompressedSize, PVOID WorkSpace)
|
||||
+NTSTATUS WINAPI RtlCompressBuffer(USHORT format, PUCHAR uncompressed, ULONG uncompressed_size,
|
||||
+ PUCHAR compressed, ULONG compressed_size, ULONG chunk_size,
|
||||
+ PULONG final_size, PVOID workspace)
|
||||
{
|
||||
- FIXME("0x%04x, %p, %u, %p, %u, %u, %p, %p :stub\n", CompressionFormatAndEngine, UncompressedBuffer,
|
||||
- UncompressedBufferSize, CompressedBuffer, CompressedBufferSize, UncompressedChunkSize,
|
||||
- FinalCompressedSize, WorkSpace);
|
||||
+ FIXME("0x%04x, %p, %u, %p, %u, %u, %p, %p :semi-stub\n", format, uncompressed,
|
||||
+ uncompressed_size, compressed, compressed_size, chunk_size, final_size, workspace);
|
||||
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
+ switch (format & ~COMPRESSION_ENGINE_MAXIMUM)
|
||||
+ {
|
||||
+ case COMPRESSION_FORMAT_LZNT1:
|
||||
+ return lznt1_compress(uncompressed, uncompressed_size, compressed,
|
||||
+ compressed_size, chunk_size, final_size, workspace);
|
||||
+
|
||||
+ case COMPRESSION_FORMAT_NONE:
|
||||
+ case COMPRESSION_FORMAT_DEFAULT:
|
||||
+ return STATUS_INVALID_PARAMETER;
|
||||
+
|
||||
+ default:
|
||||
+ FIXME("format %d not implemented\n", format);
|
||||
+ return STATUS_UNSUPPORTED_COMPRESSION;
|
||||
+ }
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
--
|
||||
2.1.2
|
||||
|
@ -0,0 +1,274 @@
|
||||
From 20d7a57c882c47dea7060b3a0e397f8092fdeddc Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 30 Oct 2014 17:26:42 +0100
|
||||
Subject: ntdll: Implement LZNT1 algorithm for RtlDecompressBuffer.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Based on a patch by Michael Müller.
|
||||
---
|
||||
dlls/ntdll/ntdll.spec | 2 +-
|
||||
dlls/ntdll/rtl.c | 229 ++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 223 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index 5bac269..785d5ed 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -510,7 +510,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 b790910..c9715df 100644
|
||||
--- a/dlls/ntdll/rtl.c
|
||||
+++ b/dlls/ntdll/rtl.c
|
||||
@@ -1300,17 +1300,232 @@ 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_end, *dst_cur, *dst_end;
|
||||
+ ULONG displacement_bits, length_bits;
|
||||
+ ULONG code_displacement, code_length;
|
||||
+ WORD flags, code;
|
||||
+
|
||||
+ src_cur = src;
|
||||
+ src_end = src + src_size;
|
||||
+ dst_cur = dst;
|
||||
+ dst_end = dst + dst_size;
|
||||
+
|
||||
+ /* Partial decompression is no error on Windows. */
|
||||
+ while (src_cur < src_end && dst_cur < dst_end)
|
||||
+ {
|
||||
+ /* read flags header */
|
||||
+ flags = 0x8000 | *src_cur++;
|
||||
+
|
||||
+ /* parse following 8 entities, either uncompressed data or backwards reference */
|
||||
+ 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;
|
||||
+
|
||||
+ /* ensure reference is valid */
|
||||
+ 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_end, *dst_cur, *dst_end, *ptr;
|
||||
+ ULONG chunk_size, block_size;
|
||||
+ WORD chunk_header;
|
||||
+
|
||||
+ src_cur = src;
|
||||
+ src_end = src + src_size;
|
||||
+ dst_cur = dst;
|
||||
+ dst_end = dst + dst_size;
|
||||
+
|
||||
+ if (src_cur + sizeof(WCHAR) > src_end)
|
||||
+ return STATUS_BAD_COMPRESSION_BUFFER;
|
||||
+
|
||||
+ /* skip over chunks which have a big distance (>= 0x1000) to the destination offset */
|
||||
+ while (offset >= 0x1000 && src_cur + sizeof(WCHAR) <= src_end)
|
||||
+ {
|
||||
+ /* read chunk header and extract size */
|
||||
+ chunk_header = *(WORD *)src_cur;
|
||||
+ src_cur += sizeof(WCHAR);
|
||||
+ if (!chunk_header) goto out;
|
||||
+ chunk_size = (chunk_header & 0xFFF) + 1;
|
||||
+
|
||||
+ /* ensure we have enough buffer to process chunk */
|
||||
+ if (src_cur + chunk_size > src_end)
|
||||
+ return STATUS_BAD_COMPRESSION_BUFFER;
|
||||
+
|
||||
+ src_cur += chunk_size;
|
||||
+ offset -= 0x1000;
|
||||
+ }
|
||||
+
|
||||
+ /* this chunk is can be included partially */
|
||||
+ if (offset && src_cur + sizeof(WCHAR) <= src_end)
|
||||
+ {
|
||||
+ /* read chunk header and extract size */
|
||||
+ chunk_header = *(WORD *)src_cur;
|
||||
+ src_cur += sizeof(WCHAR);
|
||||
+ if (!chunk_header) goto out;
|
||||
+ chunk_size = (chunk_header & 0xFFF) + 1;
|
||||
+
|
||||
+ /* ensure we have enough buffer to process chunk */
|
||||
+ 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;
|
||||
+ }
|
||||
+
|
||||
+ while (src_cur + sizeof(WCHAR) <= src_end)
|
||||
+ {
|
||||
+ /* read chunk header and extract size */
|
||||
+ chunk_header = *(WORD *)src_cur;
|
||||
+ src_cur += sizeof(WCHAR);
|
||||
+ if (!chunk_header) goto out;
|
||||
+ chunk_size = (chunk_header & 0xFFF) + 1;
|
||||
+
|
||||
+ /* ensure we have enough buffer to process chunk */
|
||||
+ if (src_cur + chunk_size > src_end)
|
||||
+ return STATUS_BAD_COMPRESSION_BUFFER;
|
||||
+
|
||||
+ /* add padding if required */
|
||||
+ 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;
|
||||
+ }
|
||||
+ else 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;
|
||||
+
|
||||
+}
|
||||
+
|
||||
/******************************************************************************
|
||||
- * RtlDecompressBuffer [NTDLL.@]
|
||||
+ * RtlDecompressFragment [NTDLL.@]
|
||||
*/
|
||||
-NTSTATUS WINAPI RtlDecompressBuffer(USHORT CompressionFormat, PUCHAR UncompressedBuffer,
|
||||
- ULONG UncompressedBufferSize, PUCHAR CompressedBuffer,
|
||||
- ULONG CompressedBufferSize, PULONG FinalUncompressedSize)
|
||||
+NTSTATUS RtlDecompressFragment(USHORT format, PUCHAR uncompressed, ULONG uncompressed_size,
|
||||
+ PUCHAR compressed, ULONG compressed_size, ULONG offset,
|
||||
+ PULONG final_size, PVOID workspace)
|
||||
{
|
||||
- FIXME("0x%04x, %p, %u, %p, %u, %p :stub\n", CompressionFormat, UncompressedBuffer, UncompressedBufferSize,
|
||||
- CompressedBuffer, CompressedBufferSize, FinalUncompressedSize);
|
||||
|
||||
- return STATUS_NOT_IMPLEMENTED;
|
||||
+ TRACE("0x%04x, %p, %u, %p, %u, %u, %p, %p :stub\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 %d not implemented\n", format);
|
||||
+ return STATUS_UNSUPPORTED_COMPRESSION;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * RtlDecompressBuffer [NTDLL.@]
|
||||
+ */
|
||||
+NTSTATUS WINAPI RtlDecompressBuffer(USHORT format, PUCHAR uncompressed, ULONG uncompressed_size,
|
||||
+ PUCHAR compressed, ULONG compressed_size, PULONG final_size)
|
||||
+{
|
||||
+ return RtlDecompressFragment(format, uncompressed, uncompressed_size,
|
||||
+ compressed, compressed_size, 0, final_size, NULL);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
--
|
||||
2.1.2
|
||||
|
File diff suppressed because it is too large
Load Diff
4
patches/ntdll-LZNT1_Compression/definition
Normal file
4
patches/ntdll-LZNT1_Compression/definition
Normal file
@ -0,0 +1,4 @@
|
||||
Author: Sebastian Lackner / Michael Müller
|
||||
Subject: Implement Rtl[Decompress|Compress]Buffer and RtlGetCompressionWorkSpaceSize.
|
||||
Revision: 1
|
||||
Fixes: [37449] Support for RtlDecompressBuffer
|
Loading…
x
Reference in New Issue
Block a user