mdbx-windows: remap whole section for mmap-resize if NtExtendSection() not available (Wine).

Some workaround for https://github.com/miranda-ng/miranda-ng/issues/1209

Change-Id: I8ce3cb0fb8bdc9bd36a05ab53343efbe4080d1f3
This commit is contained in:
Leonid Yuriev 2020-11-23 10:45:46 +03:00
parent ddee04d991
commit 23fd4444b5

View File

@ -1451,10 +1451,9 @@ MDBX_INTERNAL_FUNC int mdbx_mresize(int flags, mdbx_mmap_t *map, size_t size,
LARGE_INTEGER SectionSize;
int err, rc = MDBX_SUCCESS;
if (!(flags & MDBX_RDONLY) && limit == map->limit && size > map->current) {
if (!(flags & MDBX_RDONLY) && limit == map->limit && size > map->current &&
/* workaround for Wine */ mdbx_NtExtendSection) {
/* growth rw-section */
if (!mdbx_NtExtendSection)
return MDBX_UNABLE_EXTEND_MAPSIZE /* workaround for Wine */;
SectionSize.QuadPart = size;
status = mdbx_NtExtendSection(map->section, &SectionSize);
if (!NT_SUCCESS(status))