gdi32: Use NtQueryFullAttributesFile directly in alloc_gdi_font.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-09-21 15:54:04 +02:00 committed by Alexandre Julliard
parent 5b57e4cca9
commit b4abe2010b
1 changed files with 18 additions and 4 deletions

View File

@ -1713,11 +1713,25 @@ static struct gdi_font *alloc_gdi_font( const WCHAR *file, void *data_ptr, SIZE_
if (file) if (file)
{ {
WIN32_FILE_ATTRIBUTE_DATA info; FILE_NETWORK_OPEN_INFORMATION info;
if (GetFileAttributesExW( file, GetFileExInfoStandard, &info )) UNICODE_STRING nt_name;
OBJECT_ATTRIBUTES attr;
nt_name.Buffer = (WCHAR *)file;
nt_name.Length = nt_name.MaximumLength = len * sizeof(WCHAR);
attr.Length = sizeof(attr);
attr.RootDirectory = 0;
attr.Attributes = OBJ_CASE_INSENSITIVE;
attr.ObjectName = &nt_name;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
if (!NtQueryFullAttributesFile( &attr, &info ))
{ {
font->writetime = info.ftLastWriteTime; font->writetime.dwLowDateTime = info.LastWriteTime.LowPart;
font->data_size = (LONGLONG)info.nFileSizeHigh << 32 | info.nFileSizeLow; font->writetime.dwHighDateTime = info.LastWriteTime.HighPart;
font->data_size = info.EndOfFile.QuadPart;
memcpy( font->file, file, len * sizeof(WCHAR) ); memcpy( font->file, file, len * sizeof(WCHAR) );
} }
} }