From: Kris Zyp Date: Wed, 19 Feb 2020 05:50:41 +0000 (-0700) Subject: ITS#9017 LMDB: allow using fixed file size on Windows X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=485465b6a700bb6a7084c875af6eaded815fb645;p=thirdparty%2Fopenldap.git ITS#9017 LMDB: allow using fixed file size on Windows --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index e0b61e1c4f..994d843248 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -4760,7 +4760,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;