Removed various patches (accepted upstream), disabled patchset for TransmitFile (rewrite in progress).

This commit is contained in:
Sebastian Lackner 2015-03-03 18:18:58 +01:00
parent cb7f47b637
commit 4d3a96536e
17 changed files with 108 additions and 699 deletions

View File

@ -38,7 +38,7 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
===================================
**Bugfixes and features included in the next upcoming release [16]:**
**Bugfixes and features included in the next upcoming release [15]:**
* Add stub for gdiplus.GdipCreateEffect ([Wine Bug #32163](https://bugs.winehq.org/show_bug.cgi?id=32163))
* Add support for CopyFileEx progress callback ([Wine Bug #22692](https://bugs.winehq.org/show_bug.cgi?id=22692))
@ -50,7 +50,6 @@ Included bug fixes and improvements
* Enforce that surfaces are flushed after ReleaseDC
* Fallback to global key state for threads without a queue ([Wine Bug #27238](https://bugs.winehq.org/show_bug.cgi?id=27238))
* Fix crash in clip_cursor_notify caused by uninitialized TLS
* Fix crash when trying to switch back to a 16-bit stack
* Fix race-condition when threads are killed during shutdown
* Implement SetFileInformationByHandle
* Process Hacker 2.x needs ntoskrnl.ProbeForRead ([Wine Bug #38103](https://bugs.winehq.org/show_bug.cgi?id=38103))

4
debian/changelog vendored
View File

@ -1,6 +1,7 @@
wine-staging (1.7.38) UNRELEASED; urgency=low
* Various improvements to patchupdate.py.
* Disabled patchset for reg.exe cleanup (partially accepted upstream).
* Disabled patchset for TransmitFile (rewrite in progress).
* Added patch to mark DllCanUnloadNow and DllGetClassObject as private (by Amine Khaldi, wine-patched/pull/3).
* Added patch to skip Wine specific __wine_check_for_events calls in ReactOS (by Amine Khaldi, wine-patched/pull/4).
* Added patch to declare pDirectInputCreateEx in a MSVC compatible way (by Amine Khaldi, wine-patched/pull/5).
@ -42,6 +43,9 @@ wine-staging (1.7.38) UNRELEASED; urgency=low
* Removed patch to avoid accessing stack below ESP when restoring thread context (accepted upstream).
* Removed patch to fix mouse jittering in Planetside 2 (accepted upstream).
* Removed patch to handle write watches while we're on the signal stack (accepted upstream).
* Removed patch with tests for NtQueryLicenseKey (accepted upstream).
* Removed patch to fix crash when trying to switch back to a 16-bit stack (accepted upstream).
* Removed patch to fix definition of SECTION_BASIC_INFORMATION and SECTION_IMAGE_INFORMATION (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 23 Feb 2015 18:24:51 +0100
wine-staging (1.7.37) unstable; urgency=low

View File

@ -1,4 +1,4 @@
From a1d2578281a218b32b84d4be18c75680439f60c9 Mon Sep 17 00:00:00 2001
From 1b7cdebf9ee746d71dee0f69d5fa4da63a3ef5f0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 15 Aug 2014 22:23:08 +0200
Subject: ntdll: Unify similar code in NtReadFile and FILE_AsyncReadService.
@ -19,10 +19,10 @@ Changes in FILE_AsyncReadService:
1 file changed, 45 insertions(+), 61 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 01cef2c..a20c3e8 100644
index 7995738..bc3c894 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -411,50 +411,63 @@ NTSTATUS FILE_GetNtStatus(void)
@@ -437,6 +437,44 @@ NTSTATUS FILE_GetNtStatus(void)
}
}
@ -67,7 +67,8 @@ index 01cef2c..a20c3e8 100644
/***********************************************************************
* FILE_AsyncReadService (INTERNAL)
*/
static NTSTATUS FILE_AsyncReadService(void *user, PIO_STATUS_BLOCK iosb, NTSTATUS status, void **apc)
@@ -444,44 +482,19 @@ static NTSTATUS FILE_AsyncReadService( void *user, IO_STATUS_BLOCK *iosb,
NTSTATUS status, void **apc, void **arg )
{
struct async_fileio_read *fileio = user;
- int fd, needs_close, result;
@ -116,7 +117,7 @@ index 01cef2c..a20c3e8 100644
break;
case STATUS_TIMEOUT:
@@ -603,7 +616,6 @@ static NTSTATUS get_io_avail_mode( HANDLE handle, enum server_fd_type type, BOOL
@@ -632,7 +645,6 @@ static NTSTATUS get_io_avail_mode( HANDLE handle, enum server_fd_type type, BOOL
return status;
}
@ -124,7 +125,7 @@ index 01cef2c..a20c3e8 100644
/******************************************************************************
* NtReadFile [NTDLL.@]
* ZwReadFile [NTDLL.@]
@@ -696,37 +708,9 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
@@ -725,37 +737,9 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
for (;;)
{
@ -165,5 +166,5 @@ index 01cef2c..a20c3e8 100644
if (async_read)
{
--
2.1.3
2.3.0

View File

@ -1,4 +1,4 @@
From cbfe442e44c7297e524c1e3b6ae077b2c84d4ab5 Mon Sep 17 00:00:00 2001
From 27b2dcf526597a12cfebcbc6bb53d45185b6f65f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 18 Aug 2014 01:48:17 +0200
Subject: ntdll: Unify similar code in NtWriteFile and FILE_AsyncWriteService.
@ -14,10 +14,10 @@ Changes in FILE_AsyncWriteService:
1 file changed, 35 insertions(+), 43 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 8de4b98..e8a1066 100644
index 54f31d6..f6679b1 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -926,6 +926,37 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
@@ -953,6 +953,37 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
return status;
}
@ -55,8 +55,8 @@ index 8de4b98..e8a1066 100644
/***********************************************************************
* FILE_AsyncWriteService (INTERNAL)
@@ -933,7 +964,7 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
static NTSTATUS FILE_AsyncWriteService(void *user, IO_STATUS_BLOCK *iosb, NTSTATUS status, void **apc)
@@ -961,7 +992,7 @@ static NTSTATUS FILE_AsyncWriteService( void *user, IO_STATUS_BLOCK *iosb,
NTSTATUS status, void **apc, void **arg )
{
struct async_fileio_write *fileio = user;
- int result, fd, needs_close;
@ -64,7 +64,7 @@ index 8de4b98..e8a1066 100644
enum server_fd_type type;
switch (status)
@@ -943,24 +974,8 @@ static NTSTATUS FILE_AsyncWriteService(void *user, IO_STATUS_BLOCK *iosb, NTSTAT
@@ -971,24 +1002,8 @@ static NTSTATUS FILE_AsyncWriteService( void *user, IO_STATUS_BLOCK *iosb,
if ((status = server_get_unix_fd( fileio->io.handle, FILE_WRITE_DATA, &fd,
&needs_close, &type, NULL )))
break;
@ -90,7 +90,7 @@ index 8de4b98..e8a1066 100644
break;
case STATUS_TIMEOUT:
@@ -1120,32 +1135,9 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
@@ -1150,32 +1165,9 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
for (;;)
{
@ -126,5 +126,5 @@ index 8de4b98..e8a1066 100644
if (async_write)
{
--
2.1.3
2.3.0

View File

@ -1,56 +0,0 @@
From ec38765fa45f37f6fa4f347506746cabb3cf8a91 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 16 Oct 2014 22:36:58 +0200
Subject: include: Fix definition of SECTION_BASIC_INFORMATION and
SECTION_IMAGE_INFORMATION.
---
include/winternl.h | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/include/winternl.h b/include/winternl.h
index 1a694da..3992309 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1792,23 +1792,28 @@ typedef enum _SECTION_INFORMATION_CLASS
} SECTION_INFORMATION_CLASS;
typedef struct _SECTION_BASIC_INFORMATION {
- ULONG BaseAddress;
+ PVOID BaseAddress;
ULONG Attributes;
LARGE_INTEGER Size;
} SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
typedef struct _SECTION_IMAGE_INFORMATION {
- PVOID EntryPoint;
- ULONG StackZeroBits;
- ULONG StackReserved;
- ULONG StackCommit;
- ULONG ImageSubsystem;
+ PVOID TransferAddress;
+ ULONG ZeroBits;
+ SIZE_T MaximumStackSize;
+ SIZE_T CommittedStackSize;
+ ULONG SubSystemType;
WORD SubsystemVersionLow;
WORD SubsystemVersionHigh;
- ULONG Unknown1;
- ULONG ImageCharacteristics;
- ULONG ImageMachineType;
- ULONG Unknown2[3];
+ ULONG GpValue;
+ USHORT ImageCharacteristics;
+ USHORT DllCharacteristics;
+ USHORT Machine;
+ BOOLEAN ImageContainsCode;
+ UCHAR ImageFlags;
+ ULONG LoaderFlags;
+ ULONG ImageFileSize;
+ ULONG CheckSum;
} SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
typedef struct _LPC_SECTION_WRITE {
--
2.3.0

View File

@ -1,55 +1,23 @@
From b2606e85a68efcaf3e3b3a0011c44900c5641359 Mon Sep 17 00:00:00 2001
From 12070adf96edad008609db450efcc2e01b052f87 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 1 Feb 2015 18:14:09 +0100
Subject: ntdll/tests: Add tests for Tp* threadpool functions.
---
dlls/ntdll/tests/Makefile.in | 1 +
dlls/ntdll/tests/threadpool.c | 780 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 781 insertions(+)
create mode 100644 dlls/ntdll/tests/threadpool.c
dlls/ntdll/tests/threadpool.c | 664 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 663 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/Makefile.in b/dlls/ntdll/tests/Makefile.in
index 81b4466..fc352dd 100644
--- a/dlls/ntdll/tests/Makefile.in
+++ b/dlls/ntdll/tests/Makefile.in
@@ -21,4 +21,5 @@ C_SRCS = \
rtlbitmap.c \
rtlstr.c \
string.c \
+ threadpool.c \
time.c
diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c
new file mode 100644
index 0000000..61f72ec
--- /dev/null
index 2e31b34..d27627e 100644
--- a/dlls/ntdll/tests/threadpool.c
+++ b/dlls/ntdll/tests/threadpool.c
@@ -0,0 +1,780 @@
+/* Unit test suite for Threadpool functions
+ *
+ * Copyright 2015 Sebastian Lackner
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "ntdll_test.h"
+
+static HMODULE hntdll = 0;
@@ -21,9 +21,39 @@
#include "ntdll_test.h"
static HMODULE hntdll = 0;
+static NTSTATUS (WINAPI *pTpAllocCleanupGroup)(TP_CLEANUP_GROUP **);
+static NTSTATUS (WINAPI *pTpAllocIoCompletion)(TP_IO **,HANDLE,PTP_WIN32_IO_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
+static NTSTATUS (WINAPI *pTpAllocPool)(TP_POOL **,PVOID);
static NTSTATUS (WINAPI *pTpAllocPool)(TP_POOL **,PVOID);
+static NTSTATUS (WINAPI *pTpAllocTimer)(TP_TIMER **,PTP_TIMER_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
+static NTSTATUS (WINAPI *pTpAllocWait)(TP_WAIT **,PTP_WAIT_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
+static NTSTATUS (WINAPI *pTpAllocWork)(TP_WORK **,PTP_WORK_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
@ -66,7 +34,7 @@ index 0000000..61f72ec
+static VOID (WINAPI *pTpReleaseCleanupGroup)(TP_CLEANUP_GROUP *);
+static VOID (WINAPI *pTpReleaseCleanupGroupMembers)(TP_CLEANUP_GROUP *,BOOL,PVOID);
+static VOID (WINAPI *pTpReleaseIoCompletion)(TP_IO *);
+static VOID (WINAPI *pTpReleasePool)(TP_POOL *);
static VOID (WINAPI *pTpReleasePool)(TP_POOL *);
+static VOID (WINAPI *pTpReleaseTimer)(TP_TIMER *);
+static VOID (WINAPI *pTpReleaseWait)(TP_WAIT *);
+static VOID (WINAPI *pTpReleaseWork)(TP_WORK *);
@ -74,33 +42,22 @@ index 0000000..61f72ec
+static BOOL (WINAPI *pTpSetPoolMinThreads)(TP_POOL *,DWORD);
+static VOID (WINAPI *pTpSetTimer)(TP_TIMER *,LARGE_INTEGER *,LONG,LONG);
+static VOID (WINAPI *pTpSetWait)(TP_WAIT *,HANDLE,LARGE_INTEGER *);
+static NTSTATUS (WINAPI *pTpSimpleTryPost)(PTP_SIMPLE_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
static NTSTATUS (WINAPI *pTpSimpleTryPost)(PTP_SIMPLE_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
+static VOID (WINAPI *pTpStartAsyncIoOperation)(TP_IO *);
+static VOID (WINAPI *pTpWaitForIoCompletion)(TP_IO *,BOOL);
+static VOID (WINAPI *pTpWaitForTimer)(TP_TIMER *,BOOL);
+static VOID (WINAPI *pTpWaitForWait)(TP_WAIT *,BOOL);
+static VOID (WINAPI *pTpWaitForWork)(TP_WORK *,BOOL);
+
+#define NTDLL_GET_PROC(func) \
+ do \
+ { \
+ p ## func = (void *)GetProcAddress(hntdll, #func); \
+ if (!p ## func) trace("Failed to get address for %s\n", #func); \
+ } \
+ while (0)
+
+static BOOL init_threadpool(void)
+{
+ hntdll = GetModuleHandleA("ntdll");
+ if (!hntdll)
+ {
+ win_skip("Could not load ntdll\n");
+ return FALSE;
+ }
+
#define NTDLL_GET_PROC(func) \
do \
@@ -42,13 +72,43 @@ static BOOL init_threadpool(void)
return FALSE;
}
+ NTDLL_GET_PROC(TpAllocCleanupGroup);
+ NTDLL_GET_PROC(TpAllocIoCompletion);
+ NTDLL_GET_PROC(TpAllocPool);
NTDLL_GET_PROC(TpAllocPool);
+ NTDLL_GET_PROC(TpAllocTimer);
+ NTDLL_GET_PROC(TpAllocWait);
+ NTDLL_GET_PROC(TpAllocWork);
@ -117,7 +74,7 @@ index 0000000..61f72ec
+ NTDLL_GET_PROC(TpReleaseCleanupGroup);
+ NTDLL_GET_PROC(TpReleaseCleanupGroupMembers);
+ NTDLL_GET_PROC(TpReleaseIoCompletion);
+ NTDLL_GET_PROC(TpReleasePool);
NTDLL_GET_PROC(TpReleasePool);
+ NTDLL_GET_PROC(TpReleaseTimer);
+ NTDLL_GET_PROC(TpReleaseWait);
+ NTDLL_GET_PROC(TpReleaseWork);
@ -125,84 +82,57 @@ index 0000000..61f72ec
+ NTDLL_GET_PROC(TpSetPoolMinThreads);
+ NTDLL_GET_PROC(TpSetTimer);
+ NTDLL_GET_PROC(TpSetWait);
+ NTDLL_GET_PROC(TpSimpleTryPost);
NTDLL_GET_PROC(TpSimpleTryPost);
+ NTDLL_GET_PROC(TpStartAsyncIoOperation);
+ NTDLL_GET_PROC(TpWaitForIoCompletion);
+ NTDLL_GET_PROC(TpWaitForTimer);
+ NTDLL_GET_PROC(TpWaitForWait);
+ NTDLL_GET_PROC(TpWaitForWork);
+
+ if (!pTpAllocPool)
+ {
if (!pTpAllocPool)
{
- skip("Threadpool functions not supported, skipping tests\n");
+ win_skip("Threadpool functions not supported, skipping tests\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+#undef NTDLL_GET_PROC
+
+
+static void CALLBACK simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
return FALSE;
}
@@ -65,13 +125,23 @@ static void CALLBACK simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
ReleaseSemaphore(semaphore, 1, NULL);
}
+static void CALLBACK simple2_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
+{
+ trace("Running simple callback\n");
+ Sleep(100);
+ InterlockedIncrement( (LONG *)userdata );
+ InterlockedIncrement((LONG *)userdata);
+}
+
+static void test_default_threadpool(void)
+{
+ TP_CALLBACK_ENVIRON environment;
+ NTSTATUS status;
+ LONG userdata;
+
+ /* Post the callback and manually wait until it has finished */
+ userdata = 0;
+ memset(&environment, 0, sizeof(environment));
+ environment.Version = 1;
+ status = pTpSimpleTryPost(simple_cb, &userdata, &environment);
+ ok(!status, "TpSimpleTryPost failed with status %x\n", status);
+ while (userdata == 0) Sleep(10);
+ ok(userdata == 1, "expected userdata = 1, got %u\n", userdata);
+}
+
+static void test_tp_simple(void)
+{
+ TP_CALLBACK_ENVIRON environment;
static void test_tp_simple(void)
{
TP_CALLBACK_ENVIRON environment;
+ TP_CLEANUP_GROUP *group;
+ TP_POOL *pool;
+ NTSTATUS status;
HANDLE semaphore;
NTSTATUS status;
TP_POOL *pool;
+ LONG userdata;
DWORD result;
+ int i;
+
+ /* Allocate new threadpool */
+ pool = NULL;
+ status = pTpAllocPool(&pool, NULL);
+ ok(!status, "TpAllocPool failed with status %x\n", status);
+ ok(pool != NULL, "expected pool != NULL\n");
+
+ /* Post the callback and manually wait until it has finished */
+ userdata = 0;
+ memset(&environment, 0, sizeof(environment));
+ environment.Version = 1;
+ environment.Pool = pool;
+ status = pTpSimpleTryPost(simple_cb, &userdata, &environment);
+ ok(!status, "TpSimpleTryPost failed with status %x\n", status);
+ while (userdata == 0) Sleep(10);
+ ok(userdata == 1, "expected userdata = 1, got %u\n", userdata);
+
+ /* Test with invalid version number */
+ userdata = 0;
+ memset(&environment, 0, sizeof(environment));
+ environment.Version = 9999;
+ environment.Pool = pool;
+ status = pTpSimpleTryPost(simple_cb, &userdata, &environment);
+ ok(!status, "TpSimpleTryPost failed with status %x\n", status);
+ while (userdata == 0) Sleep(10);
+ ok(userdata == 1, "expected userdata = 1, got %u\n", userdata);
+
+ /* Allocate a cleanup group for synchronization */
semaphore = CreateSemaphoreA(NULL, 0, 1, NULL);
ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError());
@@ -105,6 +175,7 @@ static void test_tp_simple(void)
environment.Version = 9999;
environment.Pool = pool;
status = pTpSimpleTryPost(simple_cb, semaphore, &environment);
+ todo_wine
ok(status == STATUS_INVALID_PARAMETER || broken(!status) /* Vista/2008 */,
"TpSimpleTryPost unexpectedly returned status %x\n", status);
if (!status)
@@ -113,9 +184,591 @@ static void test_tp_simple(void)
ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result);
}
+ /* allocate a cleanup group for synchronization */
+ group = NULL;
+ status = pTpAllocCleanupGroup(&group);
+ ok(!status, "TpAllocCleanupGroup failed with status %x\n", status);
@ -213,7 +143,7 @@ index 0000000..61f72ec
+ environment.Version = 1;
+ environment.Pool = pool;
+ environment.CleanupGroup = group;
+ status = pTpSimpleTryPost(simple_cb, &userdata, &environment);
+ status = pTpSimpleTryPost(simple2_cb, &userdata, &environment);
+ ok(!status, "TpSimpleTryPost failed with status %x\n", status);
+
+ pTpReleaseCleanupGroupMembers(group, FALSE, NULL);
@ -227,16 +157,17 @@ index 0000000..61f72ec
+ environment.CleanupGroup = group;
+ for (i = 0; i < 100; i++)
+ {
+ status = pTpSimpleTryPost(simple_cb, &userdata, &environment);
+ status = pTpSimpleTryPost(simple2_cb, &userdata, &environment);
+ ok(!status, "TpSimpleTryPost failed with status %x\n", status);
+ }
+
+ pTpReleaseCleanupGroupMembers(group, TRUE, NULL);
+ ok(userdata < 100, "expected userdata < 100, got %u\n", userdata);
+
+ /* Cleanup */
/* cleanup */
+ pTpReleaseCleanupGroup(group);
+ pTpReleasePool(pool);
+ CloseHandle(semaphore);
+}
+
+static void CALLBACK work_cb(TP_CALLBACK_INSTANCE *instance, void *userdata, TP_WORK *work)
@ -366,7 +297,7 @@ index 0000000..61f72ec
+ /* Cleanup */
+ pTpReleaseWork(work);
+ pTpReleaseCleanupGroup(group);
+ pTpReleasePool(pool);
pTpReleasePool(pool);
+}
+
+static void CALLBACK instance_cb(TP_CALLBACK_INSTANCE *instance, void *userdata)
@ -496,7 +427,7 @@ index 0000000..61f72ec
+ ok(ret == WAIT_OBJECT_0, "expected ret = WAIT_OBJECT_0, got %u\n", ret);
+ while (userdata != 2) Sleep(10);
+
+ CloseHandle(semaphore);
CloseHandle(semaphore);
+
+ /* Cleanup */
+ pTpReleasePool(pool);
@ -786,15 +717,13 @@ index 0000000..61f72ec
+ pTpReleaseTimer(timer);
+ pTpReleaseTimer(timer2);
+ pTpReleasePool(pool);
+}
+
+START_TEST(threadpool)
+{
+ if(!init_threadpool())
+ return;
+
+ test_default_threadpool();
+ test_tp_simple();
}
START_TEST(threadpool)
@@ -124,4 +777,13 @@ START_TEST(threadpool)
return;
test_tp_simple();
+ test_tp_work();
+ test_tp_work_scheduler();
+ test_tp_instance();
@ -804,7 +733,7 @@ index 0000000..61f72ec
+
+ /* FIXME: Make sure worker threads have terminated before. */
+ Sleep(100);
+}
}
--
2.2.2
2.3.0

View File

@ -1,4 +1,4 @@
From eabc190f60fddb8d6e454da9686a403ae8391939 Mon Sep 17 00:00:00 2001
From c5ee3c98cf283e254fa1d572d8732ce8aa2ad203 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 6 Feb 2015 20:09:41 +0100
Subject: ntdll/tests: Add tests for threadpool wait objects.
@ -8,10 +8,10 @@ Subject: ntdll/tests: Add tests for threadpool wait objects.
1 file changed, 287 insertions(+)
diff --git a/dlls/ntdll/tests/threadpool.c b/dlls/ntdll/tests/threadpool.c
index 61f72ec..424fde2 100644
index d1223d5..13c4dc8 100644
--- a/dlls/ntdll/tests/threadpool.c
+++ b/dlls/ntdll/tests/threadpool.c
@@ -761,6 +761,291 @@ static void test_tp_window_length(void)
@@ -770,6 +770,291 @@ static void test_tp_window_length(void)
pTpReleasePool(pool);
}
@ -302,8 +302,8 @@ index 61f72ec..424fde2 100644
+
START_TEST(threadpool)
{
if(!init_threadpool())
@@ -774,6 +1059,8 @@ START_TEST(threadpool)
if (!init_threadpool())
@@ -782,6 +1067,8 @@ START_TEST(threadpool)
test_tp_group_cancel();
test_tp_timer();
test_tp_window_length();
@ -313,5 +313,5 @@ index 61f72ec..424fde2 100644
/* FIXME: Make sure worker threads have terminated before. */
Sleep(100);
--
2.2.2
2.3.0

View File

@ -197,7 +197,6 @@ patch_enable_all ()
enable_wine_inf_Performance="$1"
enable_wineboot_HKEY_DYN_DATA="$1"
enable_winebuild_LinkerVersion="$1"
enable_winebuild_Restore_Context="$1"
enable_winecfg_Libraries="$1"
enable_winecfg_Staging="$1"
enable_wined3d_CSMT_Helper="$1"
@ -218,7 +217,6 @@ patch_enable_all ()
enable_winmm_Delay_Import_Depends="$1"
enable_wpcap_Dynamic_Linking="$1"
enable_ws2_32_Connect_Time="$1"
enable_ws2_32_TransmitFile="$1"
enable_ws2_32_WriteWatches="$1"
enable_ws2_32_getaddrinfo="$1"
enable_wtsapi32_EnumerateProcesses="$1"
@ -633,9 +631,6 @@ patch_enable ()
winebuild-LinkerVersion)
enable_winebuild_LinkerVersion="$2"
;;
winebuild-Restore_Context)
enable_winebuild_Restore_Context="$2"
;;
winecfg-Libraries)
enable_winecfg_Libraries="$2"
;;
@ -696,9 +691,6 @@ patch_enable ()
ws2_32-Connect_Time)
enable_ws2_32_Connect_Time="$2"
;;
ws2_32-TransmitFile)
enable_ws2_32_TransmitFile="$2"
;;
ws2_32-WriteWatches)
enable_ws2_32_WriteWatches="$2"
;;
@ -1121,12 +1113,10 @@ if test "$enable_ws2_32_WriteWatches" -eq 1; then
patch_apply ws2_32-WriteWatches/0001-ntdll-Handle-write-watches-in-virtual_uninterrupted_.patch
patch_apply ws2_32-WriteWatches/0002-ntdll-Expose-wine_uninterrupted_-read-write-_memory-.patch
patch_apply ws2_32-WriteWatches/0003-ws2_32-Avoid-race-conditions-of-async-WSARecv-operat.patch
patch_apply ws2_32-WriteWatches/0004-ws2_32-Avoid-race-condition-with-write-watches-in-WS.patch
(
echo '+ { "Sebastian Lackner", "ntdll: Handle write watches in virtual_uninterrupted_write_memory.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll: Expose wine_uninterrupted_[read|write]_memory as exports.", 1 },';
echo '+ { "Sebastian Lackner", "ws2_32: Avoid race-conditions of async WSARecv() operations with write watches.", 2 },';
echo '+ { "Sebastian Lackner", "ws2_32: Avoid race-condition with write watches in WS2_async_accept.", 1 },';
) >> "$patchlist"
fi
@ -2830,15 +2820,13 @@ fi
# | * [#37338] Support for NtQuerySection
# |
# | Modified files:
# | * dlls/kernel32/tests/virtual.c, dlls/ntdll/nt.c, dlls/ntdll/ntdll.spec, dlls/ntdll/virtual.c, include/winternl.h,
# | server/mapping.c, server/protocol.def
# | * dlls/kernel32/tests/virtual.c, dlls/ntdll/nt.c, dlls/ntdll/ntdll.spec, dlls/ntdll/virtual.c, server/mapping.c,
# | server/protocol.def
# |
if test "$enable_ntdll_NtQuerySection" -eq 1; then
patch_apply ntdll-NtQuerySection/0001-include-Fix-definition-of-SECTION_BASIC_INFORMATION-.patch
patch_apply ntdll-NtQuerySection/0002-ntdll-Implement-NtQuerySection.patch
patch_apply ntdll-NtQuerySection/0003-kernel32-tests-Add-tests-for-NtQuerySection.patch
patch_apply ntdll-NtQuerySection/0001-ntdll-Implement-NtQuerySection.patch
patch_apply ntdll-NtQuerySection/0002-kernel32-tests-Add-tests-for-NtQuerySection.patch
(
echo '+ { "Dmitry Timoshkov", "include: Fix definition of SECTION_BASIC_INFORMATION and SECTION_IMAGE_INFORMATION.", 1 },';
echo '+ { "Dmitry Timoshkov", "ntdll: Implement NtQuerySection.", 2 },';
echo '+ { "Dmitry Timoshkov", "kernel32/tests: Add tests for NtQuerySection.", 2 },';
) >> "$patchlist"
@ -2951,8 +2939,7 @@ fi
# |
# | Modified files:
# | * dlls/kernel32/kernel32.spec, dlls/kernel32/tests/thread.c, dlls/kernel32/thread.c, dlls/ntdll/Makefile.in,
# | dlls/ntdll/ntdll.spec, dlls/ntdll/tests/Makefile.in, dlls/ntdll/tests/threadpool.c, dlls/ntdll/threadpool2.c,
# | include/winternl.h
# | dlls/ntdll/ntdll.spec, dlls/ntdll/tests/threadpool.c, dlls/ntdll/threadpool2.c, include/winternl.h
# |
if test "$enable_ntdll_Vista_Threadpool" -eq 1; then
patch_apply ntdll-Vista_Threadpool/0001-ntdll-Add-threadpool-stub-functions-to-specfile.patch
@ -3681,11 +3668,9 @@ fi
# | include/winternl.h, loader/wine.inf.in
# |
if test "$enable_slc_SLGetWindowsInformation" -eq 1; then
patch_apply slc-SLGetWindowsInformation/0001-ntdll-tests-Add-tests-for-NtQueryLicenseKey.patch
patch_apply slc-SLGetWindowsInformation/0002-ntdll-Implement-Nt-Zw-QueryLicenseValue.patch
patch_apply slc-SLGetWindowsInformation/0003-slc-Implement-SLGetWindowsInformationDWORD.patch
patch_apply slc-SLGetWindowsInformation/0001-ntdll-Implement-Nt-Zw-QueryLicenseValue.patch
patch_apply slc-SLGetWindowsInformation/0002-slc-Implement-SLGetWindowsInformationDWORD.patch
(
echo '+ { "Sebastian Lackner", "ntdll/tests: Add tests for NtQueryLicenseKey.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll: Implement [Nt|Zw]QueryLicenseValue.", 1 },';
echo '+ { "Sebastian Lackner", "slc: Implement SLGetWindowsInformationDWORD.", 1 },';
) >> "$patchlist"
@ -3960,18 +3945,6 @@ if test "$enable_winebuild_LinkerVersion" -eq 1; then
) >> "$patchlist"
fi
# Patchset winebuild-Restore_Context
# |
# | Modified files:
# | * tools/winebuild/relay.c
# |
if test "$enable_winebuild_Restore_Context" -eq 1; then
patch_apply winebuild-Restore_Context/0001-winebuild-Conditionally-use-different-code-for-resto.patch
(
echo '+ { "Sebastian Lackner", "winebuild: Conditionally use different code for restoring the context structure.", 1 },';
) >> "$patchlist"
fi
# Patchset winecfg-Libraries
# |
# | This patchset fixes the following Wine bugs:
@ -4244,29 +4217,6 @@ if test "$enable_ws2_32_Connect_Time" -eq 1; then
) >> "$patchlist"
fi
# Patchset ws2_32-TransmitFile
# |
# | This patchset fixes the following Wine bugs:
# | * [#5048] Support for TransmitFile
# |
# | Modified files:
# | * 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-stub-for-TransmitFile.patch
patch_apply ws2_32-TransmitFile/0002-ws2_32-Check-for-invalid-parameters-in-TransmitFile.patch
patch_apply ws2_32-TransmitFile/0003-ws2_32-Implement-a-basic-synchronous-TransmitFile.patch
patch_apply ws2_32-TransmitFile/0004-ws2_32-Add-asynchronous-support-for-TransmitFile.patch
patch_apply ws2_32-TransmitFile/0005-ws2_32-Add-support-for-TF_DISCONNECT-and-TF_REUSE_SO.patch
(
echo '+ { "Erich E. Hoover", "ws2_32: Add stub for TransmitFile.", 1 },';
echo '+ { "Erich E. Hoover", "ws2_32: Check for invalid parameters in TransmitFile.", 1 },';
echo '+ { "Erich E. Hoover", "ws2_32: Implement a basic synchronous TransmitFile.", 1 },';
echo '+ { "Erich E. Hoover", "ws2_32: Add asynchronous support for TransmitFile.", 1 },';
echo '+ { "Erich E. Hoover", "ws2_32: Add support for TF_DISCONNECT and TF_REUSE_SOCKET to TransmitFile.", 1 },';
) >> "$patchlist"
fi
# Patchset ws2_32-getaddrinfo
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,224 +0,0 @@
From d472e386628175207a8e51bcc6a4d357bbf970a9 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 22 Dec 2014 07:58:10 +0100
Subject: ntdll/tests: Add tests for NtQueryLicenseKey.
---
dlls/ntdll/tests/reg.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c
index 08af73e..1606f8f 100644
--- a/dlls/ntdll/tests/reg.c
+++ b/dlls/ntdll/tests/reg.c
@@ -130,6 +130,7 @@ static NTSTATUS (WINAPI * pNtCreateKey)( PHANDLE retkey, ACCESS_MASK access, con
ULONG TitleIndex, const UNICODE_STRING *class, ULONG options,
PULONG dispos );
static NTSTATUS (WINAPI * pNtQueryKey)(HANDLE,KEY_INFORMATION_CLASS,PVOID,ULONG,PULONG);
+static NTSTATUS (WINAPI * pNtQueryLicenseValue)(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
static NTSTATUS (WINAPI * pNtQueryValueKey)(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
static NTSTATUS (WINAPI * pNtSetValueKey)(HANDLE, const PUNICODE_STRING, ULONG,
ULONG, const void*, ULONG );
@@ -191,6 +192,10 @@ static BOOL InitFunctionPtrs(void)
NTDLL_GET_PROC(RtlZeroMemory)
NTDLL_GET_PROC(RtlpNtQueryValueKey)
NTDLL_GET_PROC(RtlOpenCurrentUser)
+
+ /* optional functions */
+ pNtQueryLicenseValue = (void *)GetProcAddress(hntdll, "NtQueryLicenseValue");
+
return TRUE;
}
#undef NTDLL_GET_PROC
@@ -645,6 +650,180 @@ static void test_NtDeleteKey(void)
ok(status == STATUS_SUCCESS, "NtDeleteKey Failed: 0x%08x\n", status);
}
+static void test_NtQueryLicenseKey(void)
+{
+ static const WCHAR emptyW[] = {'E','M','P','T','Y',0};
+ UNICODE_STRING name;
+ WORD buffer[32];
+ NTSTATUS status;
+ ULONG type, len;
+ DWORD value;
+
+ if (!pNtQueryLicenseValue)
+ {
+ skip("NtQueryLicenseValue not found, skipping tests\n");
+ return;
+ }
+
+ type = 0xdead;
+ len = 0xbeef;
+ memset(&name, 0, sizeof(name));
+ status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ /* test with empty key */
+ pRtlCreateUnicodeStringFromAsciiz(&name, "");
+
+ type = 0xdead;
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(NULL, &type, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ type = 0xdead;
+ status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer), NULL);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(&name, NULL, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ type = 0xdead;
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ pRtlFreeUnicodeString(&name);
+
+ /* test with nonexistent licence key */
+ pRtlCreateUnicodeStringFromAsciiz(&name, "Nonexistent-License-Value");
+
+ type = 0xdead;
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(NULL, &type, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ type = 0xdead;
+ status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer), NULL);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(&name, NULL, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "NtQueryLicenseValue returned %08x, expected STATUS_OBJECT_NAME_NOT_FOUND\n", status);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ type = 0xdead;
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "NtQueryLicenseValue unexpected suceeded\n");
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ pRtlFreeUnicodeString(&name);
+
+ /* test with REG_SZ license key */
+ pRtlCreateUnicodeStringFromAsciiz(&name, "Kernel-MUI-Language-Allowed");
+
+ type = 0xdead;
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(NULL, &type, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ type = 0xdead;
+ status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer), NULL);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+
+ type = 0xdead;
+ len = 0;
+ status = pNtQueryLicenseValue(&name, &type, buffer, 0, &len);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryLicenseValue returned %08x, expected STATUS_BUFFER_TOO_SMALL\n", status);
+ ok(type == REG_SZ, "expected type = REG_SZ, got %u\n", type);
+ ok(len == sizeof(emptyW), "expected len = %u, got %u\n", (DWORD)sizeof(emptyW), len);
+
+ len = 0;
+ status = pNtQueryLicenseValue(&name, NULL, buffer, 0, &len);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryLicenseValue returned %08x, expected STATUS_BUFFER_TOO_SMALL\n", status);
+ ok(len == sizeof(emptyW), "expected len = %u, got %u\n", (DWORD)sizeof(emptyW), len);
+
+ type = 0xdead;
+ len = 0;
+ memset(buffer, 0x11, sizeof(buffer));
+ status = pNtQueryLicenseValue(&name, &type, buffer, sizeof(buffer), &len);
+ ok(status == STATUS_SUCCESS, "NtQueryLicenseValue returned %08x, expected STATUS_SUCCESS\n", status);
+ ok(type == REG_SZ, "expected type = REG_SZ, got %u\n", type);
+ ok(len == sizeof(emptyW), "expected len = %u, got %u\n", (DWORD)sizeof(emptyW), len);
+ ok(!memcmp(buffer, emptyW, sizeof(emptyW)), "unexpected buffer content\n");
+
+ type = 0xdead;
+ len = 0;
+ memset(buffer, 0x11, sizeof(buffer));
+ status = pNtQueryLicenseValue(&name, &type, buffer, 2, &len);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryLicenseValue returned %08x, expected STATUS_BUFFER_TOO_SMALL\n", status);
+ ok(type == REG_SZ, "expected type REG_SZ, got %u\n", type);
+ ok(len == sizeof(emptyW), "expected len = %u, got %u\n", (DWORD)sizeof(emptyW), len);
+ ok(buffer[0] == 0x1111, "expected buffer[0] = 0x1111, got %u\n", buffer[0]);
+
+ pRtlFreeUnicodeString(&name);
+
+ /* test with REG_DWORD license key */
+ pRtlCreateUnicodeStringFromAsciiz(&name, "Kernel-MUI-Number-Allowed");
+
+ type = 0xdead;
+ len = 0xbeef;
+ status = pNtQueryLicenseValue(NULL, &type, &value, sizeof(value), &len);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+ ok(len == 0xbeef, "expected unmodified value for len, got %u\n", len);
+
+ type = 0xdead;
+ status = pNtQueryLicenseValue(&name, &type, &value, sizeof(value), NULL);
+ ok(status == STATUS_INVALID_PARAMETER, "NtQueryLicenseValue returned %08x, expected STATUS_INVALID_PARAMETER\n", status);
+ ok(type == 0xdead, "expected unmodified value for type, got %u\n", type);
+
+ type = 0xdead;
+ len = 0;
+ status = pNtQueryLicenseValue(&name, &type, &value, 0, &len);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryLicenseValue returned %08x, expected STATUS_BUFFER_TOO_SMALL\n", status);
+ ok(type == REG_DWORD, "expected type = REG_DWORD, got %u\n", type);
+ ok(len == sizeof(value), "expected len = %u, got %u\n", (DWORD)sizeof(value), len);
+
+ len = 0;
+ status = pNtQueryLicenseValue(&name, NULL, &value, 0, &len);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryLicenseValue returned %08x, expected STATUS_BUFFER_TOO_SMALL\n", status);
+ ok(len == sizeof(value), "expected len = %u, got %u\n", (DWORD)sizeof(value), len);
+
+ type = 0xdead;
+ len = 0;
+ value = 0xdeadbeef;
+ status = pNtQueryLicenseValue(&name, &type, &value, sizeof(value), &len);
+ ok(status == STATUS_SUCCESS, "NtQueryLicenseValue returned %08x, expected STATUS_SUCCESS\n", status);
+ ok(type == REG_DWORD, "expected type = REG_DWORD, got %u\n", type);
+ ok(len == sizeof(value), "expected len = %u, got %u\n", (DWORD)sizeof(value), len);
+ ok(value != 0xdeadbeef, "expected value != 0xdeadbeef\n");
+
+ type = 0xdead;
+ len = 0;
+ status = pNtQueryLicenseValue(&name, &type, &value, 2, &len);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryLicenseValue returned %08x, expected STATUS_BUFFER_TOO_SMALL\n", status);
+ ok(type == REG_DWORD, "expected type REG_DWORD, got %u\n", type);
+ ok(len == sizeof(value), "expected len = %u, got %u\n", (DWORD)sizeof(value), len);
+
+ pRtlFreeUnicodeString(&name);
+}
+
static void test_RtlpNtQueryValueKey(void)
{
NTSTATUS status;
@@ -1347,6 +1526,7 @@ START_TEST(reg)
test_NtFlushKey();
test_NtQueryKey();
test_NtQueryValueKey();
+ test_NtQueryLicenseKey();
test_long_value_name();
test_NtDeleteKey();
test_symlinks();
--
2.2.1

View File

@ -1,118 +0,0 @@
From 771d35e63a5f64f82ac9f16d790033763fa82002 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 2 Mar 2015 01:59:00 +0100
Subject: winebuild: Conditionally use different code for restoring the context
structure.
Fixes a regression introduced by 44fbc018eda12bdee5c2c1e2e40dbdc6a81b27fd.
See for example: https://bugs.winehq.org/show_bug.cgi?id=26344#c9
The previous code was not completely correct for the situation when switching
back to a 16-bit stack. If ESP contains garbage in the high word, then accessing
the memory on the target stack fails. We could theoretically use only the lower
16-bits for accessing the memory, but there is no good way to determine if a
segment if 16- or 32-bit. To ensure that the original issue stays fixed this
patch adds a check, to decide at runtime if we can safely copy values on the target
stack or not. If not then we use again the "old" method of restoring the thread
context.
---
tools/winebuild/relay.c | 57 +++++++++++++++++++++++++++++++++++--------------
1 file changed, 41 insertions(+), 16 deletions(-)
diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c
index 63c2ca4..cb4b0ca 100644
--- a/tools/winebuild/relay.c
+++ b/tools/winebuild/relay.c
@@ -852,36 +852,35 @@ static void build_call_from_regs_x86(void)
/* Restore the context structure */
- output( "2:\n" );
+ output( "2:\tpushl 0x94(%%ecx)\n" ); /* SegEs */
+ output( "\tpopl %%es\n" );
+ output( "\tpushl 0x90(%%ecx)\n" ); /* SegFs */
+ output( "\tpopl %%fs\n" );
+ output( "\tpushl 0x8c(%%ecx)\n" ); /* SegGs */
+ output( "\tpopl %%gs\n" );
+
+ output( "\tmovw %%ss,%%ax\n" );
+ output( "\tcmpw 0xc8(%%ecx),%%ax\n" ); /* SegSs */
+ output( "\tjne 3f\n" );
/* As soon as we have switched stacks the context structure could
* be invalid (when signal handlers are executed for example). Copy
* values on the target stack before changing ESP. */
- output( "\tpushl 0xc8(%%ecx)\n" ); /* SegSs */
- output( "\tpopl %%es\n" );
output( "\tmovl 0xc4(%%ecx),%%eax\n" ); /* Esp */
output( "\tleal -4*4(%%eax),%%eax\n" );
output( "\tmovl 0xc0(%%ecx),%%edx\n" ); /* EFlags */
- output( "\t.byte 0x26\n\tmovl %%edx,3*4(%%eax)\n" );
+ output( "\t.byte 0x36\n\tmovl %%edx,3*4(%%eax)\n" );
output( "\tmovl 0xbc(%%ecx),%%edx\n" ); /* SegCs */
- output( "\t.byte 0x26\n\tmovl %%edx,2*4(%%eax)\n" );
+ output( "\t.byte 0x36\n\tmovl %%edx,2*4(%%eax)\n" );
output( "\tmovl 0xb8(%%ecx),%%edx\n" ); /* Eip */
- output( "\t.byte 0x26\n\tmovl %%edx,1*4(%%eax)\n" );
+ output( "\t.byte 0x36\n\tmovl %%edx,1*4(%%eax)\n" );
output( "\tmovl 0xb0(%%ecx),%%edx\n" ); /* Eax */
- output( "\t.byte 0x26\n\tmovl %%edx,0*4(%%eax)\n" );
+ output( "\t.byte 0x36\n\tmovl %%edx,0*4(%%eax)\n" );
- output( "\tpushl %%es\n" );
output( "\tpushl 0x98(%%ecx)\n" ); /* SegDs */
- output(" \tpushl 0x94(%%ecx)\n" ); /* SegEs */
- output( "\tpopl %%es\n" );
- output( "\tpushl 0x90(%%ecx)\n"); /* SegFs */
- output( "\tpopl %%fs\n" );
- output( "\tpushl 0x8c(%%ecx)\n"); /* SegGs */
- output( "\tpopl %%gs\n" );
-
output( "\tmovl 0x9c(%%ecx),%%edi\n" ); /* Edi */
output( "\tmovl 0xa0(%%ecx),%%esi\n" ); /* Esi */
output( "\tmovl 0xa4(%%ecx),%%ebx\n" ); /* Ebx */
@@ -890,11 +889,37 @@ static void build_call_from_regs_x86(void)
output( "\tmovl 0xac(%%ecx),%%ecx\n" ); /* Ecx */
output( "\tpopl %%ds\n" );
- output( "\tpopl %%ss\n" );
output( "\tmovl %%eax,%%esp\n" );
output( "\tpopl %%eax\n" );
output( "\tiret\n" );
+
+ output("3:\n");
+
+ /* Restore the context when the stack segment changes. We can't use
+ * the same code as above because we do not know if the stack segment
+ * is 16 or 32 bit, and 'movl' will throw an exception when we try to
+ * access memory above the limit. */
+
+ output( "\tmovl 0x9c(%%ecx),%%edi\n" ); /* Edi */
+ output( "\tmovl 0xa0(%%ecx),%%esi\n" ); /* Esi */
+ output( "\tmovl 0xa4(%%ecx),%%ebx\n" ); /* Ebx */
+ output( "\tmovl 0xa8(%%ecx),%%edx\n" ); /* Edx */
+ output( "\tmovl 0xb0(%%ecx),%%eax\n" ); /* Eax */
+ output( "\tmovl 0xb4(%%ecx),%%ebp\n" ); /* Ebp */
+
+ output( "\tpushl 0xc8(%%ecx)\n" ); /* SegSs */
+ output( "\tpopl %%ss\n" );
+ output( "\tmovl 0xc4(%%ecx),%%esp\n" ); /* Esp */
+
+ output( "\tpushl 0xc0(%%ecx)\n" ); /* EFlags */
+ output( "\tpushl 0xbc(%%ecx)\n" ); /* SegCs */
+ output( "\tpushl 0xb8(%%ecx)\n" ); /* Eip */
+ output( "\tpushl 0x98(%%ecx)\n" ); /* SegDs */
+ output( "\tmovl 0xac(%%ecx),%%ecx\n" ); /* Ecx */
+
+ output( "\tpopl %%ds\n" );
+ output( "\tiret\n" );
output_cfi( ".cfi_endproc" );
output_function_size( "__wine_call_from_regs" );
--
2.3.0

View File

@ -1 +0,0 @@
Fixes: Fix crash when trying to switch back to a 16-bit stack

View File

@ -1 +1,2 @@
Fixes: [5048] Support for TransmitFile
Disabled: true

View File

@ -1,76 +0,0 @@
From 373361ca2f09176e7c587879703ba176dc1ccb38 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 10 Feb 2015 07:31:21 +0100
Subject: ws2_32: Avoid race-condition with write watches in WS2_async_accept.
---
dlls/ws2_32/socket.c | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 8b34e5b..72bffa5 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -363,4 +363,5 @@ typedef struct ws2_accept_async
int remote_len;
struct ws2_async *read;
+ char name_buf[1];
} ws2_accept_async;
@@ -2065,7 +2066,6 @@ static NTSTATUS WS2_async_accept( void *arg, IO_STATUS_BLOCK *iosb, NTSTATUS sta
{
struct ws2_accept_async *wsa = arg;
int len;
- char *addr;
TRACE("status: 0x%x listen: %p, accept: %p\n", status, wsa->listen_socket, wsa->accept_socket);
@@ -2095,17 +2095,29 @@ static NTSTATUS WS2_async_accept( void *arg, IO_STATUS_BLOCK *iosb, NTSTATUS sta
goto finish;
/* WS2 Spec says size param is extra 16 bytes long...what do we put in it? */
- addr = ((char *)wsa->buf) + wsa->data_len;
len = wsa->local_len - sizeof(int);
WS_getsockname(HANDLE2SOCKET(wsa->accept_socket),
- (struct WS_sockaddr *)(addr + sizeof(int)), &len);
- *(int *)addr = len;
+ (struct WS_sockaddr *)(wsa->name_buf + sizeof(int)), &len);
+ *(int *)wsa->name_buf = len;
+
+ if (wine_uninterrupted_write_memory( (char *)wsa->buf + wsa->data_len,
+ wsa->name_buf, sizeof(int) + len ) < sizeof(int) + len)
+ {
+ status = STATUS_ACCESS_VIOLATION;
+ goto finish;
+ }
- addr += wsa->local_len;
len = wsa->remote_len - sizeof(int);
WS_getpeername(HANDLE2SOCKET(wsa->accept_socket),
- (struct WS_sockaddr *)(addr + sizeof(int)), &len);
- *(int *)addr = len;
+ (struct WS_sockaddr *)(wsa->name_buf + sizeof(int)), &len);
+ *(int *)wsa->name_buf = len;
+
+ if (wine_uninterrupted_write_memory( (char *)wsa->buf + wsa->data_len + wsa->local_len,
+ wsa->name_buf, sizeof(int) + len ) < sizeof(int) + len)
+ {
+ status = STATUS_ACCESS_VIOLATION;
+ goto finish;
+ }
if (!wsa->read)
goto finish;
@@ -2433,7 +2445,8 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
}
release_sock_fd( acceptor, fd );
- wsa = HeapAlloc( GetProcessHeap(), 0, sizeof(*wsa) );
+ wsa = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET(struct ws2_accept_async,
+ name_buf[max( local_addr_len, rem_addr_len )]) );
if(!wsa)
{
SetLastError(WSAEFAULT);
--
2.2.2