mdbx-windows: use SetFileInformationByHandle() when available.

Change-Id: I27d9d4271d4328947ad68cdf30af61a31978b4f9
This commit is contained in:
Leonid Yuriev
2018-12-26 19:53:03 +03:00
parent e3ff44d01b
commit 624968b74c
3 changed files with 26 additions and 5 deletions

View File

@@ -663,6 +663,7 @@ MDBX_srwlock_function mdbx_srwlock_Init, mdbx_srwlock_AcquireShared,
MDBX_GetFileInformationByHandleEx mdbx_GetFileInformationByHandleEx;
MDBX_GetVolumeInformationByHandleW mdbx_GetVolumeInformationByHandleW;
MDBX_GetFinalPathNameByHandleW mdbx_GetFinalPathNameByHandleW;
MDBX_SetFileInformationByHandle mdbx_SetFileInformationByHandle;
MDBX_NtFsControlFile mdbx_NtFsControlFile;
static void mdbx_winnt_import(void) {
@@ -699,6 +700,10 @@ static void mdbx_winnt_import(void) {
(MDBX_GetFinalPathNameByHandleW)GetProcAddress(
hKernel32dll, "GetFinalPathNameByHandleW");
mdbx_SetFileInformationByHandle =
(MDBX_SetFileInformationByHandle)GetProcAddress(
hKernel32dll, "SetFileInformationByHandle");
const HINSTANCE hNtdll = GetModuleHandleA("ntdll.dll");
mdbx_NtFsControlFile =
(MDBX_NtFsControlFile)GetProcAddress(hNtdll, "NtFsControlFile");