7 /***************************/
8 #ifdef CROSSNT_DECL_API
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;
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;
20 #endif //CROSSNT_DECL_API
22 /***************************/
23 #ifdef CROSSNT_DECL_STUB
25 #define CROSSNT_DECL(type, dspec, name, args, callargs) \
26 extern "C" ptr##name CrNt##name = NULL; \
28 #define CROSSNT_DECL_EX(mod, type, dspec, name, args, callargs) \
29 extern "C" ptr##name CrNt##name = NULL; \
31 #endif //CROSSNT_DECL_STUB
33 /***************************/
34 #ifdef CROSSNT_INIT_STUB
36 #define CROSSNT_DECL(type, dspec, name, args, callargs) \
37 KdPrint(("Init " #name " cur %x\n", CrNt##name)); \
39 CrNt##name = (ptr##name)CrNtGetProcAddress(g_hNtosKrnl, #name); \
40 KdPrint((" GetProcAddr(NTOSKRNL.EXE," #name ") = %x\n", CrNt##name)); \
42 CrNt##name = CrNt##name##_impl; \
44 KdPrint((" final %\n", CrNt##name)); \
47 #define CROSSNT_DECL_EX(mod, type, dspec, name, args, callargs) \
48 KdPrint(("Init " mod "," #name " cur %x\n", CrNt##name)); \
50 CrNt##name = (ptr##name)CrNtGetProcAddress(CrNtGetModuleBase(mod), #name); \
51 KdPrint((" GetProcAddr(" mod "," #name ") = %x\n", CrNt##name)); \
53 CrNt##name = CrNt##name##_impl; \
55 KdPrint((" final %x\n", CrNt##name)); \
58 #endif //CROSSNT_INIT_STUB