From ed9eb1dfc33c070d834353cb8a03da69bc829eba Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 25 May 2025 16:23:00 +0200 Subject: [PATCH] Small fixes --- src/samples/test-sample/test.cpp | 2 +- src/windows-emulator/registry/hive_parser.cpp | 2 +- src/windows-emulator/registry/registry_manager.cpp | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/samples/test-sample/test.cpp b/src/samples/test-sample/test.cpp index 518409a2..67634c58 100644 --- a/src/samples/test-sample/test.cpp +++ b/src/samples/test-sample/test.cpp @@ -689,7 +689,7 @@ namespace { int executions = 0; - auto* apc_func = +[](ULONG_PTR param) { + auto* apc_func = +[](const ULONG_PTR param) { *reinterpret_cast(param) += 1; // }; diff --git a/src/windows-emulator/registry/hive_parser.cpp b/src/windows-emulator/registry/hive_parser.cpp index 3388b3c7..9a2a40d3 100644 --- a/src/windows-emulator/registry/hive_parser.cpp +++ b/src/windows-emulator/registry/hive_parser.cpp @@ -159,7 +159,7 @@ const hive_value* hive_key::get_value(std::ifstream& file, const std::string_vie return &value; } -const hive_value* hive_key::get_value(std::ifstream& file, size_t index) +const hive_value* hive_key::get_value(std::ifstream& file, const size_t index) { this->parse(file); diff --git a/src/windows-emulator/registry/registry_manager.cpp b/src/windows-emulator/registry/registry_manager.cpp index 55e6aa04..e07a70bc 100644 --- a/src/windows-emulator/registry/registry_manager.cpp +++ b/src/windows-emulator/registry/registry_manager.cpp @@ -4,7 +4,6 @@ #include #include "hive_parser.hpp" -#include namespace { @@ -153,7 +152,7 @@ std::optional registry_manager::get_key(const utils::path_key& key return {std::move(reg_key)}; } -std::optional registry_manager::get_value(const registry_key& key, std::string_view name) +std::optional registry_manager::get_value(const registry_key& key, const std::string_view name) { const auto iterator = this->hives_.find(key.hive); if (iterator == this->hives_.end()) @@ -175,7 +174,7 @@ std::optional registry_manager::get_value(const registry_key& ke return v; } -std::optional registry_manager::get_value(const registry_key& key, size_t index) +std::optional registry_manager::get_value(const registry_key& key, const size_t index) { const auto iterator = this->hives_.find(key.hive); if (iterator == this->hives_.end()) @@ -210,7 +209,7 @@ registry_manager::hive_map::iterator registry_manager::find_hive(const utils::pa return this->hives_.end(); } -std::optional registry_manager::get_sub_key_name(const registry_key& key, size_t index) +std::optional registry_manager::get_sub_key_name(const registry_key& key, const size_t index) { const auto iterator = this->hives_.find(key.hive); if (iterator == this->hives_.end())