Skip to content

Commit c930c8c

Browse files
authored
[GDI32] Implement RemoveFontResourceExA (reactos#7813)
JIRA issue: CORE-17684
1 parent aee5cbd commit c930c8c

File tree

1 file changed

+23
-12
lines changed
  • win32ss/gdi/gdi32/objects

1 file changed

+23
-12
lines changed

win32ss/gdi/gdi32/objects/font.c

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,32 +2062,43 @@ RemoveFontResourceA(LPCSTR lpFileName)
20622062
}
20632063

20642064
/*
2065-
* @unimplemented
2065+
* @implemented
20662066
*/
20672067
BOOL
20682068
WINAPI
20692069
RemoveFontResourceExA(LPCSTR lpFileName,
20702070
DWORD fl,
2071-
PVOID pdv
2072-
)
2071+
PVOID pdv)
20732072
{
20742073
NTSTATUS Status;
20752074
LPWSTR lpFileNameW;
2075+
BOOL result;
20762076

2077-
/* FIXME the flags */
2078-
/* FIXME the pdv */
2079-
/* FIXME NtGdiRemoveFontResource handle flags and pdv */
2077+
if (fl & ~(FR_PRIVATE | FR_NOT_ENUM))
2078+
{
2079+
SetLastError(ERROR_INVALID_PARAMETER);
2080+
return FALSE;
2081+
}
20802082

2081-
Status = HEAP_strdupA2W ( &lpFileNameW, lpFileName );
2082-
if (!NT_SUCCESS (Status))
2083-
SetLastError (RtlNtStatusToDosError(Status));
2084-
else
2083+
_SEH2_TRY
2084+
{
2085+
Status = HEAP_strdupA2W(&lpFileNameW, lpFileName);
2086+
}
2087+
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
20852088
{
2089+
Status = _SEH2_GetExceptionCode();
2090+
}
2091+
_SEH2_END;
20862092

2087-
HEAP_free ( lpFileNameW );
2093+
if (!NT_SUCCESS(Status))
2094+
{
2095+
SetLastError(RtlNtStatusToDosError(Status));
2096+
return FALSE;
20882097
}
20892098

2090-
return 0;
2099+
result = RemoveFontResourceExW(lpFileNameW, fl, pdv);
2100+
HEAP_free(lpFileNameW);
2101+
return result;
20912102
}
20922103

20932104
/*

0 commit comments

Comments
 (0)