Rebase against 18883a76762afab3e18e1279a9666240e19d4d03.

This commit is contained in:
Zebediah Figura 2019-04-08 17:01:18 -05:00
parent be0910e9a9
commit 52a77f6b00
16 changed files with 163 additions and 385 deletions

View File

@ -1,78 +0,0 @@
From 0f3d6b8b305ee7ae0260d5fc2b1a72e11237d67a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 15 Jul 2017 01:41:07 +0200
Subject: dinput: Avoid possible deadlock when CS are acquired in different
order.
---
dlls/dinput/device.c | 8 ++++----
dlls/dinput/dinput_main.c | 4 ++--
dlls/dinput/dinput_private.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 7b83a39d4b3..bb2a6417191 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -990,9 +990,9 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
EnterCriticalSection(&This->crit);
res = This->acquired ? S_FALSE : DI_OK;
This->acquired = 1;
- if (res == DI_OK)
- check_dinput_hooks(iface);
LeaveCriticalSection(&This->crit);
+ if (res == DI_OK)
+ check_dinput_hooks(iface, TRUE);
return res;
}
@@ -1018,9 +1018,9 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
EnterCriticalSection(&This->crit);
res = !This->acquired ? DI_NOEFFECT : DI_OK;
This->acquired = 0;
- if (res == DI_OK)
- check_dinput_hooks(iface);
LeaveCriticalSection(&This->crit);
+ if (res == DI_OK)
+ check_dinput_hooks(iface, FALSE);
return res;
}
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 95d24876c8e..bbdfe28d385 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -1773,7 +1773,7 @@ static BOOL check_hook_thread(void)
return hook_thread_id != 0;
}
-void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface)
+void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface, BOOL acquired)
{
static HHOOK callwndproc_hook;
static ULONG foreground_cnt;
@@ -1783,7 +1783,7 @@ void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface)
if (dev->dwCoopLevel & DISCL_FOREGROUND)
{
- if (dev->acquired)
+ if (acquired)
foreground_cnt++;
else
foreground_cnt--;
diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h
index 6c93e16e9ee..3ed68f2264a 100644
--- a/dlls/dinput/dinput_private.h
+++ b/dlls/dinput/dinput_private.h
@@ -69,7 +69,7 @@ extern const struct dinput_device joystick_linux_device DECLSPEC_HIDDEN;
extern const struct dinput_device joystick_linuxinput_device DECLSPEC_HIDDEN;
extern const struct dinput_device joystick_osx_device DECLSPEC_HIDDEN;
-extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W) DECLSPEC_HIDDEN;
+extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W, BOOL) DECLSPEC_HIDDEN;
extern void check_dinput_events(void) DECLSPEC_HIDDEN;
typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM);
--
2.13.1

View File

@ -1 +0,0 @@
Fixes: [43356] Avoid possible deadlock in dinput when CS are acquired in different order

View File

