Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

381 lines
5.9 KiB

  1. #ifdef DEBUG
  2. #ifdef K32
  3. const char UnimpMessage[] = "Unimplemented API %s";
  4. const char AttentionMessage[] = "ATTENTION !!! API stub might corrupt the stack";
  5. enum {DEB_FATAL, DEB_ERR, DEB_WARN, DEB_TRACE };
  6. int apiLevel = DEB_WARN;
  7. VOID KERNENTRY vDebugOut(int level, const char *pfmt, ...);
  8. #define DebugOut(args) vDebugOut args
  9. #define UNIMP_MESSAGE DebugOut((apiLevel, UnimpMessage, api_string));
  10. #define DEBUG_OOPS DebugOut((DEB_ERR, UnimpMessage, api_string)); \
  11. #else
  12. const char UnimpMessage[] = "Unimplemented API %s\r\n";
  13. const char AttentionMessage[] = "ATTENTION !!! API stub might corrupt the stack\r\n";
  14. #define UNIMP_MESSAGE DebugPrintf(UnimpMessage, api_string);
  15. #define DEBUG_OOPS DebugPrintf(UnimpMessage, api_string); _asm { int 3 };
  16. #endif
  17. #endif
  18. /*
  19. * Macros for unimplemented APIs stubs.
  20. *
  21. */
  22. #define API_name(api_name) api_name
  23. #define API_decl(api_name) long APIENTRY API_name(api_name)
  24. #ifdef DEBUG
  25. #define API_body(api_name, return_value) \
  26. const char api_string[] = #api_name; \
  27. UNIMP_MESSAGE \
  28. SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
  29. return(return_value);
  30. #else
  31. #define API_body(api_name, return_value) \
  32. SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
  33. return(return_value);
  34. #endif
  35. #ifdef DEBUG
  36. #define APISTUB_(api_name, return_value) \
  37. API_decl(api_name) (VOID) \
  38. { \
  39. const char api_string[] = #api_name; \
  40. DebugPrintf(AttentionMessage); \
  41. DEBUG_OOPS \
  42. SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
  43. return(return_value); \
  44. }
  45. #else
  46. #define APISTUB_(api_name, return_value) \
  47. API_decl(api_name) (VOID) \
  48. { \
  49. SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
  50. return(return_value); \
  51. }
  52. #endif
  53. #define APISTUB_0(api_name, return_value) \
  54. API_decl(api_name) (VOID) \
  55. { \
  56. API_body(api_name, return_value) \
  57. }
  58. #define APISTUB_1(api_name, return_value) \
  59. API_decl(api_name) ( \
  60. int p1 \
  61. ) \
  62. { \
  63. API_body(api_name, return_value) \
  64. p1; \
  65. }
  66. #define APISTUB_2(api_name, return_value) \
  67. API_decl(api_name) ( \
  68. int p1, \
  69. int p2 \
  70. ) \
  71. { \
  72. API_body(api_name, return_value) \
  73. p1; \
  74. p2; \
  75. }
  76. #define APISTUB_3(api_name, return_value) \
  77. API_decl(api_name) ( \
  78. int p1, \
  79. int p2, \
  80. int p3 \
  81. ) \
  82. { \
  83. API_body(api_name, return_value) \
  84. p1; \
  85. p2; \
  86. p3; \
  87. }
  88. #define APISTUB_4(api_name, return_value) \
  89. API_decl(api_name) ( \
  90. int p1, \
  91. int p2, \
  92. int p3, \
  93. int p4 \
  94. ) \
  95. { \
  96. API_body(api_name, return_value) \
  97. p1; \
  98. p2; \
  99. p3; \
  100. p4; \
  101. }
  102. #define APISTUB_5(api_name, return_value) \
  103. API_decl(api_name) ( \
  104. int p1, \
  105. int p2, \
  106. int p3, \
  107. int p4, \
  108. int p5 \
  109. ) \
  110. { \
  111. API_body(api_name, return_value) \
  112. p1; \
  113. p2; \
  114. p3; \
  115. p4; \
  116. p5; \
  117. }
  118. #define APISTUB_6(api_name, return_value) \
  119. API_decl(api_name) ( \
  120. int p1, \
  121. int p2, \
  122. int p3, \
  123. int p4, \
  124. int p5, \
  125. int p6 \
  126. ) \
  127. { \
  128. API_body(api_name, return_value) \
  129. p1; \
  130. p2; \
  131. p3; \
  132. p4; \
  133. p5; \
  134. p6; \
  135. }
  136. #define APISTUB_7(api_name, return_value) \
  137. API_decl(api_name) ( \
  138. int p1, \
  139. int p2, \
  140. int p3, \
  141. int p4, \
  142. int p5, \
  143. int p6, \
  144. int p7 \
  145. ) \
  146. { \
  147. API_body(api_name, return_value) \
  148. p1; \
  149. p2; \
  150. p3; \
  151. p4; \
  152. p5; \
  153. p6; \
  154. p7; \
  155. }
  156. #define APISTUB_8(api_name, return_value) \
  157. API_decl(api_name) ( \
  158. int p1, \
  159. int p2, \
  160. int p3, \
  161. int p4, \
  162. int p5, \
  163. int p6, \
  164. int p7, \
  165. int p8 \
  166. ) \
  167. { \
  168. API_body(api_name, return_value) \
  169. p1; \
  170. p2; \
  171. p3; \
  172. p4; \
  173. p5; \
  174. p6; \
  175. p7; \
  176. p8; \
  177. }
  178. #define APISTUB_9(api_name, return_value) \
  179. API_decl(api_name) ( \
  180. int p1, \
  181. int p2, \
  182. int p3, \
  183. int p4, \
  184. int p5, \
  185. int p6, \
  186. int p7, \
  187. int p8, \
  188. int p9 \
  189. ) \
  190. { \
  191. API_body(api_name, return_value) \
  192. p1; \
  193. p2; \
  194. p3; \
  195. p4; \
  196. p5; \
  197. p6; \
  198. p7; \
  199. p8; \
  200. p9; \
  201. }
  202. #define APISTUB_10(api_name, return_value) \
  203. API_decl(api_name) ( \
  204. int p1, \
  205. int p2, \
  206. int p3, \
  207. int p4, \
  208. int p5, \
  209. int p6, \
  210. int p7, \
  211. int p8, \
  212. int p9, \
  213. int p10 \
  214. ) \
  215. { \
  216. API_body(api_name, return_value) \
  217. p1; \
  218. p2; \
  219. p3; \
  220. p4; \
  221. p5; \
  222. p6; \
  223. p7; \
  224. p8; \
  225. p9; \
  226. p10; \
  227. }
  228. #define APISTUB_11(api_name, return_value) \
  229. API_decl(api_name) ( \
  230. int p1, \
  231. int p2, \
  232. int p3, \
  233. int p4, \
  234. int p5, \
  235. int p6, \
  236. int p7, \
  237. int p8, \
  238. int p9, \
  239. int p10, \
  240. int p11 \
  241. ) \
  242. { \
  243. API_body(api_name, return_value) \
  244. p1; \
  245. p2; \
  246. p3; \
  247. p4; \
  248. p5; \
  249. p6; \
  250. p7; \
  251. p8; \
  252. p9; \
  253. p10; \
  254. p11; \
  255. }
  256. #define APISTUB_12(api_name, return_value) \
  257. API_decl(api_name) ( \
  258. int p1, \
  259. int p2, \
  260. int p3, \
  261. int p4, \
  262. int p5, \
  263. int p6, \
  264. int p7, \
  265. int p8, \
  266. int p9, \
  267. int p10, \
  268. int p11, \
  269. int p12 \
  270. ) \
  271. { \
  272. API_body(api_name, return_value) \
  273. p1; \
  274. p2; \
  275. p3; \
  276. p4; \
  277. p5; \
  278. p6; \
  279. p7; \
  280. p8; \
  281. p9; \
  282. p10; \
  283. p11; \
  284. p12; \
  285. }
  286. #define APISTUB_13(api_name, return_value) \
  287. API_decl(api_name) ( \
  288. int p1, \
  289. int p2, \
  290. int p3, \
  291. int p4, \
  292. int p5, \
  293. int p6, \
  294. int p7, \
  295. int p8, \
  296. int p9, \
  297. int p10, \
  298. int p11, \
  299. int p12, \
  300. int p13 \
  301. ) \
  302. { \
  303. API_body(api_name, return_value) \
  304. p1; \
  305. p2; \
  306. p3; \
  307. p4; \
  308. p5; \
  309. p6; \
  310. p7; \
  311. p8; \
  312. p9; \
  313. p10; \
  314. p11; \
  315. p12; \
  316. p13; \
  317. }
  318. #define APISTUB_14(api_name, return_value) \
  319. API_decl(api_name) ( \
  320. int p1, \
  321. int p2, \
  322. int p3, \
  323. int p4, \
  324. int p5, \
  325. int p6, \
  326. int p7, \
  327. int p8, \
  328. int p9, \
  329. int p10, \
  330. int p11, \
  331. int p12, \
  332. int p13, \
  333. int p14 \
  334. ) \
  335. { \
  336. API_body(api_name, return_value) \
  337. p1; \
  338. p2; \
  339. p3; \
  340. p4; \
  341. p5; \
  342. p6; \
  343. p7; \
  344. p8; \
  345. p9; \
  346. p10; \
  347. p11; \
  348. p12; \
  349. p13; \
  350. p14; \
  351. }
  352. /*
  353. * Miscelaneous declarations needed for the APIs
  354. */
  355. extern void _cdecl DebugPrintf();