[PATCH] ntdll: Map top-down if DllCharacteristics include DYNAMIC_BASE.

Myah Caron qsniyg at protonmail.com
Sat Mar 13 05:48:56 CST 2021


Yes it does, the latest comment is referring to a different issue (one I have not yet been able to replicate).

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, March 13, 2021 3:00 AM, Fabian Maurer <dark.shadow4 at web.de> wrote:

> Hello,
> 

> are you sure this fixes https://bugs.winehq.org/show_bug.cgi?id=44893 ?
> Because the latest comment explicitly states that your patch does not help.
> 

> Regards,
> Fabian Maurer
> 

> On Samstag, 13. März 2021 05:37:22 CET Myah Caron wrote:
> 

> > Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=44893
> > Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=48641
> > Signed-off-by: Myah Caron qsniyg at protonmail.com
> > 

> > ----------------------------------------------------------------------------------------------------------------------------------------------------------------
> > 

> > A test is available here:
> > https://github.com/qsniyg/wine_dll_load_test/tree/b2b64bc8d7d1589cbfeb1dbb5
> > 33674e4b32ed2b3/2 (D1 should load with a high 0x7fff... address)
> > If --dynamicbase is added to the linker options, it will map the DLL
> > top-down rather than bottom-up (tested under Windows 10). This patch fixes
> > the SKSE issue, as it requires its base address to be > 0x180000000.
> > While the linked issue may be "invalid" due to it an application bug, it
> > does nonetheless demonstrate a bug in wine, so I believe it's worth fixing
> > this issue.
> > dlls/ntdll/loader.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> > diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
> > index a7e6d712df1..5f4b78e133c 100644
> > --- a/dlls/ntdll/loader.c
> > +++ b/dlls/ntdll/loader.c
> > @@ -2279,8 +2279,9 @@ static NTSTATUS load_native_dll( LPCWSTR load_path,
> > const UNICODE_STRING *nt_nam {
> > void *module = NULL;
> > SIZE_T len = 0;
> > 

> > -   ULONG alloc_type = (image_info->DllCharacteristics &
> >     IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) ? MEM_TOP_DOWN : 0; NTSTATUS status
> >     = NtMapViewOfSection( mapping, NtCurrentProcess(), &module, 0, 0, NULL,
> >     &len, - ViewShare, 0,
> >     PAGE_EXECUTE_READ ); + ViewShare,
> >     alloc_type, PAGE_EXECUTE_READ );
> >     if (status == STATUS_IMAGE_NOT_AT_BASE) status = STATUS_SUCCESS;
> >     #ifdef _WIN64
> >     --
> >     2.30.2
> >

-------------- next part --------------
A non-text attachment was scrubbed...
Name: publickey - qsniyg at protonmail.com - 0xE014E37E.asc
Type: application/pgp-keys
Size: 1790 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210313/0e69cd44/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 509 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210313/0e69cd44/attachment.sig>


More information about the wine-devel mailing list