@ -1,11 +1,10 @@
From f3596cd66ac694d4a7633f91bc53a2f44b2608cc Mon Sep 17 00:00:00 2001
From bb968ec541ccdcd1b04b4b967065d5ee81f3fd78 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Thu, 7 Jun 2018 21:23:52 -0500
Subject: [PATCH 07/83] ntdll: Implement waiting on esync objects.
Subject: [PATCH] ntdll: Implement waiting on esync objects.
This is the most basic case: WAIT_ANY. We use poll() (actually ppoll(), for
the better granularity) to select on all of the handles that we can.
---
dlls/ntdll/esync.c | 161 +++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/esync.h | 3 +
@ -13,7 +12,7 @@ the better granularity) to select on all of the handles that we can.
3 files changed, 171 insertions(+)
diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c
index f7a427425..0950d8b5a 100644
index f7a427425..f6ceefe53 100644
--- a/dlls/ntdll/esync.c
+++ b/dlls/ntdll/esync.c
@@ -22,6 +22,13 @@
@ -118,14 +117,14 @@ index f7a427425..0950d8b5a 100644
+ {
+ TRACE("Waiting for %s of %d handles:", wait_any ? "any" : "all", count);
+ for (i = 0; i < count; i++)
+ DPRINTF(" %p", handles[i]);
+ TRACE(" %p", handles[i]);
+
+ if (!timeout)
+ DPRINTF(", timeout = INFINITE.\n");
+ TRACE(", timeout = INFINITE.\n");
+ else
+ {
+ timeleft = update_timeout( end );
+ DPRINTF(", timeout = %ld.%07ld sec.\n",
+ TRACE(", timeout = %ld.%07ld sec.\n",
+ (long) timeleft / TICKSPERSEC, (long) timeleft % TICKSPERSEC);
+ }
+ }
@ -221,5 +220,5 @@ index 93052ddb5..40bc619a2 100644
select_op.wait.op = wait_any ? SELECT_WAIT : SELECT_WAIT_ALL;
for (i = 0; i < count; i++) select_op.wait.handles[i] = wine_server_obj_handle( handles[i] );
--
2.20.1
2.21.0

View File

@ -1,8 +1,7 @@
From 69c158267facd8919329e71e082e872031ee4054 Mon Sep 17 00:00:00 2001
From f3bcb0b64f7960dad656347dadb56be9b3afe262 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Fri, 8 Jun 2018 22:04:29 -0500
Subject: [PATCH 20/83] server: Create eventfd file descriptors for thread
objects.
Subject: [PATCH] server: Create eventfd file descriptors for thread objects.
---
server/thread.c | 16 +++++++++++++++-
@ -10,7 +9,7 @@ Subject: [PATCH 20/83] server: Create eventfd file descriptors for thread
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/server/thread.c b/server/thread.c
index ae00c89da..e82d71f67 100644
index 85349475c..35bddeeaa 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -133,6 +133,7 @@ static const struct object_ops thread_apc_ops =
@ -20,8 +19,8 @@ index ae00c89da..e82d71f67 100644
+static int thread_get_esync_fd( struct object *obj );
static unsigned int thread_map_access( struct object *obj, unsigned int access );
static void thread_poll_event( struct fd *fd, int event );
static void destroy_thread( struct object *obj );
@@ -145,7 +146,7 @@ static const struct object_ops thread_ops =
static struct list *thread_get_kernel_obj_list( struct object *obj );
@@ -146,7 +147,7 @@ static const struct object_ops thread_ops =
add_queue, /* add_queue */
remove_queue, /* remove_queue */
thread_signaled, /* signaled */
@ -30,7 +29,7 @@ index ae00c89da..e82d71f67 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -185,6 +186,7 @@ static inline void init_thread_structure( struct thread *thread )
@@ -186,6 +187,7 @@ static inline void init_thread_structure( struct thread *thread )
thread->suspend_context = NULL;
thread->teb = 0;
thread->entry_point = 0;
@ -38,7 +37,7 @@ index ae00c89da..e82d71f67 100644
thread->debug_ctx = NULL;
thread->debug_event = NULL;
thread->debug_break = 0;
@@ -292,6 +294,9 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
@@ -294,6 +296,9 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
return NULL;
}
@ -48,7 +47,7 @@ index ae00c89da..e82d71f67 100644
set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */
add_process_thread( thread->process, thread );
return thread;
@@ -364,6 +369,9 @@ static void destroy_thread( struct object *obj )
@@ -372,6 +377,9 @@ static void destroy_thread( struct object *obj )
if (thread->exit_poll) remove_timeout_user( thread->exit_poll );
if (thread->id) free_ptid( thread->id );
if (thread->token) release_object( thread->token );
@ -58,7 +57,7 @@ index ae00c89da..e82d71f67 100644
}
/* dump a thread on stdout for debugging purposes */
@@ -388,6 +396,12 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
@@ -397,6 +405,12 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
return mythread->state == TERMINATED && !mythread->exit_poll;
}
@ -72,7 +71,7 @@ index ae00c89da..e82d71f67 100644
{
if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | THREAD_QUERY_INFORMATION | THREAD_GET_CONTEXT;
diff --git a/server/thread.h b/server/thread.h
index bfd818ce2..4913577f7 100644
index fa4ced546..46064cb4a 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -54,6 +54,7 @@ struct thread
@ -84,5 +83,5 @@ index bfd818ce2..4913577f7 100644
struct debug_event *debug_event; /* debug event being sent to debugger */
int debug_break; /* debug breakpoint pending? */
--
2.20.1
2.21.0

View File

@ -1,8 +1,8 @@
From e3a723494fcecb85cebeeb8557aa21cf3f30f0b1 Mon Sep 17 00:00:00 2001
From 29517778d9000de8de3217bcd6f1a2bb933123c6 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sat, 9 Jun 2018 14:44:54 -0500
Subject: [PATCH 24/83] server, ntdll: Also wait on the queue fd when waiting
for driver events.
Subject: [PATCH] server, ntdll: Also wait on the queue fd when waiting for
driver events.
Normally the server handles this, by polling on the fd during its main loop.
The problem there is that the server only polls when the thread is waiting
@ -23,7 +23,7 @@ fix the 'drives' tab.
8 files changed, 60 insertions(+), 23 deletions(-)
diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c
index 210556fc2..4d708c6df 100644
index 5d8dbac2d..dcb7801d9 100644
--- a/dlls/ntdll/esync.c
+++ b/dlls/ntdll/esync.c
@@ -80,17 +80,9 @@ void __wine_esync_set_queue_fd( int fd )
@ -100,13 +100,13 @@ index 210556fc2..4d708c6df 100644
FIXME("Can't wait on esync and server objects at the same time!\n");
@@ -510,6 +515,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
for (i = 0; i < count; i++)
DPRINTF(" %p", handles[i]);
TRACE(" %p", handles[i]);
+ if (msgwait)
+ DPRINTF(" or driver events (fd %d)", ntdll_get_thread_data()->esync_queue_fd);
+ TRACE(" or driver events (fd %d)", ntdll_get_thread_data()->esync_queue_fd);
+
if (!timeout)
DPRINTF(", timeout = INFINITE.\n");
TRACE(", timeout = INFINITE.\n");
else
@@ -527,10 +535,16 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
fds[i].fd = objs[i] ? objs[i]->fd : -1;
@ -176,7 +176,7 @@ index 4f7ff6bda..1f8c0d516 100644
}
else
diff --git a/server/event.c b/server/event.c
index 62d8bf7d3..9e0bf8cbf 100644
index d2f9e378c..79287e7ed 100644
--- a/server/event.c
+++ b/server/event.c
@@ -50,7 +50,7 @@ static void event_dump( struct object *obj, int verbose );
@ -188,7 +188,7 @@ index 62d8bf7d3..9e0bf8cbf 100644
static unsigned int event_map_access( struct object *obj, unsigned int access );
static int event_signal( struct object *obj, unsigned int access);
static struct list *event_get_kernel_obj_list( struct object *obj );
@@ -202,9 +202,10 @@ static int event_signaled( struct object *obj, struct wait_queue_entry *entry )
@@ -203,9 +203,10 @@ static int event_signaled( struct object *obj, struct wait_queue_entry *entry )
return event->signaled;
}
@ -201,7 +201,7 @@ index 62d8bf7d3..9e0bf8cbf 100644
}
diff --git a/server/object.h b/server/object.h
index 592b76617..23dcdafa4 100644
index ee0f1f776..ca5a191f9 100644
--- a/server/object.h
+++ b/server/object.h
@@ -69,7 +69,7 @@ struct object_ops
@ -214,7 +214,7 @@ index 592b76617..23dcdafa4 100644
void (*satisfied)(struct object *,struct wait_queue_entry *);
/* signal an object */
diff --git a/server/process.c b/server/process.c
index 0bb220dba..d2fa0f3a8 100644
index 1ce2fb05c..6e6dfc41c 100644
--- a/server/process.c
+++ b/server/process.c
@@ -67,7 +67,7 @@ static unsigned int process_map_access( struct object *obj, unsigned int access
@ -226,7 +226,7 @@ index 0bb220dba..d2fa0f3a8 100644
static void terminate_process( struct process *process, struct thread *skip, int exit_code );
static const struct object_ops process_ops =
@@ -652,9 +652,10 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
@@ -654,9 +654,10 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
return !process->running_threads;
}
@ -239,10 +239,10 @@ index 0bb220dba..d2fa0f3a8 100644
}
diff --git a/server/protocol.def b/server/protocol.def
index 5f2d77bc7..cebe0e88e 100644
index 17959c233..8d2df1f97 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -4056,4 +4056,14 @@ struct handle_info
@@ -4012,4 +4012,14 @@ struct handle_info
@REQ(get_esync_fd)
obj_handle_t handle; /* handle to the object */
@REPLY
@ -283,7 +283,7 @@ index 0ea95291c..91de4a3a8 100644
}
diff --git a/server/thread.c b/server/thread.c
index e82d71f67..539cd0491 100644
index 35bddeeaa..7c8ff1d5d 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -133,7 +133,7 @@ static const struct object_ops thread_apc_ops =
@ -294,8 +294,8 @@ index e82d71f67..539cd0491 100644
+static int thread_get_esync_fd( struct object *obj, enum esync_type *type );
static unsigned int thread_map_access( struct object *obj, unsigned int access );
static void thread_poll_event( struct fd *fd, int event );
static void destroy_thread( struct object *obj );
@@ -396,9 +396,10 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
static struct list *thread_get_kernel_obj_list( struct object *obj );
@@ -405,9 +405,10 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
return mythread->state == TERMINATED && !mythread->exit_poll;
}
@ -308,5 +308,5 @@ index e82d71f67..539cd0491 100644
}
--
2.20.1
2.21.0

View File

