HMODULE mod = GetModuleHandleA("gdiplus.dll");
struct GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
+ HMODULE hmsvcrt;
+ int (CDECL * _controlfp_s)(unsigned int *cur, unsigned int newval, unsigned int mask);
+
+ /* Enable all FP exceptions except _EM_INEXACT, which gdi32 can trigger */
+ hmsvcrt = LoadLibraryA("msvcrt");
+ _controlfp_s = (void*)GetProcAddress(hmsvcrt, "_controlfp_s");
+ if (_controlfp_s) _controlfp_s(0, 0, 0x0008001e);
gdiplusStartupInput.GdiplusVersion = 1;
gdiplusStartupInput.DebugEventCallback = NULL;