summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/KernelKit/IPEFDylibObject.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:13:48 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:15:17 +0100
commita13e1c0911c0627184bc38f18c7fdda64447b3ad (patch)
tree073a62c09bf216e85a3f310376640fa1805147f9 /dev/Kernel/KernelKit/IPEFDylibObject.h
parent149fa096eb306d03686b3b67e813cf1a78e08cd0 (diff)
meta(kernel): Reworked repository's filesystem structure.
Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/KernelKit/IPEFDylibObject.h')
-rw-r--r--dev/Kernel/KernelKit/IPEFDylibObject.h106
1 files changed, 0 insertions, 106 deletions
diff --git a/dev/Kernel/KernelKit/IPEFDylibObject.h b/dev/Kernel/KernelKit/IPEFDylibObject.h
deleted file mode 100644
index 20f87410..00000000
--- a/dev/Kernel/KernelKit/IPEFDylibObject.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * ========================================================
- *
- * Kernel
- * Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
- *
- * ========================================================
- */
-
-#ifndef __KERNELKIT_SHARED_OBJECT_H__
-#define __KERNELKIT_SHARED_OBJECT_H__
-
-#include <KernelKit/PEF.h>
-#include <NewKit/Defines.h>
-#include <KernelKit/PEFCodeMgr.h>
-#include <KernelKit/UserProcessScheduler.h>
-#include <KernelKit/IDylibObject.h>
-
-namespace NeOS
-{
- /**
- * @brief Shared Library class
- * Load library from this class
- */
- class IPEFDylibObject final NE_DYLIB_OBJECT
- {
- public:
- explicit IPEFDylibObject() = default;
- ~IPEFDylibObject() = default;
-
- public:
- NE_COPY_DEFAULT(IPEFDylibObject);
-
- private:
- DLL_TRAITS* fMounted{nullptr};
-
- public:
- DLL_TRAITS** GetAddressOf()
- {
- return &fMounted;
- }
-
- DLL_TRAITS* Get()
- {
- return fMounted;
- }
-
- public:
- void Mount(DLL_TRAITS* to_mount)
- {
- if (!to_mount || !to_mount->ImageObject)
- return;
-
- fMounted = to_mount;
-
- if (fLoader && to_mount)
- {
- delete fLoader;
- fLoader = nullptr;
- }
-
- if (!fLoader)
- {
- fLoader = new PEFLoader(fMounted->ImageObject);
- }
- }
-
- void Unmount()
- {
- if (fMounted)
- fMounted = nullptr;
- };
-
- template <typename SymbolType>
- SymbolType Load(const Char* symbol_name, SizeT len, Int32 kind)
- {
- if (symbol_name == nullptr || *symbol_name == 0)
- return nullptr;
- if (len > kPathLen || len < 1)
- return nullptr;
-
- auto ret =
- reinterpret_cast<SymbolType>(fLoader->FindSymbol(symbol_name, kind));
-
- if (!ret)
- {
- if (kind == kPefCode)
- return (VoidPtr)&__zka_pure_call;
-
- return nullptr;
- }
-
- return ret;
- }
-
- private:
- PEFLoader* fLoader{nullptr};
- };
-
- typedef IPEFDylibObject* IDylibRef;
-
- EXTERN_C IDylibRef rtl_init_dylib(UserProcess& header);
- EXTERN_C Void rtl_fini_dylib(UserProcess& header, IDylibRef lib, Bool* successful);
-} // namespace NeOS
-
-#endif /* ifndef __KERNELKIT_SHARED_OBJECT_H__ */