1
0
Fork 0

Fix for the fix, damn

Closes #3068
pull/3077/head
Duncan Ogilvie 2023-04-15 16:53:03 +02:00
parent 8566d7b884
commit 1845952e17
4 changed files with 11 additions and 6 deletions

View File

@ -142,7 +142,7 @@ static bool FileExists(const wchar_t* szFullPath)
return (attrib != INVALID_FILE_ATTRIBUTES && !(attrib & FILE_ATTRIBUTE_DIRECTORY));
}
SIGNATURE_EXPORT HMODULE WINAPI LoadLibraryCheckedW(const wchar_t* szDll, bool allowFailure)
HMODULE WINAPI LoadLibraryCheckedW(const wchar_t* szDll, bool allowFailure)
{
std::wstring fullDllPath = szApplicationDir;
fullDllPath += szDll;
@ -190,7 +190,7 @@ SIGNATURE_EXPORT HMODULE WINAPI LoadLibraryCheckedW(const wchar_t* szDll, bool a
return hModule;
}
SIGNATURE_EXPORT HMODULE WINAPI LoadLibraryCheckedA(const char* szDll, bool allowFailure)
HMODULE WINAPI LoadLibraryCheckedA(const char* szDll, bool allowFailure)
{
return LoadLibraryCheckedW(Utf8ToUtf16(szDll).c_str(), allowFailure);
}

View File

@ -0,0 +1,3 @@
EXPORTS
LoadLibraryCheckedA
LoadLibraryCheckedW

View File

@ -2,8 +2,6 @@
#include <Windows.h>
#define SIGNATURE_EXPORT extern "C" __declspec(dllexport)
bool InitializeSignatureCheck();
SIGNATURE_EXPORT HMODULE WINAPI LoadLibraryCheckedW(const wchar_t* szDll, bool allowFailure);
SIGNATURE_EXPORT HMODULE WINAPI LoadLibraryCheckedA(const char* szDll, bool allowFailure);
HMODULE WINAPI LoadLibraryCheckedW(const wchar_t* szDll, bool allowFailure);
HMODULE WINAPI LoadLibraryCheckedA(const char* szDll, bool allowFailure);

View File

@ -141,6 +141,7 @@
</AdditionalManifestDependencies>
<LargeAddressAware>true</LargeAddressAware>
<DelayLoadDLLs>user32.dll;wintrust.dll;x32bridge.dll</DelayLoadDLLs>
<ModuleDefinitionFile>signaturecheck.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -159,6 +160,7 @@
<ProgramDatabaseFile>$(TargetDir)$(TargetName)_exe.pdb</ProgramDatabaseFile>
<AdditionalManifestDependencies>
</AdditionalManifestDependencies>
<ModuleDefinitionFile>signaturecheck.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -177,6 +179,7 @@
<AdditionalManifestDependencies>
</AdditionalManifestDependencies>
<DelayLoadDLLs>user32.dll;wintrust.dll;x64bridge.dll</DelayLoadDLLs>
<ModuleDefinitionFile>signaturecheck.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -194,6 +197,7 @@
<ProgramDatabaseFile>$(TargetDir)$(TargetName)_exe.pdb</ProgramDatabaseFile>
<AdditionalManifestDependencies>
</AdditionalManifestDependencies>
<ModuleDefinitionFile>signaturecheck.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />