mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Dalamud.Boot doesn't need main.cpp
This commit is contained in:
parent
ee5c5e6f37
commit
8931ce75db
1 changed files with 0 additions and 49 deletions
|
|
@ -1,49 +0,0 @@
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
#include <Windows.h>
|
|
||||||
#include "CoreCLR.h"
|
|
||||||
#include "boot.h"
|
|
||||||
|
|
||||||
int wmain(int argc, char** argv)
|
|
||||||
{
|
|
||||||
#if defined(_DEBUG)
|
|
||||||
ConsoleSetup(L"Dalamud Injector Boot");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wchar_t _module_path[MAX_PATH];
|
|
||||||
GetModuleFileNameW(NULL, _module_path, sizeof _module_path / 2);
|
|
||||||
std::filesystem::path fs_module_path(_module_path);
|
|
||||||
|
|
||||||
std::wstring runtimeconfig_path = _wcsdup(fs_module_path.replace_filename(L"Dalamud.Injector.runtimeconfig.json").c_str());
|
|
||||||
std::wstring module_path = _wcsdup(fs_module_path.replace_filename(L"Dalamud.Injector.dll").c_str());
|
|
||||||
|
|
||||||
// =========================================================================== //
|
|
||||||
|
|
||||||
void* entrypoint_vfn;
|
|
||||||
int result = InitializeClrAndGetEntryPoint(
|
|
||||||
runtimeconfig_path,
|
|
||||||
module_path,
|
|
||||||
L"Dalamud.Injector.EntryPoint, Dalamud.Injector",
|
|
||||||
L"Main",
|
|
||||||
L"Dalamud.Injector.EntryPoint+MainDelegate, Dalamud.Injector",
|
|
||||||
&entrypoint_vfn);
|
|
||||||
|
|
||||||
if (result != 0)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
typedef void (CORECLR_DELEGATE_CALLTYPE* custom_component_entry_point_fn)(int, char**);
|
|
||||||
custom_component_entry_point_fn entrypoint_fn = reinterpret_cast<custom_component_entry_point_fn>(entrypoint_vfn);
|
|
||||||
|
|
||||||
printf("Running Dalamud Injector... ");
|
|
||||||
entrypoint_fn(argc, argv);
|
|
||||||
printf("Done!\n");
|
|
||||||
|
|
||||||
// =========================================================================== //
|
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
|
||||||
FreeConsole();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue