Rebase against 8075101480df82c5f4280d534f2d76f035653667.

This commit is contained in:
Sebastian Lackner
2015-10-21 19:51:16 +02:00
parent 7cf357b20c
commit bd89770641
16 changed files with 175 additions and 893 deletions

View File

@@ -34,12 +34,10 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [4]:**
**Bug fixes and features included in the next upcoming release [2]:**
* Do not allow interruption of system APC in server_select ([Wine Bug #14697](https://bugs.winehq.org/show_bug.cgi?id=14697))
* Implement stub for ProcessQuotaLimits info class
* Release capture before sending WM_COMMAND ([Wine Bug #39296](https://bugs.winehq.org/show_bug.cgi?id=39296))
* Use wrapper function for consolidation callback during unwinding. ([Wine Bug #39449](https://bugs.winehq.org/show_bug.cgi?id=39449))
**Bug fixes and features in Wine Staging 1.7.53 [262]:**
@@ -248,7 +246,7 @@ for more details.*
* Return an error when trying to open a terminated process ([Wine Bug #37087](https://bugs.winehq.org/show_bug.cgi?id=37087))
* Return correct IMediaSeeking stream positions in quartz
* Return correct values for GetThreadTimes function ([Wine Bug #20230](https://bugs.winehq.org/show_bug.cgi?id=20230))
* Return default palette entries from GetSystemPaletteEntries for non-palette-based devices ([Wine Bug #36895](https://bugs.winehq.org/show_bug.cgi?id=36895))
* ~~Return default palette entries from GetSystemPaletteEntries for non-palette-based devices~~ ([Wine Bug #36895](https://bugs.winehq.org/show_bug.cgi?id=36895))
* Return dummy ID3DXSkinInfo interface when skinning info not present ([Wine Bug #33904](https://bugs.winehq.org/show_bug.cgi?id=33904))
* Return fake device type when systemroot is located on virtual disk ([Wine Bug #36546](https://bugs.winehq.org/show_bug.cgi?id=36546))
* Return proper status codes when NtReadFile/NtWriteFile is called on closed (but not disconnected) pipe

6
debian/changelog vendored
View File

@@ -9,6 +9,12 @@ wine-staging (1.7.54) UNRELEASED; urgency=low
* Partially removed patches for ws2_32 TransmitFile (accepted upstream).
* Removed patch to fix NULL dereference in ICSeqCompressFrameStart (fixed
upstream).
* Removed patch to return default palette entries from GetSystemPaletteEntries
for non-palette-based devices (accepted upstream).
* Removed patch to use wrapper function for consolidate callback during
unwinding on x86_64 (accepted upstream).
* Removed patch to release capture before sending WM_COMMAND (accepted
upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 19 Oct 2015 21:56:22 +0200
wine-staging (1.7.53) unstable; urgency=low

View File

@@ -1,191 +0,0 @@
From f3e41ff12cb58ee6cb5c36a447cfdeeda3eb21a2 Mon Sep 17 00:00:00 2001
From: Anton Baskanov <baskanov@gmail.com>
Date: Fri, 1 May 2015 13:02:28 +0600
Subject: gdi32: Return default palette entries from GetSystemPaletteEntries
for non-palette-based devices.
Fixes rendering artifacts in Marble Drop.
Changes by Sebastian Lackner <sebastian@fds-team.de>:
* Added additional tests.
* Fix comparison in GetSystemPaletteEntries.
---
dlls/gdi32/palette.c | 35 +++++++++++++-
dlls/gdi32/tests/palette.c | 112 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 145 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c
index d850d0f..70a75d8 100644
--- a/dlls/gdi32/palette.c
+++ b/dlls/gdi32/palette.c
@@ -418,8 +418,39 @@ UINT WINAPI GetSystemPaletteEntries(
if ((dc = get_dc_ptr( hdc )))
{
- PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetSystemPaletteEntries );
- ret = physdev->funcs->pGetSystemPaletteEntries( physdev, start, count, entries );
+ if (!(GetDeviceCaps( hdc, RASTERCAPS ) & RC_PALETTE))
+ {
+ if (entries && start < 256)
+ {
+ UINT i;
+ const RGBQUAD *default_entries;
+
+ if (start + count > 256) count = 256 - start;
+
+ default_entries = get_default_color_table( 8 );
+ for (i = 0; i < count; ++i)
+ {
+ if (start + i < 10 || start + i >= 246)
+ {
+ entries[i].peRed = default_entries[start + i].rgbRed;
+ entries[i].peGreen = default_entries[start + i].rgbGreen;
+ entries[i].peBlue = default_entries[start + i].rgbBlue;
+ }
+ else
+ {
+ entries[i].peRed = 0;
+ entries[i].peGreen = 0;
+ entries[i].peBlue = 0;
+ }
+ entries[i].peFlags = 0;
+ }
+ }
+ }
+ else
+ {
+ PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetSystemPaletteEntries );
+ ret = physdev->funcs->pGetSystemPaletteEntries( physdev, start, count, entries );
+ }
release_dc_ptr( dc );
}
return ret;
diff --git a/dlls/gdi32/tests/palette.c b/dlls/gdi32/tests/palette.c
index f95c0d3..09a00a5 100644
--- a/dlls/gdi32/tests/palette.c
+++ b/dlls/gdi32/tests/palette.c
@@ -191,9 +191,121 @@ static void test_halftone_palette(void)
ReleaseDC( 0, hdc );
}
+static void test_system_palette_entries(void)
+{
+ HDC hdc;
+ PALETTEENTRY entries[256];
+ PALETTEENTRY defpal[20];
+ int i, count;
+
+ hdc = GetDC(0);
+
+ if (!(GetDeviceCaps( hdc, RASTERCAPS ) & RC_PALETTE))
+ {
+ memset( defpal, 0xaa, sizeof(defpal) );
+ count = GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, 20, defpal );
+ ok( count == 20, "wrong size %u\n", count );
+
+ memset( entries, 0x55, sizeof(entries) );
+ count = GetSystemPaletteEntries( hdc, 0, 256, entries );
+ ok( count == 0, "wrong size %u\n", count);
+ for (i = 0; i < 10; i++)
+ {
+ ok( entries[i].peRed == defpal[i].peRed &&
+ entries[i].peGreen == defpal[i].peGreen &&
+ entries[i].peBlue == defpal[i].peBlue &&
+ !entries[i].peFlags,
+ "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i,
+ entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags,
+ defpal[i].peRed, defpal[i].peGreen, defpal[i].peBlue );
+ }
+ for (i = 10; i < 246; ++i)
+ {
+ ok( !entries[i].peRed &&
+ !entries[i].peGreen &&
+ !entries[i].peBlue &&
+ !entries[i].peFlags,
+ "%u: wrong color %02x,%02x,%02x,%02x instead of 0,0,0\n", i,
+ entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags);
+ }
+ for (i = 246; i < 256; i++)
+ {
+ int idx = i - 246 + 10;
+ ok( entries[i].peRed == defpal[idx].peRed &&
+ entries[i].peGreen == defpal[idx].peGreen &&
+ entries[i].peBlue == defpal[idx].peBlue &&
+ !entries[i].peFlags,
+ "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i,
+ entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags,
+ defpal[idx].peRed, defpal[idx].peGreen, defpal[idx].peBlue );
+ }
+
+ memset( entries, 0x55, sizeof(entries) );
+ count = GetSystemPaletteEntries( hdc, 0, 10, entries );
+ ok( count == 0, "wrong size %u\n", count);
+ for (i = 0; i < 10; i++)
+ {
+ ok( entries[i].peRed == defpal[i].peRed &&
+ entries[i].peGreen == defpal[i].peGreen &&
+ entries[i].peBlue == defpal[i].peBlue &&
+ !entries[i].peFlags,
+ "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i,
+ entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags,
+ defpal[i].peRed, defpal[i].peGreen, defpal[i].peBlue );
+ }
+
+ memset( entries, 0x55, sizeof(entries) );
+ count = GetSystemPaletteEntries( hdc, 10, 246, entries );
+ ok( count == 0, "wrong size %u\n", count);
+ for (i = 0; i < 236; ++i)
+ {
+ ok( !entries[i].peRed &&
+ !entries[i].peGreen &&
+ !entries[i].peBlue &&
+ !entries[i].peFlags,
+ "%u: wrong color %02x,%02x,%02x,%02x instead of 0,0,0\n", i,
+ entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags);
+ }
+ for (i = 236; i < 246; i++)
+ {
+ int idx = i - 236 + 10;
+ ok( entries[i].peRed == defpal[idx].peRed &&
+ entries[i].peGreen == defpal[idx].peGreen &&
+ entries[i].peBlue == defpal[idx].peBlue &&
+ !entries[i].peFlags,
+ "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i,
+ entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags,
+ defpal[idx].peRed, defpal[idx].peGreen, defpal[idx].peBlue );
+ }
+
+ memset( entries, 0x55, sizeof(entries) );
+ count = GetSystemPaletteEntries( hdc, 246, 10, entries );
+ ok( count == 0, "wrong size %u\n", count);
+ for (i = 0; i < 10; i++)
+ {
+ int idx = i + 10;
+ ok( entries[i].peRed == defpal[idx].peRed &&
+ entries[i].peGreen == defpal[idx].peGreen &&
+ entries[i].peBlue == defpal[idx].peBlue &&
+ !entries[i].peFlags,
+ "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i,
+ entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags,
+ defpal[idx].peRed, defpal[idx].peGreen, defpal[idx].peBlue );
+ }
+
+ }
+ else
+ {
+ skip( "device is palette-based, skipping test\n" );
+ }
+
+ ReleaseDC( 0, hdc );
+}
+
START_TEST(palette)
{
test_DIB_PAL_COLORS();
test_palette_entries();
test_halftone_palette();
+ test_system_palette_entries();
}
--
2.3.7

View File

@@ -1 +0,0 @@
Fixes: [36895] Return default palette entries from GetSystemPaletteEntries for non-palette-based devices

View File

@@ -1,94 +0,0 @@
From cea14f59b480bf408af07081dba8300cd62efbfd Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 20 Oct 2015 05:53:46 +0200
Subject: ntdll: Use wrapper function for consolidate callback on x86_64.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
---
dlls/ntdll/signal_x86_64.c | 63 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 61 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 575a770..524de68 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -3288,6 +3288,64 @@ static void call_teb_unwind_handler( EXCEPTION_RECORD *rec, DISPATCHER_CONTEXT *
}
+/**********************************************************************
+ * call_consolidate_callback
+ *
+ * Wrapper function to call a consolidate callback from a fake frame.
+ * If the callback executes RtlUnwindEx (like for example done in C++ handlers),
+ * we have to skip all frames which were already processed. To do that we
+ * trick the unwinding functions into thinking the call came from somewhere
+ * else. All CFI instructions are either DW_CFA_def_cfa_expression or
+ * DW_CFA_expression, and the expressions have the following format:
+ *
+ * DW_OP_breg6; sleb128 0x10 | Load %rbp + 0x10
+ * DW_OP_deref | Get *(%rbp + 0x10) == context
+ * DW_OP_plus_uconst; uleb128 <OFFSET> | Add offset to get struct member
+ * [DW_OP_deref] | Dereference, only for CFA
+ */
+extern void * WINAPI call_consolidate_callback( CONTEXT *context,
+ void *(CALLBACK *callback)(EXCEPTION_RECORD *),
+ EXCEPTION_RECORD *rec );
+__ASM_GLOBAL_FUNC( call_consolidate_callback,
+ "pushq %rbp\n\t"
+ __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t")
+ __ASM_CFI(".cfi_rel_offset %rbp,0\n\t")
+ "movq %rsp,%rbp\n\t"
+ __ASM_CFI(".cfi_def_cfa_register %rbp\n\t")
+ "subq $0x20,%rsp\n\t"
+ "movq %rcx,0x10(%rbp)\n\t"
+ __ASM_CFI(".cfi_remember_state\n\t")
+ __ASM_CFI(".cfi_escape 0x0f,0x07,0x76,0x10,0x06,0x23,0x98,0x01,0x06\n\t") /* CFA */
+ __ASM_CFI(".cfi_escape 0x10,0x03,0x06,0x76,0x10,0x06,0x23,0x90,0x01\n\t") /* %rbx */
+ __ASM_CFI(".cfi_escape 0x10,0x04,0x06,0x76,0x10,0x06,0x23,0xa8,0x01\n\t") /* %rsi */
+ __ASM_CFI(".cfi_escape 0x10,0x05,0x06,0x76,0x10,0x06,0x23,0xb0,0x01\n\t") /* %rdi */
+ __ASM_CFI(".cfi_escape 0x10,0x06,0x06,0x76,0x10,0x06,0x23,0xa0,0x01\n\t") /* %rbp */
+ __ASM_CFI(".cfi_escape 0x10,0x0c,0x06,0x76,0x10,0x06,0x23,0xd8,0x01\n\t") /* %r12 */
+ __ASM_CFI(".cfi_escape 0x10,0x0d,0x06,0x76,0x10,0x06,0x23,0xe0,0x01\n\t") /* %r13 */
+ __ASM_CFI(".cfi_escape 0x10,0x0e,0x06,0x76,0x10,0x06,0x23,0xe8,0x01\n\t") /* %r14 */
+ __ASM_CFI(".cfi_escape 0x10,0x0f,0x06,0x76,0x10,0x06,0x23,0xf0,0x01\n\t") /* %r15 */
+ __ASM_CFI(".cfi_escape 0x10,0x10,0x06,0x76,0x10,0x06,0x23,0xf8,0x01\n\t") /* %rip */
+ __ASM_CFI(".cfi_escape 0x10,0x17,0x06,0x76,0x10,0x06,0x23,0x80,0x04\n\t") /* %xmm6 */
+ __ASM_CFI(".cfi_escape 0x10,0x18,0x06,0x76,0x10,0x06,0x23,0x90,0x04\n\t") /* %xmm7 */
+ __ASM_CFI(".cfi_escape 0x10,0x19,0x06,0x76,0x10,0x06,0x23,0xa0,0x04\n\t") /* %xmm8 */
+ __ASM_CFI(".cfi_escape 0x10,0x1a,0x06,0x76,0x10,0x06,0x23,0xb0,0x04\n\t") /* %xmm9 */
+ __ASM_CFI(".cfi_escape 0x10,0x1b,0x06,0x76,0x10,0x06,0x23,0xc0,0x04\n\t") /* %xmm10 */
+ __ASM_CFI(".cfi_escape 0x10,0x1c,0x06,0x76,0x10,0x06,0x23,0xd0,0x04\n\t") /* %xmm11 */
+ __ASM_CFI(".cfi_escape 0x10,0x1d,0x06,0x76,0x10,0x06,0x23,0xe0,0x04\n\t") /* %xmm12 */
+ __ASM_CFI(".cfi_escape 0x10,0x1e,0x06,0x76,0x10,0x06,0x23,0xf0,0x04\n\t") /* %xmm13 */
+ __ASM_CFI(".cfi_escape 0x10,0x1f,0x06,0x76,0x10,0x06,0x23,0x80,0x05\n\t") /* %xmm14 */
+ __ASM_CFI(".cfi_escape 0x10,0x20,0x06,0x76,0x10,0x06,0x23,0x90,0x05\n\t") /* %xmm15 */
+ "movq %r8,%rcx\n\t"
+ "callq *%rdx\n\t"
+ __ASM_CFI(".cfi_restore_state\n\t")
+ "movq %rbp,%rsp\n\t"
+ __ASM_CFI(".cfi_def_cfa_register %rsp\n\t")
+ "popq %rbp\n\t"
+ __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t")
+ __ASM_CFI(".cfi_same_value %rbp\n\t")
+ "ret")
+
+
/*******************************************************************
* RtlUnwindEx (NTDLL.@)
*/
@@ -3474,8 +3532,9 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
else if (rec->ExceptionCode == STATUS_UNWIND_CONSOLIDATE && rec->NumberParameters >= 1)
{
PVOID (CALLBACK *consolidate)(EXCEPTION_RECORD *) = (void *)rec->ExceptionInformation[0];
- TRACE( "calling consolidate callback %p\n", consolidate );
- target_ip = consolidate( rec );
+ TRACE( "calling consolidate callback %p (rec=%p)\n", consolidate, rec );
+ target_ip = call_consolidate_callback( context, consolidate, rec );
+ TRACE( "-> target=%p\n", target_ip );
}
context->Rax = (ULONG64)retval;
context->Rip = (ULONG64)target_ip;
--
2.6.1

View File

@@ -1 +0,0 @@
Fixes: [39449] Use wrapper function for consolidation callback during unwinding.

View File

@@ -1,21 +1,21 @@
From eac9db85f7a5703a41bb956a9cabc2277872881d Mon Sep 17 00:00:00 2001
From 0a7a9cfce718a28567b87a5bf6776632af629d41 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 20:56:49 -0700
Subject: ntdll: Add support for junction point creation.
---
dlls/ntdll/file.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/file.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/file.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++
include/Makefile.in | 1 +
include/ntifs.h | 52 +++++++++++++++++++++++++++
4 files changed, 236 insertions(+)
4 files changed, 238 insertions(+)
create mode 100644 include/ntifs.h
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 8503dd8..fb171f2 100644
index fecec13..d8bb01b 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -88,12 +88,14 @@
@@ -103,12 +103,14 @@
#include "winioctl.h"
#include "ddk/ntddk.h"
#include "ddk/ntddser.h"
@@ -30,7 +30,7 @@ index 8503dd8..fb171f2 100644
#define SECSPERDAY 86400
#define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
@@ -1633,6 +1635,76 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
@@ -1655,6 +1657,76 @@ NTSTATUS WINAPI SYSCALL(NtDeviceIoControlFile)(HANDLE handle, HANDLE event,
}
@@ -107,10 +107,16 @@ index 8503dd8..fb171f2 100644
/**************************************************************************
* NtFsControlFile [NTDLL.@]
* ZwFsControlFile [NTDLL.@]
@@ -1780,6 +1852,23 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
@@ -1803,11 +1875,30 @@ NTSTATUS WINAPI SYSCALL(NtFsControlFile)(HANDLE handle, HANDLE event, PIO_APC_RO
}
break;
}
+
case FSCTL_SET_SPARSE:
TRACE("FSCTL_SET_SPARSE: Ignoring request\n");
io->Information = 0;
status = STATUS_SUCCESS;
break;
+
+ case FSCTL_SET_REPARSE_POINT:
+ {
@@ -128,11 +134,12 @@ index 8503dd8..fb171f2 100644
+ }
+ break;
+ }
+
case FSCTL_PIPE_LISTEN:
case FSCTL_PIPE_WAIT:
default:
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 3696124..b7b9e00 100644
index 55e34ad..71e10c2 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -37,6 +37,7 @@
@@ -143,7 +150,7 @@ index 3696124..b7b9e00 100644
#ifndef IO_COMPLETION_ALL_ACCESS
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
@@ -2866,6 +2867,98 @@ static void test_query_ea(void)
@@ -4273,6 +4274,98 @@ static void test_query_ea(void)
#undef EA_BUFFER_SIZE
}
@@ -242,17 +249,17 @@ index 3696124..b7b9e00 100644
START_TEST(file)
{
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
@@ -2922,4 +3015,5 @@ START_TEST(file)
@@ -4332,4 +4425,5 @@ START_TEST(file)
test_query_volume_information_file();
test_query_attribute_information_file();
test_query_ea();
+ test_junction_points();
}
diff --git a/include/Makefile.in b/include/Makefile.in
index 499c5d4..e410e14 100644
index c5563a2..1e60e08 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -479,6 +479,7 @@ SRCDIR_INCLUDES = \
@@ -493,6 +493,7 @@ SRCDIR_INCLUDES = \
ntddstor.h \
ntdef.h \
ntdsapi.h \
@@ -319,5 +326,5 @@ index 0000000..db07c28
+
+#endif /* __WINE_NTIFS_H */
--
2.4.2
2.6.1

View File

@@ -1,18 +1,18 @@
From 8770e934e61e237b6ef88b5442e7635542d99d4c Mon Sep 17 00:00:00 2001
From 4489ca1cdd1eeb62b129e4f83278da14af653468 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 20:57:57 -0700
Subject: ntdll: Add support for reading junction points.
---
dlls/ntdll/file.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/file.c | 14 ++++++++++-
dlls/ntdll/file.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/file.c | 14 ++++++++++-
2 files changed, 76 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 8413ad1..39044ee 100644
index d8bb01b..6e73547 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1542,6 +1542,60 @@ cleanup:
@@ -1727,6 +1727,60 @@ cleanup:
}
@@ -73,9 +73,9 @@ index 8413ad1..39044ee 100644
/**************************************************************************
* NtFsControlFile [NTDLL.@]
* ZwFsControlFile [NTDLL.@]
@@ -1690,6 +1744,15 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
@@ -1882,6 +1936,15 @@ NTSTATUS WINAPI SYSCALL(NtFsControlFile)(HANDLE handle, HANDLE event, PIO_APC_RO
status = STATUS_SUCCESS;
break;
}
+ case FSCTL_GET_REPARSE_POINT:
+ {
@@ -90,10 +90,10 @@ index 8413ad1..39044ee 100644
{
REPARSE_DATA_BUFFER *buffer = (REPARSE_DATA_BUFFER *)in_buffer;
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 90e753d..5c218d7 100644
index 71e10c2..e07e6a8 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -2713,9 +2713,10 @@ static void test_junction_points(void)
@@ -4303,9 +4303,10 @@ static void test_junction_points(void)
static const WCHAR dotW[] = {'.',0};
REPARSE_DATA_BUFFER *buffer = NULL;
DWORD dwret, dwLen, dwFlags;
@@ -105,7 +105,7 @@ index 90e753d..5c218d7 100644
BOOL bret;
/* Create a temporary folder for the junction point tests */
@@ -2763,6 +2764,17 @@ static void test_junction_points(void)
@@ -4353,6 +4354,17 @@ static void test_junction_points(void)
buffer_len = build_reparse_buffer(nameW.Buffer, &buffer);
bret = DeviceIoControl(hJunction, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
@@ -124,5 +124,5 @@ index 90e753d..5c218d7 100644
cleanup:
--
1.7.9.5
2.6.1

View File

@@ -1,19 +1,19 @@
From 2e0449be946b4d73a4debb712d5032d79bd93878 Mon Sep 17 00:00:00 2001
From 295b74af626b2870ff5f6923d7138f0c0ccb7346 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 21:00:21 -0700
Subject: ntdll: Add support for deleting junction points.
---
dlls/ntdll/file.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/file.c | 23 +++++++++++++++++++++
include/ntifs.h | 11 ++++++++++
dlls/ntdll/file.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/file.c | 23 ++++++++++++++++++++++
include/ntifs.h | 11 +++++++++++
3 files changed, 85 insertions(+)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 39044ee..c8d1a31 100644
index 6e73547..7abbc89 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1596,6 +1596,41 @@ cleanup:
@@ -1781,6 +1781,41 @@ cleanup:
}
@@ -55,9 +55,9 @@ index 39044ee..c8d1a31 100644
/**************************************************************************
* NtFsControlFile [NTDLL.@]
* ZwFsControlFile [NTDLL.@]
@@ -1744,6 +1779,22 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
@@ -1936,6 +1971,22 @@ NTSTATUS WINAPI SYSCALL(NtFsControlFile)(HANDLE handle, HANDLE event, PIO_APC_RO
status = STATUS_SUCCESS;
break;
}
+ case FSCTL_DELETE_REPARSE_POINT:
+ {
@@ -79,10 +79,10 @@ index 39044ee..c8d1a31 100644
{
REPARSE_DATA_BUFFER *buffer = (REPARSE_DATA_BUFFER *)out_buffer;
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 5c218d7..f84f6ea 100644
index e07e6a8..b9aa665 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -2708,12 +2708,15 @@ static void test_junction_points(void)
@@ -4298,12 +4298,15 @@ static void test_junction_points(void)
static const WCHAR junctionW[] = {'\\','j','u','n','c','t','i','o','n',0};
WCHAR path[MAX_PATH], junction_path[MAX_PATH], target_path[MAX_PATH];
static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0};
@@ -98,7 +98,7 @@ index 5c218d7..f84f6ea 100644
UNICODE_STRING nameW;
HANDLE hJunction;
WCHAR *dest;
@@ -2761,6 +2764,8 @@ static void test_junction_points(void)
@@ -4351,6 +4354,8 @@ static void test_junction_points(void)
win_skip("Failed to open junction point directory handle (0x%x).\n", GetLastError());
goto cleanup;
}
@@ -107,7 +107,7 @@ index 5c218d7..f84f6ea 100644
buffer_len = build_reparse_buffer(nameW.Buffer, &buffer);
bret = DeviceIoControl(hJunction, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
@@ -2775,6 +2780,24 @@ static void test_junction_points(void)
@@ -4365,6 +4370,24 @@ static void test_junction_points(void)
ok(bret, "Failed to read junction point!\n");
ok((memcmp(dest, nameW.Buffer, string_len) == 0), "Junction point destination does not match ('%s' != '%s')!\n",
wine_dbgstr_w(dest), wine_dbgstr_w(nameW.Buffer));
@@ -155,5 +155,5 @@ index db07c28..cb8638b 100644
#endif /* __WINE_NTIFS_H */
--
1.7.9.5
2.6.1

View File

@@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "59cca65ce0edd88b65a55a847468761e11dfab0b"
echo "8075101480df82c5f4280d534f2d76f035653667"
}
# Show version information
@@ -137,7 +137,6 @@ patch_enable_all ()
enable_dxgi_MakeWindowAssociation="$1"
enable_dxva2_Video_Decoder="$1"
enable_fonts_Missing_Fonts="$1"
enable_gdi32_Default_Palette="$1"
enable_gdi32_Lazy_Font_Initialization="$1"
enable_gdi32_MaxPixelFormats="$1"
enable_gdi32_MultiMonitor="$1"
@@ -180,7 +179,6 @@ patch_enable_all ()
enable_ntdll_APC_Start_Process="$1"
enable_ntdll_Activation_Context="$1"
enable_ntdll_CLI_Images="$1"
enable_ntdll_Consolidation_Callback="$1"
enable_ntdll_DOS_Attributes="$1"
enable_ntdll_Dealloc_Thread_Stack="$1"
enable_ntdll_DeviceType_Systemroot="$1"
@@ -278,7 +276,6 @@ patch_enable_all ()
enable_user32_Mouse_Message_Hwnd="$1"
enable_user32_Painting="$1"
enable_user32_Refresh_MDI_Menus="$1"
enable_user32_ReleaseCapture="$1"
enable_user32_ScrollWindowEx="$1"
enable_user32_WndProc="$1"
enable_uxtheme_GTK_Theming="$1"
@@ -509,9 +506,6 @@ patch_enable ()
fonts-Missing_Fonts)
enable_fonts_Missing_Fonts="$2"
;;
gdi32-Default_Palette)
enable_gdi32_Default_Palette="$2"
;;
gdi32-Lazy_Font_Initialization)
enable_gdi32_Lazy_Font_Initialization="$2"
;;
@@ -638,9 +632,6 @@ patch_enable ()
ntdll-CLI_Images)
enable_ntdll_CLI_Images="$2"
;;
ntdll-Consolidation_Callback)
enable_ntdll_Consolidation_Callback="$2"
;;
ntdll-DOS_Attributes)
enable_ntdll_DOS_Attributes="$2"
;;
@@ -932,9 +923,6 @@ patch_enable ()
user32-Refresh_MDI_Menus)
enable_user32_Refresh_MDI_Menus="$2"
;;
user32-ReleaseCapture)
enable_user32_ReleaseCapture="$2"
;;
user32-ScrollWindowEx)
enable_user32_ScrollWindowEx="$2"
;;
@@ -3142,21 +3130,6 @@ if test "$enable_fonts_Missing_Fonts" -eq 1; then
) >> "$patchlist"
fi
# Patchset gdi32-Default_Palette
# |
# | This patchset fixes the following Wine bugs:
# | * [#36895] Return default palette entries from GetSystemPaletteEntries for non-palette-based devices
# |
# | Modified files:
# | * dlls/gdi32/palette.c, dlls/gdi32/tests/palette.c
# |
if test "$enable_gdi32_Default_Palette" -eq 1; then
patch_apply gdi32-Default_Palette/0001-gdi32-Return-default-palette-entries-from-GetSystemP.patch
(
echo '+ { "Anton Baskanov", "gdi32: Return default palette entries from GetSystemPaletteEntries for non-palette-based devices.", 1 },';
) >> "$patchlist"
fi
# Patchset gdi32-Lazy_Font_Initialization
# |
# | Modified files:
@@ -3910,21 +3883,6 @@ if test "$enable_ntdll_CLI_Images" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-Consolidation_Callback
# |
# | This patchset fixes the following Wine bugs:
# | * [#39449] Use wrapper function for consolidation callback during unwinding.
# |
# | Modified files:
# | * dlls/ntdll/signal_x86_64.c
# |
if test "$enable_ntdll_Consolidation_Callback" -eq 1; then
patch_apply ntdll-Consolidation_Callback/0001-ntdll-Use-wrapper-function-for-consolidation-callbac.patch
(
echo '+ { "Sebastian Lackner", "ntdll: Use wrapper function for consolidate callback on x86_64.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-Syscall_Wrappers
# |
# | This patchset fixes the following Wine bugs:
@@ -5453,21 +5411,6 @@ if test "$enable_user32_Refresh_MDI_Menus" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-ReleaseCapture
# |
# | This patchset fixes the following Wine bugs:
# | * [#39296] Release capture before sending WM_COMMAND
# |
# | Modified files:
# | * dlls/user32/button.c
# |
if test "$enable_user32_ReleaseCapture" -eq 1; then
patch_apply user32-ReleaseCapture/0001-user32-Release-capture-before-sending-WM_COMMAND.patch
(
echo '+ { "Alex Henrie", "user32: Release capture before sending WM_COMMAND.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-ScrollWindowEx
# |
# | This patchset fixes the following Wine bugs:
@@ -6546,11 +6489,9 @@ fi
# | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, include/winsock.h, server/protocol.def, server/sock.c
# |
if test "$enable_ws2_32_TransmitFile" -eq 1; then
patch_apply ws2_32-TransmitFile/0001-ws2_32-Add-asynchronous-support-for-TransmitFile.-re.patch
patch_apply ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_DISCONNECT-to-TransmitFile.patch
patch_apply ws2_32-TransmitFile/0003-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch
patch_apply ws2_32-TransmitFile/0001-ws2_32-Add-support-for-TF_DISCONNECT-to-TransmitFile.patch
patch_apply ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch
(
echo '+ { "Erich E. Hoover", "ws2_32: Add asynchronous support for TransmitFile.", 1 },';
echo '+ { "Erich E. Hoover", "ws2_32: Add support for TF_DISCONNECT to TransmitFile.", 1 },';
echo '+ { "Erich E. Hoover", "ws2_32: Add support for TF_REUSE_SOCKET to TransmitFile.", 1 },';
) >> "$patchlist"

View File

@@ -1,34 +0,0 @@
From 031d48634a011950fec9990d4bccf835d5b016fa Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Mon, 12 Oct 2015 01:30:51 -0600
Subject: user32: Release capture before sending WM_COMMAND.
Fixes https://bugs.winehq.org/show_bug.cgi?id=39296
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
dlls/user32/button.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index eeb3035..db479a8 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -353,9 +353,13 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
(state & BST_INDETERMINATE) ? 0 : ((state & 3) + 1), 0 );
break;
}
+ ReleaseCapture();
BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
}
- ReleaseCapture();
+ else
+ {
+ ReleaseCapture();
+ }
break;
case WM_CAPTURECHANGED:
--
2.6.1

View File

@@ -1 +0,0 @@
Fixes: [39296] Release capture before sending WM_COMMAND

File diff suppressed because it is too large Load Diff

View File

@@ -1,348 +0,0 @@
From 38e2c0d234e1d3615ac26eeb4808a0446a6c72de Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Wed, 7 Oct 2015 12:19:42 -0600
Subject: ws2_32: Add asynchronous support for TransmitFile.
Signed-off-by: Erich E. Hoover <erich.e.hoover@wine-staging.com>
---
dlls/ws2_32/socket.c | 89 ++++++++++++++++++++++++++++++++++++++--------
dlls/ws2_32/tests/sock.c | 91 ++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 160 insertions(+), 20 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index bc29f6d..4531b81 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -177,6 +177,8 @@
#define TCP_KEEPIDLE TCP_KEEPALIVE
#endif
+#define FILE_USE_FILE_POINTER_POSITION ((LONGLONG)-2)
+
WINE_DEFAULT_DEBUG_CHANNEL(winsock);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
@@ -524,6 +526,7 @@ struct ws2_transmitfile_async
DWORD bytes_per_send;
TRANSMIT_FILE_BUFFERS buffers;
DWORD flags;
+ LARGE_INTEGER offset;
struct ws2_async write;
};
@@ -2742,9 +2745,10 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
*
* Perform an APC-safe ReadFile operation
*/
-static NTSTATUS WS2_ReadFile(HANDLE hFile, PIO_STATUS_BLOCK io_status, char* buffer, ULONG length)
+static NTSTATUS WS2_ReadFile(HANDLE hFile, PIO_STATUS_BLOCK io_status, char* buffer, ULONG length,
+ PLARGE_INTEGER offset)
{
- int result, unix_handle;
+ int result = -1, unix_handle;
unsigned int options;
NTSTATUS status;
@@ -2753,8 +2757,12 @@ static NTSTATUS WS2_ReadFile(HANDLE hFile, PIO_STATUS_BLOCK io_status, char* buf
status = wine_server_handle_to_fd( hFile, FILE_READ_DATA, &unix_handle, &options );
if (status) return status;
- while ((result = read( unix_handle, buffer, length )) == -1)
+ while (result == -1)
{
+ if (offset && offset->QuadPart != FILE_USE_FILE_POINTER_POSITION)
+ result = pread( unix_handle, buffer, length, offset->QuadPart );
+ else
+ result = read( unix_handle, buffer, length );
if (errno != EINTR)
break;
}
@@ -2772,6 +2780,8 @@ static NTSTATUS WS2_ReadFile(HANDLE hFile, PIO_STATUS_BLOCK io_status, char* buf
TRACE("= 0x%08x (%d)\n", status, result);
if (status == STATUS_SUCCESS || status == STATUS_END_OF_FILE)
{
+ if (offset && offset->QuadPart != FILE_USE_FILE_POINTER_POSITION)
+ offset->QuadPart += result;
io_status->u.Status = status;
io_status->Information = result;
}
@@ -2811,7 +2821,7 @@ static NTSTATUS WS2_transmitfile_getbuffer( int fd, struct ws2_transmitfile_asyn
/* when the size of the transfer is limited ensure that we don't go past that limit */
if (wsa->file_bytes != 0)
bytes_per_send = min(bytes_per_send, wsa->file_bytes - wsa->file_read);
- status = WS2_ReadFile( wsa->file, &iosb, wsa->buffer, bytes_per_send );
+ status = WS2_ReadFile( wsa->file, &iosb, wsa->buffer, bytes_per_send, &wsa->offset );
if (status == STATUS_END_OF_FILE)
wsa->file = NULL; /* continue on to the footer */
else if (status != STATUS_SUCCESS)
@@ -2860,10 +2870,15 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws
status = WS2_transmitfile_getbuffer( fd, wsa );
if (status == STATUS_PENDING)
{
+ IO_STATUS_BLOCK *iosb = (IO_STATUS_BLOCK *)wsa->write.user_overlapped;
int n;
n = WS2_send( fd, &wsa->write, convert_flags(wsa->write.flags) );
- if (n == -1 && errno != EAGAIN)
+ if (n >= 0)
+ {
+ if (iosb) iosb->Information += n;
+ }
+ else if (errno != EAGAIN)
return wsaErrStatus();
}
@@ -2871,26 +2886,46 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws
}
/***********************************************************************
+ * WS2_async_transmitfile (INTERNAL)
+ *
+ * Asynchronous callback for overlapped TransmitFile operations.
+ */
+static NTSTATUS WS2_async_transmitfile( void *user, IO_STATUS_BLOCK *iosb,
+ NTSTATUS status, void **apc, void **arg )
+{
+ struct ws2_transmitfile_async *wsa = user;
+ int fd;
+
+ if (status == STATUS_ALERTED)
+ {
+ if (!(status = wine_server_handle_to_fd( wsa->write.hSocket, FILE_WRITE_DATA, &fd, NULL )))
+ {
+ status = WS2_transmitfile_base( fd, wsa );
+ wine_server_release_fd( wsa->write.hSocket, fd );
+ }
+ if (status == STATUS_PENDING)
+ return status;
+ }
+
+ iosb->u.Status = status;
+ release_async_io( &wsa->io );
+ return status;
+}
+
+/***********************************************************************
* TransmitFile
*/
static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD bytes_per_send,
LPOVERLAPPED overlapped, LPTRANSMIT_FILE_BUFFERS buffers,
DWORD flags )
{
+ IO_STATUS_BLOCK *iosb = (IO_STATUS_BLOCK *)overlapped;
union generic_unix_sockaddr uaddr;
unsigned int uaddrlen = sizeof(uaddr);
struct ws2_transmitfile_async *wsa;
NTSTATUS status;
int fd;
- if (overlapped)
- {
- FIXME("(%lx, %p, %d, %d, %p, %p, %d): stub !\n", s, h, file_bytes, bytes_per_send,
- overlapped, buffers, flags);
- WSASetLastError( WSAEOPNOTSUPP );
- return FALSE;
- }
-
TRACE("(%lx, %p, %d, %d, %p, %p, %d)\n", s, h, file_bytes, bytes_per_send, overlapped,
buffers, flags );
@@ -2937,6 +2972,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD
wsa->file_bytes = file_bytes;
wsa->bytes_per_send = bytes_per_send;
wsa->flags = flags;
+ wsa->offset.QuadPart = FILE_USE_FILE_POINTER_POSITION;
wsa->write.hSocket = SOCKET2HANDLE(s);
wsa->write.addr = NULL;
wsa->write.addrlen.val = 0;
@@ -2945,7 +2981,32 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD
wsa->write.control = NULL;
wsa->write.n_iovecs = 0;
wsa->write.first_iovec = 0;
- wsa->write.user_overlapped = NULL;
+ wsa->write.user_overlapped = overlapped;
+ if (overlapped)
+ {
+ int status;
+
+ wsa->offset.u.LowPart = overlapped->u.s.Offset;
+ wsa->offset.u.HighPart = overlapped->u.s.OffsetHigh;
+ iosb->u.Status = STATUS_PENDING;
+ iosb->Information = 0;
+ SERVER_START_REQ( register_async )
+ {
+ req->type = ASYNC_TYPE_WRITE;
+ req->async.handle = wine_server_obj_handle( SOCKET2HANDLE(s) );
+ req->async.event = wine_server_obj_handle( overlapped->hEvent );
+ req->async.callback = wine_server_client_ptr( WS2_async_transmitfile );
+ req->async.iosb = wine_server_client_ptr( iosb );
+ req->async.arg = wine_server_client_ptr( wsa );
+ status = wine_server_call( req );
+ }
+ SERVER_END_REQ;
+
+ if(status != STATUS_PENDING) HeapFree( GetProcessHeap(), 0, wsa );
+ release_sock_fd( s, fd );
+ WSASetLastError( NtStatusToWSAError(status) );
+ return FALSE;
+ }
do
{
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 3d20c89..29e20c3 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -7429,15 +7429,15 @@ end:
closesocket(connector2);
}
-#define compare_file(h,s) compare_file2(h,s,__FILE__,__LINE__)
+#define compare_file(h,s,o) compare_file2(h,s,o,__FILE__,__LINE__)
-static void compare_file2(HANDLE handle, SOCKET sock, const char *file, int line)
+static void compare_file2(HANDLE handle, SOCKET sock, int offset, const char *file, int line)
{
char buf1[256], buf2[256];
BOOL success;
int i = 0;
- SetFilePointer(handle, 0, NULL, FILE_BEGIN);
+ SetFilePointer(handle, offset, NULL, FILE_BEGIN);
while (1)
{
DWORD n1 = 0, n2 = 0;
@@ -7457,6 +7457,7 @@ static void compare_file2(HANDLE handle, SOCKET sock, const char *file, int line
static void test_TransmitFile(void)
{
+ DWORD num_bytes, err, file_size, total_sent;
GUID transmitFileGuid = WSAID_TRANSMITFILE;
LPFN_TRANSMITFILE pTransmitFile = NULL;
HANDLE file = INVALID_HANDLE_VALUE;
@@ -7466,11 +7467,13 @@ static void test_TransmitFile(void)
struct sockaddr_in bindAddress;
TRANSMIT_FILE_BUFFERS buffers;
SOCKET client, server, dest;
- DWORD num_bytes, err;
+ WSAOVERLAPPED ov;
char buf[256];
int iret, len;
BOOL bret;
+ memset( &ov, 0, sizeof(ov) );
+
/* Setup sockets for testing TransmitFile */
client = socket(AF_INET, SOCK_STREAM, 0);
server = socket(AF_INET, SOCK_STREAM, 0);
@@ -7494,6 +7497,7 @@ static void test_TransmitFile(void)
skip("Unable to open a file to transmit.\n");
goto cleanup;
}
+ file_size = GetFileSize(file, NULL);
/* Test TransmitFile with an invalid socket */
bret = pTransmitFile(INVALID_SOCKET, file, 0, 0, NULL, NULL, 0);
@@ -7567,7 +7571,7 @@ static void test_TransmitFile(void)
/* Test TransmitFile with only file data */
bret = pTransmitFile(client, file, 0, 0, NULL, NULL, 0);
ok(bret, "TransmitFile failed unexpectedly.\n");
- compare_file(file, dest);
+ compare_file(file, dest, 0);
/* Test TransmitFile with both file and buffer data */
buffers.Head = &header_msg[0];
@@ -7580,7 +7584,81 @@ static void test_TransmitFile(void)
iret = recv(dest, buf, sizeof(header_msg)+1, 0);
ok(memcmp(buf, &header_msg[0], sizeof(header_msg)+1) == 0,
"TransmitFile header buffer did not match!\n");
- compare_file(file, dest);
+ compare_file(file, dest, 0);
+ iret = recv(dest, buf, sizeof(footer_msg)+1, 0);
+ ok(memcmp(buf, &footer_msg[0], sizeof(footer_msg)+1) == 0,
+ "TransmitFile footer buffer did not match!\n");
+
+ /* Test overlapped TransmitFile */
+ ov.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
+ if (ov.hEvent == INVALID_HANDLE_VALUE)
+ {
+ skip("Could not create event object, some tests will be skipped. errno = %d\n",
+ GetLastError());
+ goto cleanup;
+ }
+ SetFilePointer(file, 0, NULL, FILE_BEGIN);
+ bret = pTransmitFile(client, file, 0, 0, &ov, NULL, 0);
+ err = WSAGetLastError();
+ ok(!bret, "TransmitFile succeeded unexpectedly.\n");
+ ok(err == ERROR_IO_PENDING, "TransmitFile triggered unexpected errno (%d != %d)\n",
+ err, ERROR_IO_PENDING);
+ iret = WaitForSingleObject(ov.hEvent, 2000);
+ ok(iret == WAIT_OBJECT_0, "Overlapped TransmitFile failed.\n");
+ WSAGetOverlappedResult(client, &ov, &total_sent, FALSE, NULL);
+ ok(total_sent == file_size,
+ "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n",
+ total_sent, file_size);
+ compare_file(file, dest, 0);
+
+ /* Test overlapped TransmitFile w/ start offset */
+ ov.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
+ if (ov.hEvent == INVALID_HANDLE_VALUE)
+ {
+ skip("Could not create event object, some tests will be skipped. errno = %d\n", GetLastError());
+ goto cleanup;
+ }
+ SetFilePointer(file, 0, NULL, FILE_BEGIN);
+ ov.Offset = 10;
+ bret = pTransmitFile(client, file, 0, 0, &ov, NULL, 0);
+ err = WSAGetLastError();
+ ok(!bret, "TransmitFile succeeded unexpectedly.\n");
+ ok(err == ERROR_IO_PENDING, "TransmitFile triggered unexpected errno (%d != %d)\n", err, ERROR_IO_PENDING);
+ iret = WaitForSingleObject(ov.hEvent, 2000);
+ ok(iret == WAIT_OBJECT_0, "Overlapped TransmitFile failed.\n");
+ WSAGetOverlappedResult(client, &ov, &total_sent, FALSE, NULL);
+ ok(total_sent == (file_size - ov.Offset),
+ "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n",
+ total_sent, file_size - ov.Offset);
+ compare_file(file, dest, ov.Offset);
+
+ /* Test overlapped TransmitFile w/ file and buffer data */
+ ov.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
+ if (ov.hEvent == INVALID_HANDLE_VALUE)
+ {
+ skip("Could not create event object, some tests will be skipped. errno = %d\n", GetLastError());
+ goto cleanup;
+ }
+ buffers.Head = &header_msg[0];
+ buffers.HeadLength = sizeof(header_msg)+1;
+ buffers.Tail = &footer_msg[0];
+ buffers.TailLength = sizeof(footer_msg)+1;
+ SetFilePointer(file, 0, NULL, FILE_BEGIN);
+ ov.Offset = 0;
+ bret = pTransmitFile(client, file, 0, 0, &ov, &buffers, 0);
+ err = WSAGetLastError();
+ ok(!bret, "TransmitFile succeeded unexpectedly.\n");
+ ok(err == ERROR_IO_PENDING, "TransmitFile triggered unexpected errno (%d != %d)\n", err, ERROR_IO_PENDING);
+ iret = WaitForSingleObject(ov.hEvent, 2000);
+ ok(iret == WAIT_OBJECT_0, "Overlapped TransmitFile failed.\n");
+ WSAGetOverlappedResult(client, &ov, &total_sent, FALSE, NULL);
+ ok(total_sent == (file_size + buffers.HeadLength + buffers.TailLength),
+ "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n",
+ total_sent, file_size + buffers.HeadLength + buffers.TailLength);
+ iret = recv(dest, buf, sizeof(header_msg)+1, 0);
+ ok(memcmp(buf, &header_msg[0], sizeof(header_msg)+1) == 0,
+ "TransmitFile header buffer did not match!\n");
+ compare_file(file, dest, 0);
iret = recv(dest, buf, sizeof(footer_msg)+1, 0);
ok(memcmp(buf, &footer_msg[0], sizeof(footer_msg)+1) == 0,
"TransmitFile footer buffer did not match!\n");
@@ -7595,6 +7673,7 @@ static void test_TransmitFile(void)
cleanup:
CloseHandle(file);
+ CloseHandle(ov.hEvent);
closesocket(client);
closesocket(server);
}
--
2.6.1

View File

@@ -1,4 +1,4 @@
From 0a0a7b4793378c54346cd0e9e7feae6eb2a89dc3 Mon Sep 17 00:00:00 2001
From 0a7427437a87557be853c5d27e11b62436a00848 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Wed, 4 Mar 2015 13:16:20 -0700
Subject: ws2_32: Add support for TF_DISCONNECT to TransmitFile.
@@ -9,10 +9,10 @@ Subject: ws2_32: Add support for TF_DISCONNECT to TransmitFile.
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 4531b81..0f94a57 100644
index b0cbb11..7deaeda 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2882,7 +2882,16 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws
@@ -2883,7 +2883,16 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws
return wsaErrStatus();
}
@@ -30,14 +30,14 @@ index 4531b81..0f94a57 100644
}
/***********************************************************************
@@ -2919,6 +2928,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD
@@ -2920,6 +2929,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD
LPOVERLAPPED overlapped, LPTRANSMIT_FILE_BUFFERS buffers,
DWORD flags )
{
+ DWORD unsupported_flags = flags & ~(TF_DISCONNECT);
IO_STATUS_BLOCK *iosb = (IO_STATUS_BLOCK *)overlapped;
union generic_unix_sockaddr uaddr;
unsigned int uaddrlen = sizeof(uaddr);
struct ws2_transmitfile_async *wsa;
@@ -2941,8 +2951,8 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD
WSASetLastError( WSAENOTCONN );
return FALSE;

View File

@@ -1,4 +1,4 @@
From 0b55083552779d1148c04778f5479e5fc4e6d6e4 Mon Sep 17 00:00:00 2001
From 58723ec84900590ae95a7abd688540d963372993 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 19:08:30 -0700
Subject: ws2_32: Add support for TF_REUSE_SOCKET to TransmitFile.
@@ -12,10 +12,10 @@ Subject: ws2_32: Add support for TF_REUSE_SOCKET to TransmitFile.
5 files changed, 75 insertions(+), 11 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index f530a94..bf33e25 100644
index 7deaeda..258f121 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2810,6 +2810,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws
@@ -2886,6 +2886,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws
if (status != STATUS_SUCCESS)
return status;
@@ -33,20 +33,20 @@ index f530a94..bf33e25 100644
if (wsa->flags & TF_DISCONNECT)
{
/* we can't use WS_closesocket because it modifies the last error */
@@ -2853,7 +2864,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD
@@ -2929,7 +2940,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD
LPOVERLAPPED overlapped, LPTRANSMIT_FILE_BUFFERS buffers,
DWORD flags )
{
- DWORD unsupported_flags = flags & ~(TF_DISCONNECT);
+ DWORD unsupported_flags = flags & ~(TF_DISCONNECT|TF_REUSE_SOCKET);
IO_STATUS_BLOCK *iosb = (IO_STATUS_BLOCK *)overlapped;
union generic_unix_sockaddr uaddr;
unsigned int uaddrlen = sizeof(uaddr);
struct ws2_transmitfile_async *wsa;
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index a8abdee..58d8db7 100644
index d5c206c..4e1a432 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -7566,7 +7566,6 @@ static void test_TransmitFile(void)
@@ -7675,7 +7675,6 @@ static void test_TransmitFile(void)
err, WSAENOTSOCK);
/* Test TransmitFile with a UDP datagram socket */
@@ -67,10 +67,10 @@ index 50237e8..e53aa1e 100644
#define FD_WINE_NONBLOCKING 0x20000000
#define FD_WINE_CONNECTED 0x40000000
diff --git a/server/protocol.def b/server/protocol.def
index 9c4dab4..0694f99 100644
index c313006..5588f6a 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1230,6 +1230,12 @@ enum server_fd_type
@@ -1263,6 +1263,12 @@ enum server_fd_type
@END
@@ -84,7 +84,7 @@ index 9c4dab4..0694f99 100644
@REQ(set_socket_event)
obj_handle_t handle; /* handle to the socket */
diff --git a/server/sock.c b/server/sock.c
index c4dcf6f..fb80bc7 100644
index 1767dea..0f029bf 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -86,6 +86,7 @@
@@ -95,7 +95,7 @@ index c4dcf6f..fb80bc7 100644
#define FD_WINE_LISTENING 0x10000000
#define FD_WINE_NONBLOCKING 0x20000000
#define FD_WINE_CONNECTED 0x40000000
@@ -134,6 +135,7 @@ static obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_da
@@ -133,6 +134,7 @@ static obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, const async_da
static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
static void sock_reselect_async( struct fd *fd, struct async_queue *queue );
static int sock_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb );
@@ -103,7 +103,7 @@ index c4dcf6f..fb80bc7 100644
static int sock_get_ntstatus( int err );
static int sock_get_error( int err );
@@ -155,7 +157,7 @@ static const struct object_ops sock_ops =
@@ -154,7 +156,7 @@ static const struct object_ops sock_ops =
default_set_sd, /* set_sd */
no_lookup_name, /* lookup_name */
no_open_file, /* open_file */
@@ -112,7 +112,7 @@ index c4dcf6f..fb80bc7 100644
sock_destroy /* destroy */
};
@@ -628,6 +630,47 @@ static struct fd *sock_get_fd( struct object *obj )
@@ -626,6 +628,47 @@ static struct fd *sock_get_fd( struct object *obj )
return (struct fd *)grab_object( sock->fd );
}
@@ -160,7 +160,7 @@ index c4dcf6f..fb80bc7 100644
static void sock_destroy( struct object *obj )
{
struct sock *sock = (struct sock *)obj;
@@ -679,15 +722,8 @@ static struct object *create_socket( int family, int type, int protocol, unsigne
@@ -677,15 +720,8 @@ static struct object *create_socket( int family, int type, int protocol, unsigne
struct sock *sock;
int sockfd;
@@ -177,7 +177,7 @@ index c4dcf6f..fb80bc7 100644
if (!(sock = alloc_object( &sock_ops )))
{
close( sockfd );
@@ -1286,6 +1322,17 @@ DECL_HANDLER(accept_into_socket)
@@ -1261,6 +1297,17 @@ DECL_HANDLER(accept_into_socket)
release_object( sock );
}
@@ -196,5 +196,5 @@ index c4dcf6f..fb80bc7 100644
DECL_HANDLER(set_socket_event)
{
--
2.3.7
2.6.1