Skip to content

Commit 4e9897e

Browse files
authored
feat: add Win32::GetCurrentDirectory (#267)
1 parent c221e7b commit 4e9897e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

include/SFSE/Impl/WinAPI.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,10 @@ namespace SFSE::WinAPI
10611061
bool FreeLibrary(
10621062
HMODULE a_module) noexcept;
10631063

1064+
[[nodiscard]] std::uint32_t GetCurrentDirectory(
1065+
std::uint32_t a_size,
1066+
char* a_buffer) noexcept;
1067+
10641068
[[nodiscard]] void* GetCurrentModule() noexcept;
10651069

10661070
[[nodiscard]] void* GetCurrentProcess() noexcept;

src/SFSE/Impl/WinAPI.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#undef ExpandEnvironmentStrings
1616
#undef FindFirstFile
1717
#undef FindNextFile
18+
#undef GetCurrentDirectory
1819
#undef GetEnvironmentVariable
1920
#undef GetFileVersionInfo
2021
#undef GetFileVersionInfoSize
@@ -264,6 +265,16 @@ namespace SFSE::WinAPI
264265
reinterpret_cast<::HMODULE>(a_module)));
265266
}
266267

268+
std::uint32_t GetCurrentDirectory(
269+
std::uint32_t a_bufferLen,
270+
char* a_buffer) noexcept
271+
{
272+
return static_cast<std::uint32_t>(
273+
GetCurrentDirectoryA(
274+
a_bufferLen,
275+
a_buffer));
276+
}
277+
267278
void* GetCurrentModule() noexcept
268279
{
269280
return std::addressof(__ImageBase);

0 commit comments

Comments
 (0)