diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 91aca9603d5..ed38a6fe2b9 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -1973,11 +1973,17 @@ HRESULT create_fontface(DWRITE_FONT_FACE_TYPE facetype, UINT32 files_number, IDW } /* IDWriteLocalFontFileLoader and its required IDWriteFontFileStream */ +struct local_refkey +{ + FILETIME writetime; + WCHAR name[1]; +}; + struct local_cached_stream { struct list entry; IDWriteFontFileStream *stream; - void *key; + struct local_refkey *key; UINT32 key_size; }; @@ -1990,12 +1996,6 @@ struct dwrite_localfontfilestream HANDLE handle; }; -struct local_refkey -{ - FILETIME writetime; - WCHAR name[1]; -}; - struct dwrite_localfontfileloader { IDWriteLocalFontFileLoader IDWriteLocalFontFileLoader_iface; LONG ref; @@ -2106,9 +2106,15 @@ static HRESULT WINAPI localfontfilestream_GetFileSize(IDWriteFontFileStream *ifa static HRESULT WINAPI localfontfilestream_GetLastWriteTime(IDWriteFontFileStream *iface, UINT64 *last_writetime) { struct dwrite_localfontfilestream *This = impl_from_IDWriteFontFileStream(iface); - FIXME("(%p)->(%p): stub\n",This, last_writetime); - *last_writetime = 0; - return E_NOTIMPL; + ULARGE_INTEGER li; + + TRACE("(%p)->(%p)\n", This, last_writetime); + + li.LowPart = This->entry->key->writetime.dwLowDateTime; + li.HighPart = This->entry->key->writetime.dwHighDateTime; + *last_writetime = li.QuadPart; + + return S_OK; } static const IDWriteFontFileStreamVtbl localfontfilestreamvtbl = diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index b8ff22d50ce..ba916a9970f 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -2362,6 +2362,7 @@ static void test_CreateStreamFromKey(void) IDWriteFontFileLoader *loader; IDWriteFactory *factory; IDWriteFontFile *file; + UINT64 writetime; void *key; UINT32 size; HRESULT hr; @@ -2398,6 +2399,12 @@ static void test_CreateStreamFromKey(void) hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader, key, size, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); EXPECT_REF(stream, 1); + + writetime = 0; + hr = IDWriteFontFileStream_GetLastWriteTime(stream, &writetime); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(writetime != 0, "got %08x%08x\n", (UINT)(writetime >> 32), (UINT)writetime); + IDWriteFontFileStream_Release(stream); IDWriteLocalFontFileLoader_Release(localloader);