From f0a3c583c80dc922edf70347cb493dff0bb5709a Mon Sep 17 00:00:00 2001 From: Amlal Date: Wed, 28 Aug 2024 19:40:36 +0200 Subject: [IMP] RunSCM, RunDLL64 programs, needs SCI.dll to implement these functions though. [WIP] WRenderer DLL, which takes care of Window rendering, add UIRenderView class. - Note that this DLL is used internally by the shell, it shouldn't be linked with. Signed-off-by: Amlal --- dev/DLL/RunDLL64/Sources/LauncherMain.cxx | 22 ++++++++++++++++++++++ dev/DLL/RunDLL64/Sources/compile_flags.txt | 1 + dev/DLL/RunDLL64/build.json | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 dev/DLL/RunDLL64/Sources/LauncherMain.cxx create mode 100644 dev/DLL/RunDLL64/Sources/compile_flags.txt create mode 100644 dev/DLL/RunDLL64/build.json (limited to 'dev/DLL/RunDLL64') diff --git a/dev/DLL/RunDLL64/Sources/LauncherMain.cxx b/dev/DLL/RunDLL64/Sources/LauncherMain.cxx new file mode 100644 index 00000000..0d64b654 --- /dev/null +++ b/dev/DLL/RunDLL64/Sources/LauncherMain.cxx @@ -0,0 +1,22 @@ +#include + +typedef int (*main_t)(int, char**); + +int WinMain(int argc, char* argv[]) +{ + if (argc < 3) + return -1; + + auto mainDll = LdrOpenDLL(argv[1], argv[2]); + + int (*entrypointOff)(int, char**) = (main_t)LdrGetDLLProc(argv[3], mainDll); + + if (!entrypointOff) + return -1; + + int ret = entrypointOff(argc, argv); + + LdrCloseDLL(mainDll); + + return ret; +} diff --git a/dev/DLL/RunDLL64/Sources/compile_flags.txt b/dev/DLL/RunDLL64/Sources/compile_flags.txt new file mode 100644 index 00000000..53118879 --- /dev/null +++ b/dev/DLL/RunDLL64/Sources/compile_flags.txt @@ -0,0 +1 @@ +-I../../SCI diff --git a/dev/DLL/RunDLL64/build.json b/dev/DLL/RunDLL64/build.json new file mode 100644 index 00000000..50c083d5 --- /dev/null +++ b/dev/DLL/RunDLL64/build.json @@ -0,0 +1,19 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../", "./", "../../"], + "sources_path": ["Sources/*.cxx"], + "output_name": "rundll64.exe", + "compiler_flags": [ + "-ffreestanding", + "-fno-rtti", + "-fno-exceptions", + " -Wl,--subsystem=17" + ], + "cpp_macros": [ + "__RUNDLL_AMD64__", + "cRunDLLVersion=0x0100", + "cRunDLLVersionHighest=0x0100", + "cRunDLLVersionLowest=0x0100" + ] +} -- cgit v1.2.3