Commit 0f41df16 authored by Alexandre Julliard's avatar Alexandre Julliard

Use FILE_GetDeviceInfo in NtMapViewOfSection to avoid having to fetch

the file descriptor twice.
parent a391a98a
...@@ -1675,7 +1675,6 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p ...@@ -1675,7 +1675,6 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr,
SECTION_INHERIT inherit, ULONG alloc_type, ULONG protect ) SECTION_INHERIT inherit, ULONG alloc_type, ULONG protect )
{ {
IO_STATUS_BLOCK io;
FILE_FS_DEVICE_INFORMATION device_info; FILE_FS_DEVICE_INFORMATION device_info;
NTSTATUS res; NTSTATUS res;
SIZE_T size = 0; SIZE_T size = 0;
...@@ -1722,8 +1721,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p ...@@ -1722,8 +1721,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
if ((res = wine_server_handle_to_fd( handle, 0, &unix_handle, NULL ))) return res; if ((res = wine_server_handle_to_fd( handle, 0, &unix_handle, NULL ))) return res;
if (NtQueryVolumeInformationFile( handle, &io, &device_info, sizeof(device_info), if (FILE_GetDeviceInfo( unix_handle, &device_info ) == STATUS_SUCCESS)
FileFsDeviceInformation ) == STATUS_SUCCESS)
removable = device_info.Characteristics & FILE_REMOVABLE_MEDIA; removable = device_info.Characteristics & FILE_REMOVABLE_MEDIA;
if (prot & VPROT_IMAGE) if (prot & VPROT_IMAGE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment