You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5a1b9d5093 | ||
|
c1f62cba4d | ||
|
02792d0328 | ||
|
44f9ec9761 | ||
|
81492f7156 | ||
|
683813d151 | ||
|
858bf979a1 | ||
|
c2319432af | ||
|
ff1bc55757 | ||
|
3695e09653 | ||
|
ef36ee4399 | ||
|
3dfacea342 | ||
|
1212b7ddff | ||
|
16dce52124 | ||
|
8a4e32eb32 | ||
|
1baaa8fbfc | ||
|
f09458658e | ||
|
e68e4dbb75 | ||
|
2e768aee87 | ||
|
b6944be810 | ||
|
ce31cba943 | ||
|
52f5128abc | ||
|
d7706d345c |
@@ -1,24 +0,0 @@
|
||||
From 170a6d9df910f617585791df31aa72b79622ed0b Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Mon, 16 May 2016 13:20:39 +0200
|
||||
Subject: d3dx9_36: Add format description for X8L8V8U8 for format conversions.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/util.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
|
||||
index d8cd43a..12b9c2c 100644
|
||||
--- a/dlls/d3dx9_36/util.c
|
||||
+++ b/dlls/d3dx9_36/util.c
|
||||
@@ -90,6 +90,7 @@ static const struct pixel_format_desc formats[] =
|
||||
{D3DFMT_G32R32F, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, FORMAT_ARGBF, NULL, NULL },
|
||||
{D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF, NULL, NULL },
|
||||
{D3DFMT_P8, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, FORMAT_INDEX, NULL, index_to_rgba},
|
||||
+ {D3DFMT_X8L8V8U8, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, FORMAT_ARGB, NULL, NULL },
|
||||
/* marks last element */
|
||||
{D3DFMT_UNKNOWN, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL },
|
||||
};
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: Recognize bump luminance X8L8V8U8 when loading dds file
|
@@ -1,4 +1,4 @@
|
||||
From 3b9e832890ad710eecf08f7901d708cfebb3520c Mon Sep 17 00:00:00 2001
|
||||
From 6dbedd8d7aebe117b013c61f9549848f13619f0e Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 13 Jun 2018 10:44:49 -0500
|
||||
Subject: [PATCH] configure: Check for sys/eventfd.h, ppoll(), and shm_open().
|
||||
@@ -7,12 +7,12 @@ We use ppoll() instead of poll() for the better time granularity.
|
||||
|
||||
Although perhaps we shouldn't since the server doesn't do this.
|
||||
---
|
||||
configure.ac | 8 ++++++++
|
||||
include/config.h.in | 9 +++++++++
|
||||
2 files changed, 17 insertions(+)
|
||||
configure.ac | 8 ++++++++
|
||||
include/config.h.in | 11 ++++++++++-
|
||||
2 files changed, 18 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 4314be5553c..920d8343925 100644
|
||||
index 67775f9cd15..c03d4c3688b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -407,6 +407,7 @@ AC_CHECK_HEADERS(\
|
||||
@@ -23,7 +23,7 @@ index 4314be5553c..920d8343925 100644
|
||||
sys/extattr.h \
|
||||
sys/filio.h \
|
||||
sys/ipc.h \
|
||||
@@ -2076,6 +2077,7 @@ AC_CHECK_FUNCS(\
|
||||
@@ -2067,6 +2068,7 @@ AC_CHECK_FUNCS(\
|
||||
port_create \
|
||||
posix_fadvise \
|
||||
posix_fallocate \
|
||||
@@ -31,9 +31,9 @@ index 4314be5553c..920d8343925 100644
|
||||
prctl \
|
||||
sched_yield \
|
||||
renameat \
|
||||
@@ -2100,6 +2102,12 @@ case $host_os in
|
||||
;;
|
||||
esac
|
||||
@@ -2087,6 +2089,12 @@ AC_SEARCH_LIBS(clock_gettime, rt,
|
||||
test "$ac_res" = "none required" || AC_SUBST(RT_LIBS,"$ac_res")])
|
||||
LIBS=$ac_save_LIBS
|
||||
|
||||
+ac_save_LIBS=$LIBS
|
||||
+AC_SEARCH_LIBS(shm_open, rt,
|
||||
@@ -45,30 +45,32 @@ index 4314be5553c..920d8343925 100644
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
||||
[[#include <sched.h>]], [[sched_setaffinity(0, 0, 0);]])],[wine_cv_have_sched_setaffinity=yes],[wine_cv_have_sched_setaffinity=no]))
|
||||
diff --git a/include/config.h.in b/include/config.h.in
|
||||
index 096ecdf94ec..303fb7f2b69 100644
|
||||
index 1c3d4c4d62b..e9686e04a2a 100644
|
||||
--- a/include/config.h.in
|
||||
+++ b/include/config.h.in
|
||||
@@ -312,6 +312,9 @@
|
||||
/* Define to 1 if you have the `posix_fallocate' function. */
|
||||
@@ -318,6 +318,9 @@
|
||||
/* Define to 1 if you have the 'posix_fallocate' function. */
|
||||
#undef HAVE_POSIX_FALLOCATE
|
||||
|
||||
+/* Define to 1 if you have the `ppoll' function. */
|
||||
+#undef HAVE_PPOLL
|
||||
+
|
||||
/* Define to 1 if you have the `prctl' function. */
|
||||
/* Define to 1 if you have the 'prctl' function. */
|
||||
#undef HAVE_PRCTL
|
||||
|
||||
@@ -369,6 +372,9 @@
|
||||
/* Define to 1 if `interface_id' is a member of `sg_io_hdr_t'. */
|
||||
@@ -375,7 +378,10 @@
|
||||
/* Define to 1 if 'interface_id' is a member of 'sg_io_hdr_t'. */
|
||||
#undef HAVE_SG_IO_HDR_T_INTERFACE_ID
|
||||
|
||||
-/* Define to 1 if 'si_fd' is a member of 'siginfo_t'. */
|
||||
+/* Define to 1 if you have the `shm_open' function. */
|
||||
+#undef HAVE_SHM_OPEN
|
||||
+
|
||||
/* Define to 1 if `si_fd' is a member of `siginfo_t'. */
|
||||
+/* Define to 1 if `si_fd' is a member of `siginfo_t'. */
|
||||
#undef HAVE_SIGINFO_T_SI_FD
|
||||
|
||||
@@ -498,6 +504,9 @@
|
||||
/* Define to 1 if you have the 'sigprocmask' function. */
|
||||
@@ -504,6 +510,9 @@
|
||||
/* Define to 1 if you have the <sys/epoll.h> header file. */
|
||||
#undef HAVE_SYS_EPOLL_H
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From e222dd363cf419eecb0d5c97390b60de15f37951 Mon Sep 17 00:00:00 2001
|
||||
From 0c97689e30108869e0ffc5fb7a13edcb42de7450 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Fri, 8 Jun 2018 18:51:40 -0500
|
||||
Subject: [PATCH] server: Add an object operation to grab the esync file
|
||||
@@ -25,6 +25,7 @@ Split off to decrease patch size.
|
||||
server/mapping.c | 3 +++
|
||||
server/mutex.c | 1 +
|
||||
server/named_pipe.c | 5 +++++
|
||||
server/object.c | 2 ++
|
||||
server/object.h | 2 ++
|
||||
server/process.c | 3 +++
|
||||
server/queue.c | 2 ++
|
||||
@@ -40,13 +41,13 @@ Split off to decrease patch size.
|
||||
server/token.c | 1 +
|
||||
server/window.c | 1 +
|
||||
server/winstation.c | 2 ++
|
||||
34 files changed, 68 insertions(+)
|
||||
35 files changed, 70 insertions(+)
|
||||
|
||||
diff --git a/server/async.c b/server/async.c
|
||||
index 9cb251df5ce..337bba8631b 100644
|
||||
index 749c547af4f..2377c737e98 100644
|
||||
--- a/server/async.c
|
||||
+++ b/server/async.c
|
||||
@@ -77,6 +77,7 @@ static const struct object_ops async_ops =
|
||||
@@ -78,6 +78,7 @@ static const struct object_ops async_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
async_signaled, /* signaled */
|
||||
@@ -54,7 +55,7 @@ index 9cb251df5ce..337bba8631b 100644
|
||||
async_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -676,6 +677,7 @@ static const struct object_ops iosb_ops =
|
||||
@@ -698,6 +699,7 @@ static const struct object_ops iosb_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -75,7 +76,7 @@ index ff0799f5880..d9824de8eac 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/change.c b/server/change.c
|
||||
index 7a806abc017..e080511bb23 100644
|
||||
index f42ce066340..d0a90a99261 100644
|
||||
--- a/server/change.c
|
||||
+++ b/server/change.c
|
||||
@@ -112,6 +112,7 @@ static const struct object_ops dir_ops =
|
||||
@@ -87,7 +88,7 @@ index 7a806abc017..e080511bb23 100644
|
||||
no_signal, /* signal */
|
||||
dir_get_fd, /* get_fd */
|
||||
diff --git a/server/clipboard.c b/server/clipboard.c
|
||||
index 8118a467dd8..8b265f2dcea 100644
|
||||
index 91f159bc7c9..0df7fd2f18e 100644
|
||||
--- a/server/clipboard.c
|
||||
+++ b/server/clipboard.c
|
||||
@@ -76,6 +76,7 @@ static const struct object_ops clipboard_ops =
|
||||
@@ -171,7 +172,7 @@ index b64283baf4a..1cc9eea6a50 100644
|
||||
no_signal, /* signal */
|
||||
console_connection_get_fd, /* get_fd */
|
||||
diff --git a/server/debugger.c b/server/debugger.c
|
||||
index 48adb244b09..d85a2000684 100644
|
||||
index c59a0abea77..ca04d4c71ce 100644
|
||||
--- a/server/debugger.c
|
||||
+++ b/server/debugger.c
|
||||
@@ -86,6 +86,7 @@ static const struct object_ops debug_event_ops =
|
||||
@@ -227,7 +228,7 @@ index 436dac6bfe9..f730fa81afa 100644
|
||||
no_signal, /* signal */
|
||||
device_file_get_fd, /* get_fd */
|
||||
diff --git a/server/directory.c b/server/directory.c
|
||||
index 23d7eb0a2b7..bc161b9ab7e 100644
|
||||
index b37ec969a9e..a6c0e292071 100644
|
||||
--- a/server/directory.c
|
||||
+++ b/server/directory.c
|
||||
@@ -69,6 +69,7 @@ static const struct object_ops object_type_ops =
|
||||
@@ -279,7 +280,7 @@ index f1b79b1b35e..c727bfdd1ba 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 74ad95fd4d1..4ce498ec0ef 100644
|
||||
index 16328063df6..4ce78db5b33 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -172,6 +172,7 @@ static const struct object_ops fd_ops =
|
||||
@@ -315,7 +316,7 @@ index 74ad95fd4d1..4ce498ec0ef 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/file.c b/server/file.c
|
||||
index b4f99ddc93b..1b4efb04bc5 100644
|
||||
index 2a839968c25..cbef0c63383 100644
|
||||
--- a/server/file.c
|
||||
+++ b/server/file.c
|
||||
@@ -94,6 +94,7 @@ static const struct object_ops file_ops =
|
||||
@@ -327,7 +328,7 @@ index b4f99ddc93b..1b4efb04bc5 100644
|
||||
no_signal, /* signal */
|
||||
file_get_fd, /* get_fd */
|
||||
diff --git a/server/handle.c b/server/handle.c
|
||||
index 0595fdb403b..d41c7e86454 100644
|
||||
index e65831b3b22..e6c5707556f 100644
|
||||
--- a/server/handle.c
|
||||
+++ b/server/handle.c
|
||||
@@ -126,6 +126,7 @@ static const struct object_ops handle_table_ops =
|
||||
@@ -339,10 +340,10 @@ index 0595fdb403b..d41c7e86454 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/hook.c b/server/hook.c
|
||||
index 5abdf39ad37..da351d6791f 100644
|
||||
index c2d2823cd61..ab4d0e9dd31 100644
|
||||
--- a/server/hook.c
|
||||
+++ b/server/hook.c
|
||||
@@ -80,6 +80,7 @@ static const struct object_ops hook_table_ops =
|
||||
@@ -81,6 +81,7 @@ static const struct object_ops hook_table_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -351,10 +352,10 @@ index 5abdf39ad37..da351d6791f 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/mailslot.c b/server/mailslot.c
|
||||
index 2d8697ec9bd..4cf9b73f784 100644
|
||||
index 61eceec94e2..92fe938d3b9 100644
|
||||
--- a/server/mailslot.c
|
||||
+++ b/server/mailslot.c
|
||||
@@ -74,6 +74,7 @@ static const struct object_ops mailslot_ops =
|
||||
@@ -81,6 +81,7 @@ static const struct object_ops mailslot_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
default_fd_signaled, /* signaled */
|
||||
@@ -362,7 +363,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
mailslot_get_fd, /* get_fd */
|
||||
@@ -133,6 +134,7 @@ static const struct object_ops mail_writer_ops =
|
||||
@@ -142,6 +143,7 @@ static const struct object_ops mail_writer_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -370,7 +371,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
|
||||
NULL, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
mail_writer_get_fd, /* get_fd */
|
||||
@@ -196,6 +198,7 @@ static const struct object_ops mailslot_device_ops =
|
||||
@@ -207,6 +209,7 @@ static const struct object_ops mailslot_device_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -378,7 +379,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -226,6 +229,7 @@ static const struct object_ops mailslot_device_file_ops =
|
||||
@@ -237,6 +240,7 @@ static const struct object_ops mailslot_device_file_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
default_fd_signaled, /* signaled */
|
||||
@@ -387,7 +388,7 @@ index 2d8697ec9bd..4cf9b73f784 100644
|
||||
no_signal, /* signal */
|
||||
mailslot_device_file_get_fd, /* get_fd */
|
||||
diff --git a/server/mapping.c b/server/mapping.c
|
||||
index 2d0a0b783e2..1acfb032bfd 100644
|
||||
index 2bf45780375..b84bb08a77b 100644
|
||||
--- a/server/mapping.c
|
||||
+++ b/server/mapping.c
|
||||
@@ -67,6 +67,7 @@ static const struct object_ops ranges_ops =
|
||||
@@ -427,7 +428,7 @@ index af0efe72132..4785a830e92 100644
|
||||
mutex_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/named_pipe.c b/server/named_pipe.c
|
||||
index f3404a33c3b..f28cb14cb45 100644
|
||||
index dd8c14b30a9..5880b601d3a 100644
|
||||
--- a/server/named_pipe.c
|
||||
+++ b/server/named_pipe.c
|
||||
@@ -119,6 +119,7 @@ static const struct object_ops named_pipe_ops =
|
||||
@@ -470,8 +471,28 @@ index f3404a33c3b..f28cb14cb45 100644
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
named_pipe_device_file_get_fd, /* get_fd */
|
||||
diff --git a/server/object.c b/server/object.c
|
||||
index b1665fb5372..0a4d1bede06 100644
|
||||
--- a/server/object.c
|
||||
+++ b/server/object.c
|
||||
@@ -108,6 +108,7 @@ static const struct object_ops apc_reserve_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
+ NULL, /* get_esync_fd */
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -132,6 +133,7 @@ static const struct object_ops completion_reserve_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
+ NULL, /* get_esync_fd */
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/object.h b/server/object.h
|
||||
index dfdd691601f..711af54b579 100644
|
||||
index 6222e3352ed..0a65d0e3892 100644
|
||||
--- a/server/object.h
|
||||
+++ b/server/object.h
|
||||
@@ -78,6 +78,8 @@ struct object_ops
|
||||
@@ -484,7 +505,7 @@ index dfdd691601f..711af54b579 100644
|
||||
void (*satisfied)(struct object *,struct wait_queue_entry *);
|
||||
/* signal an object */
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index a0d5ea64d97..777bf7c2fe2 100644
|
||||
index 49f5c75005f..dc83a089655 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -105,6 +105,7 @@ static const struct object_ops process_ops =
|
||||
@@ -512,10 +533,10 @@ index a0d5ea64d97..777bf7c2fe2 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index 348fdac3214..2cd8949a252 100644
|
||||
index 984d466b66e..8a95055db40 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -174,6 +174,7 @@ static const struct object_ops msg_queue_ops =
|
||||
@@ -165,6 +165,7 @@ static const struct object_ops msg_queue_ops =
|
||||
msg_queue_add_queue, /* add_queue */
|
||||
msg_queue_remove_queue, /* remove_queue */
|
||||
msg_queue_signaled, /* signaled */
|
||||
@@ -523,7 +544,7 @@ index 348fdac3214..2cd8949a252 100644
|
||||
msg_queue_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -211,6 +212,7 @@ static const struct object_ops thread_input_ops =
|
||||
@@ -202,6 +203,7 @@ static const struct object_ops thread_input_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -532,7 +553,7 @@ index 348fdac3214..2cd8949a252 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/registry.c b/server/registry.c
|
||||
index 629d67c832f..d6b39b99b22 100644
|
||||
index cc9a33fff1d..c19e92c9750 100644
|
||||
--- a/server/registry.c
|
||||
+++ b/server/registry.c
|
||||
@@ -180,6 +180,7 @@ static const struct object_ops key_ops =
|
||||
@@ -544,7 +565,7 @@ index 629d67c832f..d6b39b99b22 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/request.c b/server/request.c
|
||||
index 7021741c765..ca83fdbd2af 100644
|
||||
index dabcea68309..832a33917b4 100644
|
||||
--- a/server/request.c
|
||||
+++ b/server/request.c
|
||||
@@ -90,6 +90,7 @@ static const struct object_ops master_socket_ops =
|
||||
@@ -568,10 +589,10 @@ index 53b42a886df..e3889f24601 100644
|
||||
semaphore_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/serial.c b/server/serial.c
|
||||
index d665eb7fa35..11e204e4419 100644
|
||||
index 209f2e9174e..0d49a996c2a 100644
|
||||
--- a/server/serial.c
|
||||
+++ b/server/serial.c
|
||||
@@ -85,6 +85,7 @@ static const struct object_ops serial_ops =
|
||||
@@ -91,6 +91,7 @@ static const struct object_ops serial_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
default_fd_signaled, /* signaled */
|
||||
@@ -592,10 +613,10 @@ index 19b76d44c16..55cd6aa037e 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/sock.c b/server/sock.c
|
||||
index 52175b08987..77b41716cd1 100644
|
||||
index d2ec882554f..44a4e3b7b15 100644
|
||||
--- a/server/sock.c
|
||||
+++ b/server/sock.c
|
||||
@@ -451,6 +451,7 @@ static const struct object_ops sock_ops =
|
||||
@@ -471,6 +471,7 @@ static const struct object_ops sock_ops =
|
||||
add_queue, /* add_queue */
|
||||
remove_queue, /* remove_queue */
|
||||
default_fd_signaled, /* signaled */
|
||||
@@ -603,7 +624,7 @@ index 52175b08987..77b41716cd1 100644
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
sock_get_fd, /* get_fd */
|
||||
@@ -3481,6 +3482,7 @@ static const struct object_ops ifchange_ops =
|
||||
@@ -3599,6 +3600,7 @@ static const struct object_ops ifchange_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -611,7 +632,7 @@ index 52175b08987..77b41716cd1 100644
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
ifchange_get_fd, /* get_fd */
|
||||
@@ -3702,6 +3704,7 @@ static const struct object_ops socket_device_ops =
|
||||
@@ -3820,6 +3822,7 @@ static const struct object_ops socket_device_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -620,7 +641,7 @@ index 52175b08987..77b41716cd1 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/symlink.c b/server/symlink.c
|
||||
index 27d48e2f994..8cb24b4ff6e 100644
|
||||
index dd28efd3a75..c7f34412317 100644
|
||||
--- a/server/symlink.c
|
||||
+++ b/server/symlink.c
|
||||
@@ -71,6 +71,7 @@ static const struct object_ops symlink_ops =
|
||||
@@ -632,7 +653,7 @@ index 27d48e2f994..8cb24b4ff6e 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index 0d5bdcf21d9..9dc38d4cce9 100644
|
||||
index cf69b3b53c3..4b537586e31 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -96,6 +96,7 @@ static const struct object_ops thread_apc_ops =
|
||||
@@ -672,10 +693,10 @@ index 96dc9d00ca1..f59902d5607 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 4df8d2e0c6e..8b4d2f0c1b1 100644
|
||||
index 48ee1eca8fe..479596bdbfa 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -143,6 +143,7 @@ static const struct object_ops token_ops =
|
||||
@@ -145,6 +145,7 @@ static const struct object_ops token_ops =
|
||||
no_add_queue, /* add_queue */
|
||||
NULL, /* remove_queue */
|
||||
NULL, /* signaled */
|
||||
@@ -684,7 +705,7 @@ index 4df8d2e0c6e..8b4d2f0c1b1 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/window.c b/server/window.c
|
||||
index 242e93f303a..3aa7ad4ad79 100644
|
||||
index 412592fbc71..94a70ce890f 100644
|
||||
--- a/server/window.c
|
||||
+++ b/server/window.c
|
||||
@@ -107,6 +107,7 @@ static const struct object_ops window_ops =
|
||||
@@ -696,7 +717,7 @@ index 242e93f303a..3aa7ad4ad79 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
diff --git a/server/winstation.c b/server/winstation.c
|
||||
index 5903497d61e..7692fbe3ed2 100644
|
||||
index e5f4bfec357..50fe34aa9ce 100644
|
||||
--- a/server/winstation.c
|
||||
+++ b/server/winstation.c
|
||||
@@ -76,6 +76,7 @@ static const struct object_ops winstation_ops =
|
||||
@@ -716,5 +737,5 @@ index 5903497d61e..7692fbe3ed2 100644
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
--
|
||||
2.42.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,119 +0,0 @@
|
||||
From dc2aaa6a25ebccc30c7903fa68235d5971f8d6b8 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Wendt <daniel.wendt@linux.com>
|
||||
Date: Fri, 15 Nov 2013 12:52:37 +0100
|
||||
Subject: [PATCH] gdi32: fix for rotated Arc, ArcTo, Chord and Pie drawing
|
||||
problem
|
||||
|
||||
Wine-Bug: http://bugs.winehq.org/show_bug.cgi?id=34579
|
||||
---
|
||||
dlls/win32u/dibdrv/graphics.c | 80 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 80 insertions(+)
|
||||
|
||||
diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c
|
||||
index 410f29e8f19..3a6f8184009 100644
|
||||
--- a/dlls/win32u/dibdrv/graphics.c
|
||||
+++ b/dlls/win32u/dibdrv/graphics.c
|
||||
@@ -310,6 +310,60 @@ static int get_arc_points( int arc_dir, const RECT *rect, POINT start, POINT end
|
||||
return pos - count;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ Check if matrix has uniform scale and shear and contains a rotation.
|
||||
+*/
|
||||
+static BOOL xform_has_rotate_and_uniform_scale_and_shear( const XFORM *xform )
|
||||
+{
|
||||
+ return xform->eM21 != 0 && xform->eM11 == xform->eM22 && -xform->eM21 == xform->eM12;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ Decompose rotation and translation from matrix xform.
|
||||
+
|
||||
+ If parameter rotation_and_translation is != NULL, save rotation and translation into it.
|
||||
+
|
||||
+ Note: The current implementation only works on matrixes with uniform scale and shear,
|
||||
+ which has to be checked by a call to xform_has_rotate_and_uniform_scale_and_shear().
|
||||
+ Hints how to get unique values for non-uniform matrixes are welcome.
|
||||
+*/
|
||||
+static BOOL xform_decompose_rotation_and_translation( XFORM *xform, XFORM *rotation_and_translation )
|
||||
+{
|
||||
+ XFORM inverse_matrix_scale;
|
||||
+ XFORM origin_matrix = *xform;
|
||||
+ double determinant = 0;
|
||||
+
|
||||
+ /* xform = xfrom-transposed * xform */
|
||||
+ xform->eM11 = sqrt( xform->eM11 * xform->eM11 + xform->eM21 * xform->eM21 );
|
||||
+ xform->eM22 = sqrt( xform->eM12 * xform->eM12 + xform->eM22 * xform->eM22 );
|
||||
+ xform->eM12 = 0;
|
||||
+ xform->eM21 = 0;
|
||||
+ xform->eDx = 0;
|
||||
+ xform->eDy = 0;
|
||||
+
|
||||
+ if ( rotation_and_translation == NULL )
|
||||
+ return TRUE;
|
||||
+
|
||||
+ if ( xform->eM11 == 0 || xform->eM22 == 0 )
|
||||
+ return FALSE;
|
||||
+
|
||||
+ determinant = xform->eM11 * xform->eM22;
|
||||
+
|
||||
+ inverse_matrix_scale.eM11 = xform->eM22 / determinant;
|
||||
+ inverse_matrix_scale.eM12 = 0;
|
||||
+ inverse_matrix_scale.eM21 = 0;
|
||||
+ inverse_matrix_scale.eM22 = xform->eM11 / determinant;
|
||||
+
|
||||
+ /* calculate the rotation matrix */
|
||||
+ rotation_and_translation->eM11 = inverse_matrix_scale.eM11 * origin_matrix.eM11;
|
||||
+ rotation_and_translation->eM12 = inverse_matrix_scale.eM11 * origin_matrix.eM12;
|
||||
+ rotation_and_translation->eM21 = inverse_matrix_scale.eM22 * origin_matrix.eM12 * -1;
|
||||
+ rotation_and_translation->eM22 = inverse_matrix_scale.eM22 * origin_matrix.eM22;
|
||||
+ rotation_and_translation->eDx = origin_matrix.eDx;
|
||||
+ rotation_and_translation->eDy = origin_matrix.eDy;
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
/* backend for arc functions; extra_lines is -1 for ArcTo, 0 for Arc, 1 for Chord, 2 for Pie */
|
||||
static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT start_x, INT start_y, INT end_x, INT end_y, INT extra_lines )
|
||||
@@ -322,6 +376,22 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
BOOL ret = TRUE;
|
||||
HRGN outline = 0, interior = 0;
|
||||
|
||||
+ BOOL exclude_rotation = FALSE;
|
||||
+ XFORM old;
|
||||
+ XFORM rotation_and_translation;
|
||||
+ if (dc->attr->graphics_mode == GM_ADVANCED)
|
||||
+ {
|
||||
+ XFORM xf;
|
||||
+ NtGdiGetTransform( pdev->dev.hdc, 0x203, &old );
|
||||
+ xf = old;
|
||||
+ if (xform_has_rotate_and_uniform_scale_and_shear( &xf ) &&
|
||||
+ xform_decompose_rotation_and_translation( &xf, &rotation_and_translation ))
|
||||
+ {
|
||||
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &xf, MWT_SET );
|
||||
+ exclude_rotation = TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (!get_pen_device_rect( dc, pdev, &rect, left, top, right, bottom )) return TRUE;
|
||||
|
||||
width = rect.right - rect.left;
|
||||
@@ -355,6 +425,16 @@ static BOOL draw_arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
points[count].y = rect.top + height / 2;
|
||||
count++;
|
||||
}
|
||||
+
|
||||
+ if (exclude_rotation == TRUE)
|
||||
+ {
|
||||
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &rotation_and_translation, MWT_SET );
|
||||
+ /* apply rotation and translation to calculated points */
|
||||
+ NtGdiTransformPoints( dev->hdc, points, points, count, NtGdiLPtoDP );
|
||||
+ /* restore origin matrix */
|
||||
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &old, MWT_SET );
|
||||
+ }
|
||||
+
|
||||
if (count < 2)
|
||||
{
|
||||
free( points );
|
||||
--
|
||||
2.33.0
|
||||
|
@@ -1,110 +0,0 @@
|
||||
From fdc9d34400af31765d20ca7b070e53d7eec710e4 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Wendt <daniel.wendt@linux.com>
|
||||
Date: Tue, 10 Dec 2013 14:55:32 +0100
|
||||
Subject: [PATCH] gdi32: fix for rotated ellipse
|
||||
|
||||
Bug: http://bugs.winehq.org/show_bug.cgi?id=35331
|
||||
---
|
||||
dlls/win32u/dibdrv/graphics.c | 63 ++++++++++++++++++++++++-----------
|
||||
1 file changed, 44 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/win32u/dibdrv/graphics.c b/dlls/win32u/dibdrv/graphics.c
|
||||
index 21d2eabbc9e..1eeea1d68ea 100644
|
||||
--- a/dlls/win32u/dibdrv/graphics.c
|
||||
+++ b/dlls/win32u/dibdrv/graphics.c
|
||||
@@ -1531,10 +1531,28 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
DC *dc = get_physdev_dc( dev );
|
||||
RECT rect;
|
||||
POINT pt[2], *points;
|
||||
- int i, end, count;
|
||||
+ int i, end;
|
||||
+ ULONG count;
|
||||
BOOL ret = TRUE;
|
||||
HRGN outline = 0, interior = 0;
|
||||
|
||||
+ BOOL exclude_rotation_translation = FALSE;
|
||||
+ XFORM old;
|
||||
+ XFORM rotation_and_translation;
|
||||
+
|
||||
+ if (dc->attr->graphics_mode == GM_ADVANCED)
|
||||
+ {
|
||||
+ XFORM xf;
|
||||
+ NtGdiGetTransform( pdev->dev.hdc, 0x203, &old );
|
||||
+ xf = old;
|
||||
+ if (xform_has_rotate_and_uniform_scale_and_shear( &xf ) &&
|
||||
+ xform_decompose_rotation_and_translation( &xf, &rotation_and_translation ))
|
||||
+ {
|
||||
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &xf, MWT_SET );
|
||||
+ exclude_rotation_translation = TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (!get_pen_device_rect( dc, pdev, &rect, left, top, right, bottom )) return TRUE;
|
||||
|
||||
pt[0].x = pt[0].y = 0;
|
||||
@@ -1555,23 +1573,6 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- if (pdev->brush.style != BS_NULL &&
|
||||
- !(interior = NtGdiCreateRoundRectRgn( rect.left, rect.top, rect.right + 1, rect.bottom + 1,
|
||||
- ellipse_width, ellipse_height )))
|
||||
- {
|
||||
- free( points );
|
||||
- if (outline) NtGdiDeleteObjectApp( outline );
|
||||
- return FALSE;
|
||||
- }
|
||||
-
|
||||
- /* if not using a region, paint the interior first so the outline can overlap it */
|
||||
- if (interior && !outline)
|
||||
- {
|
||||
- ret = brush_region( pdev, interior );
|
||||
- NtGdiDeleteObjectApp( interior );
|
||||
- interior = 0;
|
||||
- }
|
||||
-
|
||||
count = ellipse_first_quadrant( ellipse_width, ellipse_height, points );
|
||||
|
||||
if (dc->attr->arc_direction == AD_CLOCKWISE)
|
||||
@@ -1615,13 +1616,37 @@ BOOL dibdrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
}
|
||||
count = end + 1;
|
||||
|
||||
+ if (exclude_rotation_translation == TRUE)
|
||||
+ {
|
||||
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &rotation_and_translation, MWT_SET );
|
||||
+ /* apply rotation and translation to calculated points */
|
||||
+ NtGdiTransformPoints( dev->hdc, points, points, count, NtGdiLPtoDP );
|
||||
+ /* restore origin matrix */
|
||||
+ NtGdiModifyWorldTransform( pdev->dev.hdc, &old, MWT_SET );
|
||||
+ }
|
||||
+
|
||||
+ if (pdev->brush.style != BS_NULL &&
|
||||
+ !(interior = ULongToHandle(NtGdiPolyPolyDraw( ULongToHandle(ALTERNATE), points, &count, 1, NtGdiPolyPolygonRgn ))))
|
||||
+ {
|
||||
+ free( points );
|
||||
+ if (outline) NtGdiDeleteObjectApp( outline );
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ /* if not using a region, paint the interior first so the outline can overlap it */
|
||||
+ if (interior && !outline)
|
||||
+ {
|
||||
+ ret = brush_region( pdev, interior );
|
||||
+ NtGdiDeleteObjectApp( interior );
|
||||
+ interior = 0;
|
||||
+ }
|
||||
+
|
||||
reset_dash_origin( pdev );
|
||||
pdev->pen_lines( pdev, count, points, TRUE, outline );
|
||||
add_pen_lines_bounds( pdev, count, points, outline );
|
||||
|
||||
if (interior)
|
||||
{
|
||||
- NtGdiCombineRgn( interior, interior, outline, RGN_DIFF );
|
||||
ret = brush_region( pdev, interior );
|
||||
NtGdiDeleteObjectApp( interior );
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: [34579] gdi32: fix for rotated Arc, ArcTo, Chord and Pie drawing problem
|
||||
Fixes: [35331] gdi32: fix for rotated ellipse
|
@@ -1,24 +1,24 @@
|
||||
From b617701d440a9b5210762503cf441e9fcb3132e1 Mon Sep 17 00:00:00 2001
|
||||
From 4dfa7d8a06e20d9888398298e03c20fac89a9fdf Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 13 Jan 2017 01:59:13 +0100
|
||||
Subject: kernel32: Always start debugger on WinSta0.
|
||||
Subject: [PATCH] kernel32: Always start debugger on WinSta0.
|
||||
|
||||
---
|
||||
dlls/kernelbase/debug.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c
|
||||
index 016c21109..0681f726b 100644
|
||||
index cbefc0c8733..b37faaa0003 100644
|
||||
--- a/dlls/kernelbase/debug.c
|
||||
+++ b/dlls/kernelbase/debug.c
|
||||
@@ -640,6 +640,7 @@ static BOOL start_debugger( EXCEPTION_POINTERS *epointers, HANDLE event )
|
||||
@@ -625,6 +625,7 @@ static BOOL start_debugger( EXCEPTION_POINTERS *epointers, HANDLE event )
|
||||
TRACE( "Starting debugger %s\n", debugstr_w(cmdline) );
|
||||
memset( &startup, 0, sizeof(startup) );
|
||||
startup.cb = sizeof(startup);
|
||||
+ startup.lpDesktop = (WCHAR*)L"WinSta0";
|
||||
startup.dwFlags = STARTF_USESHOWWINDOW;
|
||||
startup.wShowWindow = SW_SHOWNORMAL;
|
||||
ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, 0, env, NULL, &startup, &info );
|
||||
ret = CreateProcessW( NULL, cmdline, NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, env, NULL, &startup, &info );
|
||||
--
|
||||
2.23.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 8f9e309dc4b3e9c7328c86cc4993b9359f0e6839 Mon Sep 17 00:00:00 2001
|
||||
From 4c246e61f0de05a8b80e7a5d5ff2edcd21036fec 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.
|
||||
@@ -16,10 +16,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46568
|
||||
1 file changed, 164 insertions(+), 246 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index cd1655d41b2..c0537375ab8 100644
|
||||
index 1a3d527f186..ec72d692c3a 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -1241,43 +1241,15 @@ static struct file_view *find_view_range( const void *addr, size_t size )
|
||||
@@ -1269,43 +1269,15 @@ static struct file_view *find_view_range( const void *addr, size_t size )
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
|
||||
/***********************************************************************
|
||||
* try_map_free_area
|
||||
@@ -1312,112 +1284,6 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
@@ -1338,112 +1310,6 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
/***********************************************************************
|
||||
* remove_reserved_area
|
||||
*
|
||||
@@ -1527,8 +1393,7 @@ static void free_view( struct file_view *view )
|
||||
@@ -1553,8 +1419,7 @@ static void free_view( struct file_view *view )
|
||||
*/
|
||||
static void unregister_view( struct file_view *view )
|
||||
{
|
||||
@@ -194,7 +194,7 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
wine_rb_remove( &views_tree, &view->entry );
|
||||
}
|
||||
|
||||
@@ -1556,8 +1421,7 @@ static void delete_view( struct file_view *view ) /* [in] View */
|
||||
@@ -1582,8 +1447,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 cd1655d41b2..c0537375ab8 100644
|
||||
}
|
||||
|
||||
|
||||
@@ -1830,89 +1694,176 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want
|
||||
@@ -1855,89 +1719,176 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
+static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BOOL top_down, int unix_prot, UINT_PTR align_mask )
|
||||
{
|
||||
- void *ptr = NULL;
|
||||
- struct reserved_area *area = LIST_ENTRY( ptr, struct reserved_area, entry );
|
||||
- struct reserved_area *area;
|
||||
+ struct range_entry *range, *ranges_start, *ranges_end;
|
||||
+ char *reserve_start, *reserve_end;
|
||||
+ struct alloc_area area;
|
||||
@@ -442,7 +442,7 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -2016,48 +1967,13 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
@@ -2041,48 +1992,13 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -495,7 +495,7 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
status = create_view( view_ret, ptr, size, vprot );
|
||||
if (status != STATUS_SUCCESS) unmap_area( ptr, size );
|
||||
return status;
|
||||
@@ -3236,6 +3152,7 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P
|
||||
@@ -3275,6 +3191,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 );
|
||||
@@ -503,7 +503,7 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -6143,6 +6060,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL
|
||||
@@ -6394,6 +6311,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL
|
||||
*ret = (ULONG_PTR)base;
|
||||
*size_ptr = size;
|
||||
}
|
||||
@@ -512,5 +512,5 @@ index cd1655d41b2..c0537375ab8 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
From d13a3f4498ddc7f10a1d435edb5c59b71dca1efc Mon Sep 17 00:00:00 2001
|
||||
From 844ba5e56a7231f65b65cabf06fe44ee49876aa0 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.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 104 ++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 95 insertions(+), 9 deletions(-)
|
||||
dlls/ntdll/unix/virtual.c | 106 ++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 97 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index c0537375ab8..b4d7f6a580d 100644
|
||||
index ec72d692c3a..30d43afc076 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -127,6 +127,7 @@ struct file_view
|
||||
@@ -28,7 +28,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
|
||||
ULONG_PTR user_space_wow_limit = 0;
|
||||
struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000;
|
||||
@@ -1129,7 +1132,9 @@ static void dump_view( struct file_view *view )
|
||||
@@ -1157,7 +1160,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 c0537375ab8..b4d7f6a580d 100644
|
||||
TRACE( " (builtin image)\n" );
|
||||
else if (view->protect & VPROT_FREE_PLACEHOLDER)
|
||||
TRACE( " (placeholder)\n" );
|
||||
@@ -1249,6 +1254,8 @@ struct alloc_area
|
||||
@@ -1277,6 +1282,8 @@ struct alloc_area
|
||||
int unix_prot;
|
||||
BOOL top_down;
|
||||
UINT_PTR align_mask;
|
||||
@@ -48,7 +48,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
@@ -1257,9 +1264,12 @@ struct alloc_area
|
||||
@@ -1285,9 +1292,14 @@ struct alloc_area
|
||||
* Try mmaping some expected free memory region, eventually stepping and
|
||||
* retrying inside it, and return where it actually succeeded, or NULL.
|
||||
*/
|
||||
@@ -60,10 +60,12 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
+ size_t abs_step = step > 0 ? step : -step;
|
||||
+ size_t size = area->size;
|
||||
+ int unix_prot = area->unix_prot;
|
||||
void *ptr;
|
||||
|
||||
+ void *ptr;
|
||||
+
|
||||
while (start && base <= start && (char*)start + size <= (char*)end)
|
||||
@@ -1272,12 +1282,19 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
{
|
||||
if (anon_mmap_tryfixed( start, size, unix_prot, 0 ) != MAP_FAILED) return start;
|
||||
@@ -1298,12 +1310,19 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
strerror(errno), start, (char *)start + size, unix_prot );
|
||||
return NULL;
|
||||
}
|
||||
@@ -84,7 +86,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1702,11 +1719,11 @@ static void *try_map_free_area_range( struct alloc_area *area, char *start, char
|
||||
@@ -1727,11 +1746,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 );
|
||||
@@ -98,7 +100,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
}
|
||||
|
||||
static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char *end )
|
||||
@@ -1796,9 +1813,10 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO
|
||||
@@ -1821,9 +1840,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;
|
||||
@@ -110,7 +112,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
|
||||
TRACE("limit %p-%p, size %p, top_down %#x.\n", limit_low, limit_high, (void *)size, top_down);
|
||||
|
||||
@@ -1863,6 +1881,50 @@ static void *alloc_free_area( char *limit_low, char *limit_high, size_t size, BO
|
||||
@@ -1888,6 +1908,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;
|
||||
}
|
||||
@@ -161,7 +163,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1922,6 +1984,17 @@ failed:
|
||||
@@ -1947,6 +2011,17 @@ failed:
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -179,7 +181,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
/***********************************************************************
|
||||
* map_view
|
||||
*
|
||||
@@ -1972,7 +2045,15 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
@@ -1997,7 +2072,15 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
if (!align_mask) align_mask = granularity_mask;
|
||||
|
||||
if (!(ptr = alloc_free_area( (void *)limit_low, (void *)limit_high, size, top_down, get_unix_prot( vprot ), align_mask )))
|
||||
@@ -196,7 +198,7 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
}
|
||||
status = create_view( view_ret, ptr, size, vprot );
|
||||
if (status != STATUS_SUCCESS) unmap_area( ptr, size );
|
||||
@@ -4287,7 +4368,12 @@ void virtual_set_force_exec( BOOL enable )
|
||||
@@ -4346,7 +4429,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 */
|
||||
@@ -211,5 +213,5 @@ index c0537375ab8..b4d7f6a580d 100644
|
||||
mprotect_range( view->base, view->size, commit, 0 );
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From ee26472916e2196456c0c59fb8ca04ee362f148a Mon Sep 17 00:00:00 2001
|
||||
From d1f5c52e07bce357d3b471e839db2a6f7a72fa86 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 3 Apr 2017 05:30:27 +0200
|
||||
Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
|
||||
2 files changed, 117 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
|
||||
index 8b332e479e6..08cb3d3f8ce 100644
|
||||
index 9b0f8f6bff2..747dfb0afa6 100644
|
||||
--- a/dlls/kernel32/tests/loader.c
|
||||
+++ b/dlls/kernel32/tests/loader.c
|
||||
@@ -28,6 +28,7 @@
|
||||
@@ -20,7 +20,7 @@ index 8b332e479e6..08cb3d3f8ce 100644
|
||||
#include "wine/test.h"
|
||||
#include "delayloadhandler.h"
|
||||
|
||||
@@ -4641,6 +4642,79 @@ static void test_Wow64Transition(void)
|
||||
@@ -4651,6 +4652,79 @@ static void test_Wow64Transition(void)
|
||||
debugstr_wn(name->SectionFileName.Buffer, name->SectionFileName.Length / sizeof(WCHAR)));
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ index 8b332e479e6..08cb3d3f8ce 100644
|
||||
START_TEST(loader)
|
||||
{
|
||||
int argc;
|
||||
@@ -4723,6 +4797,7 @@ START_TEST(loader)
|
||||
@@ -4734,6 +4808,7 @@ START_TEST(loader)
|
||||
test_InMemoryOrderModuleList();
|
||||
test_LoadPackagedLibrary();
|
||||
test_wow64_redirection();
|
||||
@@ -109,7 +109,7 @@ index 8b332e479e6..08cb3d3f8ce 100644
|
||||
test_dll_file( "kernel32.dll" );
|
||||
test_dll_file( "advapi32.dll" );
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 5f84ca7e23b..4da48a82d74 100644
|
||||
index 0ed37ad390c..94610a82a65 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -128,6 +128,9 @@ struct file_id
|
||||
@@ -122,8 +122,8 @@ index 5f84ca7e23b..4da48a82d74 100644
|
||||
/* internal representation of loaded modules */
|
||||
typedef struct _wine_modref
|
||||
{
|
||||
@@ -556,6 +559,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
|
||||
}
|
||||
@@ -603,6 +606,33 @@ static int base_address_compare( const void *key, const RTL_BALANCED_NODE *entry
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/*************************************************************************
|
||||
@@ -156,12 +156,14 @@ index 5f84ca7e23b..4da48a82d74 100644
|
||||
/*************************************************************************
|
||||
* get_modref
|
||||
*
|
||||
@@ -1557,7 +1587,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
|
||||
@@ -1599,9 +1629,14 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
|
||||
&wm->ldr.InLoadOrderLinks);
|
||||
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList,
|
||||
&wm->ldr.InMemoryOrderLinks);
|
||||
+ InsertTailList(&hash_table[hash_basename(wm->ldr.BaseDllName.Buffer)],
|
||||
+ &wm->ldr.HashLinks);
|
||||
if (rtl_rb_tree_put( &base_address_index_tree, wm->ldr.DllBase, &wm->ldr.BaseAddressIndexNode, base_address_compare ))
|
||||
ERR( "rtl_rb_tree_put failed.\n" );
|
||||
+
|
||||
/* wait until init is called for inserting into InInitializationOrderModuleList */
|
||||
+ wm->ldr.InInitializationOrderLinks.Flink = NULL;
|
||||
@@ -169,23 +171,23 @@ index 5f84ca7e23b..4da48a82d74 100644
|
||||
|
||||
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
|
||||
{
|
||||
@@ -2253,6 +2288,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
|
||||
@@ -2299,6 +2334,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
|
||||
/* the module has only be inserted in the load & memory order lists */
|
||||
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
|
||||
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
|
||||
+ RemoveEntryList(&wm->ldr.HashLinks);
|
||||
RtlRbRemoveNode( &base_address_index_tree, &wm->ldr.BaseAddressIndexNode );
|
||||
|
||||
/* FIXME: there are several more dangling references
|
||||
* left. Including dlls loaded by this dll before the
|
||||
@@ -3916,6 +3952,7 @@ static void free_modref( WINE_MODREF *wm )
|
||||
@@ -3963,6 +3999,7 @@ static void free_modref( WINE_MODREF *wm )
|
||||
|
||||
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
|
||||
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
|
||||
+ RemoveEntryList(&wm->ldr.HashLinks);
|
||||
RtlRbRemoveNode( &base_address_index_tree, &wm->ldr.BaseAddressIndexNode );
|
||||
if (wm->ldr.InInitializationOrderLinks.Flink)
|
||||
RemoveEntryList(&wm->ldr.InInitializationOrderLinks);
|
||||
|
||||
@@ -4336,6 +4373,7 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
@@ -4384,6 +4421,7 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" );
|
||||
WINE_MODREF *kernel32;
|
||||
PEB *peb = NtCurrentTeb()->Peb;
|
||||
@@ -193,7 +195,7 @@ index 5f84ca7e23b..4da48a82d74 100644
|
||||
|
||||
peb->LdrData = &ldr;
|
||||
peb->FastPebLock = &peb_lock;
|
||||
@@ -4354,6 +4392,10 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
@@ -4402,6 +4440,10 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
if (!(tls_dirs = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, tls_module_count * sizeof(*tls_dirs) )))
|
||||
NtTerminateProcess( GetCurrentProcess(), STATUS_NO_MEMORY );
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 5306b83f69d37bf99110fc1b662fccc89552be3d Mon Sep 17 00:00:00 2001
|
||||
From c2236d2048faf1e01da3130fdb81688da6829d4a Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 16 Jan 2014 21:02:11 -0700
|
||||
Subject: [PATCH] server: Implement FILE_OPEN_REPARSE_POINT option.
|
||||
@@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
2 files changed, 142 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
|
||||
index e1ba92a6448..04cb6760872 100644
|
||||
index 1f13511fa7b..1c41e0011f3 100644
|
||||
--- a/dlls/kernelbase/file.c
|
||||
+++ b/dlls/kernelbase/file.c
|
||||
@@ -732,6 +732,8 @@ static UINT get_nt_file_options( DWORD attributes )
|
||||
@@ -769,6 +769,8 @@ static UINT get_nt_file_options( DWORD attributes )
|
||||
options |= FILE_SEQUENTIAL_ONLY;
|
||||
if (attributes & FILE_FLAG_WRITE_THROUGH)
|
||||
options |= FILE_WRITE_THROUGH;
|
||||
@@ -23,18 +23,18 @@ index e1ba92a6448..04cb6760872 100644
|
||||
}
|
||||
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 8576882aaa9..0d5964b2427 100644
|
||||
index 04688c5eb0d..94b8bd088ed 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <stdio.h>
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
+#include <libgen.h>
|
||||
#include <poll.h>
|
||||
#ifdef HAVE_LINUX_MAJOR_H
|
||||
#include <linux/major.h>
|
||||
@@ -101,6 +102,10 @@
|
||||
@@ -99,6 +100,10 @@
|
||||
#include "winioctl.h"
|
||||
#include "ddk/wdm.h"
|
||||
|
||||
@@ -45,7 +45,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
#if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL_CREATE)
|
||||
# include <sys/epoll.h>
|
||||
# define USE_EPOLL
|
||||
@@ -1066,6 +1071,9 @@ static void device_destroy( struct object *obj )
|
||||
@@ -1064,6 +1069,9 @@ static void device_destroy( struct object *obj )
|
||||
list_remove( &device->entry ); /* remove it from the hash table */
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
/****************************************************************/
|
||||
/* inode functions */
|
||||
|
||||
@@ -1073,10 +1081,29 @@ static void unlink_closed_fd( struct inode *inode, struct closed_fd *fd )
|
||||
@@ -1071,10 +1079,29 @@ static void unlink_closed_fd( struct inode *inode, struct closed_fd *fd )
|
||||
{
|
||||
/* make sure it is still the same file */
|
||||
struct stat st;
|
||||
@@ -86,7 +86,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1115,6 +1142,59 @@ static void inode_dump( struct object *obj, int verbose )
|
||||
@@ -1113,6 +1140,59 @@ static void inode_dump( struct object *obj, int verbose )
|
||||
fprintf( stderr, "\n" );
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
static void inode_destroy( struct object *obj )
|
||||
{
|
||||
struct inode *inode = (struct inode *)obj;
|
||||
@@ -1870,6 +1950,38 @@ void get_nt_name( struct fd *fd, struct unicode_str *name )
|
||||
@@ -1861,6 +1941,38 @@ void get_nt_name( struct fd *fd, struct unicode_str *name )
|
||||
name->len = fd->nt_namelen;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
/* open() wrapper that returns a struct fd with no fd user set */
|
||||
struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_name,
|
||||
int flags, mode_t *mode, unsigned int access,
|
||||
@@ -1930,6 +2042,15 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
@@ -1921,6 +2033,15 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
}
|
||||
else rw_mode = O_RDONLY;
|
||||
|
||||
@@ -201,7 +201,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
if ((fd->unix_fd = open( name, rw_mode | (flags & ~O_TRUNC), *mode )) == -1)
|
||||
{
|
||||
/* if we tried to open a directory for write access, retry read-only */
|
||||
@@ -1954,7 +2075,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
@@ -1945,7 +2066,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
fd->unix_name = NULL;
|
||||
if ((path = dup_fd_name( root, name )))
|
||||
{
|
||||
@@ -210,7 +210,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
free( path );
|
||||
}
|
||||
|
||||
@@ -1965,10 +2086,11 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
@@ -1956,10 +2077,11 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
*mode = st.st_mode;
|
||||
|
||||
/* only bother with an inode for normal files and directories */
|
||||
@@ -223,7 +223,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
|
||||
if (!inode)
|
||||
{
|
||||
@@ -1983,13 +2105,17 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
@@ -1974,13 +2096,17 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
|
||||
list_add_head( &inode->open, &fd->inode_entry );
|
||||
closed_fd = NULL;
|
||||
|
||||
@@ -243,7 +243,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
{
|
||||
set_error( STATUS_FILE_IS_A_DIRECTORY );
|
||||
goto error;
|
||||
@@ -2436,6 +2562,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
|
||||
@@ -2427,6 +2553,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
|
||||
|
||||
static int is_dir_empty( int fd )
|
||||
{
|
||||
@@ -251,7 +251,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
DIR *dir;
|
||||
int empty;
|
||||
struct dirent *de;
|
||||
@@ -2443,8 +2570,13 @@ static int is_dir_empty( int fd )
|
||||
@@ -2434,8 +2561,13 @@ static int is_dir_empty( int fd )
|
||||
if ((fd = dup( fd )) == -1)
|
||||
return -1;
|
||||
|
||||
@@ -266,7 +266,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
close( fd );
|
||||
return -1;
|
||||
}
|
||||
@@ -2456,6 +2588,7 @@ static int is_dir_empty( int fd )
|
||||
@@ -2447,6 +2579,7 @@ static int is_dir_empty( int fd )
|
||||
empty = 0;
|
||||
}
|
||||
closedir( dir );
|
||||
@@ -274,7 +274,7 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
return empty;
|
||||
}
|
||||
|
||||
@@ -2494,7 +2627,7 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags )
|
||||
@@ -2485,7 +2618,7 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags )
|
||||
file_set_error();
|
||||
return;
|
||||
}
|
||||
@@ -284,5 +284,5 @@ index 8576882aaa9..0d5964b2427 100644
|
||||
if (!(flags & FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE) &&
|
||||
!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 4aea41b4f635ab83ad6ac571b04ca0f8f00310ab Mon Sep 17 00:00:00 2001
|
||||
From e062c6f139f716fe0e95a26e5016aa4f94087146 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,20 +20,20 @@ index 3742968c415..084469a2820 100644
|
||||
SOURCES = \
|
||||
atom.c \
|
||||
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
|
||||
index e678f7f43a0..71a413d9f18 100644
|
||||
index d013848c07a..f239575d13e 100644
|
||||
--- a/dlls/ntdll/tests/rtl.c
|
||||
+++ b/dlls/ntdll/tests/rtl.c
|
||||
@@ -36,6 +36,9 @@
|
||||
#include "ddk/ntifs.h"
|
||||
@@ -37,6 +37,9 @@
|
||||
#include "wine/test.h"
|
||||
#include "wine/asm.h"
|
||||
#include "wine/rbtree.h"
|
||||
+#include "initguid.h"
|
||||
+#define COBJMACROS
|
||||
+#include "shobjidl.h"
|
||||
|
||||
#ifndef __WINE_WINTERNL_H
|
||||
|
||||
@@ -104,6 +107,9 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION
|
||||
@@ -105,6 +108,9 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION
|
||||
static NTSTATUS (WINAPI *pRtlInitializeCriticalSectionEx)(CRITICAL_SECTION *, ULONG, ULONG);
|
||||
static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *);
|
||||
static NTSTATUS (WINAPI *pLdrEnumerateLoadedModules)(void *, void *, void *);
|
||||
@@ -43,7 +43,7 @@ index e678f7f43a0..71a413d9f18 100644
|
||||
static NTSTATUS (WINAPI *pLdrRegisterDllNotification)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, void *, void **);
|
||||
static NTSTATUS (WINAPI *pLdrUnregisterDllNotification)(void *);
|
||||
static VOID (WINAPI *pRtlGetDeviceFamilyInfoEnum)(ULONGLONG *,DWORD *,DWORD *);
|
||||
@@ -148,6 +154,9 @@ static void InitFunctionPtrs(void)
|
||||
@@ -152,6 +158,9 @@ static void InitFunctionPtrs(void)
|
||||
pRtlInitializeCriticalSectionEx = (void *)GetProcAddress(hntdll, "RtlInitializeCriticalSectionEx");
|
||||
pRtlFindExportedRoutineByName = (void *)GetProcAddress(hntdll, "RtlFindExportedRoutineByName");
|
||||
pLdrEnumerateLoadedModules = (void *)GetProcAddress(hntdll, "LdrEnumerateLoadedModules");
|
||||
@@ -53,7 +53,7 @@ index e678f7f43a0..71a413d9f18 100644
|
||||
pLdrRegisterDllNotification = (void *)GetProcAddress(hntdll, "LdrRegisterDllNotification");
|
||||
pLdrUnregisterDllNotification = (void *)GetProcAddress(hntdll, "LdrUnregisterDllNotification");
|
||||
pRtlGetDeviceFamilyInfoEnum = (void *)GetProcAddress(hntdll, "RtlGetDeviceFamilyInfoEnum");
|
||||
@@ -3708,6 +3717,76 @@ static void test_RtlFirstFreeAce(void)
|
||||
@@ -3714,6 +3723,76 @@ static void test_RtlFirstFreeAce(void)
|
||||
HeapFree(GetProcessHeap(), 0, acl);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ index e678f7f43a0..71a413d9f18 100644
|
||||
static void test_RtlInitializeSid(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY sid_ident = { SECURITY_NT_AUTHORITY };
|
||||
@@ -3823,6 +3902,7 @@ START_TEST(rtl)
|
||||
@@ -3970,6 +4049,7 @@ START_TEST(rtl)
|
||||
test_RtlInitializeCriticalSectionEx();
|
||||
test_RtlLeaveCriticalSection();
|
||||
test_LdrEnumerateLoadedModules();
|
||||
@@ -139,5 +139,5 @@ index e678f7f43a0..71a413d9f18 100644
|
||||
test_LdrRegisterDllNotification();
|
||||
test_DbgPrint();
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,35 +0,0 @@
|
||||
From 00a5e4e8b55ad439d5c3d8faa876d08df8be759f Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 4 Oct 2014 02:35:44 +0200
|
||||
Subject: [PATCH] ntdll: Trigger write watches before passing userdata pointer
|
||||
to wait_reply.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/server.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
|
||||
index 6af8effe9e1..6dbd9cb3ea0 100644
|
||||
--- a/dlls/ntdll/unix/server.c
|
||||
+++ b/dlls/ntdll/unix/server.c
|
||||
@@ -282,9 +282,17 @@ unsigned int server_call_unlocked( void *req_ptr )
|
||||
*/
|
||||
unsigned int CDECL wine_server_call( void *req_ptr )
|
||||
{
|
||||
+ struct __server_request_info * const req = req_ptr;
|
||||
sigset_t old_set;
|
||||
unsigned int ret;
|
||||
|
||||
+ /* trigger write watches, otherwise read() might return EFAULT */
|
||||
+ if (req->u.req.request_header.reply_size &&
|
||||
+ !virtual_check_buffer_for_write( req->reply_data, req->u.req.request_header.reply_size ))
|
||||
+ {
|
||||
+ return STATUS_ACCESS_VIOLATION;
|
||||
+ }
|
||||
+
|
||||
pthread_sigmask( SIG_BLOCK, &server_block_set, &old_set );
|
||||
ret = server_call_unlocked( req_ptr );
|
||||
pthread_sigmask( SIG_SETMASK, &old_set, NULL );
|
||||
--
|
||||
2.20.1
|
||||
|
@@ -1,26 +0,0 @@
|
||||
From 3d340d4f31aa1cb3ad6cd9e7a59118e84ab040f1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Aida=20Jonikien=C4=97?= <aidas957@gmail.com>
|
||||
Date: Fri, 8 Mar 2024 17:52:24 -0600
|
||||
Subject: [PATCH] ntdll: Trigger write watches on the "info" pointer in
|
||||
SystemInterruptInformation.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/system.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
|
||||
index 4c6c4cd23e2..9dc1ff80152 100644
|
||||
--- a/dlls/ntdll/unix/system.c
|
||||
+++ b/dlls/ntdll/unix/system.c
|
||||
@@ -2943,7 +2943,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
len = peb->NumberOfProcessors * sizeof(SYSTEM_INTERRUPT_INFORMATION);
|
||||
if (size >= len)
|
||||
{
|
||||
- if (!info) ret = STATUS_ACCESS_VIOLATION;
|
||||
+ if (!info || !virtual_check_buffer_for_write( info, len )) ret = STATUS_ACCESS_VIOLATION;
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_GETRANDOM
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,63 +0,0 @@
|
||||
From 96831bd0bda656192510397cd18cb2c4bff5d8f4 Mon Sep 17 00:00:00 2001
|
||||
From: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
Date: Thu, 22 Aug 2024 18:42:33 -0500
|
||||
Subject: [PATCH 03/10] ntdll: Install signal handlers a bit earlier.
|
||||
|
||||
The wine-staging WRITECOPY implementation needs to be able to handle write faults while relocating builtin modules loaded during process initialization.
|
||||
|
||||
Note that the comment about debug events isn't relevant anymore because these exceptions all happen on the Unix stack anyway.
|
||||
|
||||
Probably there's a better solution involving simply not write-protecting these pages until we get to PE code, but that's not worth writing when this whole patch set is moribund anyway.
|
||||
---
|
||||
dlls/ntdll/unix/loader.c | 1 +
|
||||
dlls/ntdll/unix/server.c | 5 -----
|
||||
dlls/ntdll/unix/signal_i386.c | 5 ++++-
|
||||
3 files changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
|
||||
index 92f2e2eb3a3..a6ea16bb7bb 100644
|
||||
--- a/dlls/ntdll/unix/loader.c
|
||||
+++ b/dlls/ntdll/unix/loader.c
|
||||
@@ -1866,6 +1866,7 @@ static void start_main_thread(void)
|
||||
set_load_order_app_name( main_wargv[0] );
|
||||
init_thread_stack( teb, 0, 0, 0 );
|
||||
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
|
||||
+ signal_init_process();
|
||||
load_ntdll();
|
||||
load_wow64_ntdll( main_image_info.Machine );
|
||||
load_apiset_dll();
|
||||
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
|
||||
index 27dbf1331aa..80504e3459c 100644
|
||||
--- a/dlls/ntdll/unix/server.c
|
||||
+++ b/dlls/ntdll/unix/server.c
|
||||
@@ -1674,11 +1674,6 @@ void server_init_process_done(void)
|
||||
send_server_task_port();
|
||||
#endif
|
||||
|
||||
- /* Install signal handlers; this cannot be done earlier, since we cannot
|
||||
- * send exceptions to the debugger before the create process event that
|
||||
- * is sent by init_process_done */
|
||||
- signal_init_process();
|
||||
-
|
||||
/* always send the native TEB */
|
||||
if (!(teb = NtCurrentTeb64())) teb = NtCurrentTeb();
|
||||
|
||||
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c
|
||||
index 61d41ec3589..b838a7a8669 100644
|
||||
--- a/dlls/ntdll/unix/signal_i386.c
|
||||
+++ b/dlls/ntdll/unix/signal_i386.c
|
||||
@@ -719,7 +719,10 @@ static inline void *init_handler( const ucontext_t *sigcontext )
|
||||
{
|
||||
struct x86_thread_data *thread_data = (struct x86_thread_data *)&teb->GdiTebBatch;
|
||||
set_fs( thread_data->fs );
|
||||
- set_gs( thread_data->gs );
|
||||
+ /* FIXME ZF: This is a bit of a hack, but it doesn't matter,
|
||||
+ * since this patch set goes in the wrong direction anyway. */
|
||||
+ if (thread_data->gs)
|
||||
+ set_gs( thread_data->gs );
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,105 +0,0 @@
|
||||
From 8ec23a75cf45f9b2841b76504c827d368682c126 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 4 Oct 2014 03:22:09 +0200
|
||||
Subject: [PATCH] ntdll: Properly handle PAGE_WRITECOPY protection. (try 5)
|
||||
|
||||
For now, only enable it when a special environment variable is set.
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 46 +++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 39 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index b108e49ad4d..70211bbfa3d 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -506,6 +506,21 @@ static void reserve_area( void *addr, void *end )
|
||||
#endif /* __APPLE__ */
|
||||
}
|
||||
|
||||
+/* This might look like a hack, but it actually isn't - the 'experimental' version
|
||||
+ * is correct, but it already has revealed a couple of additional Wine bugs, which
|
||||
+ * were not triggered before, and there are probably some more.
|
||||
+ * To avoid breaking Wine for everyone, the new correct implementation has to be
|
||||
+ * manually enabled, until it is tested a bit more. */
|
||||
+static inline BOOL experimental_WRITECOPY( void )
|
||||
+{
|
||||
+ static int enabled = -1;
|
||||
+ if (enabled == -1)
|
||||
+ {
|
||||
+ const char *str = getenv("STAGING_WRITECOPY");
|
||||
+ enabled = str && (atoi(str) != 0);
|
||||
+ }
|
||||
+ return enabled;
|
||||
+}
|
||||
|
||||
static void mmap_init( const struct preload_info *preload_info )
|
||||
{
|
||||
@@ -1136,8 +1151,19 @@ static int get_unix_prot( BYTE vprot )
|
||||
{
|
||||
if (vprot & VPROT_READ) prot |= PROT_READ;
|
||||
if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ;
|
||||
- if (vprot & VPROT_WRITECOPY) prot |= PROT_WRITE | PROT_READ;
|
||||
if (vprot & VPROT_EXEC) prot |= PROT_EXEC | PROT_READ;
|
||||
+#if defined(__i386__)
|
||||
+ if (vprot & VPROT_WRITECOPY)
|
||||
+ {
|
||||
+ if (experimental_WRITECOPY())
|
||||
+ prot = (prot & ~PROT_WRITE) | PROT_READ;
|
||||
+ else
|
||||
+ prot |= PROT_WRITE | PROT_READ;
|
||||
+ }
|
||||
+#else
|
||||
+ /* FIXME: Architecture needs implementation of signal_init_early. */
|
||||
+ if (vprot & VPROT_WRITECOPY) prot |= PROT_WRITE | PROT_READ;
|
||||
+#endif
|
||||
if (vprot & VPROT_WRITEWATCH) prot &= ~PROT_WRITE;
|
||||
}
|
||||
if (!prot) prot = PROT_NONE;
|
||||
@@ -1817,7 +1843,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size
|
||||
{
|
||||
TRACE( "updating watch %p-%p-%p\n", base, (char *)base + accessed_size, (char *)base + size );
|
||||
/* clear write watch flag on accessed pages */
|
||||
- set_page_vprot_bits( base, accessed_size, 0, VPROT_WRITEWATCH );
|
||||
+ set_page_vprot_bits( base, accessed_size, VPROT_WRITE, VPROT_WRITEWATCH | VPROT_WRITECOPY );
|
||||
/* restore page protections on the entire range */
|
||||
mprotect_range( base, size, 0, 0 );
|
||||
}
|
||||
@@ -4065,12 +4091,13 @@ NTSTATUS virtual_handle_fault( EXCEPTION_RECORD *rec, void *stack )
|
||||
mprotect_range( page, page_size, 0, 0 );
|
||||
}
|
||||
}
|
||||
- /* ignore fault if page is writable now */
|
||||
- if (get_unix_prot( get_page_vprot( page )) & PROT_WRITE)
|
||||
+ if (vprot & VPROT_WRITECOPY)
|
||||
{
|
||||
- if ((vprot & VPROT_WRITEWATCH) || is_write_watch_range( page, page_size ))
|
||||
- ret = STATUS_SUCCESS;
|
||||
+ set_page_vprot_bits( page, page_size, VPROT_WRITE, VPROT_WRITECOPY );
|
||||
+ mprotect_range( page, page_size, 0, 0 );
|
||||
}
|
||||
+ /* ignore fault if page is writable now */
|
||||
+ if (get_unix_prot( get_page_vprot( page ) ) & PROT_WRITE) ret = STATUS_SUCCESS;
|
||||
}
|
||||
mutex_unlock( &virtual_mutex );
|
||||
rec->ExceptionCode = ret;
|
||||
@@ -4144,11 +4171,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat
|
||||
{
|
||||
BYTE vprot = get_page_vprot( addr + i );
|
||||
if (vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE;
|
||||
+ if (vprot & VPROT_WRITECOPY)
|
||||
+ {
|
||||
+ vprot = (vprot & ~VPROT_WRITECOPY) | VPROT_WRITE;
|
||||
+ *has_write_watch = TRUE;
|
||||
+ }
|
||||
if (!(get_unix_prot( vprot & ~VPROT_WRITEWATCH ) & PROT_WRITE))
|
||||
return STATUS_INVALID_USER_BUFFER;
|
||||
}
|
||||
if (*has_write_watch)
|
||||
- mprotect_range( addr, size, 0, VPROT_WRITEWATCH ); /* temporarily enable write access */
|
||||
+ mprotect_range( addr, size, VPROT_WRITE, VPROT_WRITEWATCH | VPROT_WRITECOPY ); /* temporarily enable write access */
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,92 +0,0 @@
|
||||
From 10f273da9caa0b7c814f46b76279065a956393af Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Wesie <awesie@gmail.com>
|
||||
Date: Fri, 24 Apr 2020 14:55:14 -0500
|
||||
Subject: [PATCH] ntdll: Track if a WRITECOPY page has been modified.
|
||||
|
||||
Once a WRITECOPY page is modified, it should be mapped as if it is a normal
|
||||
read-write page.
|
||||
|
||||
Signed-off-by: Andrew Wesie <awesie@gmail.com>
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 30 ++++++++++++++++++++++++------
|
||||
1 file changed, 24 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 5eadabf7dca..58fd4d0edfc 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -122,6 +122,7 @@ struct file_view
|
||||
#define VPROT_GUARD 0x10
|
||||
#define VPROT_COMMITTED 0x20
|
||||
#define VPROT_WRITEWATCH 0x40
|
||||
+#define VPROT_WRITTEN 0x80
|
||||
/* per-mapping protection flags */
|
||||
#define VPROT_ARM64EC 0x0100 /* view may contain ARM64EC code */
|
||||
#define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
|
||||
@@ -1155,7 +1156,7 @@ static int get_unix_prot( BYTE vprot )
|
||||
#if defined(__i386__)
|
||||
if (vprot & VPROT_WRITECOPY)
|
||||
{
|
||||
- if (experimental_WRITECOPY())
|
||||
+ if (experimental_WRITECOPY() && !(vprot & VPROT_WRITTEN))
|
||||
prot = (prot & ~PROT_WRITE) | PROT_READ;
|
||||
else
|
||||
prot |= PROT_WRITE | PROT_READ;
|
||||
@@ -1672,7 +1673,11 @@ static NTSTATUS create_view( struct file_view **view_ret, void *base, size_t siz
|
||||
*/
|
||||
static DWORD get_win32_prot( BYTE vprot, unsigned int map_prot )
|
||||
{
|
||||
- DWORD ret = VIRTUAL_Win32Flags[vprot & 0x0f];
|
||||
+ DWORD ret;
|
||||
+
|
||||
+ if ((vprot & VPROT_WRITECOPY) && (vprot & VPROT_WRITTEN))
|
||||
+ vprot = (vprot & ~VPROT_WRITECOPY) | VPROT_WRITE;
|
||||
+ ret = VIRTUAL_Win32Flags[vprot & 0x0f];
|
||||
if (vprot & VPROT_GUARD) ret |= PAGE_GUARD;
|
||||
if (map_prot & SEC_NOCACHE) ret |= PAGE_NOCACHE;
|
||||
return ret;
|
||||
@@ -1778,16 +1783,29 @@ static void mprotect_range( void *base, size_t size, BYTE set, BYTE clear )
|
||||
*/
|
||||
static BOOL set_vprot( struct file_view *view, void *base, size_t size, BYTE vprot )
|
||||
{
|
||||
+ int unix_prot;
|
||||
+
|
||||
if (view->protect & VPROT_WRITEWATCH)
|
||||
{
|
||||
/* each page may need different protections depending on write watch flag */
|
||||
- set_page_vprot_bits( base, size, vprot & ~VPROT_WRITEWATCH, ~vprot & ~VPROT_WRITEWATCH );
|
||||
+ set_page_vprot_bits( base, size, vprot & ~VPROT_WRITEWATCH, ~vprot & ~(VPROT_WRITEWATCH|VPROT_WRITTEN) );
|
||||
mprotect_range( base, size, 0, 0 );
|
||||
return TRUE;
|
||||
}
|
||||
+
|
||||
if (enable_write_exceptions && is_vprot_exec_write( vprot )) vprot |= VPROT_WRITEWATCH;
|
||||
- if (mprotect_exec( base, size, get_unix_prot(vprot) )) return FALSE;
|
||||
- set_page_vprot( base, size, vprot );
|
||||
+ unix_prot = get_unix_prot(vprot);
|
||||
+
|
||||
+ /* check that we can map this memory with PROT_WRITE since we cannot fail later */
|
||||
+ if (vprot & VPROT_WRITECOPY)
|
||||
+ unix_prot |= PROT_WRITE;
|
||||
+
|
||||
+ if (mprotect_exec( base, size, unix_prot )) return FALSE;
|
||||
+ /* each page may need different protections depending on writecopy */
|
||||
+ set_page_vprot_bits( base, size, vprot, ~vprot & ~VPROT_WRITTEN );
|
||||
+ if (vprot & VPROT_WRITECOPY)
|
||||
+ mprotect_range( base, size, 0, 0 );
|
||||
+
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -4093,7 +4111,7 @@ NTSTATUS virtual_handle_fault( EXCEPTION_RECORD *rec, void *stack )
|
||||
}
|
||||
if (vprot & VPROT_WRITECOPY)
|
||||
{
|
||||
- set_page_vprot_bits( page, page_size, VPROT_WRITE, VPROT_WRITECOPY );
|
||||
+ set_page_vprot_bits( page, page_size, VPROT_WRITE | VPROT_WRITTEN, VPROT_WRITECOPY );
|
||||
mprotect_range( page, page_size, 0, 0 );
|
||||
}
|
||||
/* ignore fault if page is writable now */
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,39 +0,0 @@
|
||||
From b083e23347c3f50112410d1c886eb17c75f34a4e Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Wesie <awesie@gmail.com>
|
||||
Date: Fri, 24 Apr 2020 14:55:17 -0500
|
||||
Subject: [PATCH] ntdll: Report unmodified WRITECOPY pages as shared.
|
||||
|
||||
We also need to clear the modified bit after we clear memory in map_image to
|
||||
match the behavior of Windows.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48665
|
||||
Signed-off-by: Andrew Wesie <awesie@gmail.com>
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index b3d8b2f7a95..568a0cef74c 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -2897,6 +2897,8 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena
|
||||
ptr + sec->VirtualAddress + file_size,
|
||||
ptr + sec->VirtualAddress + end );
|
||||
memset( ptr + sec->VirtualAddress + file_size, 0, end - file_size );
|
||||
+ /* clear WRITTEN mark so QueryVirtualMemory returns correct values */
|
||||
+ set_page_vprot_bits( ptr + sec->VirtualAddress + file_size, 1, 0, VPROT_WRITTEN );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5326,7 +5328,7 @@ static void fill_working_set_info( struct fill_working_set_info_data *d, struct
|
||||
pagemap = d->pm_buffer[page - d->buffer_start];
|
||||
|
||||
p->VirtualAttributes.Valid = !(vprot & VPROT_GUARD) && (vprot & 0x0f) && (pagemap >> 63);
|
||||
- p->VirtualAttributes.Shared = !is_view_valloc( view ) && ((pagemap >> 61) & 1);
|
||||
+ p->VirtualAttributes.Shared = (!is_view_valloc( view ) && ((pagemap >> 61) & 1)) || ((view->protect & VPROT_WRITECOPY) && !(vprot & VPROT_WRITTEN));
|
||||
if (p->VirtualAttributes.Shared && p->VirtualAttributes.Valid)
|
||||
p->VirtualAttributes.ShareCount = 1; /* FIXME */
|
||||
if (p->VirtualAttributes.Valid)
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,65 +0,0 @@
|
||||
From 1d8b9ce07aaafd3184a118c8d986b54617571c7b Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Wesie <awesie@gmail.com>
|
||||
Date: Tue, 28 Apr 2020 03:27:16 -0500
|
||||
Subject: [PATCH] ntdll: Fallback to copy pages for WRITECOPY.
|
||||
|
||||
When a file is first mapped, whether it is mapped shared or private is
|
||||
determined by whether it is mapped with WRITECOPY. If the page protection later
|
||||
changes to include WRITECOPY, then virtual_handle_fault needs to change the page
|
||||
from shared to private. The only way to do this on Linux is to copy the page
|
||||
contents to a temporary location, map an anonymous page to the old location,
|
||||
then copy the contents to the new page.
|
||||
|
||||
Signed-off-by: Andrew Wesie <awesie@gmail.com>
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 25 +++++++++++++++++++++----
|
||||
1 file changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 71fe33cdb0e..ba5701d7bfe 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -1796,8 +1796,9 @@ static BOOL set_vprot( struct file_view *view, void *base, size_t size, BYTE vpr
|
||||
if (enable_write_exceptions && is_vprot_exec_write( vprot )) vprot |= VPROT_WRITEWATCH;
|
||||
unix_prot = get_unix_prot(vprot);
|
||||
|
||||
- /* check that we can map this memory with PROT_WRITE since we cannot fail later */
|
||||
- if (vprot & VPROT_WRITECOPY)
|
||||
+ /* check that we can map this memory with PROT_WRITE since we cannot fail later,
|
||||
+ * but we fallback to copying pages for read-only mappings in virtual_handle_fault */
|
||||
+ if ((vprot & VPROT_WRITECOPY) && (view->protect & VPROT_WRITECOPY))
|
||||
unix_prot |= PROT_WRITE;
|
||||
|
||||
if (mprotect_exec( base, size, unix_prot )) return FALSE;
|
||||
@@ -4111,10 +4112,26 @@ NTSTATUS virtual_handle_fault( EXCEPTION_RECORD *rec, void *stack )
|
||||
mprotect_range( page, page_size, 0, 0 );
|
||||
}
|
||||
}
|
||||
- if (vprot & VPROT_WRITECOPY)
|
||||
+ if ((vprot & VPROT_WRITECOPY) && (vprot & VPROT_COMMITTED))
|
||||
{
|
||||
+ struct file_view *view = find_view( page, 0 );
|
||||
+
|
||||
set_page_vprot_bits( page, page_size, VPROT_WRITE | VPROT_WRITTEN, VPROT_WRITECOPY );
|
||||
- mprotect_range( page, page_size, 0, 0 );
|
||||
+ if (view->protect & VPROT_WRITECOPY)
|
||||
+ {
|
||||
+ mprotect_range( page, page_size, 0, 0 );
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ static BYTE *temp_page = NULL;
|
||||
+ if (!temp_page)
|
||||
+ temp_page = anon_mmap_alloc( page_size, PROT_READ | PROT_WRITE );
|
||||
+
|
||||
+ /* original mapping is shared, replace with a private page */
|
||||
+ memcpy( temp_page, page, page_size );
|
||||
+ anon_mmap_fixed( page, page_size, get_unix_prot( vprot | VPROT_WRITE | VPROT_WRITTEN ), 0 );
|
||||
+ memcpy( page, temp_page, page_size );
|
||||
+ }
|
||||
}
|
||||
/* ignore fault if page is writable now */
|
||||
if (get_unix_prot( get_page_vprot( page ) ) & PROT_WRITE) ret = STATUS_SUCCESS;
|
||||
--
|
||||
2.45.2
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user