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.

483 lines
18 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. tbitmap.c
  5. Abstract:
  6. Test program for the Bitmap Procedures
  7. Author:
  8. Gary Kimura [GaryKi] 30-Jan-1989
  9. Revision History:
  10. --*/
  11. #include <stdio.h>
  12. #include "nt.h"
  13. #include "ntrtl.h"
  14. ULONG Buffer[512];
  15. RTL_BITMAP BitMapHeader;
  16. PRTL_BITMAP BitMap;
  17. int
  18. main(
  19. int argc,
  20. char *argv[]
  21. )
  22. {
  23. ULONG j;
  24. DbgPrint("Start BitMapTest()\n");
  25. //
  26. // First create a new bitmap
  27. //
  28. BitMap = &BitMapHeader;
  29. RtlInitializeBitMap( BitMap, Buffer, 2048*8 );
  30. //
  31. // >>>> Test setting bits
  32. //
  33. //
  34. // Now clear all bits
  35. //
  36. RtlClearAllBits( BitMap );
  37. if (RtlNumberOfClearBits( BitMap ) != 2048*8) { DbgPrint("Number of Clear bits error 1\n" ); }
  38. if (RtlNumberOfSetBits( BitMap ) != 0) { DbgPrint("Number of Set bits error 1\n" ); }
  39. //
  40. // Now set some bit patterns, and test them
  41. //
  42. RtlSetBits( BitMap, 0, 1 );
  43. RtlSetBits( BitMap, 63, 1 );
  44. RtlSetBits( BitMap, 65, 30 );
  45. RtlSetBits( BitMap, 127, 2 );
  46. RtlSetBits( BitMap, 191, 34 );
  47. if ((BitMap->Buffer[0] != 0x00000001) ||
  48. (BitMap->Buffer[1] != 0x80000000) ||
  49. (BitMap->Buffer[2] != 0x7ffffffe) ||
  50. (BitMap->Buffer[3] != 0x80000000) ||
  51. (BitMap->Buffer[4] != 0x00000001) ||
  52. (BitMap->Buffer[5] != 0x80000000) ||
  53. (BitMap->Buffer[6] != 0xffffffff) ||
  54. (BitMap->Buffer[7] != 0x00000001)) {
  55. DbgPrint("RtlSetBits Error\n");
  56. return FALSE;
  57. }
  58. if (RtlNumberOfClearBits( BitMap ) != 2048*8 - 68) { DbgPrint("Number of Clear bits error 2\n" ); }
  59. if (RtlNumberOfSetBits( BitMap ) != 68) { DbgPrint("Number of Set bits error 2\n" ); }
  60. //
  61. // Now test some RtlFindClearBitsAndSet
  62. //
  63. RtlSetAllBits( BitMap );
  64. RtlClearBits( BitMap, 0 + 10*32, 1 );
  65. RtlClearBits( BitMap, 5 + 11*32, 1 );
  66. RtlClearBits( BitMap, 7 + 12*32, 1 );
  67. RtlClearBits( BitMap, 0 + 13*32, 9 );
  68. RtlClearBits( BitMap, 4 + 14*32, 9 );
  69. RtlClearBits( BitMap, 7 + 15*32, 9 );
  70. RtlClearBits( BitMap, 0 + 16*32, 10 );
  71. RtlClearBits( BitMap, 4 + 17*32, 10 );
  72. RtlClearBits( BitMap, 6 + 18*32, 10 );
  73. RtlClearBits( BitMap, 7 + 19*32, 10 );
  74. RtlClearBits( BitMap, 0 + 110*32, 14 );
  75. RtlClearBits( BitMap, 1 + 111*32, 14 );
  76. RtlClearBits( BitMap, 2 + 112*32, 14 );
  77. RtlClearBits( BitMap, 0 + 113*32, 15 );
  78. RtlClearBits( BitMap, 1 + 114*32, 15 );
  79. RtlClearBits( BitMap, 2 + 115*32, 15 );
  80. //DbgPrint("ClearBits = %08lx, ", RtlNumberOfClearBits( BitMap ));
  81. //DbgPrint("SetBits = %08lx\n", RtlNumberOfSetBits( BitMap ));
  82. // {
  83. // ULONG i;
  84. // for (i = 0; i < 16; i++) {
  85. // DbgPrint("%2d: ", i);
  86. // DbgPrint("%08lx\n", BitMap->Buffer[i]);
  87. // }
  88. // }
  89. if (RtlFindClearBitsAndSet(BitMap, 15, 0) != 0 + 113*32) {
  90. DbgPrint("RtlFindClearBitsAndSet Error 0 + 113*32\n");
  91. return FALSE;
  92. }
  93. if (RtlFindClearBitsAndSet(BitMap, 15, 0) != 1 + 114*32) {
  94. DbgPrint("RtlFindClearBitsAndSet Error 1 + 114*32\n");
  95. return FALSE;
  96. }
  97. if (RtlFindClearBitsAndSet(BitMap, 15, 0) != 2 + 115*32) {
  98. DbgPrint("RtlFindClearBitsAndSet Error 2 + 115*32\n");
  99. return FALSE;
  100. }
  101. if (RtlFindClearBitsAndSet(BitMap, 14, 0) != 0 + 110*32) {
  102. DbgPrint("RtlFindClearBitsAndSet Error 0 + 110*32\n");
  103. return FALSE;
  104. }
  105. if (RtlFindClearBitsAndSet(BitMap, 14, 0) != 1 + 111*32) {
  106. DbgPrint("RtlFindClearBitsAndSet Error 1 + 111*32\n");
  107. return FALSE;
  108. }
  109. if (RtlFindClearBitsAndSet(BitMap, 14, 0) != 2 + 112*32) {
  110. DbgPrint("RtlFindClearBitsAndSet Error 2 + 112*32\n");
  111. return FALSE;
  112. }
  113. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 0 + 16*32) {
  114. DbgPrint("RtlFindClearBitsAndSet Error 0 + 16*32\n");
  115. return FALSE;
  116. }
  117. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 4 + 17*32) {
  118. DbgPrint("RtlFindClearBitsAndSet Error 4 + 17*32\n");
  119. return FALSE;
  120. }
  121. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 6 + 18*32) {
  122. DbgPrint("RtlFindClearBitsAndSet Error 6 + 18*32\n");
  123. return FALSE;
  124. }
  125. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 7 + 19*32) {
  126. DbgPrint("RtlFindClearBitsAndSet Error 7 + 19*32\n");
  127. return FALSE;
  128. }
  129. if (RtlFindClearBitsAndSet(BitMap, 9, 0) != 0 + 13*32) {
  130. DbgPrint("RtlFindClearBitsAndSet Error 0 + 13*32\n");
  131. return FALSE;
  132. }
  133. if (RtlFindClearBitsAndSet(BitMap, 9, 0) != 4 + 14*32) {
  134. DbgPrint("RtlFindClearBitsAndSet Error 4 + 14*32\n");
  135. return FALSE;
  136. }
  137. if (RtlFindClearBitsAndSet(BitMap, 9, 0) != 7 + 15*32) {
  138. DbgPrint("RtlFindClearBitsAndSet Error 7 + 15*32\n");
  139. return FALSE;
  140. }
  141. if (RtlFindClearBitsAndSet(BitMap, 1, 0) != 0 + 10*32) {
  142. DbgPrint("RtlFindClearBitsAndSet Error 0 + 10*32\n");
  143. return FALSE;
  144. }
  145. if (RtlFindClearBitsAndSet(BitMap, 1, 0) != 5 + 11*32) {
  146. DbgPrint("RtlFindClearBitsAndSet Error 5 + 11*32\n");
  147. return FALSE;
  148. }
  149. if (RtlFindClearBitsAndSet(BitMap, 1, 0) != 7 + 12*32) {
  150. DbgPrint("RtlFindClearBitsAndSet Error 7 + 12*32\n");
  151. return FALSE;
  152. }
  153. if (RtlNumberOfClearBits( BitMap ) != 0) { DbgPrint("Number of Clear bits error 3\n" ); }
  154. if (RtlNumberOfSetBits( BitMap ) != 2048*8) { DbgPrint("Number of Set bits error 3\n" ); }
  155. //
  156. // Now test some RtlFindClearBitsAndSet
  157. //
  158. RtlSetAllBits( BitMap );
  159. RtlClearBits( BitMap, 0 + 0*32, 1 );
  160. RtlClearBits( BitMap, 5 + 1*32, 1 );
  161. RtlClearBits( BitMap, 7 + 2*32, 1 );
  162. RtlClearBits( BitMap, 0 + 3*32, 9 );
  163. RtlClearBits( BitMap, 4 + 4*32, 9 );
  164. RtlClearBits( BitMap, 7 + 5*32, 9 );
  165. RtlClearBits( BitMap, 0 + 6*32, 10 );
  166. RtlClearBits( BitMap, 4 + 7*32, 10 );
  167. RtlClearBits( BitMap, 6 + 8*32, 10 );
  168. RtlClearBits( BitMap, 7 + 9*32, 10 );
  169. RtlClearBits( BitMap, 0 + 10*32, 14 );
  170. RtlClearBits( BitMap, 1 + 11*32, 14 );
  171. RtlClearBits( BitMap, 2 + 12*32, 14 );
  172. RtlClearBits( BitMap, 0 + 13*32, 15 );
  173. RtlClearBits( BitMap, 1 + 14*32, 15 );
  174. RtlClearBits( BitMap, 2 + 15*32, 15 );
  175. //DbgPrint("ClearBits = %08lx, ", RtlNumberOfClearBits( BitMap ));
  176. //DbgPrint("SetBits = %08lx\n", RtlNumberOfSetBits( BitMap ));
  177. // {
  178. // ULONG i;
  179. // for (i = 0; i < 16; i++) {
  180. // DbgPrint("%2d: ", i);
  181. // DbgPrint("%08lx\n", BitMap->Buffer[i]);
  182. // }
  183. // }
  184. if (RtlFindClearBitsAndSet(BitMap, 15, 0) != 0 + 13*32) {
  185. DbgPrint("RtlFindClearBitsAndSet Error 0 + 13*32\n");
  186. return FALSE;
  187. }
  188. if (RtlFindClearBitsAndSet(BitMap, 15, 0) != 1 + 14*32) {
  189. DbgPrint("RtlFindClearBitsAndSet Error 1 + 14*32\n");
  190. return FALSE;
  191. }
  192. if (RtlFindClearBitsAndSet(BitMap, 15, 0) != 2 + 15*32) {
  193. DbgPrint("RtlFindClearBitsAndSet Error 2 + 15*32\n");
  194. return FALSE;
  195. }
  196. if (RtlFindClearBitsAndSet(BitMap, 14, 0) != 0 + 10*32) {
  197. DbgPrint("RtlFindClearBitsAndSet Error 0 + 10*32\n");
  198. return FALSE;
  199. }
  200. if (RtlFindClearBitsAndSet(BitMap, 14, 0) != 1 + 11*32) {
  201. DbgPrint("RtlFindClearBitsAndSet Error 1 + 11*32\n");
  202. return FALSE;
  203. }
  204. if (RtlFindClearBitsAndSet(BitMap, 14, 0) != 2 + 12*32) {
  205. DbgPrint("RtlFindClearBitsAndSet Error 2 + 12*32\n");
  206. return FALSE;
  207. }
  208. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 0 + 6*32) {
  209. DbgPrint("RtlFindClearBitsAndSet Error 0 + 6*32\n");
  210. return FALSE;
  211. }
  212. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 4 + 7*32) {
  213. DbgPrint("RtlFindClearBitsAndSet Error 4 + 7*32\n");
  214. return FALSE;
  215. }
  216. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 6 + 8*32) {
  217. DbgPrint("RtlFindClearBitsAndSet Error 6 + 8*32\n");
  218. return FALSE;
  219. }
  220. if (RtlFindClearBitsAndSet(BitMap, 10, 0) != 7 + 9*32) {
  221. DbgPrint("RtlFindClearBitsAndSet Error 7 + 9*32\n");
  222. return FALSE;
  223. }
  224. if (RtlFindClearBitsAndSet(BitMap, 9, 0) != 0 + 3*32) {
  225. DbgPrint("RtlFindClearBitsAndSet Error 0 + 3*32\n");
  226. return FALSE;
  227. }
  228. if (RtlFindClearBitsAndSet(BitMap, 9, 0) != 4 + 4*32) {
  229. DbgPrint("RtlFindClearBitsAndSet Error 4 + 4*32\n");
  230. return FALSE;
  231. }
  232. if (RtlFindClearBitsAndSet(BitMap, 9, 0) != 7 + 5*32) {
  233. DbgPrint("RtlFindClearBitsAndSet Error 7 + 5*32\n");
  234. return FALSE;
  235. }
  236. if (RtlFindClearBitsAndSet(BitMap, 1, 0) != 0 + 0*32) {
  237. DbgPrint("RtlFindClearBitsAndSet Error 0 + 0*32\n");
  238. return FALSE;
  239. }
  240. if (RtlFindClearBitsAndSet(BitMap, 1, 0) != 5 + 1*32) {
  241. DbgPrint("RtlFindClearBitsAndSet Error 5 + 1*32\n");
  242. return FALSE;
  243. }
  244. if (RtlFindClearBitsAndSet(BitMap, 1, 0) != 7 + 2*32) {
  245. DbgPrint("RtlFindClearBitsAndSet Error 7 + 2*32\n");
  246. return FALSE;
  247. }
  248. if (RtlNumberOfClearBits( BitMap ) != 0) { DbgPrint("Number of Clear bits error 4\n" ); }
  249. if (RtlNumberOfSetBits( BitMap ) != 2048*8) { DbgPrint("Number of Set bits error 4\n" ); }
  250. //
  251. // Test RtlAreBitsClear and AreBitsSet
  252. //
  253. DbgPrint("Start bit query tests\n");
  254. RtlClearAllBits( BitMap );
  255. if (!RtlAreBitsClear( BitMap, 0, 2048*8 )) { DbgPrint("RtlAreBitsClear Error 0\n"); }
  256. RtlSetAllBits( BitMap );
  257. if (RtlAreBitsClear( BitMap, 8, 8 )) { DbgPrint("AreBitsClear Error 1\n"); }
  258. RtlClearBits( BitMap, 9, 6 );
  259. if (RtlAreBitsClear( BitMap, 8, 8 )) { DbgPrint("AreBitsClear Error 2\n"); }
  260. RtlClearBits( BitMap, 8, 1 );
  261. if (RtlAreBitsClear( BitMap, 8, 8 )) { DbgPrint("AreBitsClear Error 3\n"); }
  262. RtlClearBits( BitMap, 15, 1 );
  263. if (!RtlAreBitsClear( BitMap, 8, 8 )) { DbgPrint("AreBitsClear Error 4\n"); }
  264. RtlSetAllBits( BitMap );
  265. if (RtlAreBitsClear( BitMap, 8, 7 )) { DbgPrint("AreBitsClear Error 5\n"); }
  266. RtlClearBits( BitMap, 9, 5 );
  267. if (RtlAreBitsClear( BitMap, 8, 7 )) { DbgPrint("AreBitsClear Error 6\n"); }
  268. RtlClearBits( BitMap, 8, 1 );
  269. if (RtlAreBitsClear( BitMap, 8, 7 )) { DbgPrint("AreBitsClear Error 7\n"); }
  270. RtlClearBits( BitMap, 14, 1 );
  271. if (!RtlAreBitsClear( BitMap, 8, 7 )) { DbgPrint("AreBitsClear Error 8\n"); }
  272. RtlSetAllBits( BitMap );
  273. if (RtlAreBitsClear( BitMap, 9, 7 )) { DbgPrint("AreBitsClear Error 9\n"); }
  274. RtlClearBits( BitMap, 10, 5 );
  275. if (RtlAreBitsClear( BitMap, 9, 7 )) { DbgPrint("AreBitsClear Error 10\n"); }
  276. RtlClearBits( BitMap, 9, 1 );
  277. if (RtlAreBitsClear( BitMap, 9, 7 )) { DbgPrint("AreBitsClear Error 11\n"); }
  278. RtlClearBits( BitMap, 15, 1 );
  279. if (!RtlAreBitsClear( BitMap, 9, 7 )) { DbgPrint("AreBitsClear Error 12\n"); }
  280. RtlSetAllBits( BitMap );
  281. if (RtlAreBitsClear( BitMap, 9, 5 )) { DbgPrint("AreBitsClear Error 13\n"); }
  282. RtlClearBits( BitMap, 10, 3 );
  283. if (RtlAreBitsClear( BitMap, 9, 5 )) { DbgPrint("AreBitsClear Error 14\n"); }
  284. RtlClearBits( BitMap, 9, 1 );
  285. if (RtlAreBitsClear( BitMap, 9, 5 )) { DbgPrint("AreBitsClear Error 15\n"); }
  286. RtlClearBits( BitMap, 13, 1 );
  287. if (!RtlAreBitsClear( BitMap, 9, 5 )) { DbgPrint("AreBitsClear Error 16\n"); }
  288. RtlSetAllBits( BitMap );
  289. if (RtlAreBitsClear( BitMap, 8, 24 )) { DbgPrint("AreBitsClear Error 17\n"); }
  290. RtlClearBits( BitMap, 9, 22 );
  291. if (RtlAreBitsClear( BitMap, 8, 24 )) { DbgPrint("AreBitsClear Error 18\n"); }
  292. RtlClearBits( BitMap, 8, 1 );
  293. if (RtlAreBitsClear( BitMap, 8, 24 )) { DbgPrint("AreBitsClear Error 19\n"); }
  294. RtlClearBits( BitMap, 31, 1 );
  295. if (!RtlAreBitsClear( BitMap, 8, 24 )) { DbgPrint("AreBitsClear Error 20\n"); }
  296. RtlSetAllBits( BitMap );
  297. if (RtlAreBitsClear( BitMap, 8, 23 )) { DbgPrint("AreBitsClear Error 21\n"); }
  298. RtlClearBits( BitMap, 9, 21 );
  299. if (RtlAreBitsClear( BitMap, 8, 23 )) { DbgPrint("AreBitsClear Error 22\n"); }
  300. RtlClearBits( BitMap, 8, 1 );
  301. if (RtlAreBitsClear( BitMap, 8, 23 )) { DbgPrint("AreBitsClear Error 23\n"); }
  302. RtlClearBits( BitMap, 30, 1 );
  303. if (!RtlAreBitsClear( BitMap, 8, 23 )) { DbgPrint("AreBitsClear Error 24\n"); }
  304. RtlSetAllBits( BitMap );
  305. if (RtlAreBitsClear( BitMap, 9, 23 )) { DbgPrint("AreBitsClear Error 25\n"); }
  306. RtlClearBits( BitMap, 10, 21 );
  307. if (RtlAreBitsClear( BitMap, 9, 23 )) { DbgPrint("AreBitsClear Error 26\n"); }
  308. RtlClearBits( BitMap, 9, 1 );
  309. if (RtlAreBitsClear( BitMap, 9, 23 )) { DbgPrint("AreBitsClear Error 27\n"); }
  310. RtlClearBits( BitMap, 31, 1 );
  311. if (!RtlAreBitsClear( BitMap, 9, 23 )) { DbgPrint("AreBitsClear Error 28\n"); }
  312. RtlSetAllBits( BitMap );
  313. if (RtlAreBitsClear( BitMap, 9, 21 )) { DbgPrint("AreBitsClear Error 29\n"); }
  314. RtlClearBits( BitMap, 10, 19 );
  315. if (RtlAreBitsClear( BitMap, 9, 21 )) { DbgPrint("AreBitsClear Error 30\n"); }
  316. RtlClearBits( BitMap, 9, 1 );
  317. if (RtlAreBitsClear( BitMap, 9, 21 )) { DbgPrint("AreBitsClear Error 31\n"); }
  318. RtlClearBits( BitMap, 29, 1 );
  319. if (!RtlAreBitsClear( BitMap, 9, 21 )) { DbgPrint("AreBitsClear Error 32\n"); }
  320. RtlSetAllBits( BitMap );
  321. if (RtlAreBitsClear( BitMap, 10, 1 )) { DbgPrint("AreBitsClear Error 33\n"); }
  322. RtlClearBits( BitMap, 9, 1 );
  323. if (RtlAreBitsClear( BitMap, 10, 1 )) { DbgPrint("AreBitsClear Error 34\n"); }
  324. RtlClearBits( BitMap, 11, 1 );
  325. if (RtlAreBitsClear( BitMap, 10, 1 )) { DbgPrint("AreBitsClear Error 35\n"); }
  326. RtlClearBits( BitMap, 10, 1 );
  327. if (!RtlAreBitsClear( BitMap, 10, 1 )) { DbgPrint("AreBitsClear Error 36\n"); }
  328. RtlSetAllBits( BitMap );
  329. if (!RtlAreBitsSet( BitMap, 0, 2048*8 )) { DbgPrint("RtlAreBitsSet Error 0\n"); }
  330. RtlClearAllBits( BitMap );
  331. if (RtlAreBitsSet( BitMap, 8, 8 )) { DbgPrint("AreBitsSet Error 1\n"); }
  332. RtlSetBits( BitMap, 9, 6 );
  333. if (RtlAreBitsSet( BitMap, 8, 8 )) { DbgPrint("AreBitsSet Error 2\n"); }
  334. RtlSetBits( BitMap, 8, 1 );
  335. if (RtlAreBitsSet( BitMap, 8, 8 )) { DbgPrint("AreBitsSet Error 3\n"); }
  336. RtlSetBits( BitMap, 15, 1 );
  337. if (!RtlAreBitsSet( BitMap, 8, 8 )) { DbgPrint("AreBitsSet Error 4\n"); }
  338. RtlClearAllBits( BitMap );
  339. if (RtlAreBitsSet( BitMap, 8, 7 )) { DbgPrint("AreBitsSet Error 5\n"); }
  340. RtlSetBits( BitMap, 9, 5 );
  341. if (RtlAreBitsSet( BitMap, 8, 7 )) { DbgPrint("AreBitsSet Error 6\n"); }
  342. RtlSetBits( BitMap, 8, 1 );
  343. if (RtlAreBitsSet( BitMap, 8, 7 )) { DbgPrint("AreBitsSet Error 7\n"); }
  344. RtlSetBits( BitMap, 14, 1 );
  345. if (!RtlAreBitsSet( BitMap, 8, 7 )) { DbgPrint("AreBitsSet Error 8\n"); }
  346. RtlClearAllBits( BitMap );
  347. if (RtlAreBitsSet( BitMap, 9, 7 )) { DbgPrint("AreBitsSet Error 9\n"); }
  348. RtlSetBits( BitMap, 10, 5 );
  349. if (RtlAreBitsSet( BitMap, 9, 7 )) { DbgPrint("AreBitsSet Error 10\n"); }
  350. RtlSetBits( BitMap, 9, 1 );
  351. if (RtlAreBitsSet( BitMap, 9, 7 )) { DbgPrint("AreBitsSet Error 11\n"); }
  352. RtlSetBits( BitMap, 15, 1 );
  353. if (!RtlAreBitsSet( BitMap, 9, 7 )) { DbgPrint("AreBitsSet Error 12\n"); }
  354. RtlClearAllBits( BitMap );
  355. if (RtlAreBitsSet( BitMap, 9, 5 )) { DbgPrint("AreBitsSet Error 13\n"); }
  356. RtlSetBits( BitMap, 10, 3 );
  357. if (RtlAreBitsSet( BitMap, 9, 5 )) { DbgPrint("AreBitsSet Error 14\n"); }
  358. RtlSetBits( BitMap, 9, 1 );
  359. if (RtlAreBitsSet( BitMap, 9, 5 )) { DbgPrint("AreBitsSet Error 15\n"); }
  360. RtlSetBits( BitMap, 13, 1 );
  361. if (!RtlAreBitsSet( BitMap, 9, 5 )) { DbgPrint("AreBitsSet Error 16\n"); }
  362. RtlClearAllBits( BitMap );
  363. if (RtlAreBitsSet( BitMap, 8, 24 )) { DbgPrint("AreBitsSet Error 17\n"); }
  364. RtlSetBits( BitMap, 9, 22 );
  365. if (RtlAreBitsSet( BitMap, 8, 24 )) { DbgPrint("AreBitsSet Error 18\n"); }
  366. RtlSetBits( BitMap, 8, 1 );
  367. if (RtlAreBitsSet( BitMap, 8, 24 )) { DbgPrint("AreBitsSet Error 19\n"); }
  368. RtlSetBits( BitMap, 31, 1 );
  369. if (!RtlAreBitsSet( BitMap, 8, 24 )) { DbgPrint("AreBitsSet Error 20\n"); }
  370. RtlClearAllBits( BitMap );
  371. if (RtlAreBitsSet( BitMap, 8, 23 )) { DbgPrint("AreBitsSet Error 21\n"); }
  372. RtlSetBits( BitMap, 9, 21 );
  373. if (RtlAreBitsSet( BitMap, 8, 23 )) { DbgPrint("AreBitsSet Error 22\n"); }
  374. RtlSetBits( BitMap, 8, 1 );
  375. if (RtlAreBitsSet( BitMap, 8, 23 )) { DbgPrint("AreBitsSet Error 23\n"); }
  376. RtlSetBits( BitMap, 30, 1 );
  377. if (!RtlAreBitsSet( BitMap, 8, 23 )) { DbgPrint("AreBitsSet Error 24\n"); }
  378. RtlClearAllBits( BitMap );
  379. if (RtlAreBitsSet( BitMap, 9, 23 )) { DbgPrint("AreBitsSet Error 25\n"); }
  380. RtlSetBits( BitMap, 10, 21 );
  381. if (RtlAreBitsSet( BitMap, 9, 23 )) { DbgPrint("AreBitsSet Error 26\n"); }
  382. RtlSetBits( BitMap, 9, 1 );
  383. if (RtlAreBitsSet( BitMap, 9, 23 )) { DbgPrint("AreBitsSet Error 27\n"); }
  384. RtlSetBits( BitMap, 31, 1 );
  385. if (!RtlAreBitsSet( BitMap, 9, 23 )) { DbgPrint("AreBitsSet Error 28\n"); }
  386. RtlClearAllBits( BitMap );
  387. if (RtlAreBitsSet( BitMap, 9, 21 )) { DbgPrint("AreBitsSet Error 29\n"); }
  388. RtlSetBits( BitMap, 10, 19 );
  389. if (RtlAreBitsSet( BitMap, 9, 21 )) { DbgPrint("AreBitsSet Error 30\n"); }
  390. RtlSetBits( BitMap, 9, 1 );
  391. if (RtlAreBitsSet( BitMap, 9, 21 )) { DbgPrint("AreBitsSet Error 31\n"); }
  392. RtlSetBits( BitMap, 29, 1 );
  393. if (!RtlAreBitsSet( BitMap, 9, 21 )) { DbgPrint("AreBitsSet Error 32\n"); }
  394. RtlClearAllBits( BitMap );
  395. if (RtlAreBitsSet( BitMap, 10, 1 )) { DbgPrint("AreBitsSet Error 33\n"); }
  396. RtlSetBits( BitMap, 9, 1 );
  397. if (RtlAreBitsSet( BitMap, 10, 1 )) { DbgPrint("AreBitsSet Error 34\n"); }
  398. RtlSetBits( BitMap, 11, 1 );
  399. if (RtlAreBitsSet( BitMap, 10, 1 )) { DbgPrint("AreBitsSet Error 35\n"); }
  400. RtlSetBits( BitMap, 10, 1 );
  401. if (!RtlAreBitsSet( BitMap, 10, 1 )) { DbgPrint("AreBitsSet Error 36\n"); }
  402. DbgPrint("End BitMapTest()\n");
  403. return TRUE;
  404. }