Skip to content

Commit 8ee2d77

Browse files
committed
Fixed build errors
1 parent 4c08816 commit 8ee2d77

File tree

4 files changed

+16
-26
lines changed

4 files changed

+16
-26
lines changed

KoalaBox

src/smoke_api/smoke_api.cpp

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,20 @@ namespace {
4343

4444
HMODULE original_steamapi_handle = nullptr;
4545

46-
std::set<std::string> find_steamclient_versions(const HMODULE steamapi_handle) noexcept {
47-
try {
48-
std::set<std::string> versions;
49-
const auto rdata = kb::win::get_pe_section_or_throw(steamapi_handle, ".rdata").to_string();
46+
std::set<std::string> find_steamclient_versions(const HMODULE steamapi_handle) {
47+
std::set<std::string> versions;
5048

51-
const std::regex pattern(R"(SteamClient\d{3})");
52-
auto matches_begin = std::sregex_iterator(rdata.begin(), rdata.end(), pattern);
53-
auto matches_end = std::sregex_iterator();
49+
const auto rdata = kb::win::get_pe_section_or_throw(steamapi_handle, ".rdata").to_string();
5450

55-
for(std::sregex_iterator i = matches_begin; i != matches_end; ++i) {
56-
versions.insert(i->str());
57-
}
51+
const std::regex pattern(R"(SteamClient\d{3})");
52+
auto matches_begin = std::sregex_iterator(rdata.begin(), rdata.end(), pattern);
53+
auto matches_end = std::sregex_iterator();
5854

59-
return versions;
60-
} catch(const std::exception& e) {
61-
LOG_ERROR("{} -> insert error: {}", __func__, e.what());
62-
return {};
55+
for(std::sregex_iterator i = matches_begin; i != matches_end; ++i) {
56+
versions.insert(i->str());
6357
}
58+
59+
return versions;
6460
}
6561

6662
// ReSharper disable once CppDFAConstantFunctionResult
@@ -93,11 +89,7 @@ namespace {
9389
}
9490

9591
void start_dll_listener() {
96-
kb::dll_monitor::init_listener(
97-
{
98-
{STEAMCLIENT_DLL, on_steamclient_loaded}
99-
}
100-
);
92+
kb::dll_monitor::init_listener({{STEAMCLIENT_DLL, on_steamclient_loaded}});
10193
}
10294
}
10395

src/steam_api/steam_interfaces.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ namespace steam_interfaces {
211211

212212
// Prepare HSteamPipe and HSteamUser
213213
const auto CreateInterface$ = KB_WIN_GET_PROC(steamclient_handle, CreateInterface);
214-
const auto* const THIS = CreateInterface$(
215-
steam_client_interface_version.c_str(), nullptr
216-
);
214+
const auto* const THIS = CreateInterface$(steam_client_interface_version.c_str(), nullptr);
217215
hook_virtuals(THIS, steam_client_interface_version);
218216

219217
const auto interface_lookup = read_interface_lookup();
@@ -236,6 +234,7 @@ namespace steam_interfaces {
236234
continue;
237235
}
238236

237+
DECLARE_EDX();
239238
const auto* const interface_ptr = ISteamClient_GetISteamGenericInterface(
240239
ARGS(steam_user, steam_pipe, interface_version.c_str())
241240
);
@@ -245,9 +244,6 @@ namespace steam_interfaces {
245244
}
246245
}
247246

248-
// ISteamClient_ReleaseUser(ARGS(steam_pipe, steam_user));
249-
// ISteamClient_BReleaseSteamPipe(ARGS(steam_pipe));
250-
251247
kb::hook::unhook_vt_all(THIS);
252248
} catch(const std::exception& e) {
253249
LOG_ERROR("{} -> Unhandled exception: {}", __func__, e.what());

static/smoke_api/types.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@
4747
#define PARAMS(...) const void* RCX, __VA_ARGS__
4848
#define ARGS(...) RCX, __VA_ARGS__
4949
#define THIS RCX
50+
#define DECLARE_EDX()
5051
#else
5152
#define PARAMS(...) const void* ECX, const void* EDX, __VA_ARGS__
5253
#define ARGS(...) ECX, EDX, __VA_ARGS__
5354
#define THIS ECX
55+
#define DECLARE_EDX() const void* EDX = nullptr;
5456
#endif
5557

5658
using AppId_t = uint32_t;

0 commit comments

Comments
 (0)