Improve dll loading on Windows.

master
Fedor 2020-08-12 09:59:33 +03:00
parent c7cfc244e1
commit 5ca94b9b0b
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@
#include "FilterNodeD2D1.h"
#include "ExtendInputEffectD2D1.h"
#include "Tools.h"
#include "nsWindowsHelpers.h"
using namespace std;
@ -1177,7 +1178,7 @@ DrawTargetD2D1::GetDWriteFactory()
}
decltype(DWriteCreateFactory)* createDWriteFactory;
HMODULE dwriteModule = LoadLibraryW(L"dwrite.dll");
HMODULE dwriteModule = LoadLibrarySystem32(L"dwrite.dll");
createDWriteFactory = (decltype(DWriteCreateFactory)*)
GetProcAddress(dwriteModule, "DWriteCreateFactory");

View File

@ -2652,6 +2652,7 @@ NS_VISIBILITY_DEFAULT PRBool nspr_use_zone_allocator = PR_FALSE;
#ifdef CAIRO_HAS_DWRITE_FONT
#include <dwrite.h>
#include "nsWindowsHelpers.h"
#ifdef DEBUG_DWRITE_STARTUP
@ -2680,7 +2681,7 @@ static DWORD WINAPI InitDwriteBG(LPVOID lpdwThreadParam)
{
SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
LOGREGISTRY(L"loading dwrite.dll");
HMODULE dwdll = LoadLibraryW(L"dwrite.dll");
HMODULE dwdll = LoadLibrarySystem32(L"dwrite.dll");
if (dwdll) {
decltype(DWriteCreateFactory)* createDWriteFactory = (decltype(DWriteCreateFactory)*)
GetProcAddress(dwdll, "DWriteCreateFactory");