@ -1,11 +1,11 @@
From 62de87cd8e8ed0006315080e06c96947727f89b2 Mon Sep 17 00:00:00 2001
From 216028748c99e8ea03c913b7885e2e97c6c0fbca Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Fri, 15 Jun 2018 14:12:22 -0500
Subject: [PATCH 45/83] server, ntdll: Implement alertable waits.
Subject: [PATCH] server, ntdll: Implement alertable waits.
We do this quite simply by waiting on an extra eventfd descriptor, which the server signals when a user APC is queued.
---
dlls/ntdll/esync.c | 94 +++++++++++++++++++++++++++++++++++------
dlls/ntdll/esync.c | 95 +++++++++++++++++++++++++++++++++++------
dlls/ntdll/ntdll_misc.h | 1 +
dlls/ntdll/thread.c | 2 +
server/esync.c | 20 +++++++--
@ -13,10 +13,10 @@ We do this quite simply by waiting on an extra eventfd descriptor, which the ser
server/protocol.def | 5 +++
server/thread.c | 13 ++++++
server/thread.h | 1 +
8 files changed, 120 insertions(+), 17 deletions(-)
8 files changed, 121 insertions(+), 17 deletions(-)
diff --git a/dlls/ntdll/esync.c b/dlls/ntdll/esync.c
index 227dd3df0..583174499 100644
index 119a36f36..8a41f6961 100644
--- a/dlls/ntdll/esync.c
+++ b/dlls/ntdll/esync.c
@@ -684,19 +684,43 @@ static int do_poll( struct pollfd *fds, nfds_t nfds, ULONGLONG *end )
@ -65,16 +65,17 @@ index 227dd3df0..583174499 100644
NtQuerySystemTime( &now );
if (timeout)
{
@@ -747,6 +771,8 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
@@ -748,6 +772,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
if (msgwait)
DPRINTF(" or driver events (fd %d)", ntdll_get_thread_data()->esync_queue_fd);
+ if (alertable)
+ DPRINTF(", alertable");
TRACE(" or driver events (fd %d)", ntdll_get_thread_data()->esync_queue_fd);
+ if (alertable)
+ TRACE(", alertable");
+
if (!timeout)
DPRINTF(", timeout = INFINITE.\n");
@@ -785,10 +811,17 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
TRACE(", timeout = INFINITE.\n");
else
@@ -785,10 +812,17 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
}
if (msgwait)
{
@ -84,18 +85,18 @@ index 227dd3df0..583174499 100644
+ fds[i].fd = ntdll_get_thread_data()->esync_queue_fd;
+ fds[i].events = POLLIN;
+ i++;
+ }
}
+ if (alertable)
+ {
+ fds[i].fd = ntdll_get_thread_data()->esync_apc_fd;
+ fds[i].events = POLLIN;
+ i++;
}
+ }
+ pollcount = i;
while (1)
{
@@ -848,10 +881,18 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
@@ -848,10 +882,18 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
}
}
@ -117,7 +118,7 @@ index 227dd3df0..583174499 100644
}
/* If we got here, someone else stole (or reset, etc.) whatever
@@ -890,6 +931,14 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
@@ -890,6 +932,14 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
tryagain:
/* First step: try to poll on each object in sequence. */
fds[0].events = POLLIN;
@ -132,7 +133,7 @@ index 227dd3df0..583174499 100644
for (i = 0; i < count; i++)
{
struct esync *obj = objs[i];
@@ -905,9 +954,11 @@ tryagain:
@@ -905,9 +955,11 @@ tryagain:
continue;
}
@ -145,7 +146,7 @@ index 227dd3df0..583174499 100644
if (fds[0].revents & (POLLHUP | POLLERR | POLLNVAL))
{
@@ -920,9 +971,11 @@ tryagain:
@@ -920,9 +972,11 @@ tryagain:
if (msgwait)
{
fds[0].fd = ntdll_get_thread_data()->esync_queue_fd;
@ -158,7 +159,7 @@ index 227dd3df0..583174499 100644
}
/* If we got here and we haven't timed out, that means all of the
@@ -934,10 +987,12 @@ tryagain:
@@ -934,10 +988,12 @@ tryagain:
}
if (msgwait)
{
@ -174,7 +175,7 @@ index 227dd3df0..583174499 100644
/* Poll everything to see if they're still signaled. */
ret = poll( fds, pollcount, 0 );
@@ -1018,6 +1073,19 @@ err:
@@ -1018,6 +1074,19 @@ err:
ERR("ppoll failed: %s\n", strerror(errno));
return FILE_GetNtStatus();
}
@ -195,10 +196,10 @@ index 227dd3df0..583174499 100644
NTSTATUS esync_signal_and_wait( HANDLE signal, HANDLE wait, BOOLEAN alertable,
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index e2ef7d9b8..b6c410c7f 100644
index 951c9b7f9..5574e24fd 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -281,6 +281,7 @@ struct ntdll_thread_data
@@ -241,6 +241,7 @@ struct ntdll_thread_data
{
struct debug_info *debug_info; /* info for debugstr functions */
int esync_queue_fd;/* fd to wait on for driver events */
@ -207,10 +208,10 @@ index e2ef7d9b8..b6c410c7f 100644
int request_fd; /* fd for sending server requests */
int reply_fd; /* fd for receiving server replies */
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 04aa8dff8..d146b9e00 100644
index 1d55162a6..dd553a864 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -328,6 +328,7 @@ void thread_init(void)
@@ -319,6 +319,7 @@ void thread_init(void)
thread_data->wait_fd[0] = -1;
thread_data->wait_fd[1] = -1;
thread_data->esync_queue_fd = -1;
@ -218,7 +219,7 @@ index 04aa8dff8..d146b9e00 100644
signal_init_thread( teb );
virtual_init_threading();
@@ -700,6 +701,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle_ptr, ACCESS_MASK access, OBJECT
@@ -691,6 +692,7 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle_ptr, ACCESS_MASK access, OBJECT
thread_data->wait_fd[1] = -1;
thread_data->start_stack = (char *)teb->Tib.StackBase;
thread_data->esync_queue_fd = -1;
@ -283,10 +284,10 @@ index aeb58c546..cea025d93 100644
void esync_clear( int fd );
diff --git a/server/protocol.def b/server/protocol.def
index 3037b8161..f55da3a0e 100644
index 4002ee642..ce165b71b 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -4076,6 +4076,11 @@ struct handle_info
@@ -4032,6 +4032,11 @@ struct handle_info
unsigned int shm_idx; /* this object's index into the shm section */
@END
@ -299,10 +300,10 @@ index 3037b8161..f55da3a0e 100644
{
ESYNC_SEMAPHORE = 1,
diff --git a/server/thread.c b/server/thread.c
index 539cd0491..24756d079 100644
index 7c8ff1d5d..0e02630b9 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -187,6 +187,7 @@ static inline void init_thread_structure( struct thread *thread )
@@ -188,6 +188,7 @@ static inline void init_thread_structure( struct thread *thread )
thread->teb = 0;
thread->entry_point = 0;
thread->esync_fd = -1;
@ -310,7 +311,7 @@ index 539cd0491..24756d079 100644
thread->debug_ctx = NULL;
thread->debug_event = NULL;
thread->debug_break = 0;
@@ -295,7 +296,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
@@ -297,7 +298,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
}
if (do_esync())
@ -321,7 +322,7 @@ index 539cd0491..24756d079 100644
set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */
add_process_thread( thread->process, thread );
@@ -1043,8 +1047,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
@@ -1052,8 +1056,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
grab_object( apc );
list_add_tail( queue, &apc->entry );
if (!list_prev( queue, &apc->entry )) /* first one */
@ -335,7 +336,7 @@ index 539cd0491..24756d079 100644
return 1;
}
@@ -1091,6 +1100,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system_
@@ -1100,6 +1109,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system_
apc = LIST_ENTRY( ptr, struct thread_apc, entry );
list_remove( ptr );
}
@ -347,7 +348,7 @@ index 539cd0491..24756d079 100644
}
diff --git a/server/thread.h b/server/thread.h
index 4913577f7..1b3bef479 100644
index 46064cb4a..36ccb9207 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -55,6 +55,7 @@ struct thread
@ -359,5 +360,5 @@ index 4913577f7..1b3bef479 100644
struct debug_event *debug_event; /* debug event being sent to debugger */
int debug_break; /* debug breakpoint pending? */
--
2.20.1
2.21.0

