Library (Windows): prefers Ldr APIs

This commit is contained in:
李通洲
2026-03-19 15:24:55 +08:00
parent bab1e4ff82
commit 86cfa4eded
7 changed files with 128 additions and 14 deletions
@@ -63,8 +63,8 @@ static const char* detectWithWmi(FFlist* result)
static const char* detectWithDdcci(const FFDisplayServerResult* displayServer, FFlist* result)
{
HMODULE gdi32 = GetModuleHandleW(L"gdi32.dll");
if (!gdi32) return "GetModuleHandleW(gdi32.dll) failed";
void* gdi32 = ffLibraryGetModule(L"gdi32.dll");
if (!gdi32) return "ffLibraryGetModule(gdi32.dll) failed";
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(gdi32, GetPhysicalMonitors)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(gdi32, DDCCIGetVCPFeature)
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(gdi32, DestroyPhysicalMonitorInternal)
+2 -1
View File
@@ -1,6 +1,7 @@
#include "opengl.h"
#include "common/library.h"
#include "common/printing.h"
#include "common/windows/nt.h"
#include <windows.h>
#include <GL/gl.h>
@@ -81,7 +82,7 @@ static const char* wglDetectOpenGL(FFOpenGLResult* result)
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(opengl32, data, wglDeleteContext);
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(opengl32, data, glGetString);
HINSTANCE hInstance = GetModuleHandleW(NULL);
HINSTANCE hInstance = ffGetPeb()->ImageBaseAddress;
WNDCLASSW wc = {
.lpfnWndProc = DefWindowProcW,
+1
View File
@@ -1,6 +1,7 @@
#include "tpm.h"
#include "common/library.h"
#include <windef.h>
#include <tbs.h>
#include <winerror.h>