[RTL][NTDLL]
[reactos.git] / reactos / drivers / filesystems / udfs / Include / CrossNt / CrNtDecl.h
1
2 #ifdef CROSSNT_DECL
3 #undef CROSSNT_DECL
4 #undef CROSSNT_DECL_EX
5 #endif //CROSSNT_DECL
6
7 /***************************/
8 #ifdef CROSSNT_DECL_API
9
10 #define CROSSNT_DECL(type, dspec, name, args, callargs) \
11 typedef type (dspec *ptr##name) args; \
12 extern "C" ptr##name CrNt##name; \
13 type dspec CrNt##name##_impl args;
14
15 #define CROSSNT_DECL_EX(mod, type, dspec, name, args, callargs) \
16 typedef type (dspec *ptr##name) args; \
17 extern "C" ptr##name CrNt##name; \
18 type dspec CrNt##name##_impl args;
19
20 #endif //CROSSNT_DECL_API
21
22 /***************************/
23 #ifdef CROSSNT_DECL_STUB
24
25 #define CROSSNT_DECL(type, dspec, name, args, callargs) \
26 extern "C" ptr##name CrNt##name = NULL; \
27
28 #define CROSSNT_DECL_EX(mod, type, dspec, name, args, callargs) \
29 extern "C" ptr##name CrNt##name = NULL; \
30
31 #endif //CROSSNT_DECL_STUB
32
33 /***************************/
34 #ifdef CROSSNT_INIT_STUB
35
36 #define CROSSNT_DECL(type, dspec, name, args, callargs) \
37 KdPrint(("Init " #name " cur %x\n", CrNt##name)); \
38 if(!CrNt##name) { \
39 CrNt##name = (ptr##name)CrNtGetProcAddress(g_hNtosKrnl, #name); \
40 KdPrint((" GetProcAddr(NTOSKRNL.EXE," #name ") = %x\n", CrNt##name)); \
41 if(!CrNt##name) { \
42 CrNt##name = CrNt##name##_impl; \
43 } \
44 KdPrint((" final %\n", CrNt##name)); \
45 }
46
47 #define CROSSNT_DECL_EX(mod, type, dspec, name, args, callargs) \
48 KdPrint(("Init " mod "," #name " cur %x\n", CrNt##name)); \
49 if(!CrNt##name) { \
50 CrNt##name = (ptr##name)CrNtGetProcAddress(CrNtGetModuleBase(mod), #name); \
51 KdPrint((" GetProcAddr(" mod "," #name ") = %x\n", CrNt##name)); \
52 if(!CrNt##name) { \
53 CrNt##name = CrNt##name##_impl; \
54 } \
55 KdPrint((" final %x\n", CrNt##name)); \
56 }
57
58 #endif //CROSSNT_INIT_STUB