mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Make RewriteRemoteEntryPointW report IErrorInfo, VirtualProtectEx before WriteProcessMemory
This commit is contained in:
parent
0cc28fb39d
commit
7e78b6293b
10 changed files with 254 additions and 123 deletions
|
|
@ -27,7 +27,7 @@ void ConsoleTeardown()
|
|||
|
||||
std::optional<CoreCLR> g_clr;
|
||||
|
||||
int InitializeClrAndGetEntryPoint(
|
||||
HRESULT InitializeClrAndGetEntryPoint(
|
||||
void* calling_module,
|
||||
bool enable_etw,
|
||||
std::wstring runtimeconfig_path,
|
||||
|
|
@ -76,7 +76,7 @@ int InitializeClrAndGetEntryPoint(
|
|||
if (result != 0)
|
||||
{
|
||||
logging::E("Unable to get RoamingAppData path (err={})", result);
|
||||
return result;
|
||||
return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND);
|
||||
}
|
||||
|
||||
std::filesystem::path fs_app_data(_appdata);
|
||||
|
|
@ -92,7 +92,7 @@ int InitializeClrAndGetEntryPoint(
|
|||
if (!std::filesystem::exists(dotnet_path))
|
||||
{
|
||||
logging::E("Error: Unable to find .NET runtime path");
|
||||
return 1;
|
||||
return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND);
|
||||
}
|
||||
|
||||
get_hostfxr_parameters init_parameters
|
||||
|
|
@ -137,12 +137,12 @@ int InitializeClrAndGetEntryPoint(
|
|||
entrypoint_delegate_type_name.c_str(),
|
||||
nullptr, entrypoint_fn)) != 0)
|
||||
{
|
||||
logging::E("Failed to load module (err={})", result);
|
||||
logging::E("Failed to load module (err=0x{:X})", static_cast<uint32_t>(result));
|
||||
return result;
|
||||
}
|
||||
logging::I("Done!");
|
||||
|
||||
// =========================================================================== //
|
||||
|
||||
return 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue