From a13e1c0911c0627184bc38f18c7fdda64447b3ad Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 23 Mar 2025 19:13:48 +0100 Subject: meta(kernel): Reworked repository's filesystem structure. Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss --- dev/Kernel/CFKit/GUIDWizard.h | 24 ----------------- dev/Kernel/CFKit/GUIDWrapper.h | 60 ------------------------------------------ dev/Kernel/CFKit/Property.h | 56 --------------------------------------- dev/Kernel/CFKit/Utils.h | 55 -------------------------------------- 4 files changed, 195 deletions(-) delete mode 100644 dev/Kernel/CFKit/GUIDWizard.h delete mode 100644 dev/Kernel/CFKit/GUIDWrapper.h delete mode 100644 dev/Kernel/CFKit/Property.h delete mode 100644 dev/Kernel/CFKit/Utils.h (limited to 'dev/Kernel/CFKit') diff --git a/dev/Kernel/CFKit/GUIDWizard.h b/dev/Kernel/CFKit/GUIDWizard.h deleted file mode 100644 index 5236688f..00000000 --- a/dev/Kernel/CFKit/GUIDWizard.h +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace CFKit::XRN::Version1 -{ - using namespace NeOS; - - Ref cf_make_sequence(const ArrayList& seq); - ErrorOr> cf_try_guid_to_string(Ref& guid); -} // namespace CFKit::XRN::Version1 diff --git a/dev/Kernel/CFKit/GUIDWrapper.h b/dev/Kernel/CFKit/GUIDWrapper.h deleted file mode 100644 index 3b7ada6d..00000000 --- a/dev/Kernel/CFKit/GUIDWrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -/* GUID for C++ Components */ - -#define kXRNNil "@{........-....-M...-N...-............}" - -// eXtensible Resource Information -namespace CFKit::XRN -{ - using namespace NeOS; - - union GUIDSequence { - alignas(8) UShort u8[16]; - alignas(8) UShort u16[8]; - alignas(8) UInt u32[4]; - alignas(8) ULong u64[2]; - - struct - { - alignas(8) UInt fMs1; - UShort fMs2; - UShort fMs3; - UChar fMs4[8]; - }; - }; - - class GUID final - { - public: - explicit GUID() = default; - ~GUID() = default; - - public: - GUID& operator=(const GUID&) = default; - GUID(const GUID&) = default; - - public: - GUIDSequence& operator->() noexcept - { - return fUUID; - } - GUIDSequence& Leak() noexcept - { - return fUUID; - } - - private: - GUIDSequence fUUID; - }; -} // namespace CFKit::XRN diff --git a/dev/Kernel/CFKit/Property.h b/dev/Kernel/CFKit/Property.h deleted file mode 100644 index e4588ad6..00000000 --- a/dev/Kernel/CFKit/Property.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. - -------------------------------------------- */ - -#ifndef CFKIT_PROPS_H -#define CFKIT_PROPS_H - -#include -#include -#include -#include -#include - -#define kMaxPropLen (256U) - -namespace CFKit -{ - using namespace NeOS; - - /// @brief handle to anything (number, ptr, string...) - using PropertyId = UIntPtr; - - /// @brief Kernel property class. - /// @example /prop/smp_max or /prop/kern_ver - class Property - { - public: - Property(); - virtual ~Property(); - - public: - Property& operator=(const Property&) = default; - Property(const Property&) = default; - - BOOL StringEquals(KString& name); - PropertyId& GetValue(); - KString& GetKey(); - - private: - KString fName{kMaxPropLen}; - PropertyId fValue{0UL}; - Ref fGUID{}; - }; - - template - using PropertyArray = Array; -} // namespace CFKit - -namespace NeOS -{ - using namespace CFKit; -} - -#endif // !CFKIT_PROPS_H diff --git a/dev/Kernel/CFKit/Utils.h b/dev/Kernel/CFKit/Utils.h deleted file mode 100644 index b8f16164..00000000 --- a/dev/Kernel/CFKit/Utils.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef CFKIT_UTILS_H -#define CFKIT_UTILS_H - -#include -#include - -namespace CFKit -{ - using namespace NeOS; - - /// @brief Finds the PE header inside the blob. - inline auto ldr_find_exec_header(DosHeaderPtr ptrDos) -> LDR_EXEC_HEADER_PTR - { - if (!ptrDos) - return nullptr; - - if (ptrDos->eMagic[0] != kMagMz0) - return nullptr; - - if (ptrDos->eMagic[1] != kMagMz1) - return nullptr; - - return (LDR_EXEC_HEADER_PTR)(VoidPtr)(&ptrDos->eLfanew + 1); - } - - /// @brief Finds the PE optional header inside the blob. - inline auto ldr_find_opt_exec_header(DosHeaderPtr ptrDos) -> LDR_OPTIONAL_HEADER_PTR - { - if (!ptrDos) - return nullptr; - - auto exec = ldr_find_exec_header(ptrDos); - - if (!exec) - return nullptr; - - return (LDR_OPTIONAL_HEADER_PTR)(VoidPtr)(&exec->Characteristics + 1); - } - - /// @brief Finds the PE header inside the blob. - /// @note overloaded function. - inline auto ldr_find_exec_header(const Char* ptrDos) -> LDR_EXEC_HEADER_PTR - { - return ldr_find_exec_header((DosHeaderPtr)ptrDos); - } - - /// @brief Finds the PE header inside the blob. - /// @note overloaded function. - inline auto ldr_find_opt_exec_header(const Char* ptrDos) -> LDR_OPTIONAL_HEADER_PTR - { - return ldr_find_opt_exec_header((DosHeaderPtr)ptrDos); - } -} // namespace CFKit - -#endif // ifndef CFKIT_UTILS_H -- cgit v1.2.3