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
52 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f8cc3baab3 | ||
|
7665942477 | ||
|
0cd181d0ce | ||
|
a580edefe1 | ||
|
fe6cfefe64 | ||
|
6900845545 | ||
|
3e3ebf5cfc | ||
|
f48794a9ce | ||
|
27397d1764 | ||
|
ca7fc8fb51 | ||
|
cc0df4cd1b | ||
|
8791ceb20d | ||
|
09808df495 | ||
|
9c995c8d8e | ||
|
b72829659d | ||
|
88ffa2bda8 | ||
|
2524bc48fe | ||
|
00ec1171cc | ||
|
277ed0c6fb | ||
|
0c2c469c7b | ||
|
7f36a96808 | ||
|
566a2bcdfd | ||
|
4eb322dc41 | ||
|
182d6c76e3 | ||
|
3e931ce80f | ||
|
716e192182 | ||
|
fba1e773c7 | ||
|
26a1ee0ee9 | ||
|
9d65092519 | ||
|
49dcc78363 | ||
|
64774ec3e5 | ||
|
4211bac798 | ||
|
aaa21bda9c | ||
|
9d5115a9ee | ||
|
9cb0330037 | ||
|
abe75a7741 | ||
|
be92c5d768 | ||
|
6d45ccd523 | ||
|
6dbab0f2e5 | ||
|
e0766792bd | ||
|
df3886edb6 | ||
|
7bcf1f6358 | ||
|
cd4d265f07 | ||
|
cf29ed121d | ||
|
09634de79c | ||
|
68cc39d3ba | ||
|
3a47cfd8a5 | ||
|
fab4cd0932 | ||
|
2ac5cdbf37 | ||
|
e3a3dcd0ce | ||
|
aa36637563 | ||
|
70958b46d0 |
@@ -1,29 +0,0 @@
|
||||
From ff117878cb3a0c74a50355ca64ac36c5fe6cee67 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Fri, 10 Mar 2017 22:07:37 +0100
|
||||
Subject: ddraw: Silence noisy FIXME about unimplemented
|
||||
D3DPROCESSVERTICES_UPDATEEXTENTS.
|
||||
|
||||
---
|
||||
dlls/ddraw/executebuffer.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c
|
||||
index 393c52c1e2..9b64c687d3 100644
|
||||
--- a/dlls/ddraw/executebuffer.c
|
||||
+++ b/dlls/ddraw/executebuffer.c
|
||||
@@ -302,7 +302,10 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer,
|
||||
ci->wStart, ci->wDest, ci->dwCount, ci->dwFlags);
|
||||
|
||||
if (ci->dwFlags & D3DPROCESSVERTICES_UPDATEEXTENTS)
|
||||
- FIXME("D3DPROCESSVERTICES_UPDATEEXTENTS not implemented.\n");
|
||||
+ {
|
||||
+ static int once;
|
||||
+ if (!once++) FIXME("D3DPROCESSVERTICES_UPDATEEXTENTS not implemented.\n");
|
||||
+ }
|
||||
if (ci->dwFlags & D3DPROCESSVERTICES_NOCOLOR)
|
||||
FIXME("D3DPROCESSVERTICES_NOCOLOR not implemented.\n");
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -1,73 +0,0 @@
|
||||
From 98a9b8337d40c1f6df21227dff3d993f270aef46 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 24 May 2019 16:16:13 +1000
|
||||
Subject: [PATCH] dinput: Allow mapping of controls based of Genre type.
|
||||
|
||||
---
|
||||
dlls/dinput/device.c | 41 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 40 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
|
||||
index e826cc89c1e..a4815f24958 100644
|
||||
--- a/dlls/dinput/device.c
|
||||
+++ b/dlls/dinput/device.c
|
||||
@@ -1741,8 +1741,15 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
|
||||
|
||||
/* Count the actions */
|
||||
for (i = 0; i < format->dwNumActions; i++)
|
||||
- if (IsEqualGUID( &impl->guid, &format->rgoAction[i].guidInstance ))
|
||||
+ {
|
||||
+ if (IsEqualGUID(&impl->guid, &format->rgoAction[i].guidInstance) ||
|
||||
+ (IsEqualGUID(&IID_NULL, &format->rgoAction[i].guidInstance) &&
|
||||
+ ((format->rgoAction[i].dwSemantic & format->dwGenre) == format->dwGenre ||
|
||||
+ (format->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */) ))
|
||||
+ {
|
||||
num_actions++;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* Should return DI_NOEFFECT if we dont have any actions and actionformat has not changed */
|
||||
if (num_actions == 0 && format->dwCRC == new_crc && !(flags & DIDSAM_FORCESAVE)) return DI_NOEFFECT;
|
||||
@@ -1779,7 +1786,39 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
|
||||
|
||||
action++;
|
||||
}
|
||||
+ else if ((format->rgoAction[i].dwSemantic & format->dwGenre) == format->dwGenre ||
|
||||
+ (format->rgoAction[i].dwSemantic & 0xff000000) == 0xff000000 /* Any Axis */)
|
||||
+ {
|
||||
+ DWORD obj_id = semantic_to_obj_id(impl, format->rgoAction[i].dwSemantic);
|
||||
+ DWORD type = DIDFT_GETTYPE(obj_id);
|
||||
+ DWORD inst = DIDFT_GETINSTANCE(obj_id);
|
||||
+ LPDIOBJECTDATAFORMAT obj;
|
||||
+
|
||||
+ if (type == DIDFT_PSHBUTTON) type = DIDFT_BUTTON;
|
||||
+ else if (type == DIDFT_RELAXIS) type = DIDFT_AXIS;
|
||||
+
|
||||
+ obj = dataformat_to_odf_by_type(df, inst, type);
|
||||
+ TRACE("obj %p, inst 0x%08lx, type 0x%08lx\n", obj, inst, type);
|
||||
+ if(obj)
|
||||
+ {
|
||||
+ memcpy(&obj_df[action], obj, df->dwObjSize);
|
||||
+
|
||||
+ impl->action_map[action].uAppData = format->rgoAction[i].uAppData;
|
||||
+ impl->action_map[action].offset = offset;
|
||||
+ obj_df[action].dwOfs = offset;
|
||||
+ offset += (type & DIDFT_BUTTON) ? 1 : 4;
|
||||
+
|
||||
+ action++;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (action == 0)
|
||||
+ {
|
||||
+ free( obj_df );
|
||||
+ return DI_NOEFFECT;
|
||||
}
|
||||
+ data_format.dwNumObjs = action;
|
||||
|
||||
IDirectInputDevice8_SetDataFormat( iface, &data_format );
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
@@ -1,3 +1,5 @@
|
||||
Fixes: [34108] dinput: Improve support for user Joystick configuration.
|
||||
Fixes: [47326] dinput: Allow mapping of controls based of genre type.
|
||||
Fixes: [35815] dinput: Allow remapping of joystick buttons.
|
||||
# Seeing active work...
|
||||
Disabled: true
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From f4e3bbf1a91a5a99d703d3fee9a81a5c5089ab79 Mon Sep 17 00:00:00 2001
|
||||
From 5bc649eecc617214650f5af105f3ae6b6fae5a11 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Harmstone <mark@harmstone.com>
|
||||
Date: Fri, 27 Mar 2015 20:48:19 +0000
|
||||
Subject: [PATCH] dsound: Support getting and setting EAX buffer properties.
|
||||
@@ -11,12 +11,12 @@ Subject: [PATCH] dsound: Support getting and setting EAX buffer properties.
|
||||
4 files changed, 72 insertions(+)
|
||||
|
||||
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
|
||||
index b7a0fb26c4b..0aff7c96842 100644
|
||||
index 5c8c495bfe4..ede6d9f1ba1 100644
|
||||
--- a/dlls/dsound/buffer.c
|
||||
+++ b/dlls/dsound/buffer.c
|
||||
@@ -1127,6 +1127,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
|
||||
return DSERR_OUTOFMEMORY;
|
||||
}
|
||||
@@ -1107,6 +1107,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
|
||||
dsb->sec_mixpos = 0;
|
||||
dsb->state = STATE_STOPPED;
|
||||
|
||||
+ dsb->eax.reverb_mix = EAX_REVERBMIX_USEDISTANCE;
|
||||
+
|
||||
@@ -39,7 +39,7 @@ index c90d82d9a3f..2ee83b94ff9 100644
|
||||
}
|
||||
#endif
|
||||
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
|
||||
index a11379f0f88..9b537ad80a5 100644
|
||||
index 021844c414d..7a89b047b42 100644
|
||||
--- a/dlls/dsound/dsound_private.h
|
||||
+++ b/dlls/dsound/dsound_private.h
|
||||
@@ -177,6 +177,8 @@ struct IDirectSoundBufferImpl
|
||||
@@ -52,7 +52,7 @@ index a11379f0f88..9b537ad80a5 100644
|
||||
};
|
||||
|
||||
diff --git a/dlls/dsound/eax.c b/dlls/dsound/eax.c
|
||||
index cdd03becbee..3931681d295 100644
|
||||
index 13471aec3a9..03b6e0a9813 100644
|
||||
--- a/dlls/dsound/eax.c
|
||||
+++ b/dlls/dsound/eax.c
|
||||
@@ -178,6 +178,38 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
||||
@@ -134,5 +134,5 @@ index cdd03becbee..3931681d295 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
2.40.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 42c58e406220e9351337b079ae44364fbc39365d Mon Sep 17 00:00:00 2001
|
||||
From e484e3dc512eacc9708c245a9e64372428bc1875 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Harmstone <mark@harmstone.com>
|
||||
Date: Fri, 27 Mar 2015 20:58:37 +0000
|
||||
Subject: [PATCH] dsound: Add EAX init and free stubs.
|
||||
@@ -10,11 +10,11 @@ Subject: [PATCH] dsound: Add EAX init and free stubs.
|
||||
3 files changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c
|
||||
index 22b23c9f877..72e96765883 100644
|
||||
index ede6d9f1ba1..309d632397a 100644
|
||||
--- a/dlls/dsound/buffer.c
|
||||
+++ b/dlls/dsound/buffer.c
|
||||
@@ -1152,6 +1152,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
|
||||
DSOUND_RecalcVolPan(&(dsb->volpan));
|
||||
@@ -1145,6 +1145,8 @@ HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *ds
|
||||
}
|
||||
|
||||
InitializeSRWLock(&dsb->lock);
|
||||
+ if (dsb->device->eax.using_eax)
|
||||
@@ -22,7 +22,7 @@ index 22b23c9f877..72e96765883 100644
|
||||
|
||||
/* register buffer */
|
||||
err = DirectSoundDevice_AddBuffer(device, dsb);
|
||||
@@ -1193,6 +1195,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
|
||||
@@ -1186,6 +1188,8 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This)
|
||||
free(This->filters);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ index 22b23c9f877..72e96765883 100644
|
||||
|
||||
free(This);
|
||||
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
|
||||
index 09566b28a12..703b5da8225 100644
|
||||
index 7a89b047b42..c5e84f07763 100644
|
||||
--- a/dlls/dsound/dsound_private.h
|
||||
+++ b/dlls/dsound/dsound_private.h
|
||||
@@ -240,6 +240,8 @@ HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
||||
@@ -97,5 +97,5 @@ index 03b6e0a9813..91438efc335 100644
|
||||
|
||||
HRESULT WINAPI EAX_Get(IDirectSoundBufferImpl *buf, REFGUID guidPropSet,
|
||||
--
|
||||
2.39.2
|
||||
2.40.1
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
Fixes: Improve performance of bilinear bitmap scaling
|
||||
Disabled: True
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From be7001f58850fb46ee07e9b4fba310c64157ee0f Mon Sep 17 00:00:00 2001
|
||||
From 2a1229098b39f923ff6e9a13bde05e161c797b0a 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 2f4dc06f6ce..7345b78eaeb 100644
|
||||
index 8f3cd8acae7..072f1fab23a 100644
|
||||
--- a/dlls/user32/input.c
|
||||
+++ b/dlls/user32/input.c
|
||||
@@ -494,7 +494,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
|
||||
@@ -499,7 +499,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ index 2f4dc06f6ce..7345b78eaeb 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 ee39b11fc12..35670ca7538 100644
|
||||
index 8f3d5750c2f..3bdfd042e85 100644
|
||||
--- a/dlls/user32/tests/input.c
|
||||
+++ b/dlls/user32/tests/input.c
|
||||
@@ -4899,6 +4899,40 @@ static void test_EnableMouseInPointer( char **argv, BOOL enable )
|
||||
@@ -5091,6 +5091,40 @@ static void test_EnableMouseInPointer( char **argv, BOOL enable )
|
||||
CloseHandle( info.hProcess );
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ index ee39b11fc12..35670ca7538 100644
|
||||
START_TEST(input)
|
||||
{
|
||||
char **argv;
|
||||
@@ -4949,6 +4983,7 @@ START_TEST(input)
|
||||
@@ -5142,6 +5176,7 @@ START_TEST(input)
|
||||
test_GetRawInputBuffer();
|
||||
test_RegisterRawInputDevices();
|
||||
test_rawinput(argv[0]);
|
||||
@@ -78,10 +78,10 @@ index ee39b11fc12..35670ca7538 100644
|
||||
|
||||
if(pGetMouseMovePointsEx)
|
||||
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
|
||||
index 36f2a45f4ef..bf4e871d107 100644
|
||||
index 11bb129134c..9864d80ceff 100644
|
||||
--- a/dlls/win32u/input.c
|
||||
+++ b/dlls/win32u/input.c
|
||||
@@ -1187,11 +1187,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
||||
@@ -1250,11 +1250,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
||||
*/
|
||||
UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
{
|
||||
@@ -94,7 +94,7 @@ index 36f2a45f4ef..bf4e871d107 100644
|
||||
HKL layout;
|
||||
|
||||
TRACE_(keyboard)( "size %d, layouts %p.\n", size, layouts );
|
||||
@@ -1205,33 +1201,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
@@ -1268,33 +1264,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
if (size && layouts)
|
||||
{
|
||||
layouts[count - 1] = layout;
|
||||
@@ -111,10 +111,10 @@ index 36f2a45f4ef..bf4e871d107 100644
|
||||
- tmp = wcstoul( key_info->Name, NULL, 16 );
|
||||
- if (query_reg_ascii_value( subkey, "Layout Id", value_info, sizeof(buffer) ) &&
|
||||
- value_info->Type == REG_SZ)
|
||||
- tmp = MAKELONG( LOWORD( tmp ),
|
||||
- 0xf000 | (wcstoul( (const WCHAR *)value_info->Data, NULL, 16 ) & 0xfff) );
|
||||
- tmp = 0xf000 | (wcstoul( (const WCHAR *)value_info->Data, NULL, 16 ) & 0xfff);
|
||||
- NtClose( subkey );
|
||||
-
|
||||
- tmp = MAKELONG( LOWORD( layout ), LOWORD( tmp ) );
|
||||
- if (layout == UlongToHandle( tmp )) continue;
|
||||
-
|
||||
- count++;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From eba9e414d60a33dfde7e7b978fcdddbaf9bfe5b6 Mon Sep 17 00:00:00 2001
|
||||
From 612c0266b7a8cec562f82f1a2aaf55cffc15f35e Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 21 Oct 2020 16:03:21 -0500
|
||||
Subject: [PATCH] winegstreamer: Allow videoconvert to parallelize.
|
||||
@@ -11,19 +11,19 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
|
||||
index 0573c99858b..5df08dc5fd7 100644
|
||||
index dfb3da9a4ab..2135dea456b 100644
|
||||
--- a/dlls/winegstreamer/wg_parser.c
|
||||
+++ b/dlls/winegstreamer/wg_parser.c
|
||||
@@ -760,6 +760,9 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
|
||||
if (!(vconv = create_element("videoconvert", "base")))
|
||||
goto out;
|
||||
@@ -842,6 +842,9 @@ static bool stream_create_post_processing_elements(struct wg_parser_stream *stre
|
||||
|| !append_element(parser->container, element, &first, &last))
|
||||
return false;
|
||||
|
||||
+ /* Let GStreamer choose a default number of threads. */
|
||||
+ gst_util_set_object_arg(G_OBJECT(vconv), "n-threads", "0");
|
||||
+ gst_util_set_object_arg(G_OBJECT(element), "n-threads", "0");
|
||||
+
|
||||
/* GStreamer outputs RGB video top-down, but DirectShow expects bottom-up. */
|
||||
if (!(flip = create_element("videoflip", "good")))
|
||||
goto out;
|
||||
if (!(element = create_element("videoflip", "good"))
|
||||
|| !append_element(parser->container, element, &first, &last))
|
||||
--
|
||||
2.37.2
|
||||
2.39.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From e1c18d8fda84e300fc6ae2b90bf3770c4f2bb2c7 Mon Sep 17 00:00:00 2001
|
||||
From 7d0af0dc23f87241726af6f7c48f47df441503a6 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Fri, 19 Mar 2021 17:01:54 -0400
|
||||
Subject: [PATCH] winegstreamer: Report streams backwards in media source.
|
||||
@@ -9,18 +9,18 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
|
||||
index 542189b28f5..a9e97f545dd 100644
|
||||
index 335b617becd..e6117fd0090 100644
|
||||
--- a/dlls/winegstreamer/media_source.c
|
||||
+++ b/dlls/winegstreamer/media_source.c
|
||||
@@ -1496,7 +1496,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
|
||||
DWORD len;
|
||||
char *str;
|
||||
|
||||
- IMFMediaStream_GetStreamDescriptor(&object->streams[i]->IMFMediaStream_iface, &descriptors[i]);
|
||||
+ IMFMediaStream_GetStreamDescriptor(&object->streams[i]->IMFMediaStream_iface, &descriptors[object->stream_count - 1 - i]);
|
||||
|
||||
for (j = 0; j < ARRAY_SIZE(tags); ++j)
|
||||
{
|
||||
@@ -1604,7 +1604,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_
|
||||
}
|
||||
strW = malloc(len * sizeof(*strW));
|
||||
if (MultiByteToWideChar(CP_UTF8, 0, str, -1, strW, len))
|
||||
- IMFStreamDescriptor_SetString(object->descriptors[i], tags[j].mf_attr, strW);
|
||||
+ IMFStreamDescriptor_SetString(object->descriptors[object->stream_count - 1 - i], tags[j].mf_attr, strW);
|
||||
free(strW);
|
||||
free(str);
|
||||
}
|
||||
--
|
||||
2.38.1
|
||||
2.40.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 56ad22a46d27fdc5313aff459f6334bb0051e21a Mon Sep 17 00:00:00 2001
|
||||
From af54761b8536f81831f2813ef0ff9b627dcc5ca4 Mon Sep 17 00:00:00 2001
|
||||
From: Nikolay Sivov <nsivov@codeweavers.com>
|
||||
Date: Wed, 12 Jan 2022 22:48:35 +0300
|
||||
Subject: [PATCH] winegstreamer: Add MFVideoFormat_ARGB32 output for the
|
||||
@@ -12,10 +12,10 @@ CW-Bug-Id: #19975
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
|
||||
index de6a2c2b232..042c635ae93 100644
|
||||
index 00c40dc2f47..7a0f65b4247 100644
|
||||
--- a/dlls/winegstreamer/media_source.c
|
||||
+++ b/dlls/winegstreamer/media_source.c
|
||||
@@ -855,7 +855,7 @@ static HRESULT new_media_stream(struct media_source *source,
|
||||
@@ -856,7 +856,7 @@ static HRESULT new_media_stream(struct media_source *source,
|
||||
static HRESULT media_stream_init_desc(struct media_stream *stream)
|
||||
{
|
||||
IMFMediaTypeHandler *type_handler = NULL;
|
||||
@@ -24,14 +24,14 @@ index de6a2c2b232..042c635ae93 100644
|
||||
struct wg_format format;
|
||||
DWORD type_count = 0;
|
||||
unsigned int i;
|
||||
@@ -874,6 +874,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
|
||||
&MFVideoFormat_YUY2,
|
||||
&MFVideoFormat_IYUV,
|
||||
&MFVideoFormat_I420,
|
||||
+ &MFVideoFormat_ARGB32,
|
||||
@@ -875,6 +875,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
|
||||
WG_VIDEO_FORMAT_YV12,
|
||||
WG_VIDEO_FORMAT_YUY2,
|
||||
WG_VIDEO_FORMAT_I420,
|
||||
+ WG_VIDEO_FORMAT_BGRA,
|
||||
};
|
||||
|
||||
IMFMediaType *base_type = mf_media_type_from_wg_format(&format);
|
||||
--
|
||||
2.37.2
|
||||
2.40.0
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
Fixes: [49692] Multiple applications need a Media Foundation media source implementation
|
||||
Disabled: True
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 5814a4b9c7d4dec027b0c2dd29822664aa56ada1 Mon Sep 17 00:00:00 2001
|
||||
From 5a81a28605ec0b32b020c84032e3f4a35d0e4768 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Tue, 14 Jan 2020 21:39:23 +0300
|
||||
Subject: [PATCH] ntdll: Increase step after failed map attempt in
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Increase step after failed map attempt in
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 84a4e331ad7..a63882023e6 100644
|
||||
index 2e61e8ba22f..039007f6a9b 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -1327,6 +1327,7 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
@@ -1336,6 +1336,7 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
step == 0)
|
||||
break;
|
||||
start = (char *)start + step;
|
||||
@@ -21,5 +21,5 @@ index 84a4e331ad7..a63882023e6 100644
|
||||
|
||||
return NULL;
|
||||
--
|
||||
2.38.1
|
||||
2.40.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From b1e6d32e7dc3bac93419f3a573f509ee6e1177b2 Mon Sep 17 00:00:00 2001
|
||||
From b7c39298824976bbbc8788b60aa4195f3815d3b9 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Thu, 23 Jul 2020 18:40:39 +0300
|
||||
Subject: [PATCH] ntdll: Increase free ranges view block size on 64 bit.
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] ntdll: Increase free ranges view block size on 64 bit.
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index a63882023e6..83909f57d4a 100644
|
||||
index 039007f6a9b..82a0a91cf14 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -205,7 +205,11 @@ static BYTE *pages_vprot;
|
||||
@@ -212,7 +212,11 @@ static BYTE *pages_vprot;
|
||||
#endif
|
||||
|
||||
static struct file_view *view_block_start, *view_block_end, *next_free_view;
|
||||
@@ -24,5 +24,5 @@ index a63882023e6..83909f57d4a 100644
|
||||
static void *preload_reserve_end;
|
||||
static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */
|
||||
--
|
||||
2.38.1
|
||||
2.40.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From c3252fd68ecdcc0186b4d284df1b36ea11ca7d7f Mon Sep 17 00:00:00 2001
|
||||
From 5be3a73fdd9728f6280a2c0b790166c94309bf73 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, 227 insertions(+), 223 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 83909f57d4a..4bce8f2f806 100644
|
||||
index 13aa67c2d82..fd5bb86e6de 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -1266,44 +1266,15 @@ static struct file_view *find_view_range( const void *addr, size_t size )
|
||||
@@ -1275,44 +1275,15 @@ static struct file_view *find_view_range( const void *addr, size_t size )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
|
||||
/***********************************************************************
|
||||
* try_map_free_area
|
||||
@@ -1337,110 +1308,6 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
@@ -1346,110 +1317,6 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
/***********************************************************************
|
||||
* add_reserved_area
|
||||
*
|
||||
@@ -1608,8 +1475,7 @@ static void free_view( struct file_view *view )
|
||||
@@ -1617,8 +1484,7 @@ static void free_view( struct file_view *view )
|
||||
*/
|
||||
static void unregister_view( struct file_view *view )
|
||||
{
|
||||
@@ -193,7 +193,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
wine_rb_remove( &views_tree, &view->entry );
|
||||
}
|
||||
|
||||
@@ -1636,8 +1502,7 @@ static void delete_view( struct file_view *view ) /* [in] View */
|
||||
@@ -1646,8 +1512,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 );
|
||||
@@ -203,7 +203,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
}
|
||||
|
||||
|
||||
@@ -1906,55 +1771,229 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want
|
||||
@@ -1916,55 +1781,229 @@ static inline void *unmap_extra_space( void *ptr, size_t total_size, size_t want
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -241,7 +241,10 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
+
|
||||
+ if (area->map_area_end <= (char *)start)
|
||||
+ return 0;
|
||||
+
|
||||
|
||||
- if (start < address_space_start) start = address_space_start;
|
||||
- if (is_beyond_limit( start, size, alloc->limit )) end = alloc->limit;
|
||||
- if (start >= end) return 0;
|
||||
+ if ((ULONG_PTR)area->map_area_end < area->size)
|
||||
+ return 1;
|
||||
+
|
||||
@@ -255,10 +258,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
+ alloc_start, area->size, area->unix_prot )))
|
||||
+ return 1;
|
||||
+ }
|
||||
|
||||
- if (start < address_space_start) start = address_space_start;
|
||||
- if (is_beyond_limit( start, size, alloc->limit )) end = alloc->limit;
|
||||
- if (start >= end) return 0;
|
||||
+
|
||||
+ if (intersect_end - intersect_start >= area->size)
|
||||
+ {
|
||||
+ alloc_start = ROUND_ADDR( intersect_end - area->size, align_mask );
|
||||
@@ -467,7 +467,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
/***********************************************************************
|
||||
* map_fixed_area
|
||||
*
|
||||
@@ -2019,6 +2058,8 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
@@ -2029,6 +2068,8 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
void *ptr;
|
||||
NTSTATUS status;
|
||||
|
||||
@@ -475,9 +475,9 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
+
|
||||
if (alloc_type & MEM_REPLACE_PLACEHOLDER)
|
||||
{
|
||||
if ((*view_ret = find_view( base, 0 )))
|
||||
@@ -2044,6 +2085,8 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
struct file_view *view;
|
||||
@@ -2046,6 +2087,8 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+ if (!align_mask) align_mask = granularity_mask;
|
||||
@@ -485,7 +485,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
if (base)
|
||||
{
|
||||
if (is_beyond_limit( base, size, address_space_limit ))
|
||||
@@ -2052,52 +2095,10 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
@@ -2056,52 +2099,10 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
if (status != STATUS_SUCCESS) return status;
|
||||
ptr = base;
|
||||
}
|
||||
@@ -540,7 +540,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
status = create_view( view_ret, ptr, size, vprot );
|
||||
if (status != STATUS_SUCCESS) unmap_area( ptr, size );
|
||||
return status;
|
||||
@@ -2758,6 +2759,7 @@ static NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_PTR z
|
||||
@@ -3050,6 +3051,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 );
|
||||
@@ -548,7 +548,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2826,6 +2828,7 @@ void virtual_init(void)
|
||||
@@ -3118,6 +3120,7 @@ void virtual_init(void)
|
||||
if (preload_reserve_start)
|
||||
address_space_start = min( address_space_start, preload_reserve_start );
|
||||
}
|
||||
@@ -556,7 +556,7 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
}
|
||||
|
||||
/* try to find space in a reserved area for the views and pages protection table */
|
||||
@@ -5579,6 +5582,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL
|
||||
@@ -5842,6 +5845,7 @@ NTSTATUS WINAPI NtWow64AllocateVirtualMemory64( HANDLE process, ULONG64 *ret, UL
|
||||
*ret = (ULONG_PTR)base;
|
||||
*size_ptr = size;
|
||||
}
|
||||
@@ -565,5 +565,5 @@ index 83909f57d4a..4bce8f2f806 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.38.1
|
||||
2.40.1
|
||||
|
||||
|
@@ -1,25 +1,35 @@
|
||||
From d29a79d8cca2220c838fbbea6ea81b9f73070ba5 Mon Sep 17 00:00:00 2001
|
||||
From bd1c2ee8168bc923e3040af04ea3bebc8c021ea5 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Tue, 2 Jun 2020 21:06:33 +0300
|
||||
Subject: [PATCH] ntdll: Exclude natively mapped areas from free areas list.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 118 ++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 100 insertions(+), 18 deletions(-)
|
||||
dlls/ntdll/unix/virtual.c | 126 ++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 107 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 4bce8f2f806..3c1bf6edc30 100644
|
||||
index b189ded181b..00569e5e24c 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -125,6 +125,7 @@ struct file_view
|
||||
@@ -130,6 +130,7 @@ C_ASSERT( offsetof( struct file_view, entry ) == 0 );
|
||||
#define VPROT_SYSTEM 0x0200 /* system view (underlying mmap not under our control) */
|
||||
#define VPROT_PLACEHOLDER 0x0400
|
||||
#define VPROT_FROMPLACEHOLDER 0x0800
|
||||
#define VPROT_PLACEHOLDER 0x0400
|
||||
#define VPROT_FREE_PLACEHOLDER 0x0800
|
||||
+#define VPROT_NATIVE 0x1000
|
||||
|
||||
/* Conversion from VPROT_* to Win32 flags */
|
||||
static const BYTE VIRTUAL_Win32Flags[16] =
|
||||
@@ -1119,7 +1120,9 @@ static void dump_view( struct file_view *view )
|
||||
@@ -184,6 +185,9 @@ static void *working_set_limit = (void *)0x7fff0000;
|
||||
|
||||
static UINT64 *arm64ec_map;
|
||||
|
||||
+static const ptrdiff_t max_try_map_step = 0x40000000;
|
||||
+static BOOL increase_try_map_step = TRUE;
|
||||
+
|
||||
struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000;
|
||||
|
||||
/* TEB allocation blocks */
|
||||
@@ -1164,7 +1168,9 @@ static void dump_view( struct file_view *view )
|
||||
BYTE prot = get_page_vprot( addr );
|
||||
|
||||
TRACE( "View: %p - %p", addr, addr + view->size - 1 );
|
||||
@@ -28,9 +38,9 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
+ TRACE(" (native)\n");
|
||||
+ else if (view->protect & VPROT_SYSTEM)
|
||||
TRACE( " (builtin image)\n" );
|
||||
else if (view->protect & VPROT_PLACEHOLDER)
|
||||
else if (view->protect & VPROT_FREE_PLACEHOLDER)
|
||||
TRACE( " (placeholder)\n" );
|
||||
@@ -1274,6 +1277,8 @@ struct alloc_area
|
||||
@@ -1283,6 +1289,8 @@ struct alloc_area
|
||||
int unix_prot;
|
||||
BOOL top_down;
|
||||
UINT_PTR align_mask;
|
||||
@@ -39,7 +49,7 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
@@ -1282,21 +1287,28 @@ struct alloc_area
|
||||
@@ -1291,27 +1299,35 @@ struct alloc_area
|
||||
* Try mmaping some expected free memory region, eventually stepping and
|
||||
* retrying inside it, and return where it actually succeeded, or NULL.
|
||||
*/
|
||||
@@ -73,7 +83,15 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
if ((step > 0 && (char *)end - (char *)start < step) ||
|
||||
(step < 0 && (char *)start - (char *)base < -step) ||
|
||||
step == 0)
|
||||
@@ -1797,9 +1809,9 @@ static int alloc_area_in_reserved_or_between_callback( void *start, SIZE_T size,
|
||||
break;
|
||||
start = (char *)start + step;
|
||||
- step *= 2;
|
||||
+ if (increase_try_map_step && llabs(step) < max_try_map_step)
|
||||
+ step *= 2;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1807,9 +1823,9 @@ static int alloc_area_in_reserved_or_between_callback( void *start, SIZE_T size,
|
||||
assert(intersect_start <= intersect_end);
|
||||
if (area->map_area_end - intersect_end >= area->size)
|
||||
{
|
||||
@@ -86,7 +104,7 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1838,8 +1850,8 @@ static int alloc_area_in_reserved_or_between_callback( void *start, SIZE_T size,
|
||||
@@ -1848,8 +1864,8 @@ static int alloc_area_in_reserved_or_between_callback( void *start, SIZE_T size,
|
||||
if (intersect_start - area->map_area_start >= area->size)
|
||||
{
|
||||
alloc_start = ROUND_ADDR( area->map_area_start + align_mask, align_mask );
|
||||
@@ -97,7 +115,7 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1900,8 +1912,7 @@ static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char
|
||||
@@ -1910,8 +1926,7 @@ static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char
|
||||
if (start >= area->map_area_end || start < area->map_area_start)
|
||||
return NULL;
|
||||
|
||||
@@ -107,7 +125,7 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1911,8 +1922,7 @@ static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char
|
||||
@@ -1921,8 +1936,7 @@ static void *alloc_free_area_in_range( struct alloc_area *area, char *base, char
|
||||
|| area->map_area_end - start < area->size)
|
||||
return NULL;
|
||||
|
||||
@@ -117,15 +135,15 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1922,6 +1932,7 @@ static void *alloc_free_area( void *limit, size_t size, BOOL top_down, int unix_
|
||||
char *reserve_start, *reserve_end;
|
||||
@@ -1933,6 +1947,7 @@ static void *alloc_free_area( void *limit, size_t size, BOOL top_down, int unix_
|
||||
struct alloc_area area;
|
||||
char *base, *end;
|
||||
+ NTSTATUS status;
|
||||
int ranges_inc;
|
||||
+ UINT status;
|
||||
|
||||
TRACE("limit %p, size %p, top_down %#x.\n", limit, (void *)size, top_down);
|
||||
@@ -1991,7 +2002,58 @@ static void *alloc_free_area( void *limit, size_t size, BOOL top_down, int unix_
|
||||
|
||||
@@ -2001,7 +2016,58 @@ static void *alloc_free_area( void *limit, size_t size, BOOL top_down, int unix_
|
||||
if ((area.result = alloc_free_area_in_range( &area, base, end )))
|
||||
break;
|
||||
}
|
||||
@@ -177,7 +195,7 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
+ }
|
||||
+ if ((status = create_view( &next, native_mapped_start, native_mapped_end - native_mapped_start,
|
||||
+ VPROT_SYSTEM | VPROT_NATIVE )))
|
||||
+ ERR("Could not cretae view for natively mapped area, status %#x.\n", status);
|
||||
+ ERR("Could not create view for natively mapped area, status %#x.\n", status);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -185,7 +203,7 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -2045,6 +2107,17 @@ static NTSTATUS map_fixed_area( void *base, size_t size, unsigned int vprot )
|
||||
@@ -2055,6 +2121,17 @@ static NTSTATUS map_fixed_area( void *base, size_t size, unsigned int vprot )
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -203,20 +221,22 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
/***********************************************************************
|
||||
* map_view
|
||||
*
|
||||
@@ -2097,7 +2170,11 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
@@ -2114,7 +2191,13 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
|
||||
}
|
||||
else if (!(ptr = alloc_free_area( (void *)limit, size, top_down, get_unix_prot( vprot ), align_mask )))
|
||||
{
|
||||
- return STATUS_NO_MEMORY;
|
||||
+ WARN("Allocation failed, clearing native views.\n");
|
||||
+ WARN( "Allocation failed, clearing native views.\n" );
|
||||
+
|
||||
+ clear_native_views();
|
||||
+ if (!(ptr = alloc_free_area( (void *)limit, size, top_down, get_unix_prot( vprot ), align_mask )))
|
||||
+ return STATUS_NO_MEMORY;
|
||||
+ if (!is_win64) increase_try_map_step = FALSE;
|
||||
+ ptr = alloc_free_area( (void *)limit, size, top_down, get_unix_prot( vprot ), align_mask );
|
||||
+ if (!is_win64) increase_try_map_step = TRUE;
|
||||
+ if (!ptr) return STATUS_NO_MEMORY;
|
||||
}
|
||||
status = create_view( view_ret, ptr, size, vprot );
|
||||
if (status != STATUS_SUCCESS) unmap_area( ptr, size );
|
||||
@@ -3835,7 +3912,12 @@ void virtual_set_force_exec( BOOL enable )
|
||||
@@ -4106,7 +4189,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 */
|
||||
@@ -231,5 +251,5 @@ index 4bce8f2f806..3c1bf6edc30 100644
|
||||
mprotect_range( view->base, view->size, commit, 0 );
|
||||
}
|
||||
--
|
||||
2.38.1
|
||||
2.40.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 0dfebc8cb8ed9804c6616fe7eec519b7c3e7ea13 Mon Sep 17 00:00:00 2001
|
||||
From 3c2f30734ab4ab7a602f1f66d415a245063ee6d8 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.
|
||||
@@ -13,10 +13,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
5 files changed, 447 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 16c4c33d816..e492a707a48 100644
|
||||
index c4f34e9e851..ec76805b3e6 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2061,6 +2061,8 @@ AC_CHECK_FUNCS(\
|
||||
@@ -2025,6 +2025,8 @@ AC_CHECK_FUNCS(\
|
||||
prctl \
|
||||
proc_pidinfo \
|
||||
sched_yield \
|
||||
@@ -26,12 +26,12 @@ index 16c4c33d816..e492a707a48 100644
|
||||
setprogname \
|
||||
sigprocmask \
|
||||
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
|
||||
index 89e4d5bb579..07688a5fcf6 100644
|
||||
index 2e862c68b7e..f8ca3e689ec 100644
|
||||
--- a/dlls/ntdll/Makefile.in
|
||||
+++ b/dlls/ntdll/Makefile.in
|
||||
@@ -4,7 +4,7 @@ UNIXLIB = ntdll.so
|
||||
IMPORTLIB = ntdll
|
||||
IMPORTS = winecrt0
|
||||
IMPORTS = $(MUSL_PE_LIBS) winecrt0
|
||||
UNIX_CFLAGS = $(UNWIND_CFLAGS)
|
||||
-UNIX_LIBS = $(IOKIT_LIBS) $(COREFOUNDATION_LIBS) $(CORESERVICES_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) $(UNWIND_LIBS) $(I386_LIBS) $(PROCSTAT_LIBS)
|
||||
+UNIX_LIBS = $(IOKIT_LIBS) $(COREFOUNDATION_LIBS) $(CORESERVICES_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) $(UNWIND_LIBS) $(I386_LIBS) $(PROCSTAT_LIBS) -lm
|
||||
@@ -39,7 +39,7 @@ index 89e4d5bb579..07688a5fcf6 100644
|
||||
EXTRADLLFLAGS = -nodefaultlibs
|
||||
i386_EXTRADLLFLAGS = -Wl,--image-base,0x7bc00000
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 98d9e6b3b0a..93e50bd6952 100644
|
||||
index 6186afdfb63..7f753caef47 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -38,6 +38,7 @@
|
||||
@@ -50,7 +50,7 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
|
||||
#ifndef IO_COMPLETION_ALL_ACCESS
|
||||
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
|
||||
@@ -5326,32 +5327,154 @@ static void test_mailslot_name(void)
|
||||
@@ -5406,32 +5407,154 @@ static void test_mailslot_name(void)
|
||||
CloseHandle( device );
|
||||
}
|
||||
|
||||
@@ -101,7 +101,9 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
+ INT buffer_len;
|
||||
+ HANDLE handle;
|
||||
+ BOOL bret;
|
||||
+
|
||||
|
||||
- pRtlInitUnicodeString( &nameW, L"\\??\\C:\\" );
|
||||
- InitializeObjectAttributes( &attr, &nameW, 0, NULL, NULL );
|
||||
+ /* Create a temporary folder for the junction point tests */
|
||||
+ GetTempFileNameW(dotW, fooW, 0, path);
|
||||
+ DeleteFileW(path);
|
||||
@@ -110,7 +112,9 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
+ win_skip("Unable to create a temporary junction point directory.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
||||
- status = pNtOpenFile( &handle, READ_CONTROL, &attr, &io, 0, 0 );
|
||||
- ok( !status, "open %s failed %#lx\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||
+ /* Check that the volume this folder is located on supports junction points */
|
||||
+ pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
|
||||
+ volW[0] = nameW.Buffer[4];
|
||||
@@ -127,15 +131,17 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
+ RemoveDirectoryW(path);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
||||
- 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 );
|
||||
+ /* 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 = 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 a destination folder for the junction point to target */
|
||||
+ lstrcpyW(target_path, path);
|
||||
+ for (int i=0; i<1; i++)
|
||||
@@ -148,8 +154,9 @@ index 98d9e6b3b0a..93e50bd6952 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 );
|
||||
- /* 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 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 +166,8 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
+ lstrcatW(long_path, path);
|
||||
+ }
|
||||
+ lstrcatW(long_path, targetW);
|
||||
+
|
||||
|
||||
- CloseHandle( handle );
|
||||
+ /* 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);
|
||||
@@ -173,9 +181,7 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
+ ok(!bret && GetLastError()==ERROR_INVALID_REPARSE_DATA, "Unexpected error (0x%lx)\n", GetLastError());
|
||||
+ 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 );
|
||||
+
|
||||
+ /* construct a long pathname to demonstrate correct behavior with very large reparse points */
|
||||
+ pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
|
||||
+ lstrcpyW(long_path, nameW.Buffer);
|
||||
@@ -185,16 +191,11 @@ index 98d9e6b3b0a..93e50bd6952 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 );
|
||||
+
|
||||
+ /* 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 98d9e6b3b0a..93e50bd6952 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,7 +222,7 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
}
|
||||
|
||||
START_TEST(file)
|
||||
@@ -5426,6 +5549,6 @@ START_TEST(file)
|
||||
@@ -5506,6 +5629,6 @@ START_TEST(file)
|
||||
test_ioctl();
|
||||
test_query_ea();
|
||||
test_flush_buffers_file();
|
||||
@@ -231,7 +231,7 @@ index 98d9e6b3b0a..93e50bd6952 100644
|
||||
+ test_mailslot_name();
|
||||
}
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
index eca75b2d4fb..0cef6438c7e 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -36,6 +36,8 @@
|
||||
@@ -243,7 +243,7 @@ index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_MNTENT_H
|
||||
@@ -121,6 +123,7 @@
|
||||
@@ -125,6 +127,7 @@
|
||||
#include "wine/list.h"
|
||||
#include "wine/debug.h"
|
||||
#include "unix_private.h"
|
||||
@@ -251,7 +251,7 @@ index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(file);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
@@ -132,6 +135,12 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
@@ -136,6 +139,12 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
#undef EXT2_IOC_GETFLAGS
|
||||
#undef EXT4_CASEFOLD_FL
|
||||
|
||||
@@ -264,7 +264,7 @@ index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
#ifdef linux
|
||||
|
||||
/* We want the real kernel dirent structure, not the libc one */
|
||||
@@ -236,6 +245,95 @@ static const BOOL is_case_sensitive = FALSE;
|
||||
@@ -247,6 +256,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 +360,7 @@ index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
/* check if a given Unicode char is OK in a DOS short name */
|
||||
static inline BOOL is_invalid_dos_char( WCHAR ch )
|
||||
{
|
||||
@@ -1540,6 +1638,28 @@ static int parse_samba_dos_attrib_data( char *data, int len )
|
||||
@@ -1562,6 +1660,28 @@ static int parse_samba_dos_attrib_data( char *data, int len )
|
||||
}
|
||||
|
||||
|
||||
@@ -389,7 +389,7 @@ index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
static BOOL fd_is_mount_point( int fd, const struct stat *st )
|
||||
{
|
||||
struct stat parent;
|
||||
@@ -3313,6 +3433,181 @@ done:
|
||||
@@ -3335,6 +3455,181 @@ done:
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +571,7 @@ index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
/******************************************************************************
|
||||
* lookup_unix_name
|
||||
*
|
||||
@@ -6072,6 +6367,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
|
||||
@@ -6099,6 +6394,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -586,10 +586,10 @@ index 6b73d9dc7e8..52b85cfc6d1 100644
|
||||
TRACE("FSCTL_SET_SPARSE: Ignoring request\n");
|
||||
io->Information = 0;
|
||||
diff --git a/include/Makefile.in b/include/Makefile.in
|
||||
index 28ac4b3f2dc..7c69ddbfddf 100644
|
||||
index f52314e745d..2ec4d835743 100644
|
||||
--- a/include/Makefile.in
|
||||
+++ b/include/Makefile.in
|
||||
@@ -564,6 +564,7 @@ SOURCES = \
|
||||
@@ -572,6 +572,7 @@ SOURCES = \
|
||||
ntdef.h \
|
||||
ntdsapi.h \
|
||||
ntgdi.h \
|
||||
@@ -598,5 +598,5 @@ index 28ac4b3f2dc..7c69ddbfddf 100644
|
||||
ntquery.h \
|
||||
ntsecapi.h \
|
||||
--
|
||||
2.38.1
|
||||
2.39.2
|
||||
|
||||
|
@@ -1,105 +0,0 @@
|
||||
From 7c13335d926a1b47f7cf88065d641c4d5fa80a59 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Fri, 11 Nov 2022 17:51:26 -0600
|
||||
Subject: [PATCH] ntdll/tests: Add tests for freeing a part of view.
|
||||
|
||||
---
|
||||
dlls/ntdll/tests/virtual.c | 70 ++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 67 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
|
||||
index 6831fe3c522..8e94566fb7f 100644
|
||||
--- a/dlls/ntdll/tests/virtual.c
|
||||
+++ b/dlls/ntdll/tests/virtual.c
|
||||
@@ -1639,21 +1639,85 @@ static void test_syscalls(void)
|
||||
|
||||
static void test_NtFreeVirtualMemory(void)
|
||||
{
|
||||
+ void *addr1, *addr;
|
||||
NTSTATUS status;
|
||||
- void *addr1;
|
||||
SIZE_T size;
|
||||
|
||||
size = 0x10000;
|
||||
addr1 = NULL;
|
||||
- status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size, MEM_RESERVE, PAGE_READWRITE);
|
||||
+ status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr1, 0, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
|
||||
ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
|
||||
size = 0;
|
||||
status = NtFreeVirtualMemory(NULL, &addr1, &size, MEM_RELEASE);
|
||||
ok(status == STATUS_INVALID_HANDLE, "Unexpected status %08lx.\n", status);
|
||||
|
||||
+ addr = (char *)addr1 + 0x1000;
|
||||
+ size = 0;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
+ ok(status == STATUS_FREE_VM_NOT_AT_BASE, "Unexpected status %08lx.\n", status);
|
||||
+
|
||||
+ size = 0x11000;
|
||||
status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE);
|
||||
- ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
+ todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
+
|
||||
+ addr = (char *)addr1 + 0x1001;
|
||||
+ size = 0xffff;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
+ todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
+ ok(size == 0xffff, "Unexpected size %p.\n", (void *)size);
|
||||
+ ok(addr == (char *)addr1 + 0x1001, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
+
|
||||
+ size = 0xfff;
|
||||
+ addr = (char *)addr1 + 0x1001;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
+ todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
+ *(volatile char *)addr1 = 1;
|
||||
+ *((volatile char *)addr1 + 0x2000) = 1;
|
||||
+ todo_wine ok(size == 0x1000, "Unexpected size %p.\n", (void *)size);
|
||||
+ todo_wine ok(addr == (char *)addr1 + 0x1000, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
+
|
||||
+ size = 0xfff;
|
||||
+ addr = (char *)addr1 + 1;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
+ todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
+ *((volatile char *)addr1 + 0x2000) = 1;
|
||||
+ todo_wine ok(size == 0x1000, "Unexpected size %p.\n", (void *)size);
|
||||
+ todo_wine ok(addr == addr1, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
+
|
||||
+ size = 0x1000;
|
||||
+ addr = addr1;
|
||||
+ status = NtAllocateVirtualMemory(NtCurrentProcess(), &addr, 0, &size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
|
||||
+ todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
+ ok(addr == addr1, "Unexpected addr %p, addr1 %p.\n", addr, addr1);
|
||||
+ ok(size == 0x1000, "Unexpected size %p.\n", (void *)size);
|
||||
+
|
||||
+ size = 0x10000;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_DECOMMIT);
|
||||
+ todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
+
|
||||
+ size = 0x10000;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE);
|
||||
+ todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
+
|
||||
+ size = 0;
|
||||
+ addr = (char *)addr1 + 0x1000;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
+ todo_wine ok(status == STATUS_MEMORY_NOT_ALLOCATED, "Unexpected status %08lx.\n", status);
|
||||
+
|
||||
+ size = 0x1000;
|
||||
+ addr = (char *)addr1 + 0x1000;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_DECOMMIT);
|
||||
+ todo_wine ok(status == STATUS_MEMORY_NOT_ALLOCATED, "Unexpected status %08lx.\n", status);
|
||||
+
|
||||
+ size = 0;
|
||||
+ addr = (char *)addr1 + 0x2000;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
+ todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
+
|
||||
+ size = 0x1000;
|
||||
+ status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE);
|
||||
+ todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
}
|
||||
|
||||
static void test_prefetch(void)
|
||||
--
|
||||
2.38.1
|
||||
|
@@ -1,30 +0,0 @@
|
||||
From bc937422e5f600be650e21de5f6c9b8656d5c23c Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Fri, 11 Nov 2022 17:56:42 -0600
|
||||
Subject: [PATCH] kernelbase: Validate nonzero size for MEM_RELEASE in
|
||||
VirtualFreeEx().
|
||||
|
||||
---
|
||||
dlls/kernelbase/memory.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c
|
||||
index 2a503587e93..c01fe817972 100644
|
||||
--- a/dlls/kernelbase/memory.c
|
||||
+++ b/dlls/kernelbase/memory.c
|
||||
@@ -447,6 +447,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH VirtualFree( void *addr, SIZE_T size, DWORD type )
|
||||
*/
|
||||
BOOL WINAPI DECLSPEC_HOTPATCH VirtualFreeEx( HANDLE process, void *addr, SIZE_T size, DWORD type )
|
||||
{
|
||||
+ if (type == MEM_RELEASE && size)
|
||||
+ {
|
||||
+ WARN( "Trying to release memory with specified size.\n" );
|
||||
+ SetLastError( ERROR_INVALID_PARAMETER );
|
||||
+ return FALSE;
|
||||
+ }
|
||||
return set_ntstatus( NtFreeVirtualMemory( process, &addr, &size, type ));
|
||||
}
|
||||
|
||||
--
|
||||
2.38.1
|
||||
|
@@ -1,117 +0,0 @@
|
||||
From 22dc17764c3b231ebd226e479686a00c7aaaf01a Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Fri, 11 Nov 2022 18:12:47 -0600
|
||||
Subject: [PATCH] ntdll: Fix size validation in NtFreeVirtualMemory().
|
||||
|
||||
---
|
||||
dlls/ntdll/tests/virtual.c | 16 ++++++++--------
|
||||
dlls/ntdll/unix/virtual.c | 26 ++++++++++++++++++--------
|
||||
2 files changed, 26 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
|
||||
index 8e94566fb7f..81e9bd0bda3 100644
|
||||
--- a/dlls/ntdll/tests/virtual.c
|
||||
+++ b/dlls/ntdll/tests/virtual.c
|
||||
@@ -1659,12 +1659,12 @@ static void test_NtFreeVirtualMemory(void)
|
||||
|
||||
size = 0x11000;
|
||||
status = NtFreeVirtualMemory(NtCurrentProcess(), &addr1, &size, MEM_RELEASE);
|
||||
- todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
+ ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
|
||||
addr = (char *)addr1 + 0x1001;
|
||||
size = 0xffff;
|
||||
status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
- todo_wine ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
+ ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
|
||||
ok(size == 0xffff, "Unexpected size %p.\n", (void *)size);
|
||||
ok(addr == (char *)addr1 + 0x1001, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
|
||||
@@ -1674,16 +1674,16 @@ static void test_NtFreeVirtualMemory(void)
|
||||
todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
*(volatile char *)addr1 = 1;
|
||||
*((volatile char *)addr1 + 0x2000) = 1;
|
||||
- todo_wine ok(size == 0x1000, "Unexpected size %p.\n", (void *)size);
|
||||
- todo_wine ok(addr == (char *)addr1 + 0x1000, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
+ ok(size == 0x1000, "Unexpected size %p.\n", (void *)size);
|
||||
+ ok(addr == (char *)addr1 + 0x1000, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
|
||||
size = 0xfff;
|
||||
addr = (char *)addr1 + 1;
|
||||
status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
todo_wine ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
|
||||
*((volatile char *)addr1 + 0x2000) = 1;
|
||||
- todo_wine ok(size == 0x1000, "Unexpected size %p.\n", (void *)size);
|
||||
- todo_wine ok(addr == addr1, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
+ ok(size == 0x1000, "Unexpected size %p.\n", (void *)size);
|
||||
+ ok(addr == addr1, "Got addr %p, addr1 %p.\n", addr, addr1);
|
||||
|
||||
size = 0x1000;
|
||||
addr = addr1;
|
||||
@@ -1703,12 +1703,12 @@ static void test_NtFreeVirtualMemory(void)
|
||||
size = 0;
|
||||
addr = (char *)addr1 + 0x1000;
|
||||
status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_RELEASE);
|
||||
- todo_wine ok(status == STATUS_MEMORY_NOT_ALLOCATED, "Unexpected status %08lx.\n", status);
|
||||
+ ok(status == STATUS_MEMORY_NOT_ALLOCATED, "Unexpected status %08lx.\n", status);
|
||||
|
||||
size = 0x1000;
|
||||
addr = (char *)addr1 + 0x1000;
|
||||
status = NtFreeVirtualMemory(NtCurrentProcess(), &addr, &size, MEM_DECOMMIT);
|
||||
- todo_wine ok(status == STATUS_MEMORY_NOT_ALLOCATED, "Unexpected status %08lx.\n", status);
|
||||
+ ok(status == STATUS_MEMORY_NOT_ALLOCATED, "Unexpected status %08lx.\n", status);
|
||||
|
||||
size = 0;
|
||||
addr = (char *)addr1 + 0x2000;
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 24d5a4e2da8..4cb0f349ffc 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -4127,26 +4127,36 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
|
||||
if (addr == (void *)1 && !size && type == MEM_RELEASE) virtual_release_address_space();
|
||||
else status = STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
- else if (!(view = find_view( base, size )) || !is_view_valloc( view ))
|
||||
- {
|
||||
- status = STATUS_INVALID_PARAMETER;
|
||||
- }
|
||||
+ else if (!(view = find_view( base, 0 ))) status = STATUS_MEMORY_NOT_ALLOCATED;
|
||||
+ else if (!is_view_valloc( view )) status = STATUS_INVALID_PARAMETER;
|
||||
else if (type == MEM_RELEASE)
|
||||
{
|
||||
/* Free the pages */
|
||||
|
||||
- if (size) status = STATUS_INVALID_PARAMETER;
|
||||
- else if (base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE;
|
||||
+ if (size && (char *)view->base + view->size - base < size) status = STATUS_UNABLE_TO_FREE_VM;
|
||||
+ else if (!size && base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE;
|
||||
else
|
||||
{
|
||||
+ if (!size) size = view->size;
|
||||
+
|
||||
+ if (size == view->size)
|
||||
+ {
|
||||
+ assert( base == view->base );
|
||||
+ delete_view( view );
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ FIXME( "Parial view release is not supported.\n" );
|
||||
+ status = STATUS_INVALID_PARAMETER;
|
||||
+ }
|
||||
*addr_ptr = base;
|
||||
- *size_ptr = view->size;
|
||||
- delete_view( view );
|
||||
+ *size_ptr = size;
|
||||
}
|
||||
}
|
||||
else if (type == MEM_DECOMMIT)
|
||||
{
|
||||
if (!size && base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE;
|
||||
+ else if (base - (char *)view->base + size > view->size) status = STATUS_UNABLE_TO_FREE_VM;
|
||||
else status = decommit_pages( view, base - (char *)view->base, size );
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
--
|
||||
2.38.1
|
||||
|
@@ -1,81 +0,0 @@
|
||||
From c97697f6bbc3c9671210e480f2fcfe761b54893d Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <pgofman@codeweavers.com>
|
||||
Date: Fri, 11 Nov 2022 18:30:20 -0600
|
||||
Subject: [PATCH] ntdll: Fully support unaligned views in free ranges
|
||||
management.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/virtual.c | 41 ++++++++++++++++++++-------------------
|
||||
1 file changed, 21 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index 4cb0f349ffc..2dca5dfa45f 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -749,18 +749,19 @@ static void free_ranges_insert_view( struct file_view *view )
|
||||
assert( range != free_ranges_end );
|
||||
assert( range->end > view_base || next != free_ranges_end );
|
||||
|
||||
- /* this happens because virtual_alloc_thread_stack shrinks a view, then creates another one on top,
|
||||
- * or because AT_ROUND_TO_PAGE was used with NtMapViewOfSection to force 4kB aligned mapping. */
|
||||
- if ((range->end > view_base && range->base >= view_end) ||
|
||||
- (range->end == view_base && next->base >= view_end))
|
||||
- {
|
||||
- /* on Win64, assert that it's correctly aligned so we're not going to be in trouble later */
|
||||
-#ifdef _WIN64
|
||||
- assert( view->base == view_base );
|
||||
-#endif
|
||||
- WARN( "range %p - %p is already mapped\n", view_base, view_end );
|
||||
+ /* Free ranges addresses are aligned at granularity_mask while the views may be not. */
|
||||
+
|
||||
+ if (range->base > view_base)
|
||||
+ view_base = range->base;
|
||||
+ if (range->end < view_end)
|
||||
+ view_end = range->end;
|
||||
+ if (range->end == view_base && next->base >= view_end)
|
||||
+ view_end = view_base;
|
||||
+
|
||||
+ TRACE( "%p - %p, aligned %p - %p.\n", view->base, (char *)view->base + view->size, view_base, view_end );
|
||||
+
|
||||
+ if (view_end <= view_base)
|
||||
return;
|
||||
- }
|
||||
|
||||
/* this should never happen */
|
||||
if (range->base > view_base || range->end < view_end)
|
||||
@@ -810,9 +811,7 @@ static void free_ranges_remove_view( struct file_view *view )
|
||||
struct range_entry *range = free_ranges_lower_bound( view_base );
|
||||
struct range_entry *next = range + 1;
|
||||
|
||||
- /* It's possible to use AT_ROUND_TO_PAGE on 32bit with NtMapViewOfSection to force 4kB alignment,
|
||||
- * and this breaks our assumptions. Look at the views around to check if the range is still in use. */
|
||||
-#ifndef _WIN64
|
||||
+ /* Free ranges addresses are aligned at granularity_mask while the views may be not. */
|
||||
struct file_view *prev_view = RB_ENTRY_VALUE( rb_prev( &view->entry ), struct file_view, entry );
|
||||
struct file_view *next_view = RB_ENTRY_VALUE( rb_next( &view->entry ), struct file_view, entry );
|
||||
void *prev_view_base = prev_view ? ROUND_ADDR( prev_view->base, granularity_mask ) : NULL;
|
||||
@@ -820,13 +819,15 @@ static void free_ranges_remove_view( struct file_view *view )
|
||||
void *next_view_base = next_view ? ROUND_ADDR( next_view->base, granularity_mask ) : NULL;
|
||||
void *next_view_end = next_view ? ROUND_ADDR( (char *)next_view->base + next_view->size + granularity_mask, granularity_mask ) : NULL;
|
||||
|
||||
- if ((prev_view_base < view_end && prev_view_end > view_base) ||
|
||||
- (next_view_base < view_end && next_view_end > view_base))
|
||||
- {
|
||||
- WARN( "range %p - %p is still mapped\n", view_base, view_end );
|
||||
+ if (prev_view_end && prev_view_end > view_base && prev_view_base < view_end)
|
||||
+ view_base = prev_view_end;
|
||||
+ if (next_view_base && next_view_base < view_end && next_view_end > view_base)
|
||||
+ view_end = next_view_base;
|
||||
+
|
||||
+ TRACE( "%p - %p, aligned %p - %p.\n", view->base, (char *)view->base + view->size, view_base, view_end );
|
||||
+
|
||||
+ if (view_end <= view_base)
|
||||
return;
|
||||
- }
|
||||
-#endif
|
||||
|
||||
/* free_ranges initial value is such that the view is either inside range or before another one. */
|
||||
assert( range != free_ranges_end );
|
||||
--
|
||||
2.38.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user