summaryrefslogtreecommitdiffhomepage
path: root/Private/CFKit/GUIDWrapper.hpp
blob: 8a71c614c9f499bfa736f356d229156f19e86b16 (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
38
39
40
41
42
43
44
45
46
47
48
49
/* -------------------------------------------

    Copyright Mahrouss Logic

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

#pragma once

#include <NewKit/Defines.hpp>
#include <NewKit/Ref.hpp>
#include <NewKit/Stream.hpp>

/* GUID for C++ Components */

#define kXRNNil "@{........-....-M...-N...-............}"

// eXtensible Resource Information
namespace NewOS::XRN {
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 m_Ms1;
    UShort m_Ms2;
    UShort m_Ms3;
    UChar m_Ms4[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 m_UUID; }
  GUIDSequence &Leak() noexcept { return m_UUID; }

 private:
  GUIDSequence m_UUID;
};
}  // namespace NewOS::XRN