mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
chore: more logging
This commit is contained in:
parent
c5e58ee014
commit
d0213ebcfd
2 changed files with 10 additions and 3 deletions
|
|
@ -30,7 +30,9 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
||||||
if (bootconfig::is_wait_messagebox())
|
if (bootconfig::is_wait_messagebox())
|
||||||
MessageBoxW(nullptr, L"Press OK to continue", L"Dalamud Boot", MB_OK);
|
MessageBoxW(nullptr, L"Press OK to continue", L"Dalamud Boot", MB_OK);
|
||||||
|
|
||||||
|
logging::print<logging::I>("Applying fixes...");
|
||||||
xivfixes::apply_all(true);
|
xivfixes::apply_all(true);
|
||||||
|
logging::print<logging::I>("Fixes OK");
|
||||||
|
|
||||||
if (bootconfig::is_wait_debugger()) {
|
if (bootconfig::is_wait_debugger()) {
|
||||||
logging::print<logging::I>("Waiting for debugger to attach...");
|
logging::print<logging::I>("Waiting for debugger to attach...");
|
||||||
|
|
@ -45,6 +47,8 @@ DllExport DWORD WINAPI Initialize(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
||||||
|
|
||||||
// ============================== CLR ========================================= //
|
// ============================== CLR ========================================= //
|
||||||
|
|
||||||
|
logging::print<logging::I>("Calling InitializeClrAndGetEntryPoint");
|
||||||
|
|
||||||
void* entrypoint_vfn;
|
void* entrypoint_vfn;
|
||||||
int result = InitializeClrAndGetEntryPoint(
|
int result = InitializeClrAndGetEntryPoint(
|
||||||
g_hModule,
|
g_hModule,
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ void xivfixes::prevent_devicechange_crashes(bool bApply) {
|
||||||
return hWnd;
|
return hWnd;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
logging::print<logging::I>("{} Enable", LogTag);
|
||||||
} else {
|
} else {
|
||||||
logging::print<logging::I>("{} Disable", LogTag);
|
logging::print<logging::I>("{} Disable", LogTag);
|
||||||
|
|
||||||
|
|
@ -86,9 +87,9 @@ void xivfixes::disable_game_openprocess_access_check(bool bApply) {
|
||||||
if (bApply) {
|
if (bApply) {
|
||||||
hook.emplace("kernel32.dll", "OpenProcess", 0);
|
hook.emplace("kernel32.dll", "OpenProcess", 0);
|
||||||
hook->set_detour([](DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)->HANDLE {
|
hook->set_detour([](DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)->HANDLE {
|
||||||
if (dwProcessId == GetCurrentProcessId()) {
|
logging::print<logging::I>("{} OpenProcess(0{:08X}, {}, {}) was invoked by thread {}.", LogTag, dwDesiredAccess, bInheritHandle, dwProcessId, GetCurrentThreadId());
|
||||||
logging::print<logging::I>("{} OpenProcess(0{:08X}, {}, {}) was invoked by thread {}.", LogTag, dwDesiredAccess, bInheritHandle, dwProcessId, GetCurrentThreadId());
|
|
||||||
|
|
||||||
|
if (dwProcessId == GetCurrentProcessId()) {
|
||||||
// Prevent game from feeling unsafe that it restarts
|
// Prevent game from feeling unsafe that it restarts
|
||||||
if (dwDesiredAccess & PROCESS_VM_WRITE) {
|
if (dwDesiredAccess & PROCESS_VM_WRITE) {
|
||||||
logging::print<logging::I>("{} Returning failure with last error code set to ERROR_ACCESS_DENIED(5).", LogTag);
|
logging::print<logging::I>("{} Returning failure with last error code set to ERROR_ACCESS_DENIED(5).", LogTag);
|
||||||
|
|
@ -100,6 +101,7 @@ void xivfixes::disable_game_openprocess_access_check(bool bApply) {
|
||||||
return hook->call_original(dwDesiredAccess, bInheritHandle, dwProcessId);
|
return hook->call_original(dwDesiredAccess, bInheritHandle, dwProcessId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
logging::print<logging::I>("{} Enable", LogTag);
|
||||||
} else {
|
} else {
|
||||||
logging::print<logging::I>("{} Disable", LogTag);
|
logging::print<logging::I>("{} Disable", LogTag);
|
||||||
hook.reset();
|
hook.reset();
|
||||||
|
|
@ -111,7 +113,6 @@ void xivfixes::redirect_openprocess(bool bApply) {
|
||||||
static std::optional<hooks::direct_hook<decltype(OpenProcess)>> hook;
|
static std::optional<hooks::direct_hook<decltype(OpenProcess)>> hook;
|
||||||
|
|
||||||
if (bApply) {
|
if (bApply) {
|
||||||
logging::print<logging::I>("{} Enable", LogTag);
|
|
||||||
hook.emplace(OpenProcess);
|
hook.emplace(OpenProcess);
|
||||||
hook->set_detour([](DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)->HANDLE {
|
hook->set_detour([](DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)->HANDLE {
|
||||||
if (dwProcessId == GetCurrentProcessId()) {
|
if (dwProcessId == GetCurrentProcessId()) {
|
||||||
|
|
@ -125,6 +126,8 @@ void xivfixes::redirect_openprocess(bool bApply) {
|
||||||
return hook->call_original(dwDesiredAccess, bInheritHandle, dwProcessId);
|
return hook->call_original(dwDesiredAccess, bInheritHandle, dwProcessId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
logging::print<logging::I>("{} Enable", LogTag);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logging::print<logging::I>("{} Disable", LogTag);
|
logging::print<logging::I>("{} Disable", LogTag);
|
||||||
hook.reset();
|
hook.reset();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue