diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-26 18:49:07 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-26 18:49:07 +0300 |
commit | a076ee7deea97716cfdce8905d5361df98ad9424 (patch) | |
tree | 2def8791d60146475bc2795186c8745a9a3430e1 /plugins/Dbx_mdbx | |
parent | 9d38cf95d713574776c4892146b67c69cc96cb2c (diff) |
very strange disk type detection removed from libmdbx (fixes #1213)
Diffstat (limited to 'plugins/Dbx_mdbx')
-rw-r--r-- | plugins/Dbx_mdbx/src/libmdbx/src/osal.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/plugins/Dbx_mdbx/src/libmdbx/src/osal.c b/plugins/Dbx_mdbx/src/libmdbx/src/osal.c index f95ac57a12..67cadd5056 100644 --- a/plugins/Dbx_mdbx/src/libmdbx/src/osal.c +++ b/plugins/Dbx_mdbx/src/libmdbx/src/osal.c @@ -827,41 +827,6 @@ int mdbx_mmap(int flags, mdbx_mmap_t *map, size_t size, size_t limit) { } } - typedef DWORD (WINAPI *pfnGetFinalPathNameByHandle)(HANDLE, LPWSTR, DWORD, DWORD); - pfnGetFinalPathNameByHandle pfname = (pfnGetFinalPathNameByHandle)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetFinalPathNameByHandleW"); - if (pfname) { - if (!pfname(map->fd, PathBuffer, INT16_MAX, FILE_NAME_NORMALIZED | VOLUME_NAME_NT)) - return GetLastError(); - - if (_wcsnicmp(PathBuffer, L"\\Device\\Mup\\", 12) == 0) - return ERROR_FILE_OFFLINE; - - if (pfname(map->fd, PathBuffer, INT16_MAX, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS)) { - UINT DriveType = GetDriveTypeW(PathBuffer); - if (DriveType == DRIVE_NO_ROOT_DIR && - wcsncmp(PathBuffer, L"\\\\?\\", 4) == 0 && - wcsncmp(PathBuffer + 5, L":\\", 2) == 0) { - PathBuffer[7] = 0; - DriveType = GetDriveTypeW(PathBuffer + 4); - } - switch (DriveType) { - case DRIVE_CDROM: - if (flags & MDBX_RDONLY) - break; - // fall through - case DRIVE_UNKNOWN: - case DRIVE_NO_ROOT_DIR: - case DRIVE_REMOTE: - default: - return ERROR_FILE_OFFLINE; - case DRIVE_REMOVABLE: - case DRIVE_FIXED: - case DRIVE_RAMDISK: - break; - } - } - } - rc = mdbx_filesize(map->fd, &map->filesize); if (rc != MDBX_SUCCESS) return rc; |