Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dlls/kernelbase/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ static const WCHAR *hack_append_command_line( const WCHAR *cmd )
{L"EverQuest 2\\LaunchPad.exe", L" --use-gl=swiftshader"},
{L"Everquest F2P\\LaunchPad.exe", L" --use-gl=swiftshader"},
{L"Red Tie Runner.exe", L" --use-angle=gl"},
{L"SocialClubHelper.exe", L" --disable-gpu --disable-gpu-compositing --disable-gpu-rasterization", "1174180"},
{L"UnrealCEFSubProcess.exe", L" --use-gl=swiftshader", "2316580"},
{L"UnrealCEFSubProcess.exe", L" --use-angle=d3d9", "2684500"},
};
Expand Down
37 changes: 37 additions & 0 deletions dlls/ntdll/unix/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,40 @@ static void reserve_area( void *addr, void *end )
}


/*
* CEF's V8 sandbox normally reserves a 1 TB placeholder. On 39-bit ARM64
* hosts V8 falls back to a 128 GB partial reservation, but by the time the
* renderer initializes, native mappings have fragmented every suitably
* aligned range. Keep one range intact from process startup. Adding it to
* Wine's reserved-area list lets VirtualAlloc2 replace the PROT_NONE mapping
* when V8 creates its placeholder.
*/
static void reserve_rdr2_v8_sandbox(void)
{
#if defined(__aarch64__) && defined(_WIN64)
static const char app_id[] = "1174180";
const char *steam_game_id = getenv( "SteamGameId" );
const char *steam_app_id = getenv( "SteamAppId" );
void *base = (void *)0x2000000000;
size_t size = 0x2000000000;

if ((!steam_game_id || strcmp( steam_game_id, app_id )) &&
(!steam_app_id || strcmp( steam_app_id, app_id ))) return;
if (is_beyond_limit( base, size, host_addr_space_limit )) return;
if (mmap_is_in_reserved_area( base, size ) == 1) return;

if (anon_mmap_tryfixed( base, size, PROT_NONE, MAP_NORESERVE ) == base)
{
mmap_add_reserved_area( base, size );
FIXME( "HACK: reserved RDR2 V8 sandbox address space %p-%p.\n",
base, (char *)base + size );
}
else WARN( "failed to reserve RDR2 V8 sandbox address space %p-%p.\n",
base, (char *)base + size );
#endif
}


static void mmap_init( const struct preload_info *preload_info )
{
#ifndef _WIN64
Expand Down Expand Up @@ -3957,6 +3991,9 @@ void virtual_init(void)
size = (char *)address_space_start - (char *)0x10000;
if (size && mmap_is_in_reserved_area( (void*)0x10000, size ) == 1)
anon_mmap_fixed( (void *)0x10000, size, PROT_READ | PROT_WRITE, 0 );

/* Keep alloc_virtual_heap() from carving its bookkeeping data out of this area. */
reserve_rdr2_v8_sandbox();
}


Expand Down
Loading