ntdll: Handle LFH blocks allocated in large blocks in heap_validate_ptr().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55842
The bug blames commit 059094c1 ("ntdll: Define heap block's BLOCK_FLAG_LFH as 0x80.") but actually before the blamed commit that worked essentially by chance.
The problem the patch is solving is that RtlValidateHeap() currently always fails for LFH blocks allocated from large block memory (vs subheap blocks). That can happen for large enough LFH block sizes. In case of the regressed game the user of RtlValidateHeap() is msvcr80.msvcrt_heap_free() which uses HeapValidate() to guess the heap used to allocate the pointer to free. I am attaching a standalone test program which can be used to reproduce the problem without the patch. test_lfh_validate.c