Commit 46532e8d authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Add support for .fot files in RemoveFontResource.

parent 4fc8bf18
......@@ -3565,7 +3565,25 @@ BOOL WINAPI RemoveFontResourceExA( LPCSTR str, DWORD fl, PVOID pdv )
*/
BOOL WINAPI RemoveFontResourceExW( LPCWSTR str, DWORD fl, PVOID pdv )
{
return WineEngRemoveFontResourceEx(str, fl, pdv);
int ret = WineEngRemoveFontResourceEx( str, fl, pdv );
WCHAR *filename;
if (ret == 0)
{
/* FreeType <2.3.5 has problems reading resources wrapped in PE files. */
HMODULE hModule = LoadLibraryExW(str, NULL, LOAD_LIBRARY_AS_DATAFILE);
if (hModule != NULL)
{
WARN("Can't unload resources from PE file %s\n", wine_dbgstr_w(str));
FreeLibrary(hModule);
}
else if ((filename = get_scalable_filename( str )) != NULL)
{
ret = WineEngRemoveFontResourceEx( filename, fl, pdv );
HeapFree( GetProcessHeap(), 0, filename );
}
}
return ret;
}
/***********************************************************************
......
......@@ -4475,22 +4475,11 @@ static void test_CreateScalableFontResource(void)
SetLastError(0xdeadbeef);
ret = pRemoveFontResourceExA(fot_name, 0, 0);
todo_wine
ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError());
ret = is_truetype_font_installed("wine_test");
todo_wine
ok(!ret, "font wine_test should not be enumerated\n");
/* FIXME: since RemoveFontResource is a stub correct testing is impossible */
if (ret)
{
/* remove once RemoveFontResource is implemented */
DeleteFile(fot_name);
DeleteFile(ttf_name);
return;
}
ret = pRemoveFontResourceExA(fot_name, 0, 0);
ok(!ret, "RemoveFontResourceEx() should fail\n");
......@@ -4509,17 +4498,21 @@ todo_wine
ok(ret, "AddFontResourceEx() error %d\n", GetLastError());
ret = is_truetype_font_installed("wine_test");
todo_wine
ok(!ret, "font wine_test should not be enumerated\n");
/* XP allows removing a private font added with 0 flags */
SetLastError(0xdeadbeef);
ret = pRemoveFontResourceExA(fot_name, FR_PRIVATE, 0);
todo_wine
ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError());
ret = is_truetype_font_installed("wine_test");
todo_wine
ok(!ret, "font wine_test should not be enumerated\n");
ret = pRemoveFontResourceExA(fot_name, 0, 0);
todo_wine
ok(!ret, "RemoveFontResourceEx() should fail\n");
DeleteFile(fot_name);
......
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