Use FILE_GetDeviceInfo in NtMapViewOfSection to avoid having to fetch

the file descriptor twice.
This commit is contained in:
Alexandre Julliard 2005-08-25 10:23:23 +00:00
parent a391a98a9d
commit 0f41df1681
1 changed files with 1 additions and 3 deletions

View File

@ -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
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)