summaryrefslogtreecommitdiffhomepage
path: root/Private/ObjectKit/ObjectKit.hxx
blob: 329b2c78e75f980d29e80fbe0a7d6c7c3f98a160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* -------------------------------------------

    Copyright Mahrouss Logic

------------------------------------------- */

#pragma once

#include <NewKit/Defines.hpp>
#include <CFKit/GUIDWrapper.hpp>

#define kObjectGlobalNamespaceSystem "HCORE_ROOT\\"
#define kObjectGlobalNamespaceUser "HCORE_USER_ROOT\\"

enum {
  kObjectTypeProcess,
  kObjectTypeFile,
  kObjectTypeDevice,
  kObjectTypeNetwork,
  kObjectTypeInvalid,
  KObjectTypeUserDefined = 0xCF,
  kObjectTypeCount = 5,
};

/// \brief Object handle.
/// \author Amlal El Mahrouss
typedef struct Object final {
  HCore::Char ObjectName[255];
  HCore::Int32 ObjectType;
  HCore::Char ObjectNamespace[255];

  HCore::Void(*Release)(struct Object* Self);
  HCore::IntPtr(*Invoke)(struct Object* Self, HCore::Int32 Sel, ...);
  HCore::Void(*Query)(struct Object* Self, HCore::VoidPtr* Dst, HCore::SizeT SzDst, HCore::XRN::GUIDSequence GuidOf);
} Object, *ObjectPtr;

#define object_cast reinterpret_cast