View File

@ -1,41 +0,0 @@
From db0ea76926fefd1658fac7373e3bf090b6068ea5 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 16 Oct 2018 15:34:38 +1100
Subject: [PATCH] hid: Implement HidD_FlushQueue
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=45878
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/hid/hid.spec | 2 +-
dlls/hid/hidd.c | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/hid/hid.spec b/dlls/hid/hid.spec
index e4d4202..505c3d2 100644
--- a/dlls/hid/hid.spec
+++ b/dlls/hid/hid.spec
@@ -1,4 +1,4 @@
-@ stub HidD_FlushQueue
+@ stdcall HidD_FlushQueue(ptr)
@ stdcall HidD_FreePreparsedData(ptr)
@ stdcall HidD_GetAttributes(long ptr)
@ stub HidD_GetConfiguration
diff --git a/dlls/hid/hidd.c b/dlls/hid/hidd.c
index ca14c4f..632035d 100644
--- a/dlls/hid/hidd.c
+++ b/dlls/hid/hidd.c
@@ -157,3 +157,11 @@ BOOLEAN WINAPI HidD_SetOutputReport(HANDLE HidDeviceObject, void *ReportBuffer,
TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength);
return sync_ioctl(HidDeviceObject, IOCTL_HID_SET_OUTPUT_REPORT, ReportBuffer, ReportBufferLength, NULL, 0);
}
+
+BOOLEAN WINAPI HidD_FlushQueue(HANDLE HidDeviceObject)
+{
+ DWORD RetLen;
+ TRACE("(%p)\n", HidDeviceObject);
+
+ return DeviceIoControl(HidDeviceObject, IOCTL_HID_FLUSH_QUEUE, NULL, 0, NULL, 0,&RetLen, NULL);
+}
--
1.9.1

View File

@ -1 +0,0 @@
Fixes: [45878] Implement HidD_FlushQueue

View File

