Skip to content

Commit

Permalink
Fix VirtualQuery rejecting unallocated blocks
Browse files Browse the repository at this point in the history
it looks like get_free_mem_state_callback sees blocks before the exe base address as overlapping the exe base from calculating the block end address as block start address + size, ie a 256 byte block starting at 0x100 would "end" at 0x200

(Source of patch https://github.com/hdmap/wine-hackery/tree/master/f4se )
This change would be the more important one of two changes which would solve the following issue for proton: ValveSoftware/Proton#1069
  • Loading branch information
Rabcor authored Oct 13, 2018
1 parent 266d11a commit 378b111
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dlls/ntdll/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -2750,7 +2750,7 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
MEMORY_BASIC_INFORMATION *info = arg;
void *end = (char *)start + size;

if ((char *)info->BaseAddress + info->RegionSize < (char *)start) return 0;
if ((char *)info->BaseAddress + info->RegionSize <= (char *)start) return 0;

if (info->BaseAddress >= end)
{
Expand Down

1 comment on commit 378b111

@Rabcor
Copy link
Owner Author

@Rabcor Rabcor commented on 378b111 Oct 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate of ValveSoftware#7

please delete. (was my first time trying to make a commit on git, I don't even know how to edit or delete it myself, somewhat embarrassing)

Please sign in to comment.