summaryrefslogtreecommitdiffhomepage
path: root/dev/ddk/DriverKit/macros.h
blob: 9b7b3d50128672561f49338a82d00152c975b4a3 (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
/* -------------------------------------------

  Copyright 2025 Amlal El Mahrouss.

  FILE: ddk.h
  PURPOSE: DDK Driver model base header.

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

#pragma once

#include <stddef.h>
#include <stdint.h>

#if defined(__cplusplus)
#define BOOL bool
#define YES true
#define NO false
#define DDK_EXTERN extern "C" __declspec(dllexport)
#define nil nullptr
#undef NULL
#define NULL 0
#define DDK_FINAL final
#else
#define BOOL char
#define YES 1
#define NO 0
#define DDK_EXTERN extern __declspec(dllexport)
#define nil ((void*) 0)
#undef NULL
#define NULL ((void*) 0)
#define DDK_FINAL
#endif  // defined(__cplusplus)

#ifndef __DDK__
#undef DDK_EXTERN
#if defined(__cplusplus)
#define DDK_EXTERN extern "C" __declspec(dllimport)
#else
#define DDK_EXTERN __declspec(dllimport)
#endif
#endif

#define ATTRIBUTE(X) __attribute__((X))

#ifndef __NEOSKRNL__
#error !!! Do not include header in EL0/Ring 3 mode !!!
#endif  // __NEOSKRNL__