@ -1,4 +1,4 @@
From ff5a1ffd966ca678a579f2b1da63290ae107d71c Mon Sep 17 00:00:00 2001
From 6c2c2f49eddd7133f6854845f54349ea2511250b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 22 Jul 2017 07:21:45 +0200
Subject: [PATCH] ntdll: Improve heap allocation performance. (v2)
@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Improve heap allocation performance. (v2)
2 files changed, 234 insertions(+), 96 deletions(-)
diff --git a/configure.ac b/configure.ac
index b4b3c7c55d..0c9bfe4628 100644
index ad4f0e05a..f8a1c8de4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2829,6 +2829,15 @@ then
@@ -2745,6 +2745,15 @@ then
AC_DEFINE(HAVE___BUILTIN_CLZ, 1, [Define to 1 if you have the `__builtin_clz' built-in function.])
fi
@ -29,7 +29,7 @@ index b4b3c7c55d..0c9bfe4628 100644
AC_CACHE_CHECK([for __builtin_popcount], ac_cv_have___builtin_popcount,
AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[return __builtin_popcount(1)]])],
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 3f1afd6f0f..a06ba32024 100644
index 3eaeea2d1..4b694ed7e 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -3,6 +3,7 @@
@ -200,13 +200,13 @@ index 3f1afd6f0f..a06ba32024 100644
static inline ULONG get_protection_type( DWORD flags )
{
@@ -344,13 +361,31 @@ static void HEAP_Dump( HEAP *heap )
DPRINTF( "Next: %p Sub-heaps:", LIST_ENTRY( heap->entry.next, HEAP, entry ) );
LIST_FOR_EACH_ENTRY( subheap, &heap->subheap_list, SUBHEAP, entry ) DPRINTF( " %p", subheap );
TRACE( "Next: %p Sub-heaps:", LIST_ENTRY( heap->entry.next, HEAP, entry ) );
LIST_FOR_EACH_ENTRY( subheap, &heap->subheap_list, SUBHEAP, entry ) TRACE( " %p", subheap );
- DPRINTF( "\nFree lists:\n Block Stat Size Id\n" );
+ DPRINTF( "\nFree lists:\n" );
- TRACE( "\nFree lists:\n Block Stat Size Id\n" );
+ TRACE( "\nFree lists:\n" );
for (i = 0; i < HEAP_NB_FREE_LISTS; i++)
- DPRINTF( "%p free %08lx prev=%p next=%p\n",
- TRACE( "%p free %08lx prev=%p next=%p\n",
- &heap->freeList[i].arena, i < HEAP_NB_SMALL_FREE_LISTS ?
- HEAP_MIN_ARENA_SIZE + i * ALIGNMENT : HEAP_freeListSizes[i - HEAP_NB_SMALL_FREE_LISTS],
- LIST_ENTRY( heap->freeList[i].arena.entry.prev, ARENA_FREE, entry ),
@ -214,24 +214,24 @@ index 3f1afd6f0f..a06ba32024 100644
+ {
+ BOOL empty = !(heap->freeMask[ HEAP_FREEMASK_INDEX( i ) ] & HEAP_FREEMASK_BIT( i ));
+
+ DPRINTF( "free %08x: ", HEAP_FREELIST_SIZE( i ) );
+ TRACE( "free %08x: ", HEAP_FREELIST_SIZE( i ) );
+ if (!empty && !list_empty( &heap->freeList[i] ))
+ {
+ DPRINTF( "head=%p tail=%p\n",
+ TRACE( "head=%p tail=%p\n",
+ LIST_ENTRY( heap->freeList[i].next, ARENA_FREE, entry.list ),
+ LIST_ENTRY( heap->freeList[i].prev, ARENA_FREE, entry.list ));
+ }
+ else if (empty && list_empty( &heap->freeList[i] ))
+ {
+ DPRINTF( "(empty)\n" );
+ TRACE( "(empty)\n" );
+ }
+ else
+ {
+ DPRINTF( "(corrupted)\n" );
+ TRACE( "(corrupted)\n" );
+ }
+ }
+
+ DPRINTF( "free %08x: root=%p\n",
+ TRACE( "free %08x: root=%p\n",
+ HEAP_FREELIST_SIZE( HEAP_NB_FREE_LISTS ),
+ heap->freeTree.root ? LIST_ENTRY( heap->freeTree.root, ARENA_FREE, entry.tree ) : NULL);
@ -241,14 +241,14 @@ index 3f1afd6f0f..a06ba32024 100644
if (*(DWORD *)ptr & ARENA_FLAG_FREE)
{
ARENA_FREE *pArena = (ARENA_FREE *)ptr;
- DPRINTF( "%p %08x free %08x prev=%p next=%p\n",
- TRACE( "%p %08x free %08x prev=%p next=%p\n",
- pArena, pArena->magic,
- pArena->size & ARENA_SIZE_MASK,
- LIST_ENTRY( pArena->entry.prev, ARENA_FREE, entry ),
- LIST_ENTRY( pArena->entry.next, ARENA_FREE, entry ) );
+ if ((pArena->size & ARENA_FLAG_FREE) == ARENA_FLAG_FREE_LIST)
+ {
+ DPRINTF( "%p %08x free %08x prev=%p next=%p\n",
+ TRACE( "%p %08x free %08x prev=%p next=%p\n",
+ pArena, pArena->magic, pArena->size & ARENA_SIZE_MASK,
+ LIST_ENTRY( pArena->entry.list.prev, ARENA_FREE, entry.list ),
+ LIST_ENTRY( pArena->entry.list.next, ARENA_FREE, entry.list ) );
@ -264,12 +264,12 @@ index 3f1afd6f0f..a06ba32024 100644
+ if (pArena->entry.tree.right)
+ right = WINE_RB_ENTRY_VALUE( pArena->entry.tree.right, ARENA_FREE, entry.tree );
+
+ DPRINTF( "%p %08x free %08x parent=%p left=%p right=%p\n",
+ TRACE( "%p %08x free %08x parent=%p left=%p right=%p\n",
+ pArena, pArena->magic, pArena->size & ARENA_SIZE_MASK, parent, left, right );
+ }
+ else
+ {
+ DPRINTF( "%p %08x free %08x corrupted\n",
+ TRACE( "%p %08x free %08x corrupted\n",
+ pArena, pArena->magic, pArena->size & ARENA_SIZE_MASK );
+ }
ptr += sizeof(*pArena) + (pArena->size & ARENA_SIZE_MASK);
@ -556,5 +556,5 @@ index 3f1afd6f0f..a06ba32024 100644
subheap->heap, prev, pArena );
return FALSE;
--
2.18.0
2.21.0

View File

@ -1,4 +1,4 @@
From 2f00e0d3531ac02c23a4339ea582ea1e71e40499 Mon Sep 17 00:00:00 2001
From 552c4e1da2a7464b64cef1c962c7d5a0de6c1a42 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Tue, 29 Jan 2019 21:54:39 -0600
Subject: [PATCH] ntoskrnl.exe/tests: Add tests for ERESOURCE functions.
@ -10,11 +10,11 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
2 files changed, 312 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
index 88237461d5b..312cdbf38cb 100644
index 81baffa7c..0dec481be 100644
--- a/dlls/ntoskrnl.exe/tests/driver.c
+++ b/dlls/ntoskrnl.exe/tests/driver.c
@@ -316,7 +316,14 @@ static NTSTATUS wait_single_handle(HANDLE handle, ULONGLONG timeout)
return ZwWaitForSingleObject(handle, FALSE, &integer);
@@ -322,7 +322,14 @@ todo_wine
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
}
-static void run_thread(PKSTART_ROUTINE proc, void *arg)
@ -29,7 +29,7 @@ index 88237461d5b..312cdbf38cb 100644
{
OBJECT_ATTRIBUTES attr = {0};
HANDLE thread;
@@ -327,12 +334,25 @@ static void run_thread(PKSTART_ROUTINE proc, void *arg)
@@ -333,12 +340,25 @@ static void run_thread(PKSTART_ROUTINE proc, void *arg)
ret = PsCreateSystemThread(&thread, THREAD_ALL_ACCESS, &attr, NULL, NULL, proc, arg);
ok(!ret, "got %#x\n", ret);
@ -55,7 +55,7 @@ index 88237461d5b..312cdbf38cb 100644
static KMUTEX test_mutex;
static void WINAPI mutex_thread(void *arg)
@@ -814,6 +834,294 @@ static void test_ob_reference(const WCHAR *test_path)
@@ -853,6 +873,294 @@ static void test_ob_reference(const WCHAR *test_path)
ok(!status, "ZwClose failed: %#x\n", status);
}
@ -350,7 +350,7 @@ index 88237461d5b..312cdbf38cb 100644
static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
{
ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength;
@@ -856,6 +1164,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
@@ -895,6 +1203,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
test_stack_callout();
test_lookaside_list();
test_ob_reference(test_input->path);
@ -359,10 +359,10 @@ index 88237461d5b..312cdbf38cb 100644
/* print process report */
if (winetest_debug)
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 3600bcd80af..d7930be68a9 100644
index dae83afb2..0faf5ecd4 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1579,6 +1579,7 @@ void WINAPI KeAcquireSpinLockAtDpcLevel(KSPIN_LOCK*);
@@ -1580,6 +1580,7 @@ void WINAPI KeAcquireSpinLockAtDpcLevel(KSPIN_LOCK*);
BOOLEAN WINAPI KeCancelTimer(KTIMER*);
void WINAPI KeClearEvent(PRKEVENT);
NTSTATUS WINAPI KeDelayExecutionThread(KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);
@ -370,7 +370,7 @@ index 3600bcd80af..d7930be68a9 100644
PKTHREAD WINAPI KeGetCurrentThread(void);
void WINAPI KeInitializeEvent(PRKEVENT,EVENT_TYPE,BOOLEAN);
void WINAPI KeInitializeMutex(PRKMUTEX,ULONG);
@@ -1586,6 +1587,7 @@ void WINAPI KeInitializeSemaphore(PRKSEMAPHORE,LONG,LONG);
@@ -1587,6 +1588,7 @@ void WINAPI KeInitializeSemaphore(PRKSEMAPHORE,LONG,LONG);
void WINAPI KeInitializeSpinLock(KSPIN_LOCK*);
void WINAPI KeInitializeTimerEx(PKTIMER,TIMER_TYPE);
void WINAPI KeInitializeTimer(KTIMER*);
@ -379,5 +379,5 @@ index 3600bcd80af..d7930be68a9 100644
void WINAPI KeQueryTickCount(LARGE_INTEGER*);
ULONG WINAPI KeQueryTimeIncrement(void);
--
2.20.1
2.21.0

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "8ee1e3453e2e714241bcaac0cd75f4af3f828c8d"
echo "18883a76762afab3e18e1279a9666240e19d4d03"
}
# Show version information
@ -130,7 +130,6 @@ patch_enable_all ()
enable_ddraw_Texture_Wrong_Caps="$1"
enable_ddraw_Write_Vtable="$1"
enable_ddraw_version_check="$1"
enable_dinput_Deadlock="$1"
enable_dinput_axis_recalc="$1"
enable_dinput_reconnect_joystick="$1"
enable_dinput_remap_joystick="$1"
@ -150,7 +149,6 @@ patch_enable_all ()
enable_gdi32_MultiMonitor="$1"
enable_gdi32_rotation="$1"
enable_gdiplus_Performance_Improvements="$1"
enable_hid_HidD_FlushQueue="$1"
enable_httpapi_HttpCreateServerSession="$1"
enable_imagehlp_BindImageEx="$1"
enable_imm32_message_on_focus="$1"
@ -533,9 +531,6 @@ patch_enable ()
ddraw-version-check)
enable_ddraw_version_check="$2"
;;
dinput-Deadlock)
enable_dinput_Deadlock="$2"
;;
dinput-axis-recalc)
enable_dinput_axis_recalc="$2"
;;
@ -593,9 +588,6 @@ patch_enable ()
gdiplus-Performance-Improvements)
enable_gdiplus_Performance_Improvements="$2"
;;
hid-HidD_FlushQueue)
enable_hid_HidD_FlushQueue="$2"
;;
httpapi-HttpCreateServerSession)
enable_httpapi_HttpCreateServerSession="$2"
;;
@ -1943,6 +1935,9 @@ if test "$enable_ntdll_FileDispositionInformation" -eq 1; then
fi
if test "$enable_eventfd_synchronization" -eq 1; then
if test "$enable_advapi32_Token_Integrity_Level" -gt 1; then
abort "Patchset advapi32-Token_Integrity_Level disabled, but eventfd_synchronization depends on that."
fi
if test "$enable_ntdll_NtSuspendProcess" -gt 1; then
abort "Patchset ntdll-NtSuspendProcess disabled, but eventfd_synchronization depends on that."
fi
@ -1955,6 +1950,9 @@ if test "$enable_eventfd_synchronization" -eq 1; then
if test "$enable_ntdll_User_Shared_Data" -gt 1; then
abort "Patchset ntdll-User_Shared_Data disabled, but eventfd_synchronization depends on that."
fi
if test "$enable_server_Misc_ACL" -gt 1; then
abort "Patchset server-Misc_ACL disabled, but eventfd_synchronization depends on that."
fi
if test "$enable_server_Realtime_Priority" -gt 1; then
abort "Patchset server-Realtime_Priority disabled, but eventfd_synchronization depends on that."
fi
@ -1964,10 +1962,12 @@ if test "$enable_eventfd_synchronization" -eq 1; then
if test "$enable_ws2_32_WSACleanup" -gt 1; then
abort "Patchset ws2_32-WSACleanup disabled, but eventfd_synchronization depends on that."
fi
enable_advapi32_Token_Integrity_Level=1
enable_ntdll_NtSuspendProcess=1
enable_ntdll_RtlCreateUserThread=1
enable_ntdll_SystemRoot_Symlink=1
enable_ntdll_User_Shared_Data=1
enable_server_Misc_ACL=1
enable_server_Realtime_Priority=1
enable_server_Shared_Memory=1
enable_ws2_32_WSACleanup=1
@ -3186,21 +3186,6 @@ if test "$enable_ddraw_version_check" -eq 1; then
) >> "$patchlist"
fi
# Patchset dinput-Deadlock
# |
# | This patchset fixes the following Wine bugs:
# | * [#43356] Avoid possible deadlock in dinput when CS are acquired in different order
# |
# | Modified files:
# | * dlls/dinput/device.c, dlls/dinput/dinput_main.c, dlls/dinput/dinput_private.h
# |
if test "$enable_dinput_Deadlock" -eq 1; then
patch_apply dinput-Deadlock/0001-dinput-Avoid-possible-deadlock-when-CS-are-acquired-.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "dinput: Avoid possible deadlock when CS are acquired in different order.", 1 },';
) >> "$patchlist"
fi
# Patchset dinput-axis-recalc
# |
# | This patchset fixes the following Wine bugs:
@ -3724,7 +3709,8 @@ fi
# Patchset eventfd_synchronization
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * kernel32-K32GetPerformanceInfo, ntdll-NtSuspendProcess, ntdll-RtlCreateUserThread, ntdll-Exception, ntdll-
# | * Staging, advapi32-CreateRestrictedToken, server-Misc_ACL, advapi32-Token_Integrity_Level,
# | kernel32-K32GetPerformanceInfo, ntdll-NtSuspendProcess, ntdll-RtlCreateUserThread, ntdll-Exception, ntdll-
# | SystemRoot_Symlink, ntdll-ThreadTime, ntdll-Hide_Wine_Exports, ntdll-User_Shared_Data, server-Realtime_Priority, ntdll-
# | Threading, ntdll-Wait_User_APC, server-Key_State, server-PeekMessage, server-Signal_Thread, server-Shared_Memory,
# | ws2_32-WSACleanup
@ -4044,21 +4030,6 @@ if test "$enable_gdiplus_Performance_Improvements" -eq 1; then
) >> "$patchlist"
fi
# Patchset hid-HidD_FlushQueue
# |
# | This patchset fixes the following Wine bugs:
# | * [#45878] Implement HidD_FlushQueue
# |
# | Modified files:
# | * dlls/hid/hid.spec, dlls/hid/hidd.c
# |
if test "$enable_hid_HidD_FlushQueue" -eq 1; then
patch_apply hid-HidD_FlushQueue/0001-hid-Implement-HidD_FlushQueue.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "hid: Implement HidD_FlushQueue.", 1 },';
) >> "$patchlist"
fi
# Patchset httpapi-HttpCreateServerSession
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,71 +0,0 @@
From 4a137148ed5f42a6f598eba630d668d2b9613b4c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 24 Feb 2016 17:49:10 +0100
Subject: user32: Implement CWF_CREATE_ONLY flag for CreateWindowStation.
---
dlls/user32/winstation.c | 11 ++++++-----
include/winuser.h | 2 ++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c
index 61add76..70715ad 100644
--- a/dlls/user32/winstation.c
+++ b/dlls/user32/winstation.c
@@ -80,26 +80,26 @@ static HANDLE get_winstations_dir_handle(void)
/***********************************************************************
* CreateWindowStationA (USER32.@)
*/
-HWINSTA WINAPI CreateWindowStationA( LPCSTR name, DWORD reserved, ACCESS_MASK access,
+HWINSTA WINAPI CreateWindowStationA( LPCSTR name, DWORD flags, ACCESS_MASK access,
LPSECURITY_ATTRIBUTES sa )
{
WCHAR buffer[MAX_PATH];
- if (!name) return CreateWindowStationW( NULL, reserved, access, sa );
+ if (!name) return CreateWindowStationW( NULL, flags, access, sa );
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
{
SetLastError( ERROR_FILENAME_EXCED_RANGE );
return 0;
}
- return CreateWindowStationW( buffer, reserved, access, sa );
+ return CreateWindowStationW( buffer, flags, access, sa );
}
/***********************************************************************
* CreateWindowStationW (USER32.@)
*/
-HWINSTA WINAPI CreateWindowStationW( LPCWSTR name, DWORD reserved, ACCESS_MASK access,
+HWINSTA WINAPI CreateWindowStationW( LPCWSTR name, DWORD flags, ACCESS_MASK access,
LPSECURITY_ATTRIBUTES sa )
{
HANDLE ret;
@@ -114,7 +114,8 @@ HWINSTA WINAPI CreateWindowStationW( LPCWSTR name, DWORD reserved, ACCESS_MASK a
{
req->flags = 0;
req->access = access;
- req->attributes = OBJ_CASE_INSENSITIVE | OBJ_OPENIF |
+ req->attributes = OBJ_CASE_INSENSITIVE |
+ ((flags & CWF_CREATE_ONLY) ? 0 : OBJ_OPENIF) |
((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0);
req->rootdir = wine_server_obj_handle( get_winstations_dir_handle() );
wine_server_add_data( req, name, len * sizeof(WCHAR) );
diff --git a/include/winuser.h b/include/winuser.h
index fa3e661..64dd6e7 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -101,6 +101,8 @@ typedef void* HPOWERNOTIFY;
#define WSF_VISIBLE 1
#define DF_ALLOWOTHERACCOUNTHOOK 1
+#define CWF_CREATE_ONLY 0x01
+
typedef struct tagUSEROBJECTFLAGS {
BOOL fInherit;
BOOL fReserved;
--
2.7.1

View File

@ -1,4 +1,4 @@
From 399a3ac66f9d3ff2ce9d3357d19989fa97378cfe Mon Sep 17 00:00:00 2001
From ef01cf56078dbb657885eb57b918f8297570807f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 19 Mar 2015 01:22:34 +0100
Subject: [PATCH] server: Implement support for global and local shared memory
@ -20,10 +20,10 @@ Subject: [PATCH] server: Implement support for global and local shared memory
12 files changed, 215 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 0c0f219cac8..0fd9d7b416e 100644
index 149b0a66a..b5f091075 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -111,6 +111,7 @@ extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct o
@@ -108,6 +108,7 @@ extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct o
extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN;
extern int wait_select_reply( void *cookie ) DECLSPEC_HIDDEN;
extern BOOL invoke_apc( const apc_call_t *call, apc_result_t *result, sigset_t *user_sigset ) DECLSPEC_HIDDEN;
@ -32,10 +32,10 @@ index 0c0f219cac8..0fd9d7b416e 100644
/* module handling */
extern LIST_ENTRY tls_links DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index add4d9e665e..56dc55dbbb3 100644
index 68881afd9..d6de9af26 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -1003,6 +1003,66 @@ done:
@@ -994,6 +994,66 @@ done:
}
@ -102,7 +102,7 @@ index add4d9e665e..56dc55dbbb3 100644
/***********************************************************************
* wine_server_fd_to_handle (NTDLL.@)
*
@@ -1539,6 +1599,10 @@ size_t server_init_thread( void *entry_point, BOOL *suspend )
@@ -1531,6 +1591,10 @@ size_t server_init_thread( void *entry_point, BOOL *suspend )
}
SERVER_END_REQ;
@ -114,10 +114,10 @@ index add4d9e665e..56dc55dbbb3 100644
ntdll_get_thread_data()->wow64_redir = is_wow64;
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 48672454e83..d1ab168adc9 100644
index 8afaba49c..eb213340e 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -612,6 +612,7 @@ void exit_thread( int status )
@@ -315,6 +315,7 @@ void exit_thread( int status )
void WINAPI RtlExitUserThread( ULONG status )
{
static void *prev_teb;
@ -125,7 +125,7 @@ index 48672454e83..d1ab168adc9 100644
sigset_t sigset;
TEB *teb;
@@ -636,6 +637,9 @@ void WINAPI RtlExitUserThread( ULONG status )
@@ -339,6 +340,9 @@ void WINAPI RtlExitUserThread( ULONG status )
LdrShutdownThread();
RtlFreeThreadActivationContextStack();
@ -136,7 +136,7 @@ index 48672454e83..d1ab168adc9 100644
if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() )))
diff --git a/include/wine/server.h b/include/wine/server.h
index d573d1f7ad4..9889b95aaff 100644
index d573d1f7a..9889b95aa 100644
--- a/include/wine/server.h
+++ b/include/wine/server.h
@@ -120,6 +120,17 @@ static inline void *wine_server_get_ptr( client_ptr_t ptr )
@ -158,10 +158,10 @@ index d573d1f7ad4..9889b95aaff 100644
/* macros for server requests */
diff --git a/include/winternl.h b/include/winternl.h
index d01b7997901..ae0bfa85671 100644
index 2b3fb947b..e15238e5e 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -402,7 +402,7 @@ typedef struct _TEB
@@ -401,7 +401,7 @@ typedef struct _TEB
PVOID Spare4; /* f7c/1750 */
PVOID ReservedForOle; /* f80/1758 */
ULONG WaitingOnLoaderLock; /* f84/1760 */
@ -171,10 +171,10 @@ index d01b7997901..ae0bfa85671 100644
#ifdef _WIN64
PVOID DeallocationBStore; /* /1788 */
diff --git a/server/fd.c b/server/fd.c
index 688a5cf45bd..52518d67126 100644
index 5d80e218b..87d7047a1 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2669,6 +2669,33 @@ DECL_HANDLER(write)
@@ -2568,6 +2568,33 @@ DECL_HANDLER(write)
release_object( fd );
}
@ -209,10 +209,10 @@ index 688a5cf45bd..52518d67126 100644
DECL_HANDLER(ioctl)
{
diff --git a/server/file.h b/server/file.h
index a9435e7eae9..e8d932effd7 100644
index 0621b4794..379fc4507 100644
--- a/server/file.h
+++ b/server/file.h
@@ -169,6 +169,14 @@ extern struct object *create_mailslot_device( struct object *root, const struct
@@ -166,6 +166,14 @@ extern struct object *create_mailslot_device( struct object *root, const struct
extern struct object *create_unix_device( struct object *root, const struct unicode_str *name,
const char *unix_path );
@ -228,7 +228,7 @@ index a9435e7eae9..e8d932effd7 100644
extern void do_change_notify( int unix_fd );
diff --git a/server/main.c b/server/main.c
index 7aed338e968..f984bfc1e30 100644
index 7aed338e9..f984bfc1e 100644
--- a/server/main.c
+++ b/server/main.c
@@ -145,6 +145,7 @@ int main( int argc, char *argv[] )
@ -240,7 +240,7 @@ index 7aed338e968..f984bfc1e30 100644
return 0;
}
diff --git a/server/mapping.c b/server/mapping.c
index fb583761ade..d7910d5f26a 100644
index ddc8be890..f12876339 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -29,8 +29,32 @@
@ -341,7 +341,7 @@ index fb583761ade..d7910d5f26a 100644
static int create_temp_file( file_pos_t size )
{
diff --git a/server/protocol.def b/server/protocol.def
index 5fa9401cf6c..7eddd5eb292 100644
index b6ad51446..125d34b29 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -69,6 +69,15 @@ struct request_max_size
@ -360,7 +360,7 @@ index 5fa9401cf6c..7eddd5eb292 100644
/* debug event data */
typedef union
@@ -1277,6 +1286,12 @@ enum server_fd_type
@@ -1283,6 +1292,12 @@ enum server_fd_type
@END
@ -374,10 +374,10 @@ index 5fa9401cf6c..7eddd5eb292 100644
@REQ(flush)
async_data_t async; /* async I/O parameters */
diff --git a/server/thread.c b/server/thread.c
index e4824d59e2d..cd3952cd2e3 100644
index 044d73ca9..35fef023a 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -202,6 +202,8 @@ static inline void init_thread_structure( struct thread *thread )
@@ -204,6 +204,8 @@ static inline void init_thread_structure( struct thread *thread )
thread->desktop_users = 0;
thread->token = NULL;
thread->exit_poll = NULL;
@ -386,7 +386,7 @@ index e4824d59e2d..cd3952cd2e3 100644
thread->creation_time = current_time;
thread->exit_time = 0;
@@ -330,6 +332,8 @@ static void cleanup_thread( struct thread *thread )
@@ -339,6 +341,8 @@ static void cleanup_thread( struct thread *thread )
thread->inflight[i].client = thread->inflight[i].server = -1;
}
}
@ -395,7 +395,7 @@ index e4824d59e2d..cd3952cd2e3 100644
thread->req_data = NULL;
thread->reply_data = NULL;
thread->request_fd = NULL;
@@ -338,6 +342,9 @@ static void cleanup_thread( struct thread *thread )
@@ -347,6 +351,9 @@ static void cleanup_thread( struct thread *thread )
thread->context = NULL;
thread->suspend_context = NULL;
thread->desktop = 0;
@ -406,12 +406,12 @@ index e4824d59e2d..cd3952cd2e3 100644
/* destroy a thread when its refcount is 0 */
diff --git a/server/thread.h b/server/thread.h
index 25dd8763169..301abdba390 100644
index 4e7f794c0..00e8b293e 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -90,6 +90,8 @@ struct thread
timeout_t exit_time; /* Thread exit time */
@@ -91,6 +91,8 @@ struct thread
struct token *token; /* security token associated with this thread */
struct list kernel_object; /* list of kernel object pointers */
struct timeout_user *exit_poll; /* poll if the thread/process has exited already */
+ int shm_fd; /* file descriptor for thread local shared memory */
+ shmlocal_t *shm; /* thread local shared memory pointer */
@ -419,5 +419,5 @@ index 25dd8763169..301abdba390 100644
struct thread_snapshot
--
2.19.2
2.21.0

View File

@ -1,4 +1,4 @@
From 2be2e3e30d2052362f31e95d1368b67250c0dbac Mon Sep 17 00:00:00 2001
From dec47516b5df791ff46909db03fe9752385a97d7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 12 Nov 2018 18:10:32 +0200
Subject: [PATCH] server: Do not signal violently terminated threads until they
@ -27,10 +27,10 @@ Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/server/thread.c b/server/thread.c
index 7162fc3..372882f 100644
index b1d324f7d..044d73ca9 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -199,6 +199,7 @@ static inline void init_thread_structure( struct thread *thread )
@@ -203,6 +203,7 @@ static inline void init_thread_structure( struct thread *thread )
thread->suspend = 0;
thread->desktop_users = 0;
thread->token = NULL;
@ -38,7 +38,7 @@ index 7162fc3..372882f 100644
thread->creation_time = current_time;
thread->exit_time = 0;
@@ -347,6 +348,7 @@ static void destroy_thread( struct object *obj )
@@ -358,6 +359,7 @@ static void destroy_thread( struct object *obj )
list_remove( &thread->entry );
cleanup_thread( thread );
release_object( thread->process );
@ -46,7 +46,7 @@ index 7162fc3..372882f 100644
if (thread->id) free_ptid( thread->id );
if (thread->token) release_object( thread->token );
}
@@ -364,7 +366,7 @@ static void dump_thread( struct object *obj, int verbose )
@@ -382,7 +384,7 @@ static struct object_type *thread_get_type( struct object *obj )
static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
{
struct thread *mythread = (struct thread *)obj;
@ -55,7 +55,7 @@ index 7162fc3..372882f 100644
}
static unsigned int thread_map_access( struct object *obj, unsigned int access )
@@ -1125,6 +1127,26 @@ int thread_get_inflight_fd( struct thread *thread, int client )
@@ -1143,6 +1145,26 @@ int thread_get_inflight_fd( struct thread *thread, int client )
return -1;
}
@ -82,7 +82,7 @@ index 7162fc3..372882f 100644
/* kill a thread on the spot */
void kill_thread( struct thread *thread, int violent_death )
{
@@ -1145,8 +1167,12 @@ void kill_thread( struct thread *thread, int violent_death )
@@ -1163,8 +1185,12 @@ void kill_thread( struct thread *thread, int violent_death )
kill_console_processes( thread, 0 );
debug_exit_thread( thread );
abandon_mutexes( thread );
@ -98,17 +98,17 @@ index 7162fc3..372882f 100644
remove_process_thread( thread->process, thread );
release_object( thread );
diff --git a/server/thread.h b/server/thread.h
index e4332df..1b01c68 100644
index bafc08ed4..4e7f794c0 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -89,6 +89,7 @@ struct thread
timeout_t creation_time; /* Thread creation time */
@@ -90,6 +90,7 @@ struct thread
timeout_t exit_time; /* Thread exit time */
struct token *token; /* security token associated with this thread */
struct list kernel_object; /* list of kernel object pointers */
+ struct timeout_user *exit_poll; /* poll if the thread/process has exited already */
};
struct thread_snapshot
--
1.9.1
2.21.0

View File

@ -1,4 +1,4 @@
From e62cddcd96e6606e9df2b2bab91c2c0b46e1a72e Mon Sep 17 00:00:00 2001
From ec2da26fdd7259af7c473698fc6aa15469393e8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 8 Jun 2017 23:41:02 +0200
Subject: [PATCH] dxgkrnl.sys: Add stub driver.
@ -15,10 +15,10 @@ Subject: [PATCH] dxgkrnl.sys: Add stub driver.
create mode 100644 dlls/dxgkrnl.sys/main.c
diff --git a/configure.ac b/configure.ac
index 9d044c749..9f8fa30d3 100644
index dcf2d4930..fbc6acda7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3263,6 +3263,7 @@ WINE_CONFIG_MAKEFILE(dlls/dxerr8)
@@ -3268,6 +3268,7 @@ WINE_CONFIG_MAKEFILE(dlls/dxerr8)
WINE_CONFIG_MAKEFILE(dlls/dxerr9)
WINE_CONFIG_MAKEFILE(dlls/dxgi)
WINE_CONFIG_MAKEFILE(dlls/dxgi/tests)
@ -116,7 +116,7 @@ index 000000000..c5639c237
+ return STATUS_SUCCESS;
+}
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 48a9f4b91..1e97e8afb 100644
index 4d28a93c3..279271f54 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2553,6 +2553,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
@ -133,8 +133,8 @@ index 48a9f4b91..1e97e8afb 100644
11,,winetest.exe,-
+12,,dxgkrnl.sys
12,,fltmgr.sys
12,,ksecdd.sys,
12,,ksecdd.sys
12,,mountmgr.sys
--
2.20.1
2.21.0

View File

@ -1,4 +1,4 @@
From 97a04cdd0ee352140773036c90ffbf4a9082258c Mon Sep 17 00:00:00 2001
From 7215993b74878cfd57aa7251fde74d18b233ba14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 8 Jun 2017 23:42:32 +0200
Subject: [PATCH] dxgmms1.sys: Add stub driver.
@ -15,10 +15,10 @@ Subject: [PATCH] dxgmms1.sys: Add stub driver.
create mode 100644 dlls/dxgmms1.sys/main.c
diff --git a/configure.ac b/configure.ac
index 9f8fa30d3..732a9f744 100644
index fbc6acda7..f8eed3baa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3264,6 +3264,7 @@ WINE_CONFIG_MAKEFILE(dlls/dxerr9)
@@ -3269,6 +3269,7 @@ WINE_CONFIG_MAKEFILE(dlls/dxerr9)
WINE_CONFIG_MAKEFILE(dlls/dxgi)
WINE_CONFIG_MAKEFILE(dlls/dxgi/tests)
WINE_CONFIG_MAKEFILE(dlls/dxgkrnl.sys)
@ -92,7 +92,7 @@ index 000000000..686493d32
+ return STATUS_SUCCESS;
+}
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 1e97e8afb..ee720aed8 100644
index 279271f54..29afb4182 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2554,6 +2554,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
@ -109,8 +109,8 @@ index 1e97e8afb..ee720aed8 100644
12,,dxgkrnl.sys
+12,,dxgmms1.sys
12,,fltmgr.sys
12,,ksecdd.sys,
12,,ksecdd.sys
12,,mountmgr.sys
--
2.20.1
2.21.0