mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +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
|
|
@ -9,7 +9,7 @@
|
|||
HMODULE g_hModule;
|
||||
HINSTANCE g_hGameInstance = GetModuleHandleW(nullptr);
|
||||
|
||||
DWORD WINAPI InitializeImpl(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
||||
HRESULT WINAPI InitializeImpl(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
||||
g_startInfo.from_envvars();
|
||||
|
||||
std::string jsonParseError;
|
||||
|
|
@ -114,7 +114,7 @@ DWORD WINAPI InitializeImpl(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
logging::I("Calling InitializeClrAndGetEntryPoint");
|
||||
|
||||
void* entrypoint_vfn;
|
||||
int result = InitializeClrAndGetEntryPoint(
|
||||
const auto result = InitializeClrAndGetEntryPoint(
|
||||
g_hModule,
|
||||
g_startInfo.BootEnableEtw,
|
||||
runtimeconfig_path,
|
||||
|
|
@ -124,7 +124,7 @@ DWORD WINAPI InitializeImpl(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
L"Dalamud.EntryPoint+InitDelegate, Dalamud",
|
||||
&entrypoint_vfn);
|
||||
|
||||
if (result != 0)
|
||||
if (FAILED(result))
|
||||
return result;
|
||||
|
||||
using custom_component_entry_point_fn = void (CORECLR_DELEGATE_CALLTYPE*)(LPVOID, HANDLE);
|
||||
|
|
@ -156,7 +156,7 @@ DWORD WINAPI InitializeImpl(LPVOID lpParam, HANDLE hMainThreadContinue) {
|
|||
entrypoint_fn(lpParam, hMainThreadContinue);
|
||||
logging::I("Done!");
|
||||
|
||||
return 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
extern "C" DWORD WINAPI Initialize(LPVOID lpParam) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue