Skip to content

Commit

Permalink
fix exported func
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Jul 10, 2024
1 parent d6c2ccf commit 38c04fd
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
46 changes: 46 additions & 0 deletions source/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,52 @@ std::filesystem::path WINAPI GetOverloadedFilePath(std::filesystem::path lpFilen
return {};
}

bool WINAPI GetOverloadedFilePathA(const char* lpFilename, char* out, size_t out_size)
{
try
{
if (!sFileLoaderPath.empty())
{
auto path = GetOverloadedFilePath(lpFilename);
if (!path.empty())
{
if (out && out_size)
{
if (!std::filesystem::path(lpFilename).is_absolute())
path = lexicallyRelativeCaseIns(path, gamePath);
out[path.string().copy(out, out_size, 0)] = '\0';
}
return true;
}
}
}
catch (...) {}
return false;
}

bool WINAPI GetOverloadedFilePathW(const wchar_t* lpFilename, wchar_t* out, size_t out_size)
{
try
{
if (!sFileLoaderPath.empty())
{
auto path = GetOverloadedFilePath(lpFilename);
if (!path.empty())
{
if (out && out_size)
{
if (!std::filesystem::path(lpFilename).is_absolute())
path = lexicallyRelativeCaseIns(path, gamePath);
out[path.wstring().copy(out, out_size, 0)] = '\0';
}
return true;
}
}
}
catch (...) {}
return false;
}

std::filesystem::path GetFilePathForOverload(auto path)
{
try
Expand Down
3 changes: 2 additions & 1 deletion source/x64.def
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
LIBRARY "UAL"
EXPORTS
IsUltimateASILoader = IsUltimateASILoader
GetOverloadedFilePath = GetOverloadedFilePath
GetOverloadedFilePathA = GetOverloadedFilePathA
GetOverloadedFilePathW = GetOverloadedFilePathW
GetMemoryModule = GetMemoryModule

LIBRARY "dinput8"
Expand Down
3 changes: 2 additions & 1 deletion source/x86.def
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
LIBRARY "UAL"
EXPORTS
IsUltimateASILoader = IsUltimateASILoader
GetOverloadedFilePath = GetOverloadedFilePath
GetOverloadedFilePathA = GetOverloadedFilePathA
GetOverloadedFilePathW = GetOverloadedFilePathW
GetMemoryModule = GetMemoryModule

LIBRARY "vorbisfile"
Expand Down

0 comments on commit 38c04fd

Please sign in to comment.