]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9017 LMDB: allow using fixed file size on Windows
authorKris Zyp <kriszyp@gmail.com>
Wed, 19 Feb 2020 05:50:41 +0000 (22:50 -0700)
committerHoward Chu <hyc@openldap.org>
Sat, 10 Oct 2020 14:21:32 +0000 (15:21 +0100)
libraries/liblmdb/mdb.c

index e0b61e1c4fb64cb19d0adce29fcc0062bd7cb29f..994d84324809795c03b956e18c560bcaf06d1ac1 100644 (file)
@@ -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;