You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3e94d12465 | ||
|
f102154244 | ||
|
26c1f46d89 | ||
|
8dd91084bf | ||
|
e232cccc6a | ||
|
2ed03c4ed0 | ||
|
5054f7359b | ||
|
7db26cf727 | ||
|
1d80a4ba4e | ||
|
5cc4d90333 | ||
|
a044166651 | ||
|
c37f9f5091 | ||
|
b3f1bf0856 | ||
|
4de57fff29 | ||
|
52ba925f90 | ||
|
cc517dd949 | ||
|
a9be5cf2b0 | ||
|
df97d6c328 | ||
|
b4006fc038 | ||
|
d1cc8d0fa5 | ||
|
ef72380f02 | ||
|
1b2e959b75 | ||
|
31a37e3f3c | ||
|
a3738434e0 | ||
|
554a64f6b3 | ||
|
7f2c4b8613 |
@@ -1,4 +1,4 @@
|
||||
From f9f5002e4ce6417dd196d53b50c51a3b224015d3 Mon Sep 17 00:00:00 2001
|
||||
From 9cf09446b0bf5da7988d1ba30c24d392c7a01f4b Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 12 Nov 2019 18:13:20 +0800
|
||||
Subject: [PATCH] comctl32: Bump version to 6.0.
|
||||
@@ -8,39 +8,25 @@ and refuses to run, changing DLL version to 6.0 makes it run.
|
||||
|
||||
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
---
|
||||
dlls/comctl32/comctl32.h | 2 +-
|
||||
dlls/comctl32/comctl32.rc | 2 +-
|
||||
include/commctrl.h | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h
|
||||
index 51f4337add2..3fe8905abea 100644
|
||||
--- a/dlls/comctl32/comctl32.h
|
||||
+++ b/dlls/comctl32/comctl32.h
|
||||
@@ -194,7 +194,7 @@ BOOL Str_SetPtrAtoW(LPWSTR *lppDest, LPCSTR lpSrc);
|
||||
BOOL Str_SetPtrWtoA(LPSTR *lppDest, LPCWSTR lpSrc);
|
||||
BOOL imagelist_has_alpha(HIMAGELIST, UINT);
|
||||
|
||||
-#define COMCTL32_VERSION_MINOR 81
|
||||
+#define COMCTL32_VERSION_MINOR 0
|
||||
|
||||
/* Our internal stack structure of the window procedures to subclass */
|
||||
typedef struct _SUBCLASSPROCS {
|
||||
diff --git a/dlls/comctl32/comctl32.rc b/dlls/comctl32/comctl32.rc
|
||||
index c9aa1ba6253..be6e2425193 100644
|
||||
index 2c62dbe2720..473de211c67 100644
|
||||
--- a/dlls/comctl32/comctl32.rc
|
||||
+++ b/dlls/comctl32/comctl32.rc
|
||||
@@ -114,7 +114,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
@@ -113,7 +113,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
#define WINE_FILEDESCRIPTION_STR "Wine Common Controls"
|
||||
#define WINE_FILENAME_STR "comctl32.dll"
|
||||
#define WINE_FILEVERSION COMCTL32_VERSION, COMCTL32_VERSION_MINOR, 4704, 1100
|
||||
-#define WINE_FILEVERSION_STR "5.81"
|
||||
+#define WINE_FILEVERSION_STR "6.00.4704.1100"
|
||||
#define WINE_PRODUCTVERSION WINE_FILEVERSION
|
||||
#define WINE_PRODUCTVERSION_STR WINE_FILEVERSION_STR
|
||||
-#define WINE_FILEVERSION COMCTL32_VERSION,81,4704,1100
|
||||
+#define WINE_FILEVERSION COMCTL32_VERSION,0,4704,1100
|
||||
|
||||
#include "wine/wine_common_ver.rc"
|
||||
|
||||
diff --git a/include/commctrl.h b/include/commctrl.h
|
||||
index a54de13d8b2..e0b0e22d4dc 100644
|
||||
index 235704a76dd..5a67c1284a0 100644
|
||||
--- a/include/commctrl.h
|
||||
+++ b/include/commctrl.h
|
||||
@@ -59,7 +59,7 @@ enum _LI_METRIC
|
||||
@@ -53,5 +39,5 @@ index a54de13d8b2..e0b0e22d4dc 100644
|
||||
#define ICC_LISTVIEW_CLASSES 0x00000001 /* listview, header */
|
||||
#define ICC_TREEVIEW_CLASSES 0x00000002 /* treeview, tooltips */
|
||||
--
|
||||
2.40.1
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 5f5cfac7099cf4e5be912f07a66665f8217f57f3 Mon Sep 17 00:00:00 2001
|
||||
From 50f9168ed92d261de21615b250dfac115160cc2e Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 6 Jul 2020 17:17:31 -0500
|
||||
Subject: [PATCH] ntdll, server: Implement alertable waits.
|
||||
@@ -15,10 +15,10 @@ Subject: [PATCH] ntdll, server: Implement alertable waits.
|
||||
8 files changed, 109 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
|
||||
index 2844f9f760c..aeeea1731ce 100644
|
||||
index f805af251bb..a80019b76dd 100644
|
||||
--- a/dlls/ntdll/unix/esync.c
|
||||
+++ b/dlls/ntdll/unix/esync.c
|
||||
@@ -599,17 +599,42 @@ static void update_grabbed_object( struct esync *obj )
|
||||
@@ -601,17 +601,42 @@ static void update_grabbed_object( struct esync *obj )
|
||||
static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any,
|
||||
BOOLEAN alertable, const LARGE_INTEGER *timeout )
|
||||
{
|
||||
@@ -62,7 +62,7 @@ index 2844f9f760c..aeeea1731ce 100644
|
||||
NtQuerySystemTime( &now );
|
||||
if (timeout)
|
||||
{
|
||||
@@ -648,6 +673,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
|
||||
@@ -650,6 +675,8 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
|
||||
|
||||
if (msgwait)
|
||||
TRACE(" or driver events");
|
||||
@@ -71,7 +71,7 @@ index 2844f9f760c..aeeea1731ce 100644
|
||||
|
||||
if (!timeout)
|
||||
TRACE(", timeout = INFINITE.\n");
|
||||
@@ -684,12 +711,27 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
|
||||
@@ -686,12 +713,27 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
|
||||
fds[i].fd = obj ? obj->fd : -1;
|
||||
fds[i].events = POLLIN;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ index 2844f9f760c..aeeea1731ce 100644
|
||||
/* Find out which object triggered the wait. */
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
@@ -763,6 +805,14 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
|
||||
@@ -765,6 +807,14 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
|
||||
tryagain:
|
||||
/* First step: try to poll on each object in sequence. */
|
||||
fds[0].events = POLLIN;
|
||||
@@ -115,7 +115,7 @@ index 2844f9f760c..aeeea1731ce 100644
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
struct esync *obj = objs[i];
|
||||
@@ -778,9 +828,11 @@ tryagain:
|
||||
@@ -780,9 +830,11 @@ tryagain:
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ index 2844f9f760c..aeeea1731ce 100644
|
||||
|
||||
if (fds[0].revents & (POLLHUP | POLLERR | POLLNVAL))
|
||||
{
|
||||
@@ -796,10 +848,12 @@ tryagain:
|
||||
@@ -798,10 +850,12 @@ tryagain:
|
||||
fds[i].fd = objs[i] ? objs[i]->fd : -1;
|
||||
fds[i].events = POLLIN;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ index 2844f9f760c..aeeea1731ce 100644
|
||||
{
|
||||
/* Quick, grab everything. */
|
||||
for (i = 0; i < count; i++)
|
||||
@@ -865,6 +919,19 @@ err:
|
||||
@@ -867,6 +921,19 @@ err:
|
||||
ERR("ppoll failed: %s\n", strerror(errno));
|
||||
return errno_to_status( errno );
|
||||
}
|
||||
@@ -164,22 +164,22 @@ index 2844f9f760c..aeeea1731ce 100644
|
||||
|
||||
/* We need to let the server know when we are doing a message wait, and when we
|
||||
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
|
||||
index b278ab8df84..a3f0368b731 100644
|
||||
index b9043351d57..283fd7d7ff6 100644
|
||||
--- a/dlls/ntdll/unix/unix_private.h
|
||||
+++ b/dlls/ntdll/unix/unix_private.h
|
||||
@@ -93,6 +93,7 @@ struct ntdll_thread_data
|
||||
{
|
||||
void *cpu_data[16]; /* reserved for CPU-specific data */
|
||||
void *kernel_stack; /* stack for thread startup and kernel syscalls */
|
||||
+ int esync_apc_fd; /* fd to wait on for user APCs */
|
||||
int request_fd; /* fd for sending server requests */
|
||||
int reply_fd; /* fd for receiving server replies */
|
||||
int wait_fd[2]; /* fd for sleeping server requests */
|
||||
@@ -105,6 +105,7 @@ struct ntdll_thread_data
|
||||
SYSTEM_SERVICE_TABLE *syscall_table; /* 214/0370 syscall table */
|
||||
struct syscall_frame *syscall_frame; /* 218/0378 current syscall frame */
|
||||
int syscall_trace; /* 21c/0380 syscall trace flag */
|
||||
+ int esync_apc_fd; /* fd to wait on for user APCs */
|
||||
int request_fd; /* fd for sending server requests */
|
||||
int reply_fd; /* fd for receiving server replies */
|
||||
int wait_fd[2]; /* fd for sleeping server requests */
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 2116b677adb..a7d0bb7e8c8 100644
|
||||
index c797c89952f..0778ad73984 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -3646,6 +3646,7 @@ static TEB *init_teb( void *ptr, BOOL is_wow )
|
||||
@@ -4014,6 +4014,7 @@ static TEB *init_teb( void *ptr, BOOL is_wow )
|
||||
teb->StaticUnicodeString.Buffer = teb->StaticUnicodeBuffer;
|
||||
teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer);
|
||||
thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch;
|
||||
@@ -244,10 +244,10 @@ index 689d8569b73..e1588d205d9 100644
|
||||
void esync_clear( int fd );
|
||||
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 8c728080d05..3ea700054c6 100644
|
||||
index 807298b6bab..a2dcdd37204 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3935,3 +3935,7 @@ enum esync_type
|
||||
@@ -4148,3 +4148,7 @@ enum esync_type
|
||||
@REPLY
|
||||
int enable; /* previous state of auto-repeat enable */
|
||||
@END
|
||||
@@ -256,10 +256,10 @@ index 8c728080d05..3ea700054c6 100644
|
||||
+@REQ(get_esync_apc_fd)
|
||||
+@END
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index fd6b91b228a..8d7c520ced7 100644
|
||||
index 11c36e49ae4..3a771838a98 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -232,6 +232,7 @@ static inline void init_thread_structure( struct thread *thread )
|
||||
@@ -400,6 +400,7 @@ static inline void init_thread_structure( struct thread *thread )
|
||||
thread->teb = 0;
|
||||
thread->entry_point = 0;
|
||||
thread->esync_fd = -1;
|
||||
@@ -267,7 +267,7 @@ index fd6b91b228a..8d7c520ced7 100644
|
||||
thread->system_regs = 0;
|
||||
thread->queue = NULL;
|
||||
thread->wait = NULL;
|
||||
@@ -380,7 +381,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
|
||||
@@ -550,7 +551,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
|
||||
}
|
||||
|
||||
if (do_esync())
|
||||
@@ -278,7 +278,7 @@ index fd6b91b228a..8d7c520ced7 100644
|
||||
|
||||
set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */
|
||||
add_process_thread( thread->process, thread );
|
||||
@@ -1174,8 +1178,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
|
||||
@@ -1384,8 +1388,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 */
|
||||
@@ -292,7 +292,7 @@ index fd6b91b228a..8d7c520ced7 100644
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1221,6 +1230,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system
|
||||
@@ -1431,6 +1440,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system
|
||||
apc = LIST_ENTRY( ptr, struct thread_apc, entry );
|
||||
list_remove( ptr );
|
||||
}
|
||||
@@ -304,10 +304,10 @@ index fd6b91b228a..8d7c520ced7 100644
|
||||
}
|
||||
|
||||
diff --git a/server/thread.h b/server/thread.h
|
||||
index 9129e473ba9..10e9e28b432 100644
|
||||
index e826a7a25de..c320ac83af7 100644
|
||||
--- a/server/thread.h
|
||||
+++ b/server/thread.h
|
||||
@@ -56,6 +56,7 @@ struct thread
|
||||
@@ -57,6 +57,7 @@ struct thread
|
||||
thread_id_t id; /* thread id */
|
||||
struct list mutex_list; /* list of currently owned mutexes */
|
||||
int esync_fd; /* esync file descriptor (signalled on exit) */
|
||||
@@ -316,5 +316,5 @@ index 9129e473ba9..10e9e28b432 100644
|
||||
struct msg_queue *queue; /* message queue */
|
||||
struct thread_wait *wait; /* current wait condition if sleeping */
|
||||
--
|
||||
2.43.0
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 9829e3c307e8019a3a2b9204d1133833863da5f1 Mon Sep 17 00:00:00 2001
|
||||
From b4f92dd9311882607cedd7d247ddf3069ae33d8b Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Sat, 7 Jul 2018 12:57:47 +0200
|
||||
Subject: [PATCH] server: Create eventfd descriptors for pseudo-fd objects and
|
||||
@@ -11,10 +11,10 @@ Subject: [PATCH] server: Create eventfd descriptors for pseudo-fd objects and
|
||||
3 files changed, 25 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 6a1b89b0e54..8ba704344cf 100644
|
||||
index 737f7ee67b9..01a055f8b2d 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -97,6 +97,7 @@
|
||||
@@ -95,6 +95,7 @@
|
||||
#include "handle.h"
|
||||
#include "process.h"
|
||||
#include "request.h"
|
||||
@@ -22,7 +22,7 @@ index 6a1b89b0e54..8ba704344cf 100644
|
||||
|
||||
#include "winternl.h"
|
||||
#include "winioctl.h"
|
||||
@@ -198,6 +199,7 @@ struct fd
|
||||
@@ -159,6 +160,7 @@ struct fd
|
||||
struct completion *completion; /* completion object attached to this fd */
|
||||
apc_param_t comp_key; /* completion key to set in completion events */
|
||||
unsigned int comp_flags; /* completion flags */
|
||||
@@ -40,7 +40,7 @@ index 6a1b89b0e54..8ba704344cf 100644
|
||||
}
|
||||
|
||||
/* check if the desired access is possible without violating */
|
||||
@@ -1784,6 +1789,7 @@ static struct fd *alloc_fd_object(void)
|
||||
@@ -1786,6 +1791,7 @@ static struct fd *alloc_fd_object(void)
|
||||
fd->poll_index = -1;
|
||||
fd->completion = NULL;
|
||||
fd->comp_flags = 0;
|
||||
@@ -48,7 +48,7 @@ index 6a1b89b0e54..8ba704344cf 100644
|
||||
init_async_queue( &fd->read_q );
|
||||
init_async_queue( &fd->write_q );
|
||||
init_async_queue( &fd->wait_q );
|
||||
@@ -1823,11 +1829,15 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
|
||||
@@ -1827,11 +1833,15 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
|
||||
fd->completion = NULL;
|
||||
fd->comp_flags = 0;
|
||||
fd->no_fd_status = STATUS_BAD_DEVICE_TYPE;
|
||||
@@ -64,7 +64,7 @@ index 6a1b89b0e54..8ba704344cf 100644
|
||||
return fd;
|
||||
}
|
||||
|
||||
@@ -2268,6 +2278,9 @@ void set_fd_signaled( struct fd *fd, int signaled )
|
||||
@@ -2283,6 +2293,9 @@ void set_fd_signaled( struct fd *fd, int signaled )
|
||||
if (fd->comp_flags & FILE_SKIP_SET_EVENT_ON_HANDLE) return;
|
||||
fd->signaled = signaled;
|
||||
if (signaled) wake_up( fd->user, 0 );
|
||||
@@ -74,7 +74,7 @@ index 6a1b89b0e54..8ba704344cf 100644
|
||||
}
|
||||
|
||||
/* check if events are pending and if yes return which one(s) */
|
||||
@@ -2293,6 +2306,15 @@ int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry )
|
||||
@@ -2324,6 +2337,15 @@ WCHAR *default_fd_get_full_name( struct object *obj, data_size_t max, data_size_
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -91,19 +91,19 @@ index 6a1b89b0e54..8ba704344cf 100644
|
||||
{
|
||||
int events = 0;
|
||||
diff --git a/server/file.h b/server/file.h
|
||||
index 0ffe0e2c8dc..b5b1e2a1077 100644
|
||||
index 7742e705e49..d86a9fc159d 100644
|
||||
--- a/server/file.h
|
||||
+++ b/server/file.h
|
||||
@@ -106,6 +106,7 @@ extern char *dup_fd_name( struct fd *root, const char *name );
|
||||
extern void get_nt_name( struct fd *fd, struct unicode_str *name );
|
||||
@@ -110,6 +110,7 @@ extern void get_nt_name( struct fd *fd, struct unicode_str *name );
|
||||
|
||||
extern int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry );
|
||||
extern WCHAR *default_fd_get_full_name( struct object *obj, data_size_t max, data_size_t *ret_len );
|
||||
+extern int default_fd_get_esync_fd( struct object *obj, enum esync_type *type );
|
||||
extern int default_fd_get_poll_events( struct fd *fd );
|
||||
extern void default_poll_event( struct fd *fd, int event );
|
||||
extern void fd_cancel_async( struct fd *fd, struct async *async );
|
||||
diff --git a/server/named_pipe.c b/server/named_pipe.c
|
||||
index b8ec17a787a..e01b28f725a 100644
|
||||
index cdb27ed45c0..d4f8cf5e964 100644
|
||||
--- a/server/named_pipe.c
|
||||
+++ b/server/named_pipe.c
|
||||
@@ -168,7 +168,7 @@ static const struct object_ops pipe_server_ops =
|
||||
@@ -125,5 +125,5 @@ index b8ec17a787a..e01b28f725a 100644
|
||||
no_signal, /* signal */
|
||||
pipe_end_get_fd, /* get_fd */
|
||||
--
|
||||
2.35.1
|
||||
2.47.2
|
||||
|
||||
|
@@ -2,3 +2,4 @@ Fixes: [36692] Many multi-threaded applications have poor performance due to hea
|
||||
Depends: ntdll-Junction_Points
|
||||
Depends: server-PeekMessage
|
||||
Depends: server-Signal_Thread
|
||||
Disabled: True
|
||||
|
@@ -0,0 +1,36 @@
|
||||
From 764a3b19afc7519fa9568a402e094a944d56055c Mon Sep 17 00:00:00 2001
|
||||
From: Akihiro Sagawa <sagawa.aki@gmail.com>
|
||||
Date: Sun, 1 Jun 2025 15:42:40 +1000
|
||||
Subject: [PATCH] kernel32: Limit old exe to 3MB available space
|
||||
|
||||
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=44931
|
||||
---
|
||||
dlls/kernel32/heap.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c
|
||||
index 1ec2f5cce0d..834f4d07e9b 100644
|
||||
--- a/dlls/kernel32/heap.c
|
||||
+++ b/dlls/kernel32/heap.c
|
||||
@@ -475,12 +475,15 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer )
|
||||
if ( lpBuffer->dwAvailPhys + lpBuffer->dwAvailPageFile >= 2U*1024*1024*1024)
|
||||
lpBuffer->dwAvailPageFile = 2U*1024*1024*1024 - lpBuffer->dwAvailPhys - 1;
|
||||
|
||||
- /* limit page file size for really old binaries */
|
||||
+ /* limit value for really old binaries */
|
||||
+ /* use MAXLONG/2, so that dwAvailPhys + dwAvailPageFile < MAXLONG */
|
||||
if (nt->OptionalHeader.MajorSubsystemVersion < 4 ||
|
||||
nt->OptionalHeader.MajorOperatingSystemVersion < 4)
|
||||
{
|
||||
- if (lpBuffer->dwTotalPageFile > MAXLONG) lpBuffer->dwTotalPageFile = MAXLONG;
|
||||
- if (lpBuffer->dwAvailPageFile > MAXLONG) lpBuffer->dwAvailPageFile = MAXLONG;
|
||||
+ lpBuffer->dwTotalPhys = min(lpBuffer->dwTotalPhys, MAXLONG / 2);
|
||||
+ lpBuffer->dwAvailPhys = min(lpBuffer->dwAvailPhys, MAXLONG / 2);
|
||||
+ lpBuffer->dwTotalPageFile = min(lpBuffer->dwTotalPageFile, MAXLONG / 2);
|
||||
+ lpBuffer->dwAvailPageFile = min(lpBuffer->dwAvailPageFile, MAXLONG / 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.47.2
|
||||
|
1
patches/kernel32-limit_heap_old_exe/definition
Normal file
1
patches/kernel32-limit_heap_old_exe/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [44931] kernel32: Limit old exe to 3MB available space
|
@@ -1,4 +1,4 @@
|
||||
From a808aeb6fbb9c7cace366a262715607379ca1b58 Mon Sep 17 00:00:00 2001
|
||||
From fec0755a2826b69658dd5a894dc424a8e1111f1a Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 9 Jul 2019 14:13:28 +1000
|
||||
Subject: [PATCH] user32: Do not enumerate the registry in
|
||||
@@ -13,10 +13,10 @@ not the complete list from the registry.
|
||||
3 files changed, 36 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
|
||||
index 00337aa72b7..375ca3abee3 100644
|
||||
index 22c296cf213..70fa8009d3b 100644
|
||||
--- a/dlls/user32/input.c
|
||||
+++ b/dlls/user32/input.c
|
||||
@@ -497,7 +497,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
|
||||
@@ -450,7 +450,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ index 00337aa72b7..375ca3abee3 100644
|
||||
{
|
||||
SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL);
|
||||
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
|
||||
index b92e59396ac..364afc08b26 100644
|
||||
index a82ca5941a2..eb565c6845b 100644
|
||||
--- a/dlls/user32/tests/input.c
|
||||
+++ b/dlls/user32/tests/input.c
|
||||
@@ -5637,6 +5637,40 @@ static void test_LoadKeyboardLayoutEx(void)
|
||||
@@ -6103,6 +6103,40 @@ static void test_LoadKeyboardLayoutEx( HKL orig_hkl )
|
||||
ok_eq( old_hkl, GetKeyboardLayout( 0 ), HKL, "%p" );
|
||||
}
|
||||
|
||||
@@ -69,19 +69,19 @@ index b92e59396ac..364afc08b26 100644
|
||||
/* run the tests in a separate desktop to avoid interaction with other
|
||||
* tests, current desktop state, or user actions. */
|
||||
static void test_input_desktop( char **argv )
|
||||
@@ -5730,6 +5764,7 @@ START_TEST(input)
|
||||
@@ -6377,6 +6411,7 @@ START_TEST(input)
|
||||
test_GetKeyState();
|
||||
test_OemKeyScan();
|
||||
test_rawinput(argv[0]);
|
||||
+ test_GetKeyboardLayoutList();
|
||||
test_DefRawInputProc();
|
||||
test_ScheduleDispatchNotification();
|
||||
|
||||
if(pGetMouseMovePointsEx)
|
||||
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
|
||||
index 1886ff979d7..1834ae40441 100644
|
||||
index 1f824f85c50..e51fe494b29 100644
|
||||
--- a/dlls/win32u/input.c
|
||||
+++ b/dlls/win32u/input.c
|
||||
@@ -1266,11 +1266,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
||||
@@ -1379,11 +1379,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
||||
*/
|
||||
UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
{
|
||||
@@ -94,7 +94,7 @@ index 1886ff979d7..1834ae40441 100644
|
||||
HKL layout;
|
||||
|
||||
TRACE_(keyboard)( "size %d, layouts %p.\n", size, layouts );
|
||||
@@ -1284,33 +1280,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
@@ -1397,33 +1393,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
if (size && layouts)
|
||||
{
|
||||
layouts[count - 1] = layout;
|
||||
@@ -129,5 +129,5 @@ index 1886ff979d7..1834ae40441 100644
|
||||
|
||||
return count;
|
||||
--
|
||||
2.43.0
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 0d4a7cf6b9bb3a57a098762113ca1750c43a810e Mon Sep 17 00:00:00 2001
|
||||
From e27b26f100bedf8f8374333ce9026fd96ed9102b Mon Sep 17 00:00:00 2001
|
||||
From: Torge Matthies <tmatthies@codeweavers.com>
|
||||
Date: Fri, 25 Oct 2024 10:47:30 +0200
|
||||
Subject: [PATCH] mf/tests: Add network bytestream tests.
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] mf/tests: Add network bytestream tests.
|
||||
1 file changed, 347 insertions(+)
|
||||
|
||||
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
|
||||
index d0f1f1cf0a4..61daaf35741 100644
|
||||
index 1070e9c1b2d..9d41b05fad3 100644
|
||||
--- a/dlls/mf/tests/mf.c
|
||||
+++ b/dlls/mf/tests/mf.c
|
||||
@@ -4726,6 +4726,7 @@ static void test_evr(void)
|
||||
@@ -4908,6 +4908,7 @@ static void test_evr(void)
|
||||
|
||||
hr = IMFActivate_ActivateObject(activate, &IID_IMFMediaSink, (void **)&sink);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
@@ -19,8 +19,8 @@ index d0f1f1cf0a4..61daaf35741 100644
|
||||
|
||||
check_interface(sink, &IID_IMFMediaSinkPreroll, TRUE);
|
||||
check_interface(sink, &IID_IMFVideoRenderer, TRUE);
|
||||
@@ -6803,6 +6804,351 @@ static void test_media_session_Close(void)
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
@@ -7130,6 +7131,351 @@ static void test_media_session_thinning(void)
|
||||
ok(hr == S_OK, "Shutdown failure, hr %#lx.\n", hr);
|
||||
}
|
||||
|
||||
+static void test_network_bytestream(void)
|
||||
@@ -371,13 +371,14 @@ index d0f1f1cf0a4..61daaf35741 100644
|
||||
START_TEST(mf)
|
||||
{
|
||||
init_functions();
|
||||
@@ -6838,5 +7184,6 @@ START_TEST(mf)
|
||||
@@ -7165,6 +7511,7 @@ START_TEST(mf)
|
||||
test_media_session_Start();
|
||||
test_MFEnumDeviceSources();
|
||||
test_media_session_Close();
|
||||
+ test_network_bytestream();
|
||||
test_media_session_source_shutdown();
|
||||
test_media_session_thinning();
|
||||
}
|
||||
--
|
||||
2.45.2
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From e5c4a6bd332d7d125e9db79fa29b14e55e3a1ee5 Mon Sep 17 00:00:00 2001
|
||||
From 32419947818521387ec9de7b5ca92f9269819bd2 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Mon, 25 Nov 2019 12:19:20 +0300
|
||||
Subject: [PATCH] ntdll: Force virtual memory allocation order.
|
||||
@@ -12,14 +12,14 @@ are from higher memory than they expect.
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48175
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46568
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 402 +++++++++++++++-----------------------
|
||||
1 file changed, 162 insertions(+), 240 deletions(-)
|
||||
dlls/ntdll/unix/virtual.c | 400 +++++++++++++++-----------------------
|
||||
1 file changed, 162 insertions(+), 238 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index a36c919d47f..2f682e70ec2 100644
|
||||
index 2353e51f5e8..a5270649c0d 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -1324,43 +1324,15 @@ static struct file_view *find_view_range( const void *addr, size_t size )
|
||||
@@ -1492,43 +1492,15 @@ static struct file_view *find_view_range( const void *addr, size_t size )
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
|
||||
/***********************************************************************
|
||||
* try_map_free_area
|
||||
@@ -1393,112 +1365,6 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
@@ -1561,112 +1533,6 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
/***********************************************************************
|
||||
* remove_reserved_area
|
||||
*
|
||||
@@ -1613,8 +1479,7 @@ static void free_view( struct file_view *view )
|
||||
@@ -1781,8 +1647,7 @@ static void free_view( struct file_view *view )
|
||||
*/
|
||||
static void unregister_view( struct file_view *view )
|
||||
{
|
||||
@@ -194,7 +194,7 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
wine_rb_remove( &views_tree, &view->entry );
|
||||
}
|
||||
|
||||
@@ -1642,8 +1507,7 @@ static void delete_view( struct file_view *view ) /* [in] View */
|
||||
@@ -1810,8 +1675,7 @@ static void delete_view( struct file_view *view ) /* [in] View */
|
||||
static void register_view( struct file_view *view )
|
||||
{
|
||||
wine_rb_put( &views_tree, view->base, &view->entry );
|
||||
@@ -204,7 +204,7 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
}
|
||||
|
||||
|
||||
@@ -1919,89 +1783,176 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want
|
||||
@@ -2099,89 +1963,176 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -223,18 +223,18 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
+ char *alloc_start;
|
||||
|
||||
- if (preload_reserve_end >= end)
|
||||
+ if (area->top_down)
|
||||
{
|
||||
- {
|
||||
- if (preload_reserve_start <= start) return NULL; /* no space in that area */
|
||||
- if (preload_reserve_start < end) end = preload_reserve_start;
|
||||
- }
|
||||
- else if (preload_reserve_start <= start)
|
||||
+ if (area->top_down)
|
||||
{
|
||||
- if (preload_reserve_end > start) start = preload_reserve_end;
|
||||
+ if (end - start < area->size) return NULL;
|
||||
+ alloc_start = ROUND_ADDR( end - area->size, area->align_mask );
|
||||
+ return try_map_free_area( start, alloc_start + area->size, area->step, alloc_start, area->size, area->unix_prot );
|
||||
}
|
||||
- else if (preload_reserve_start <= start)
|
||||
- {
|
||||
- if (preload_reserve_end > start) start = preload_reserve_end;
|
||||
- }
|
||||
- else /* range is split in two by the preloader reservation, try both parts */
|
||||
+
|
||||
+ alloc_start = ROUND_ADDR( start + area->align_mask, area->align_mask );
|
||||
@@ -442,16 +442,16 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -2112,43 +2063,12 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
@@ -2299,41 +2250,12 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
void *start = address_space_start;
|
||||
void *end = min( user_space_limit, host_addr_space_limit );
|
||||
size_t host_size = ROUND_SIZE( 0, size, host_page_mask );
|
||||
- size_t unmap_size, view_size = host_size + align_mask + 1;
|
||||
-
|
||||
|
||||
if (limit_low && (void *)limit_low > start) start = (void *)limit_low;
|
||||
if (limit_high && (void *)limit_high < end) end = (char *)limit_high + 1;
|
||||
|
||||
- if ((ptr = map_reserved_area( start, end, host_size, top_down, get_unix_prot(vprot), align_mask )))
|
||||
- if ((ptr = map_reserved_area( start, end, host_size, top_down, unix_prot, align_mask )))
|
||||
- {
|
||||
- TRACE( "got mem in reserved area %p-%p\n", ptr, (char *)ptr + size );
|
||||
- goto done;
|
||||
@@ -459,7 +459,7 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
-
|
||||
- if (start > address_space_start || end < host_addr_space_limit || top_down)
|
||||
- {
|
||||
- if (!(ptr = map_free_area( start, end, host_size, top_down, get_unix_prot(vprot), align_mask )))
|
||||
- if (!(ptr = map_free_area( start, end, host_size, top_down, unix_prot, align_mask )))
|
||||
- return STATUS_NO_MEMORY;
|
||||
- TRACE( "got mem with map_free_area %p-%p\n", ptr, (char *)ptr + size );
|
||||
- goto done;
|
||||
@@ -467,11 +467,11 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
-
|
||||
- for (;;)
|
||||
- {
|
||||
- if ((ptr = anon_mmap_alloc( view_size, get_unix_prot(vprot) )) == MAP_FAILED)
|
||||
- if ((ptr = anon_mmap_alloc( view_size, unix_prot )) == MAP_FAILED)
|
||||
- {
|
||||
- status = (errno == ENOMEM) ? STATUS_NO_MEMORY : STATUS_INVALID_PARAMETER;
|
||||
- ERR( "anon mmap error %s, size %p, unix_prot %#x\n",
|
||||
- strerror(errno), (void *)view_size, get_unix_prot( vprot ) );
|
||||
- strerror(errno), (void *)view_size, unix_prot );
|
||||
- return status;
|
||||
- }
|
||||
- TRACE( "got mem with anon mmap %p-%p\n", ptr, (char *)ptr + size );
|
||||
@@ -481,14 +481,12 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
- if (unmap_size) munmap( ptr, unmap_size );
|
||||
- }
|
||||
- ptr = unmap_extra_space( ptr, view_size, host_size, align_mask );
|
||||
+ if (!(ptr = alloc_free_area( start, end, host_size, top_down, get_unix_prot( vprot ), align_mask )))
|
||||
+ if (!(ptr = alloc_free_area( start, end, host_size, top_down, unix_prot, align_mask )))
|
||||
+ return STATUS_NO_MEMORY;
|
||||
}
|
||||
-done:
|
||||
done:
|
||||
status = create_view( view_ret, ptr, size, vprot );
|
||||
if (status != STATUS_SUCCESS) unmap_area( ptr, size );
|
||||
return status;
|
||||
@@ -3413,6 +3333,7 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P
|
||||
@@ -3602,6 +3524,7 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P
|
||||
done:
|
||||
server_leave_uninterrupted_section( &virtual_mutex, &sigset );
|
||||
if (needs_close) close( unix_handle );
|
||||
@@ -496,7 +494,7 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -6624,6 +6545,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL
|
||||
@@ -6875,6 +6798,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL
|
||||
*ret = (ULONG_PTR)base;
|
||||
*size_ptr = size;
|
||||
}
|
||||
@@ -505,5 +503,5 @@ index a36c919d47f..2f682e70ec2 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.49.0
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 09d76a4049ee4cc8bce4ffafc349da326fc058e0 Mon Sep 17 00:00:00 2001
|
||||
From f918a9c53c678d3234cc6b51083af524087966bb Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Fri, 1 Dec 2023 14:55:20 -0600
|
||||
Subject: [PATCH] ntdll: Exclude natively mapped areas from free areas list.
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] ntdll: Exclude natively mapped areas from free areas list.
|
||||
1 file changed, 96 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 2f682e70ec2..6170363f0a0 100644
|
||||
index a5270649c0d..0fe761a3b85 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -135,6 +135,7 @@ struct file_view
|
||||
@@ -144,6 +144,7 @@ struct file_view
|
||||
#define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
|
||||
#define VPROT_PLACEHOLDER 0x0400
|
||||
#define VPROT_FREE_PLACEHOLDER 0x0800
|
||||
@@ -19,7 +19,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
|
||||
/* Conversion from VPROT_* to Win32 flags */
|
||||
static const BYTE VIRTUAL_Win32Flags[16] =
|
||||
@@ -191,6 +192,8 @@ static void *working_set_limit = (void *)0x7fff0000;
|
||||
@@ -200,6 +201,8 @@ static void *working_set_limit = (void *)0x7fff0000;
|
||||
static void *host_addr_space_limit; /* top of the host virtual address space */
|
||||
|
||||
static struct file_view *arm64ec_view;
|
||||
@@ -28,7 +28,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
|
||||
ULONG_PTR user_space_wow_limit = 0;
|
||||
struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000;
|
||||
@@ -1212,7 +1215,9 @@ static void dump_view( struct file_view *view )
|
||||
@@ -1380,7 +1383,9 @@ static void dump_view( struct file_view *view )
|
||||
BYTE prot = get_page_vprot( addr );
|
||||
|
||||
TRACE( "View: %p - %p", addr, addr + view->size - 1 );
|
||||
@@ -39,7 +39,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
TRACE( " (builtin image)\n" );
|
||||
else if (view->protect & VPROT_FREE_PLACEHOLDER)
|
||||
TRACE( " (placeholder)\n" );
|
||||
@@ -1332,6 +1337,8 @@ struct alloc_area
|
||||
@@ -1500,6 +1505,8 @@ struct alloc_area
|
||||
int unix_prot;
|
||||
BOOL top_down;
|
||||
UINT_PTR align_mask;
|
||||
@@ -48,7 +48,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
@@ -1340,9 +1347,13 @@ struct alloc_area
|
||||
@@ -1508,9 +1515,13 @@ struct alloc_area
|
||||
* Try mmaping some expected free memory region, eventually stepping and
|
||||
* retrying inside it, and return where it actually succeeded, or NULL.
|
||||
*/
|
||||
@@ -64,7 +64,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
while (start && base <= start && (char*)start + size <= (char*)end)
|
||||
{
|
||||
if (anon_mmap_tryfixed( start, size, unix_prot, 0 ) != MAP_FAILED) return start;
|
||||
@@ -1353,12 +1364,19 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
@@ -1521,12 +1532,19 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
strerror(errno), start, (char *)start + size, unix_prot );
|
||||
return NULL;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1791,11 +1809,11 @@ static void *try_map_free_area_range( struct alloc_area *area, char *start, char
|
||||
@@ -1971,11 +1989,11 @@ static void *try_map_free_area_range( struct alloc_area *area, char *start, char
|
||||
{
|
||||
if (end - start < area->size) return NULL;
|
||||
alloc_start = ROUND_ADDR( end - area->size, area->align_mask );
|
||||
@@ -99,7 +99,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
}
|
||||
|
||||
static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char *end )
|
||||
@@ -1885,9 +1903,10 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO
|
||||
@@ -2065,9 +2083,10 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO
|
||||
struct range_entry *range, *ranges_start, *ranges_end;
|
||||
char *reserve_start, *reserve_end;
|
||||
struct alloc_area area;
|
||||
@@ -111,7 +111,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
|
||||
TRACE("limit %p-%p, size %p, top_down %#x.\n", limit_low, limit_high, (void *)size, top_down);
|
||||
|
||||
@@ -1952,6 +1971,50 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO
|
||||
@@ -2132,6 +2151,50 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO
|
||||
if ((result = alloc_free_area_in_range( &area, base, end )))
|
||||
break;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2012,6 +2075,17 @@ failed:
|
||||
@@ -2191,6 +2254,17 @@ failed:
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -180,24 +180,24 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
/***********************************************************************
|
||||
* map_view
|
||||
*
|
||||
@@ -2067,7 +2141,15 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
@@ -2255,7 +2329,15 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
if (limit_high && (void *)limit_high < end) end = (char *)limit_high + 1;
|
||||
|
||||
if (!(ptr = alloc_free_area( start, end, host_size, top_down, get_unix_prot( vprot ), align_mask )))
|
||||
if (!(ptr = alloc_free_area( start, end, host_size, top_down, unix_prot, align_mask )))
|
||||
- return STATUS_NO_MEMORY;
|
||||
+ {
|
||||
+ WARN("Allocation failed, clearing native views.\n");
|
||||
+
|
||||
+ clear_native_views();
|
||||
+ if (!is_win64) increase_try_map_step = FALSE;
|
||||
+ ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, get_unix_prot( vprot ), align_mask );
|
||||
+ ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, unix_prot, align_mask );
|
||||
+ if (!is_win64) increase_try_map_step = TRUE;
|
||||
+ if (!ptr) return STATUS_NO_MEMORY;
|
||||
+ }
|
||||
}
|
||||
done:
|
||||
status = create_view( view_ret, ptr, size, vprot );
|
||||
if (status != STATUS_SUCCESS) unmap_area( ptr, size );
|
||||
@@ -4503,7 +4585,12 @@ void virtual_set_force_exec( BOOL enable )
|
||||
@@ -4746,7 +4828,12 @@ void virtual_set_force_exec( BOOL enable )
|
||||
WINE_RB_FOR_EACH_ENTRY( view, &views_tree, struct file_view, entry )
|
||||
{
|
||||
/* file mappings are always accessible */
|
||||
@@ -212,5 +212,5 @@ index 2f682e70ec2..6170363f0a0 100644
|
||||
mprotect_range( view->base, view->size, commit, 0 );
|
||||
}
|
||||
--
|
||||
2.49.0
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From c8fe58f588703421d2e85eb6376d93e3299f0880 Mon Sep 17 00:00:00 2001
|
||||
From 32aeea846670432cf1e8d90defe6ca486b710559 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 16 Jan 2014 20:56:49 -0700
|
||||
Subject: [PATCH] ntdll: Add support for creating reparse points.
|
||||
@@ -7,16 +7,16 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
configure.ac | 2 +
|
||||
dlls/ntdll/Makefile.in | 2 +-
|
||||
dlls/ntdll/tests/file.c | 159 ++++++++++++++++++---
|
||||
dlls/ntdll/tests/file.c | 157 ++++++++++++++++++---
|
||||
dlls/ntdll/unix/file.c | 302 ++++++++++++++++++++++++++++++++++++++++
|
||||
include/ddk/ntifs.h | 5 +
|
||||
5 files changed, 451 insertions(+), 19 deletions(-)
|
||||
5 files changed, 450 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a171e143136..abd91b6b51f 100644
|
||||
index 6d093b52526..c9e433f4e6c 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2084,6 +2084,8 @@ AC_CHECK_FUNCS(\
|
||||
@@ -2111,6 +2111,8 @@ AC_CHECK_FUNCS(\
|
||||
prctl \
|
||||
sched_getcpu \
|
||||
sched_yield \
|
||||
@@ -39,7 +39,7 @@ index f7558bb5d86..aad14d17e61 100644
|
||||
EXTRADLLFLAGS = -nodefaultlibs
|
||||
i386_EXTRADLLFLAGS = -Wl,--image-base,0x7bc00000
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index cc0afdbdb64..00f90552e84 100644
|
||||
index a2ccf3f5332..121ebe5d62a 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -38,6 +38,7 @@
|
||||
@@ -50,7 +50,7 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
|
||||
#ifndef IO_COMPLETION_ALL_ACCESS
|
||||
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
|
||||
@@ -6028,32 +6029,154 @@ static void test_mailslot_name(void)
|
||||
@@ -5970,32 +5971,154 @@ static void test_mailslot_name(void)
|
||||
CloseHandle( device );
|
||||
}
|
||||
|
||||
@@ -127,15 +127,17 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
+ RemoveDirectoryW(path);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
||||
- pRtlInitUnicodeString( &nameW, L"\\??\\C:\\" );
|
||||
- InitializeObjectAttributes( &attr, &nameW, 0, NULL, NULL );
|
||||
+ /* Create the folder to be replaced by a junction point */
|
||||
+ lstrcpyW(reparse_path, path);
|
||||
+ lstrcatW(reparse_path, reparseW);
|
||||
+ bret = CreateDirectoryW(reparse_path, NULL);
|
||||
+ ok(bret, "Failed to create junction point directory.\n");
|
||||
|
||||
- pRtlInitUnicodeString( &nameW, L"\\??\\C:\\" );
|
||||
- InitializeObjectAttributes( &attr, &nameW, 0, NULL, NULL );
|
||||
- status = pNtOpenFile( &handle, READ_CONTROL, &attr, &io, 0, 0 );
|
||||
- ok( !status, "open %s failed %#lx\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||
+ /* Create a destination folder for the junction point to target */
|
||||
+ lstrcpyW(target_path, path);
|
||||
+ for (int i=0; i<1; i++)
|
||||
@@ -148,8 +150,8 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
+ ok(bret, "Failed to create junction point target directory.\n");
|
||||
+ pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
|
||||
|
||||
- status = pNtOpenFile( &handle, READ_CONTROL, &attr, &io, 0, 0 );
|
||||
- ok( !status, "open %s failed %#lx\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, NULL, 0 );
|
||||
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
|
||||
+ /* construct a too long pathname (resulting reparse buffer over 16 kiB limit) */
|
||||
+ long_path = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32767);
|
||||
+ lstrcpyW(long_path, nameW.Buffer);
|
||||
@@ -159,7 +161,9 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
+ lstrcatW(long_path, path);
|
||||
+ }
|
||||
+ lstrcatW(long_path, targetW);
|
||||
+
|
||||
|
||||
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 0 );
|
||||
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
|
||||
+ /* Create the junction point */
|
||||
+ handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
|
||||
@@ -174,8 +178,9 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ CloseHandle(handle);
|
||||
|
||||
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, NULL, 0 );
|
||||
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
|
||||
- /* a volume cannot be a reparse point by definition */
|
||||
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 1 );
|
||||
- ok( status == STATUS_NOT_A_REPARSE_POINT, "expected %#lx, got %#lx\n", STATUS_NOT_A_REPARSE_POINT, status );
|
||||
+ /* construct a long pathname to demonstrate correct behavior with very large reparse points */
|
||||
+ pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
|
||||
+ lstrcpyW(long_path, nameW.Buffer);
|
||||
@@ -186,15 +191,11 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
+ }
|
||||
+ lstrcatW(long_path, targetW);
|
||||
|
||||
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 0 );
|
||||
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
|
||||
- CloseHandle( handle );
|
||||
+ /* use a sane (not obscenely long) target for the rest of testing */
|
||||
+ pRtlFreeUnicodeString(&nameW);
|
||||
+ pRtlDosPathNameToNtPathName_U(target_path, &nameW, NULL, NULL);
|
||||
|
||||
- /* a volume cannot be a reparse point by definition */
|
||||
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 1 );
|
||||
- ok( status == STATUS_NOT_A_REPARSE_POINT, "expected %#lx, got %#lx\n", STATUS_NOT_A_REPARSE_POINT, status );
|
||||
+
|
||||
+ /* Create the junction point */
|
||||
+ handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
|
||||
@@ -207,8 +208,7 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
+ bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
|
||||
+ ok(bret, "Failed to create junction point! (0x%lx)\n", GetLastError());
|
||||
+ CloseHandle(handle);
|
||||
|
||||
- CloseHandle( handle );
|
||||
+
|
||||
+cleanup:
|
||||
+ /* Cleanup */
|
||||
+ pRtlFreeUnicodeString(&nameW);
|
||||
@@ -222,16 +222,8 @@ index cc0afdbdb64..00f90552e84 100644
|
||||
}
|
||||
|
||||
static void test_set_io_completion_ex(void)
|
||||
@@ -6193,6 +6316,6 @@ START_TEST(file)
|
||||
test_ioctl();
|
||||
test_query_ea();
|
||||
test_flush_buffers_file();
|
||||
- test_mailslot_name();
|
||||
test_reparse_points();
|
||||
+ test_mailslot_name();
|
||||
}
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index faef06ae084..a47c3d90df4 100644
|
||||
index 8d2809ca193..672a1d1fa27 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -36,6 +36,8 @@
|
||||
@@ -264,7 +256,7 @@ index faef06ae084..a47c3d90df4 100644
|
||||
#ifdef linux
|
||||
|
||||
/* We want the real kernel dirent structure, not the libc one */
|
||||
@@ -243,6 +252,95 @@ static const BOOL is_case_sensitive = FALSE;
|
||||
@@ -244,6 +253,95 @@ static const BOOL is_case_sensitive = FALSE;
|
||||
static pthread_mutex_t dir_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t mnt_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
@@ -360,7 +352,7 @@ index faef06ae084..a47c3d90df4 100644
|
||||
/* check if a given Unicode char is OK in a DOS short name */
|
||||
static inline BOOL is_invalid_dos_char( WCHAR ch )
|
||||
{
|
||||
@@ -1641,6 +1739,28 @@ static int parse_samba_dos_attrib_data( char *data, int len )
|
||||
@@ -1665,6 +1763,28 @@ static int parse_samba_dos_attrib_data( char *data, int len )
|
||||
}
|
||||
|
||||
|
||||
@@ -389,7 +381,7 @@ index faef06ae084..a47c3d90df4 100644
|
||||
static BOOL fd_is_mount_point( int fd, const struct stat *st )
|
||||
{
|
||||
struct stat parent;
|
||||
@@ -3441,6 +3561,181 @@ done:
|
||||
@@ -3528,6 +3648,181 @@ done:
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +563,7 @@ index faef06ae084..a47c3d90df4 100644
|
||||
/******************************************************************************
|
||||
* lookup_unix_name
|
||||
*
|
||||
@@ -6271,6 +6566,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
|
||||
@@ -6415,6 +6710,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From a34c3f550b16e84f907c637514f0645456420d65 Mon Sep 17 00:00:00 2001
|
||||
From fea1d301c573d3410e2f7d66b21609663ee47880 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Sat, 6 Feb 2021 12:46:30 -0700
|
||||
Subject: [PATCH] kernelbase: Add support for moving reparse points with
|
||||
@@ -8,15 +8,15 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/kernelbase/file.c | 2 +-
|
||||
dlls/ntdll/tests/file.c | 12 +++++++++++-
|
||||
dlls/ntdll/unix/file.c | 20 ++++++++++++++++++++
|
||||
dlls/ntdll/unix/file.c | 23 ++++++++++++++++++++++-
|
||||
server/fd.c | 6 ++++--
|
||||
4 files changed, 36 insertions(+), 4 deletions(-)
|
||||
4 files changed, 38 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
|
||||
index b7d16410d75..dccae6cb565 100644
|
||||
index 51459402e75..d70e0fc833c 100644
|
||||
--- a/dlls/kernelbase/file.c
|
||||
+++ b/dlls/kernelbase/file.c
|
||||
@@ -2514,7 +2514,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH MoveFileWithProgressW( const WCHAR *source, const
|
||||
@@ -2538,7 +2538,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH MoveFileWithProgressW( const WCHAR *source, const
|
||||
InitializeObjectAttributes( &attr, &nt_name, OBJ_CASE_INSENSITIVE, 0, NULL );
|
||||
status = NtOpenFile( &source_handle, DELETE | SYNCHRONIZE, &attr, &io,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
@@ -26,10 +26,10 @@ index b7d16410d75..dccae6cb565 100644
|
||||
if (!set_ntstatus( status )) goto error;
|
||||
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 8b561e162e8..7b6e2776947 100644
|
||||
index b592036d2d0..6e2c7906644 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -6021,7 +6021,8 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, ULONG flags,
|
||||
@@ -6025,7 +6025,8 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, ULONG flags,
|
||||
|
||||
static void test_reparse_points(void)
|
||||
{
|
||||
@@ -39,7 +39,7 @@ index 8b561e162e8..7b6e2776947 100644
|
||||
static const WCHAR reparseW[] = {'\\','r','e','p','a','r','s','e',0};
|
||||
static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0};
|
||||
static const WCHAR parentW[] = {'\\','.','.','\\',0};
|
||||
@@ -6392,6 +6393,15 @@ static void test_reparse_points(void)
|
||||
@@ -6396,6 +6397,15 @@ static void test_reparse_points(void)
|
||||
wine_dbgstr_w(dest), wine_dbgstr_w(rel_target));
|
||||
CloseHandle(handle);
|
||||
|
||||
@@ -56,24 +56,23 @@ index 8b561e162e8..7b6e2776947 100644
|
||||
/* Cleanup */
|
||||
pRtlFreeUnicodeString(&nameW);
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index d3045c6c936..49afb57b2b6 100644
|
||||
index 8e9e28269f8..6385a26bee7 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -5556,8 +5556,10 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
{
|
||||
FILE_RENAME_INFORMATION *info = ptr;
|
||||
@@ -5675,6 +5675,8 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
unsigned int flags;
|
||||
+ REPARSE_DATA_BUFFER *buffer = NULL;
|
||||
UNICODE_STRING name_str, redir;
|
||||
UNICODE_STRING name_str, nt_name;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
+ REPARSE_DATA_BUFFER *buffer = NULL;
|
||||
+ ULONG buffer_len = 0;
|
||||
char *unix_name;
|
||||
|
||||
if (class == FileRenameInformation)
|
||||
@@ -5574,6 +5576,19 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
@@ -5689,6 +5691,20 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
name_str.Length = info->FileNameLength;
|
||||
name_str.MaximumLength = info->FileNameLength + sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &name_str, OBJ_CASE_INSENSITIVE, info->RootDirectory, NULL );
|
||||
get_redirect( &attr, &redir );
|
||||
|
||||
+
|
||||
+ /* obtain all the data from the reparse point (if applicable) */
|
||||
+ status = get_reparse_point( handle, NULL, &buffer_len );
|
||||
+ if (status == STATUS_BUFFER_TOO_SMALL)
|
||||
@@ -87,10 +86,10 @@ index d3045c6c936..49afb57b2b6 100644
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
status = nt_to_unix_file_name( &attr, &unix_name, FILE_OPEN_IF );
|
||||
status = get_nt_and_unix_names( &attr, &nt_name, &unix_name, FILE_OPEN_IF );
|
||||
if (status == STATUS_SUCCESS || status == STATUS_NO_SUCH_FILE)
|
||||
{
|
||||
@@ -5590,9 +5605,14 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
@@ -5705,8 +5721,13 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
@@ -98,18 +97,18 @@ index d3045c6c936..49afb57b2b6 100644
|
||||
+ if (buffer && status == STATUS_SUCCESS)
|
||||
+ status = create_reparse_point( handle, buffer );
|
||||
+
|
||||
free( unix_name );
|
||||
+ free( unix_name );
|
||||
}
|
||||
free( redir.Buffer );
|
||||
- free( unix_name );
|
||||
+ free( buffer );
|
||||
free( nt_name.Buffer );
|
||||
}
|
||||
else status = STATUS_INVALID_PARAMETER_3;
|
||||
break;
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index dd6a61c557d..dde92beb664 100644
|
||||
index 466259ae567..7f88fcd6e33 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -2724,7 +2724,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
@@ -2771,7 +2771,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
goto failed;
|
||||
}
|
||||
|
||||
@@ -118,7 +117,7 @@ index dd6a61c557d..dde92beb664 100644
|
||||
{
|
||||
if (!fstat( fd->unix_fd, &st2 ) && st.st_ino == st2.st_ino && st.st_dev == st2.st_dev)
|
||||
{
|
||||
@@ -2740,7 +2740,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
@@ -2787,7 +2787,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
}
|
||||
|
||||
/* can't replace directories or special files */
|
||||
@@ -127,7 +126,7 @@ index dd6a61c557d..dde92beb664 100644
|
||||
{
|
||||
set_error( STATUS_ACCESS_DENIED );
|
||||
goto failed;
|
||||
@@ -2806,6 +2806,8 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
@@ -2853,6 +2853,8 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
|
||||
fd->nt_name = dup_nt_name( root, nt_name, &fd->nt_namelen );
|
||||
free( fd->unix_name );
|
||||
fd->closed->unix_name = fd->unix_name = realpath( name, NULL );
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 4f26d71abf2447b5e0c6d7b6e878cf6b6c578558 Mon Sep 17 00:00:00 2001
|
||||
From a9773394980e77b017dcb797766ec422b384a5cc Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Sat, 3 Sep 2022 11:23:31 -0600
|
||||
Subject: [PATCH] ntdll: Follow reparse points during path resolution.
|
||||
@@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
2 files changed, 184 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 39b98af7efa..80b967f5469 100644
|
||||
index 9bd4bbdd245..84a0957b040 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -6082,7 +6082,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, ULONG flags,
|
||||
@@ -6025,7 +6025,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, ULONG flags,
|
||||
|
||||
static void test_reparse_points(void)
|
||||
{
|
||||
@@ -22,7 +22,7 @@ index 39b98af7efa..80b967f5469 100644
|
||||
static const WCHAR new_reparseW[] = {'\\','n','e','w','_','r','e','p','a','r','s','e',0};
|
||||
static const WCHAR reparseW[] = {'\\','r','e','p','a','r','s','e',0};
|
||||
static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0};
|
||||
@@ -6469,11 +6469,20 @@ static void test_reparse_points(void)
|
||||
@@ -6412,11 +6412,20 @@ static void test_reparse_points(void)
|
||||
bret = CopyFileW(reparse_path, new_path, TRUE);
|
||||
ok(!bret, "Reparse points cannot be copied.\n");
|
||||
|
||||
@@ -44,10 +44,10 @@ index 39b98af7efa..80b967f5469 100644
|
||||
ok(bret, "Failed to remove temporary reparse point directory!\n");
|
||||
bret = RemoveDirectoryW(target_path);
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 49afb57b2b6..26e412d28f1 100644
|
||||
index f3274478ae2..860e563f69d 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -3725,6 +3725,35 @@ done:
|
||||
@@ -3741,6 +3741,35 @@ done:
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
/*
|
||||
* Retrieve the unix name corresponding to a file handle, remove that directory, and then symlink
|
||||
* the requested directory to the location of the old directory.
|
||||
@@ -3901,16 +3930,14 @@ cleanup:
|
||||
@@ -3917,16 +3946,14 @@ cleanup:
|
||||
|
||||
|
||||
/*
|
||||
@@ -102,7 +102,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
char *encoded = NULL;
|
||||
int link_dir_fd = -1;
|
||||
NTSTATUS status;
|
||||
@@ -3918,9 +3945,6 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG *si
|
||||
@@ -3934,9 +3961,6 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG *si
|
||||
int depth;
|
||||
char *p;
|
||||
|
||||
@@ -112,7 +112,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
ret = readlink( unix_name, link_path, sizeof(link_path) );
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -4020,12 +4044,76 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG *si
|
||||
@@ -4036,12 +4060,76 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG *si
|
||||
|
||||
cleanup:
|
||||
if (link_dir_fd != -1) close( link_dir_fd );
|
||||
@@ -190,7 +190,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
/*
|
||||
* Retrieve the unix name corresponding to a file handle, remove that symlink, and then recreate
|
||||
* a directory at the location of the old filename.
|
||||
@@ -4119,15 +4207,24 @@ cleanup:
|
||||
@@ -4135,15 +4223,24 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
NTSTATUS status;
|
||||
int ret;
|
||||
struct stat st;
|
||||
@@ -4184,6 +4281,8 @@ static NTSTATUS lookup_unix_name( int root_fd, const WCHAR *name, int name_len,
|
||||
@@ -4200,6 +4297,8 @@ static NTSTATUS lookup_unix_name( int root_fd, const WCHAR *name, int name_len,
|
||||
while (name_len)
|
||||
{
|
||||
const WCHAR *end, *next;
|
||||
@@ -225,7 +225,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
|
||||
end = name;
|
||||
while (end < name + name_len && *end != '\\') end++;
|
||||
@@ -4203,8 +4302,31 @@ static NTSTATUS lookup_unix_name( int root_fd, const WCHAR *name, int name_len,
|
||||
@@ -4219,8 +4318,31 @@ static NTSTATUS lookup_unix_name( int root_fd, const WCHAR *name, int name_len,
|
||||
|
||||
status = find_file_in_dir( root_fd, unix_name, pos, name, end - name, is_unix );
|
||||
|
||||
@@ -258,7 +258,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
{
|
||||
if (status == STATUS_OBJECT_NAME_NOT_FOUND)
|
||||
{
|
||||
@@ -4243,12 +4365,12 @@ static NTSTATUS lookup_unix_name( int root_fd, const WCHAR *name, int name_len,
|
||||
@@ -4259,12 +4381,12 @@ static NTSTATUS lookup_unix_name( int root_fd, const WCHAR *name, int name_len,
|
||||
/******************************************************************************
|
||||
* nt_to_unix_file_name_no_root
|
||||
*/
|
||||
@@ -273,7 +273,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
NTSTATUS status = STATUS_SUCCESS;
|
||||
const WCHAR *name;
|
||||
struct stat st;
|
||||
@@ -4338,7 +4460,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char
|
||||
@@ -4354,7 +4476,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char
|
||||
name += prefix_len;
|
||||
name_len -= prefix_len;
|
||||
|
||||
@@ -282,7 +282,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
if (status == STATUS_SUCCESS || status == STATUS_NO_SUCH_FILE)
|
||||
{
|
||||
TRACE( "%s -> %s\n", debugstr_us(nameW), debugstr_a(unix_name) );
|
||||
@@ -4346,7 +4468,8 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char
|
||||
@@ -4362,7 +4484,8 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -292,9 +292,9 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
free( unix_name );
|
||||
}
|
||||
return status;
|
||||
@@ -4364,18 +4487,30 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char
|
||||
@@ -4380,18 +4503,30 @@ static NTSTATUS nt_to_unix_file_name_no_root( const UNICODE_STRING *nameW, char
|
||||
*/
|
||||
NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition )
|
||||
static NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition )
|
||||
{
|
||||
+ HANDLE rootdir = attr->RootDirectory;
|
||||
enum server_fd_type type;
|
||||
@@ -328,7 +328,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
|
||||
if (name_len && name[0] == '\\') return STATUS_INVALID_PARAMETER;
|
||||
|
||||
@@ -4383,7 +4518,7 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U
|
||||
@@ -4399,7 +4534,7 @@ static NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name
|
||||
if (!(unix_name = malloc( unix_len ))) return STATUS_NO_MEMORY;
|
||||
unix_name[0] = '.';
|
||||
|
||||
@@ -337,7 +337,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
{
|
||||
if (type != FD_TYPE_DIR)
|
||||
{
|
||||
@@ -4392,7 +4527,16 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U
|
||||
@@ -4408,7 +4543,16 @@ static NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -355,7 +355,7 @@ index 49afb57b2b6..26e412d28f1 100644
|
||||
if (needs_close) close( root_fd );
|
||||
}
|
||||
}
|
||||
@@ -4400,14 +4544,22 @@ NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, U
|
||||
@@ -4416,14 +4560,22 @@ static NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name
|
||||
|
||||
if (status == STATUS_SUCCESS || status == STATUS_NO_SUCH_FILE)
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 18540f65cde320c499eb8bcb630ade9f9fa977fe Mon Sep 17 00:00:00 2001
|
||||
From 41e1d1b92a179f00f391919b47732e7eab9f8337 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 30 Nov 2021 16:32:34 +0300
|
||||
Subject: [PATCH] ntdll: Implement opening files through nt device paths.
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Implement opening files through nt device paths.
|
||||
2 files changed, 156 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index af67e8d75bf..608b64a32ad 100644
|
||||
index 16489f4b29c..11769021b32 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -137,18 +137,22 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved )
|
||||
@@ -139,18 +139,22 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved )
|
||||
|
||||
static void create_file_test(void)
|
||||
{
|
||||
@@ -36,7 +36,7 @@ index af67e8d75bf..608b64a32ad 100644
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
IO_STATUS_BLOCK io;
|
||||
UNICODE_STRING nameW;
|
||||
@@ -328,6 +332,25 @@ static void create_file_test(void)
|
||||
@@ -320,6 +324,25 @@ static void create_file_test(void)
|
||||
status = pNtQueryFullAttributesFile( &attr, &info );
|
||||
ok( status == STATUS_OBJECT_NAME_INVALID,
|
||||
"query %s failed %lx\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||
@@ -63,10 +63,10 @@ index af67e8d75bf..608b64a32ad 100644
|
||||
|
||||
static void open_file_test(void)
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index ba9cd8d9031..c3ddf72b44b 100644
|
||||
index a39079efa97..c76d91cdf68 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -4494,7 +4494,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( FILE_OBJECT *fileobj, char **unix_
|
||||
@@ -4688,7 +4688,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( FILE_OBJECT *fileobj, char **unix_
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -75,16 +75,16 @@ index ba9cd8d9031..c3ddf72b44b 100644
|
||||
*
|
||||
* Convert a file name from NT namespace to Unix namespace.
|
||||
*
|
||||
@@ -4502,7 +4502,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( FILE_OBJECT *fileobj, char **unix_
|
||||
@@ -4696,7 +4696,7 @@ static NTSTATUS nt_to_unix_file_name_no_root( FILE_OBJECT *fileobj, char **unix_
|
||||
* element doesn't have to exist; in that case STATUS_NO_SUCH_FILE is
|
||||
* returned, but the unix name is still filled in properly.
|
||||
*/
|
||||
-NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition )
|
||||
-static NTSTATUS nt_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition )
|
||||
+NTSTATUS nt_to_unix_file_name_internal( const OBJECT_ATTRIBUTES *attr, char **name_ret, UINT disposition )
|
||||
{
|
||||
HANDLE rootdir = attr->RootDirectory;
|
||||
enum server_fd_type type;
|
||||
@@ -4581,6 +4581,136 @@ reparse:
|
||||
@@ -4775,6 +4775,136 @@ reparse:
|
||||
}
|
||||
|
||||
|
||||
@@ -222,5 +222,5 @@ index ba9cd8d9031..c3ddf72b44b 100644
|
||||
* wine_nt_to_unix_file_name
|
||||
*
|
||||
--
|
||||
2.39.1
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 8b9d023ce5ef1a063fe1db248255c7d774976890 Mon Sep 17 00:00:00 2001
|
||||
From 74faace74b9343d64ff88b16577773bd08513eca Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 00:50:50 +0100
|
||||
Subject: [PATCH] ntdll/tests: Add basic tests for RtlQueryPackageIdentity.
|
||||
@@ -20,10 +20,10 @@ index 3742968c415..084469a2820 100644
|
||||
SOURCES = \
|
||||
atom.c \
|
||||
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
|
||||
index e3f3efa5bfc..1066bfdbdec 100644
|
||||
index f5db5cdc6e2..0bd086c71fb 100644
|
||||
--- a/dlls/ntdll/tests/rtl.c
|
||||
+++ b/dlls/ntdll/tests/rtl.c
|
||||
@@ -38,6 +38,9 @@
|
||||
@@ -39,6 +39,9 @@
|
||||
#include "wine/test.h"
|
||||
#include "wine/asm.h"
|
||||
#include "wine/rbtree.h"
|
||||
@@ -33,7 +33,7 @@ index e3f3efa5bfc..1066bfdbdec 100644
|
||||
|
||||
#ifndef __WINE_WINTERNL_H
|
||||
|
||||
@@ -121,6 +124,9 @@ static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *);
|
||||
@@ -122,6 +125,9 @@ static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *);
|
||||
static void * (WINAPI *pRtlLookupElementGenericTable)(PRTL_GENERIC_TABLE, void *);
|
||||
static ULONG (WINAPI *pRtlNumberGenericTableElements)(PRTL_GENERIC_TABLE);
|
||||
static NTSTATUS (WINAPI *pLdrEnumerateLoadedModules)(void *, void *, void *);
|
||||
@@ -43,7 +43,7 @@ index e3f3efa5bfc..1066bfdbdec 100644
|
||||
static NTSTATUS (WINAPI *pLdrRegisterDllNotification)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, void *, void **);
|
||||
static NTSTATUS (WINAPI *pLdrUnregisterDllNotification)(void *);
|
||||
static VOID (WINAPI *pRtlGetDeviceFamilyInfoEnum)(ULONGLONG *,DWORD *,DWORD *);
|
||||
@@ -192,6 +198,9 @@ static void InitFunctionPtrs(void)
|
||||
@@ -194,6 +200,9 @@ static void InitFunctionPtrs(void)
|
||||
pRtlLookupElementGenericTable = (void *)GetProcAddress(hntdll, "RtlLookupElementGenericTable");
|
||||
pRtlNumberGenericTableElements = (void *)GetProcAddress(hntdll, "RtlNumberGenericTableElements");
|
||||
pLdrEnumerateLoadedModules = (void *)GetProcAddress(hntdll, "LdrEnumerateLoadedModules");
|
||||
@@ -52,8 +52,8 @@ index e3f3efa5bfc..1066bfdbdec 100644
|
||||
+ pRtlAbsoluteToSelfRelativeSD = (void *)GetProcAddress(hntdll, "RtlAbsoluteToSelfRelativeSD");
|
||||
pLdrRegisterDllNotification = (void *)GetProcAddress(hntdll, "LdrRegisterDllNotification");
|
||||
pLdrUnregisterDllNotification = (void *)GetProcAddress(hntdll, "LdrUnregisterDllNotification");
|
||||
pRtlDeriveCapabilitySidsFromName = (void *)GetProcAddress(hntdll, "RtlDeriveCapabilitySidsFromName");
|
||||
@@ -3764,6 +3773,76 @@ static void test_RtlFirstFreeAce(void)
|
||||
pRtlCreateServiceSid = (void *)GetProcAddress(hntdll, "RtlCreateServiceSid");
|
||||
@@ -3767,6 +3776,76 @@ static void test_RtlFirstFreeAce(void)
|
||||
HeapFree(GetProcessHeap(), 0, acl);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ index e3f3efa5bfc..1066bfdbdec 100644
|
||||
static void test_RtlInitializeSid(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY sid_ident = { SECURITY_NT_AUTHORITY };
|
||||
@@ -5487,6 +5566,7 @@ START_TEST(rtl)
|
||||
@@ -5515,6 +5594,7 @@ START_TEST(rtl)
|
||||
test_RtlInitializeCriticalSectionEx();
|
||||
test_RtlLeaveCriticalSection();
|
||||
test_LdrEnumerateLoadedModules();
|
||||
|
@@ -64,7 +64,7 @@ index fb5259d8714..93020158d0b 100644
|
||||
+static void sigsys_handler( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
+{
|
||||
+ extern const void *__wine_syscall_dispatcher_prolog_end_ptr;
|
||||
+ struct syscall_frame *frame = amd64_thread_data()->syscall_frame;
|
||||
+ struct syscall_frame *frame = get_syscall_frame();
|
||||
+ ucontext_t *ctx = sigcontext;
|
||||
+
|
||||
+ TRACE_(seh)("SIGSYS, rax %#llx, rip %#llx.\n", ctx->uc_mcontext.gregs[REG_RAX],
|
||||
@@ -171,7 +171,7 @@ index fb5259d8714..93020158d0b 100644
|
||||
+ BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
|
||||
+ };
|
||||
+ long (*test_syscall)(long sc_number);
|
||||
+ struct syscall_frame *frame = amd64_thread_data()->syscall_frame;
|
||||
+ struct syscall_frame *frame = get_syscall_frame();
|
||||
+ struct sock_fprog prog;
|
||||
+ NTSTATUS status;
|
||||
+
|
||||
@@ -189,7 +189,7 @@ index fb5259d8714..93020158d0b 100644
|
||||
+
|
||||
+ sigaction(SIGSYS, sig_act, NULL);
|
||||
+
|
||||
+ frame->syscall_flags = syscall_flags;
|
||||
+
|
||||
+
|
||||
+
|
||||
+ test_syscall = mmap((void *)0x600000000000, 0x1000, PROT_EXEC | PROT_READ | PROT_WRITE,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 1fbb361023f9474a3522762aae32ad64d056e37e Mon Sep 17 00:00:00 2001
|
||||
From 537fd63e028ce58f4b5dfead7a9fc2a64692fa1e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= <gabrielopcode@gmail.com>
|
||||
Date: Fri, 24 May 2019 15:09:35 +0300
|
||||
Subject: [PATCH] ntdll/server: Mark drive_c as case-insensitive when created
|
||||
@@ -13,7 +13,7 @@ Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
|
||||
1 file changed, 43 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
|
||||
index ab9d99c4f47..f40897757e3 100644
|
||||
index 159b62f268d..66685f4a87b 100644
|
||||
--- a/dlls/ntdll/unix/server.c
|
||||
+++ b/dlls/ntdll/unix/server.c
|
||||
@@ -49,6 +49,10 @@
|
||||
@@ -27,9 +27,9 @@ index ab9d99c4f47..f40897757e3 100644
|
||||
#ifdef HAVE_SYS_PRCTL_H
|
||||
# include <sys/prctl.h>
|
||||
#endif
|
||||
@@ -83,6 +87,22 @@
|
||||
|
||||
@@ -85,6 +89,22 @@
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(server);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(syscall);
|
||||
|
||||
+/* just in case... */
|
||||
+#undef EXT2_IOC_GETFLAGS
|
||||
@@ -50,7 +50,7 @@ index ab9d99c4f47..f40897757e3 100644
|
||||
#ifndef MSG_CMSG_CLOEXEC
|
||||
#define MSG_CMSG_CLOEXEC 0
|
||||
#endif
|
||||
@@ -1137,6 +1157,28 @@ static const char *init_server_dir( dev_t dev, ino_t ino )
|
||||
@@ -1291,6 +1311,28 @@ static const char *init_server_dir( dev_t dev, ino_t ino )
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ index ab9d99c4f47..f40897757e3 100644
|
||||
/***********************************************************************
|
||||
* setup_config_dir
|
||||
*
|
||||
@@ -1173,6 +1215,7 @@ static int setup_config_dir(void)
|
||||
@@ -1327,6 +1369,7 @@ static int setup_config_dir(void)
|
||||
if (!mkdir( "dosdevices", 0777 ))
|
||||
{
|
||||
mkdir( "drive_c", 0777 );
|
||||
@@ -88,5 +88,5 @@ index ab9d99c4f47..f40897757e3 100644
|
||||
symlink( "/", "dosdevices/z:" );
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 31eece6eff95baed8c1d9404d2cfc05834df9753 Mon Sep 17 00:00:00 2001
|
||||
From da9b85d2993598eb6153d5e1610ba327284715a6 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 15 Mar 2015 01:05:48 +0100
|
||||
Subject: [PATCH] server: Fix handling of GetMessage after previous PeekMessage
|
||||
@@ -93,26 +93,26 @@ index a5f7318dffd..e50ddc45038 100644
|
||||
* because both messages are in the same queue. */
|
||||
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
index 3845a86c962..ed5ebf6996e 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -134,6 +134,7 @@ struct msg_queue
|
||||
timeout_t last_get_msg; /* time of last get message call */
|
||||
@@ -136,6 +136,7 @@ struct msg_queue
|
||||
int keystate_lock; /* owns an input keystate lock */
|
||||
int waiting; /* is thread waiting on queue */
|
||||
queue_shm_t *shared; /* queue in session shared memory */
|
||||
+ unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
|
||||
};
|
||||
|
||||
struct hotkey
|
||||
@@ -313,6 +314,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
@@ -318,6 +319,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
queue->hooks = NULL;
|
||||
queue->last_get_msg = current_time;
|
||||
queue->keystate_lock = 0;
|
||||
+ queue->ignore_post_msg = 0;
|
||||
queue->waiting = 0;
|
||||
list_init( &queue->send_result );
|
||||
list_init( &queue->callback_result );
|
||||
list_init( &queue->pending_timers );
|
||||
@@ -793,13 +795,21 @@ static inline struct msg_queue *get_current_queue(void)
|
||||
@@ -812,13 +814,21 @@ static inline struct msg_queue *get_current_queue(void)
|
||||
}
|
||||
|
||||
/* get a (pseudo-)unique id to tag hardware messages */
|
||||
@@ -135,7 +135,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
/* lookup an already queued mouse message that matches the message, window and type */
|
||||
static struct message *find_mouse_message( struct thread_input *input, const struct message *msg )
|
||||
{
|
||||
@@ -1150,7 +1160,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win )
|
||||
@@ -1169,7 +1179,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win )
|
||||
}
|
||||
|
||||
/* retrieve a posted message */
|
||||
@@ -144,7 +144,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
unsigned int first, unsigned int last, unsigned int flags,
|
||||
struct get_message_reply *reply )
|
||||
{
|
||||
@@ -1161,6 +1171,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win,
|
||||
@@ -1180,6 +1190,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win,
|
||||
{
|
||||
if (!match_window( win, msg->win )) continue;
|
||||
if (!check_msg_filter( msg->msg, first, last )) continue;
|
||||
@@ -152,7 +152,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
goto found; /* found one */
|
||||
}
|
||||
return 0;
|
||||
@@ -1841,6 +1852,7 @@ found:
|
||||
@@ -1858,6 +1869,7 @@ found:
|
||||
msg->msg = WM_HOTKEY;
|
||||
msg->wparam = hotkey->id;
|
||||
msg->lparam = ((hotkey->vkey & 0xffff) << 16) | modifiers;
|
||||
@@ -160,7 +160,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
|
||||
free( msg->data );
|
||||
msg->data = NULL;
|
||||
@@ -2827,7 +2839,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
|
||||
@@ -2844,7 +2856,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
|
||||
}
|
||||
|
||||
/* now we can return it */
|
||||
@@ -169,7 +169,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
reply->type = MSG_HARDWARE;
|
||||
reply->win = win;
|
||||
reply->msg = msg_code;
|
||||
@@ -2934,6 +2946,7 @@ void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lpa
|
||||
@@ -2951,6 +2963,7 @@ void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lpa
|
||||
msg->result = NULL;
|
||||
msg->data = NULL;
|
||||
msg->data_size = 0;
|
||||
@@ -177,7 +177,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
|
||||
get_message_defaults( thread->queue, &msg->x, &msg->y, &msg->time );
|
||||
|
||||
@@ -3251,6 +3264,7 @@ DECL_HANDLER(send_message)
|
||||
@@ -3259,6 +3272,7 @@ DECL_HANDLER(send_message)
|
||||
set_queue_bits( recv_queue, QS_SENDMESSAGE );
|
||||
break;
|
||||
case MSG_POSTED:
|
||||
@@ -185,7 +185,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
list_add_tail( &recv_queue->msg_list[POST_MESSAGE], &msg->entry );
|
||||
set_queue_bits( recv_queue, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE );
|
||||
if (msg->msg == WM_HOTKEY)
|
||||
@@ -3385,12 +3399,12 @@ DECL_HANDLER(get_message)
|
||||
@@ -3395,12 +3409,12 @@ DECL_HANDLER(get_message)
|
||||
|
||||
/* then check for posted messages */
|
||||
if ((filter & QS_POSTMESSAGE) &&
|
||||
@@ -200,7 +200,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
return;
|
||||
|
||||
/* only check for quit messages if not posted messages pending */
|
||||
@@ -3401,7 +3415,7 @@ DECL_HANDLER(get_message)
|
||||
@@ -3411,7 +3425,7 @@ DECL_HANDLER(get_message)
|
||||
if ((filter & QS_INPUT) &&
|
||||
filter_contains_hw_range( req->get_first, req->get_last ) &&
|
||||
get_hardware_message( current, req->hw_id, get_win, req->get_first, req->get_last, req->flags, reply ))
|
||||
@@ -209,7 +209,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
|
||||
/* now check for WM_PAINT */
|
||||
if ((filter & QS_PAINT) &&
|
||||
@@ -3414,7 +3428,7 @@ DECL_HANDLER(get_message)
|
||||
@@ -3424,7 +3438,7 @@ DECL_HANDLER(get_message)
|
||||
reply->wparam = 0;
|
||||
reply->lparam = 0;
|
||||
get_message_defaults( queue, &reply->x, &reply->y, &reply->time );
|
||||
@@ -218,7 +218,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
}
|
||||
|
||||
/* now check for timer */
|
||||
@@ -3430,9 +3444,19 @@ DECL_HANDLER(get_message)
|
||||
@@ -3440,9 +3454,19 @@ DECL_HANDLER(get_message)
|
||||
get_message_defaults( queue, &reply->x, &reply->y, &reply->time );
|
||||
if (!(req->flags & PM_NOYIELD) && current->process->idle_event)
|
||||
set_event( current->process->idle_event );
|
||||
@@ -239,9 +239,9 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
if (get_win == -1 && current->process->idle_event) set_event( current->process->idle_event );
|
||||
|
||||
SHARED_WRITE_BEGIN( queue_shm, queue_shm_t )
|
||||
@@ -3443,6 +3467,13 @@ DECL_HANDLER(get_message)
|
||||
SHARED_WRITE_END;
|
||||
@@ -3454,6 +3478,13 @@ DECL_HANDLER(get_message)
|
||||
|
||||
reset_queue_sync( queue );
|
||||
set_error( STATUS_PENDING ); /* FIXME */
|
||||
+ return;
|
||||
+
|
||||
@@ -253,7 +253,7 @@ index cfbc9e6c89b..f07b73e3ce9 100644
|
||||
}
|
||||
|
||||
|
||||
@@ -3460,7 +3491,10 @@ DECL_HANDLER(reply_message)
|
||||
@@ -3471,7 +3502,10 @@ DECL_HANDLER(reply_message)
|
||||
DECL_HANDLER(accept_hardware_message)
|
||||
{
|
||||
if (current->queue)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 222ae102097fd34e6ff52813d1c0a165c7165776 Mon Sep 17 00:00:00 2001
|
||||
From f4a1348aaf4998e1d5c5a8014d38326982ce5f3d 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
|
||||
@@ -22,15 +22,15 @@ no guarantee currently that the terminated thread really stopped executing.
|
||||
|
||||
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
|
||||
---
|
||||
server/thread.c | 32 +++++++++++++++++++++++++++++---
|
||||
server/thread.c | 31 +++++++++++++++++++++++++++++--
|
||||
server/thread.h | 1 +
|
||||
2 files changed, 30 insertions(+), 3 deletions(-)
|
||||
2 files changed, 30 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index f7e5e5fabe8..506adfc0a6f 100644
|
||||
index 05ec6a4ec00..b3b971548bc 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -246,6 +246,7 @@ static inline void init_thread_structure( struct thread *thread )
|
||||
@@ -422,6 +422,7 @@ static inline void init_thread_structure( struct thread *thread )
|
||||
thread->token = NULL;
|
||||
thread->desc = NULL;
|
||||
thread->desc_len = 0;
|
||||
@@ -38,24 +38,15 @@ index f7e5e5fabe8..506adfc0a6f 100644
|
||||
|
||||
thread->creation_time = current_time;
|
||||
thread->exit_time = 0;
|
||||
@@ -450,6 +451,7 @@ static void destroy_thread( struct object *obj )
|
||||
@@ -642,6 +643,7 @@ static void destroy_thread( struct object *obj )
|
||||
list_remove( &thread->entry );
|
||||
cleanup_thread( thread );
|
||||
release_object( thread->process );
|
||||
+ if (thread->exit_poll) remove_timeout_user( thread->exit_poll );
|
||||
if (thread->id) free_ptid( thread->id );
|
||||
if (thread->token) release_object( thread->token );
|
||||
}
|
||||
@@ -467,7 +469,7 @@ static void dump_thread( struct object *obj, int verbose )
|
||||
static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
|
||||
{
|
||||
struct thread *mythread = (struct thread *)obj;
|
||||
- return (mythread->state == TERMINATED);
|
||||
+ return mythread->state == TERMINATED && !mythread->exit_poll;
|
||||
}
|
||||
|
||||
static unsigned int thread_map_access( struct object *obj, unsigned int access )
|
||||
@@ -1275,6 +1277,26 @@ int thread_get_inflight_fd( struct thread *thread, int client )
|
||||
if (thread->sync) release_object( thread->sync );
|
||||
@@ -1549,6 +1551,26 @@ int thread_get_inflight_fd( struct thread *thread, int client )
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -75,33 +66,34 @@ index f7e5e5fabe8..506adfc0a6f 100644
|
||||
+ /* grab reference since object can be destroyed while trying to wake up */
|
||||
+ grab_object( &thread->obj );
|
||||
+ thread->exit_poll = NULL;
|
||||
+ wake_up( &thread->obj, 0 );
|
||||
+ signal_sync( thread->sync );
|
||||
+ release_object( &thread->obj );
|
||||
+}
|
||||
+
|
||||
/* kill a thread on the spot */
|
||||
void kill_thread( struct thread *thread, int violent_death )
|
||||
{
|
||||
@@ -1294,8 +1316,12 @@ void kill_thread( struct thread *thread, int violent_death )
|
||||
@@ -1568,8 +1590,13 @@ void kill_thread( struct thread *thread, int violent_death )
|
||||
}
|
||||
kill_console_processes( thread, 0 );
|
||||
abandon_mutexes( thread );
|
||||
- wake_up( &thread->obj, 0 );
|
||||
- signal_sync( thread->sync );
|
||||
- if (violent_death) send_thread_signal( thread, SIGQUIT );
|
||||
+ if (violent_death)
|
||||
+ {
|
||||
+ send_thread_signal( thread, SIGQUIT );
|
||||
+ check_terminated( thread );
|
||||
+ }
|
||||
+ else wake_up( &thread->obj, 0 );
|
||||
+ else
|
||||
+ signal_sync( thread->sync );
|
||||
cleanup_thread( thread );
|
||||
remove_process_thread( thread->process, thread );
|
||||
release_object( thread );
|
||||
diff --git a/server/thread.h b/server/thread.h
|
||||
index a1bc5060bb9..edf2a825451 100644
|
||||
index 58081be7481..d87f84603ef 100644
|
||||
--- a/server/thread.h
|
||||
+++ b/server/thread.h
|
||||
@@ -93,6 +93,7 @@ struct thread
|
||||
@@ -95,6 +95,7 @@ struct thread
|
||||
data_size_t desc_len; /* thread description length in bytes */
|
||||
WCHAR *desc; /* thread description string */
|
||||
struct completion_wait *completion_wait; /* completion port wait object the thread is associated with */
|
||||
@@ -110,5 +102,5 @@ index a1bc5060bb9..edf2a825451 100644
|
||||
|
||||
extern struct thread *current;
|
||||
--
|
||||
2.45.2
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 2b9d0c9e955f188d5e5ba2311ed96ff9821f7d44 Mon Sep 17 00:00:00 2001
|
||||
From 40a771ea3f017a017f949063e7fbe8d1c8d5cf0c Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 30 Mar 2015 12:32:34 +0200
|
||||
Subject: [PATCH] server: Add a helper function set_sd_from_token_internal to
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH] server: Add a helper function set_sd_from_token_internal to
|
||||
2 files changed, 40 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/server/object.c b/server/object.c
|
||||
index 1a3bff65969..d46dbf01b6f 100644
|
||||
index 4f34d2979dc..fe9df4b2882 100644
|
||||
--- a/server/object.c
|
||||
+++ b/server/object.c
|
||||
@@ -563,8 +563,9 @@ struct security_descriptor *default_get_sd( struct object *obj )
|
||||
@@ -652,8 +652,9 @@ struct security_descriptor *default_get_sd( struct object *obj )
|
||||
return obj->sd;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
{
|
||||
struct security_descriptor new_sd, *new_sd_ptr;
|
||||
int present;
|
||||
@@ -573,8 +574,6 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
@@ -662,8 +663,6 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
struct acl *replaced_sacl = NULL;
|
||||
char *ptr;
|
||||
|
||||
@@ -34,7 +34,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
new_sd.control = sd->control & ~SE_SELF_RELATIVE;
|
||||
|
||||
if (set_info & OWNER_SECURITY_INFORMATION && sd->owner_len)
|
||||
@@ -582,10 +581,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
@@ -671,10 +670,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
owner = sd_get_owner( sd );
|
||||
new_sd.owner_len = sd->owner_len;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
}
|
||||
else if (token)
|
||||
{
|
||||
@@ -599,10 +598,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
@@ -688,10 +687,10 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
group = sd_get_group( sd );
|
||||
new_sd.group_len = sd->group_len;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
}
|
||||
else if (token)
|
||||
{
|
||||
@@ -620,20 +619,20 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
@@ -709,20 +708,20 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
else if (set_info & LABEL_SECURITY_INFORMATION && present)
|
||||
{
|
||||
const struct acl *old_sacl = NULL;
|
||||
@@ -88,7 +88,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
}
|
||||
else
|
||||
new_sd.sacl_len = 0;
|
||||
@@ -647,12 +646,12 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
@@ -736,12 +735,12 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -104,7 +104,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
}
|
||||
else if (token)
|
||||
{
|
||||
@@ -668,7 +667,7 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
@@ -757,7 +756,7 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
if (!ptr)
|
||||
{
|
||||
free( replaced_sacl );
|
||||
@@ -113,7 +113,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
}
|
||||
new_sd_ptr = (struct security_descriptor*)ptr;
|
||||
|
||||
@@ -679,9 +678,25 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
@@ -768,9 +767,25 @@ int set_sd_defaults_from_token( struct object *obj, const struct security_descri
|
||||
mem_append( ptr, dacl, new_sd.dacl_len );
|
||||
|
||||
free( replaced_sacl );
|
||||
@@ -143,7 +143,7 @@ index 1a3bff65969..d46dbf01b6f 100644
|
||||
|
||||
/** Set the security descriptor using the current primary token for defaults. */
|
||||
diff --git a/server/object.h b/server/object.h
|
||||
index e38913d430d..e61d29d91ea 100644
|
||||
index ecdac2669e1..7cf84ed281e 100644
|
||||
--- a/server/object.h
|
||||
+++ b/server/object.h
|
||||
@@ -175,6 +175,9 @@ extern struct fd *no_get_fd( struct object *obj );
|
||||
@@ -155,7 +155,7 @@ index e38913d430d..e61d29d91ea 100644
|
||||
+ unsigned int set_info, struct token *token );
|
||||
extern int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd,
|
||||
unsigned int set_info, struct token *token );
|
||||
extern WCHAR *no_get_full_name( struct object *obj, data_size_t *ret_len );
|
||||
extern WCHAR *no_get_full_name( struct object *obj, data_size_t max, data_size_t *ret_len );
|
||||
--
|
||||
2.45.2
|
||||
2.47.2
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user