Skip to content

Commit

Permalink
Treat all 32 bit processes as "large address aware"
Browse files Browse the repository at this point in the history
Do not rely on the IMAGE_FILE_LARGE_ADDRESS_AWARE flag being set
  • Loading branch information
felixhaedicke committed Jan 24, 2021
1 parent 477fe4b commit 997480e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions dlls/kernel32/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,16 +582,6 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORYSTATUS lpBuffer )
lpBuffer->dwAvailVirtual = memstatus.ullAvailVirtual;
}

/* values are limited to 2Gb unless the app has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag */
/* page file sizes are not limited (Adobe Illustrator 8 depends on this) */
if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE))
{
if (lpBuffer->dwTotalPhys > MAXLONG) lpBuffer->dwTotalPhys = MAXLONG;
if (lpBuffer->dwAvailPhys > MAXLONG) lpBuffer->dwAvailPhys = MAXLONG;
if (lpBuffer->dwTotalVirtual > MAXLONG) lpBuffer->dwTotalVirtual = MAXLONG;
if (lpBuffer->dwAvailVirtual > MAXLONG) lpBuffer->dwAvailVirtual = MAXLONG;
}

/* work around for broken photoshop 4 installer */
if ( lpBuffer->dwAvailPhys + lpBuffer->dwAvailPageFile >= 2U*1024*1024*1024)
lpBuffer->dwAvailPageFile = 2U*1024*1024*1024 - lpBuffer->dwAvailPhys - 1;
Expand Down
2 changes: 1 addition & 1 deletion dlls/ntdll/unix/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ void server_init_process_done(void)
#ifdef __APPLE__
send_server_task_port();
#endif
if (nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) virtual_set_large_address_space();
virtual_set_large_address_space();

/* Install signal handlers; this cannot be done earlier, since we cannot
* send exceptions to the debugger before the create process event that
Expand Down

0 comments on commit 997480e

Please sign in to comment.