Use system-wide Wine, DXVK & D9VK for Steam Play/Proton (Windows) games directly from Linux Steam client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.7 KiB

  1. Original patch code by Valve Corporation
  2. Original commits:
  3. https://github.com/ValveSoftware/wine/commit/62c9478e4768e94e841da2ef75eb778ed346e3ab
  4. LICENSE: See https://github.com/ValveSoftware/wine
  5. Target Wine version of this patch file:
  6. Wine 4.9 (Vanilla/Non-staging)
  7. --- a/dlls/kernel32/heap.c
  8. +++ b/dlls/kernel32/heap.c
  9. @@ -75,6 +75,7 @@ WINE_DECLARE_DEBUG_CHANNEL(globalmem);
  10. static HANDLE systemHeap; /* globally shared heap */
  11. +extern BOOL CDECL __wine_needs_override_large_address_aware(void);
  12. /***********************************************************************
  13. * HEAP_CreateSystemHeap
  14. @@ -1375,6 +1376,10 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORY
  15. MEMORYSTATUSEX memstatus;
  16. OSVERSIONINFOW osver;
  17. IMAGE_NT_HEADERS *nt = RtlImageNtHeader( GetModuleHandleW(0) );
  18. + static int force_large_address_aware = -1;
  19. +
  20. + if (force_large_address_aware == -1)
  21. + force_large_address_aware = __wine_needs_override_large_address_aware();
  22. /* Because GlobalMemoryStatus is identical to GlobalMemoryStatusEX save
  23. for one extra field in the struct, and the lack of a bug, we simply
  24. @@ -1415,7 +1420,8 @@ VOID WINAPI GlobalMemoryStatus( LPMEMORY
  25. /* values are limited to 2Gb unless the app has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag */
  26. /* page file sizes are not limited (Adobe Illustrator 8 depends on this) */
  27. - if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE))
  28. + if (!(nt->FileHeader.Characteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) &&
  29. + !force_large_address_aware)
  30. {
  31. if (lpBuffer->dwTotalPhys > MAXLONG) lpBuffer->dwTotalPhys = MAXLONG;
  32. if (lpBuffer->dwAvailPhys > MAXLONG) lpBuffer->dwAvailPhys = MAXLONG;