mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Add option to use global import hook instead of MinHook for OpenProcess (#860)
This commit is contained in:
parent
d1e69ed6fd
commit
c5f84eb27d
13 changed files with 775 additions and 165 deletions
|
|
@ -55,6 +55,18 @@ void logging::start_file_logging(const std::filesystem::path& path) {
|
|||
if (s_hLogFile)
|
||||
return;
|
||||
|
||||
try {
|
||||
if (exists(path) && file_size(path) > 1048576) {
|
||||
auto oldPath = std::filesystem::path(path);
|
||||
oldPath.replace_extension(".log.old");
|
||||
if (exists(oldPath))
|
||||
remove(oldPath);
|
||||
rename(path, oldPath);
|
||||
}
|
||||
} catch (...) {
|
||||
// whatever
|
||||
}
|
||||
|
||||
const auto h = CreateFile(path.wstring().c_str(),
|
||||
GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue