From 147582b5dcd86d1d92bb9a3fda9eb640300ccae3 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Tue, 18 Feb 2020 22:50:41 -0700 Subject: [PATCH] ITS#9017 LMDB: allow using fixed file size on Windows --- libraries/liblmdb/mdb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 80f09b2..9aefc8f 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4469,7 +4469,14 @@ mdb_env_map(MDB_env *env, void *addr) alloctype = MEM_RESERVE; } +#ifdef MDB_FIXEDSIZE + LARGE_INTEGER fsize; + fsize.LowPart = msize & 0xffffffff; + fsize.HighPart = msize >> 16 >> 16; + rc = NtCreateSection(&mh, access, NULL, &fsize, secprot, SEC_RESERVE, env->me_fd); +#else rc = NtCreateSection(&mh, access, NULL, NULL, secprot, SEC_RESERVE, env->me_fd); +#endif if (rc) return mdb_nt2win32(rc); map = addr;