Skip to content

Commit 968349f

Browse files
author
bot-1450
committed
Qualify ModulePath
Qualify ModulePath rather than simply append relative path.
1 parent 0e0166f commit 968349f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Injector/Injector.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ std::tstring Injector::GetPath( const std::tstring& ModuleName )
254254
ModulePath = ModulePath.substr(0, ModulePath.rfind( _T("\\") ) + 1);
255255
ModulePath.append(ModuleName);
256256

257+
TCHAR FullModulePath[MAX_PATH];
258+
if (!GetFullPathName(ModulePath.c_str(), sizeof(FullModulePath) / sizeof(TCHAR), FullModulePath, NULL))
259+
throw std::runtime_error("Could not get full path to module.");
260+
ModulePath = std::tstring(&FullModulePath[0]);
261+
257262
// Check path/file is valid
258263
if (GetFileAttributes(ModulePath.c_str()) == INVALID_FILE_ATTRIBUTES)
259264
{

0 commit comments

Comments
 (0)