diff options
| author | amlal <amlal@el-mahrouss-logic.com> | 2024-03-21 00:38:52 +0100 |
|---|---|---|
| committer | amlal <amlal@el-mahrouss-logic.com> | 2024-03-21 00:38:52 +0100 |
| commit | 333fed96b7ccd3ee4f5f097445408dde34d330db (patch) | |
| tree | a1c9894b26bd81c2e762b5487e04601b357682f2 /Public/Kits/System.Core/Defs.hxx | |
| parent | f48c5b2cda43241919d3ea1b263bef01e014c537 (diff) | |
Kernel: See below.
- Fix kernel heap, made it better.
- Fix System.Core, made it better.
Signed-off-by: amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Kits/System.Core/Defs.hxx')
| -rw-r--r-- | Public/Kits/System.Core/Defs.hxx | 71 |
1 files changed, 64 insertions, 7 deletions
diff --git a/Public/Kits/System.Core/Defs.hxx b/Public/Kits/System.Core/Defs.hxx index 84bdc7bb..e99abcc4 100644 --- a/Public/Kits/System.Core/Defs.hxx +++ b/Public/Kits/System.Core/Defs.hxx @@ -7,7 +7,7 @@ #pragma once #ifndef __cplusplus -#error This API is meant to be used with C++ +#error This API is meant to be used with C++. #endif #ifdef CA_MUST_PASS @@ -38,7 +38,7 @@ CA_EXTERN_C void __assert_chk_fail(void); #define CA_CDECL __attribute__((cdecl)) #define CA_MSCALL __attribute__((ms_abi)) -#define CA_PASCALL CA_STDCALL +#define CA_PASCAL CA_STDCALL typedef __UINT8_TYPE__ BYTE; typedef __UINT16_TYPE__ WORD; @@ -61,13 +61,16 @@ typedef __INT32_TYPE__ INT32; typedef __WCHAR_TYPE__ WCHAR; typedef WCHAR* PWCHAR; -typedef bool BOOL; +typedef CHAR BOOL; -#define TRUE true -#define FALSE false +#define TRUE 1 +#define FALSE 0 #define PTR * +#define FAR __far +#define NEAR __near + #define CA_UNREFERENCED_PARAMETER(e) ((VOID)e) #ifdef __x86_64__ @@ -123,7 +126,61 @@ class SystemException { virtual const char *Name() = 0; virtual const char *Reason() = 0; +}; + +/// @brief Object exception +/// Throws when the object isn't found. +class ObjectNotFoundException : public SystemException { + public: + explicit ObjectNotFoundException() = default; + virtual ~ObjectNotFoundException() = default; + + public: + HCORE_COPY_DEFAULT(ObjectNotFoundException); + + public: + const char *Name() override { return "ObjectNotFoundException"; } + const char *Reason() override { return mReason; } + + private: + const char *mReason{ + "System.Core: ObjectNotFoundException: Catastrophic failure!"}; +}; + +/// @brief pointer exception +/// Throws when the object isn't found. +class PointerException : public SystemException { + public: + explicit PointerException() = default; + virtual ~PointerException() = default; + + public: + HCORE_COPY_DEFAULT(PointerException); + + public: + const char *Name() override { return "PointerException"; } + const char *Reason() override { return mReason; } + private: const char *mReason{ - "System.Core: SystemException: Catastrophic failure!"}; -};
\ No newline at end of file + "System.Core: PointerException: Catastrophic failure!"}; +}; + +/// @brief pointer exception +/// Throws when the object isn't found. +class NullPointerException : public SystemException { + public: + explicit NullPointerException() = default; + virtual ~NullPointerException() = default; + + public: + HCORE_COPY_DEFAULT(NullPointerException); + + public: + const char *Name() override { return "NullPointerException"; } + const char *Reason() override { return mReason; } + + private: + const char *mReason{ + "System.Core: NullPointerException: Catastrophic failure!"}; +}; |
