From daa4f8c748d290feba8a71e889743a8a3097ad7d Mon Sep 17 00:00:00 2001 From: Amlal Date: Wed, 25 Sep 2024 08:26:08 +0200 Subject: Refactor codebase: Move Objects to obj/, fix flags, remove .vscode, add syscalls - Refactored Objects directory to obj/ for better organization. - Fixed incorrect flags in the build process. - Removed .vscode folder to clean up unnecessary IDE settings. - Added syscall implementations for enhanced functionality. Signed-off-by: Amlal --- dev/base/RunXPCOM/build.json | 2 +- dev/base/RunXPCOM/src/LauncherMain.cxx | 28 ---------------------------- dev/base/RunXPCOM/src/xpcom.cxx | 28 ++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 dev/base/RunXPCOM/src/LauncherMain.cxx create mode 100644 dev/base/RunXPCOM/src/xpcom.cxx (limited to 'dev/base/RunXPCOM') diff --git a/dev/base/RunXPCOM/build.json b/dev/base/RunXPCOM/build.json index a932d733..45d249b8 100644 --- a/dev/base/RunXPCOM/build.json +++ b/dev/base/RunXPCOM/build.json @@ -8,7 +8,7 @@ "-ffreestanding", "-fno-rtti", "-fno-exceptions", - " -Wl,--subsystem=17" + "-Wl,--subsystem=17" ], "cpp_macros": [ "__SCM_AMD64__", diff --git a/dev/base/RunXPCOM/src/LauncherMain.cxx b/dev/base/RunXPCOM/src/LauncherMain.cxx deleted file mode 100644 index b6047435..00000000 --- a/dev/base/RunXPCOM/src/LauncherMain.cxx +++ /dev/null @@ -1,28 +0,0 @@ -#include - -typedef SInt32 (*RPCProcKind)(IUnknown*); - -/** - * @brief Main procedure for DLL runner. - */ -int WinMain(int argc, char* argv[]) -{ - if (argc < 4) - return -1; - - auto mainDll = LdrOpenDLL(argv[1], argv[2]); - - IUnknown* interface = (IUnknown*)LdrGetDLLProc(argv[3], mainDll); - RPCProcKind dllRpc = (RPCProcKind)LdrGetDLLProc(argv[4], mainDll); - - if (!dllRpc) - return -1; - if (!interface) - return -1; - - auto ret = dllRpc(interface); - - LdrCloseDLL(mainDll); - - return ret; -} diff --git a/dev/base/RunXPCOM/src/xpcom.cxx b/dev/base/RunXPCOM/src/xpcom.cxx new file mode 100644 index 00000000..9536b070 --- /dev/null +++ b/dev/base/RunXPCOM/src/xpcom.cxx @@ -0,0 +1,28 @@ +#include + +typedef SInt32 (*RPCProcKind)(IUnknown*); + +/** + * @brief Main procedure for DLL runner. + */ +int main(int argc, char* argv[]) +{ + if (argc < 4) + return -1; + + auto mainDll = LdrOpenDLL(argv[1], argv[2]); + + IUnknown* interface = (IUnknown*)LdrGetDLLProc(argv[3], mainDll); + RPCProcKind dllRpc = (RPCProcKind)LdrGetDLLProc(argv[4], mainDll); + + if (!dllRpc) + return -1; + if (!interface) + return -1; + + auto ret = dllRpc(interface); + + LdrCloseDLL(mainDll); + + return ret; +} -- cgit v1.2.3