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:
parent
5b57e4cca9
commit
b4abe2010b
|
@ -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) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue