linux fixes
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -30,9 +30,8 @@ namespace AZ
|
||||
result.m_pathIncludesFilename = true;
|
||||
// Platform specific get exe path: http://stackoverflow.com/a/1024937
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamea
|
||||
AZStd::wstring pathBuffer;
|
||||
pathBuffer.resize(exeStorageSize);
|
||||
const DWORD pathLen = GetModuleFileName(nullptr, pathBuffer.data(), static_cast<DWORD>(exeStorageSize));
|
||||
wchar_t pathBufferW[AZ_MAX_PATH_LEN] = { 0 };
|
||||
const DWORD pathLen = GetModuleFileNameW(nullptr, pathBufferW, static_cast<DWORD>(exeStorageSize));
|
||||
const DWORD errorCode = GetLastError();
|
||||
if (pathLen == exeStorageSize && errorCode == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
@@ -44,7 +43,7 @@ namespace AZ
|
||||
}
|
||||
else
|
||||
{
|
||||
AZStd::to_string(exeStorageBuffer, exeStorageSize, pathBuffer.c_str());
|
||||
AZStd::to_string(exeStorageBuffer, exeStorageSize, pathBufferW);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user