Skip to content

Commit

Permalink
LoadLibraryAWrappesa
Browse files Browse the repository at this point in the history
  • Loading branch information
otya128 committed Jul 18, 2018
1 parent f470553 commit 078333f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion wine/wine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>wine.def</ModuleDefinitionFile>
<GenerateMapFile>true</GenerateMapFile>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -96,6 +96,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>wine.def</ModuleDefinitionFile>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
16 changes: 15 additions & 1 deletion wine/wrapper.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#include <Windows.h>
#include <Shlwapi.h>
//PROGMAN.EXEなどでCOMMDLGが読み込まれなかったので修正
HMODULE LoadLibraryAWrapper(const char *name)
{
return LoadLibraryA(name);
HMODULE m = LoadLibraryA(name);
if (m)
return m;
else
{
char buf[MAX_PATH];
char buf2[MAX_PATH];
GetModuleFileNameA(GetModuleHandleA("libwine.dll"), buf, sizeof(buf));
*PathFindFileNameA(buf) = '\0';
PathCombineA(buf2, buf, name);

m = LoadLibraryA(buf2);
}
return m;
}

0 comments on commit 078333f

Please sign in to comment.