diff --git a/include/SFSE/Impl/WinAPI.h b/include/SFSE/Impl/WinAPI.h index d9468932..cf3d662c 100644 --- a/include/SFSE/Impl/WinAPI.h +++ b/include/SFSE/Impl/WinAPI.h @@ -1061,6 +1061,10 @@ namespace SFSE::WinAPI bool FreeLibrary( HMODULE a_module) noexcept; + [[nodiscard]] std::uint32_t GetCurrentDirectory( + std::uint32_t a_size, + char* a_buffer) noexcept; + [[nodiscard]] void* GetCurrentModule() noexcept; [[nodiscard]] void* GetCurrentProcess() noexcept; diff --git a/src/SFSE/Impl/WinAPI.cpp b/src/SFSE/Impl/WinAPI.cpp index 500870dd..e4e90fbc 100644 --- a/src/SFSE/Impl/WinAPI.cpp +++ b/src/SFSE/Impl/WinAPI.cpp @@ -15,6 +15,7 @@ #undef ExpandEnvironmentStrings #undef FindFirstFile #undef FindNextFile +#undef GetCurrentDirectory #undef GetEnvironmentVariable #undef GetFileVersionInfo #undef GetFileVersionInfoSize @@ -264,6 +265,16 @@ namespace SFSE::WinAPI reinterpret_cast<::HMODULE>(a_module))); } + std::uint32_t GetCurrentDirectory( + std::uint32_t a_bufferLen, + char* a_buffer) noexcept + { + return static_cast( + GetCurrentDirectoryA( + a_bufferLen, + a_buffer)); + } + void* GetCurrentModule() noexcept { return std::addressof(__ImageBase);