Leaked source code of windows server 2003
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.

481 lines
26 KiB

  1. /**INC+**********************************************************************/
  2. /* */
  3. /* adcgmcro.h */
  4. /* */
  5. /* DC-Groupware common macros - portable include file. */
  6. /* */
  7. /* Copyright(c) Microsoft 1996-1997 */
  8. /* */
  9. /****************************************************************************/
  10. /* Changes: */
  11. /* */
  12. // $Log: Y:/logs/h/dcl/adcgmcro.h_v $
  13. //
  14. // Rev 1.9 22 Aug 1997 10:34:52 MD
  15. // SFR1162: Retire DC_LOCAL_TO_WIRE16
  16. //
  17. // Rev 1.8 24 Jul 1997 16:48:28 KH
  18. // SFR1033: Add DCMAKEDCUINT16
  19. //
  20. // Rev 1.7 23 Jul 1997 10:47:56 mr
  21. // SFR1079: Merged \server\h duplicates to \h\dcl
  22. //
  23. // Rev 1.2 30 Jun 1997 15:23:52 OBK
  24. // SFR0000: Fix erroneous DCHI8 macro
  25. //
  26. // Rev 1.1 19 Jun 1997 21:45:40 OBK
  27. // SFR0000: Start of RNS codebase
  28. /* */
  29. /**INC-**********************************************************************/
  30. #ifndef _H_ADCGMCRO
  31. #define _H_ADCGMCRO
  32. /****************************************************************************/
  33. /* */
  34. /* INCLUDES */
  35. /* */
  36. /****************************************************************************/
  37. /****************************************************************************/
  38. /* Include the Windows header. This will then include the appropriate */
  39. /* specific header (Win31, Win NT, etc). */
  40. /****************************************************************************/
  41. #include <wdcgmcro.h>
  42. /****************************************************************************/
  43. /* */
  44. /* STRUCTURES */
  45. /* */
  46. /****************************************************************************/
  47. /****************************************************************************/
  48. /* DC_ID_STAMP2 */
  49. /* ============ */
  50. /* This is used by the stamp macros below. */
  51. /* */
  52. /* component : */
  53. /* structure : */
  54. /* instance : */
  55. /****************************************************************************/
  56. typedef struct tagDC_ID_STAMP2
  57. {
  58. DCUINT16 component;
  59. DCUINT16 structure;
  60. DCUINT32 instance;
  61. } DC_ID_STAMP2;
  62. typedef DC_ID_STAMP2 DCPTR PDC_ID_STAMP2;
  63. /****************************************************************************/
  64. /* */
  65. /* MACROS */
  66. /* */
  67. /****************************************************************************/
  68. /****************************************************************************/
  69. /* Common function macros used throughout the product. */
  70. /****************************************************************************/
  71. #define DC_QUIT goto DC_EXIT_POINT
  72. #define DC_QUIT_ON_FAIL(hr) if (FAILED(hr)) DC_QUIT;
  73. /****************************************************************************/
  74. /* New function entry/exit macros. */
  75. /****************************************************************************/
  76. #define DC_BEGIN_FN(str) TRC_FN(str); TRC_ENTRY;
  77. #define DC_END_FN() TRC_EXIT;
  78. /****************************************************************************/
  79. /* Conversion macros. */
  80. /****************************************************************************/
  81. #define DCMAKEDCUINT32(lo16, hi16) ((DCUINT32)(((DCUINT16)(lo16)) | \
  82. (((DCUINT32)((DCUINT16)(hi16))) << 16)))
  83. #define DCMAKEDCUINT16(lowByte, highByte) \
  84. ((DCUINT16)(((DCUINT8)(lowByte)) | \
  85. (((DCUINT16)((DCUINT8)(highByte))) << 8)))
  86. #define DCLO16(u32) ((DCUINT16)((u32) & 0xFFFF))
  87. #define DCHI16(u32) ((DCUINT16)((((DCUINT32)(u32)) >> 16) & 0xFFFF))
  88. #define DCLO8(w) ((DCUINT8)((w) & 0xFF))
  89. #define DCHI8(w) ((DCUINT8)(((DCUINT16)(w) >> 8) & 0xFF))
  90. /****************************************************************************/
  91. /* Macro to round up a number to the nearest multiple of four. */
  92. /****************************************************************************/
  93. #define DC_ROUND_UP_4(x) ((x + 3) & ~((DCUINT32)0X03))
  94. /****************************************************************************/
  95. /* PAD macro - use it to add X pad bytes to a structure. */
  96. /* */
  97. /* Can only be used once per structure. */
  98. /****************************************************************************/
  99. #define DCPAD(X) DCINT8 padBytes[X]
  100. /****************************************************************************/
  101. /* Byte swapping macros for different endian architectures. */
  102. /* */
  103. /* DC_xx_WIRExx converts in a functional form */
  104. /* DC_xx_WIRExx_INPLACE converts a given field (must be an lvalue) */
  105. /* */
  106. /* Note that these macros require aligned access. See below for unaligned */
  107. /* access macros. */
  108. /* */
  109. /* Note that on bigendian machines DC_{TO,FROM}_WIRE16 casts to a DCUINT16. */
  110. /* In code of the form */
  111. /* B = DC_{TO,FROM}_WIRE16(A) */
  112. /* there is an implicit cast to the type of B. So if A is a DCINT16 and is */
  113. /* negative, and B has > 16 bits, then B will end up being large and */
  114. /* positive. It is therefore necessary to add a cast to a DCINT16. */
  115. /* */
  116. /****************************************************************************/
  117. #ifndef DC_BIGEND
  118. #define DC_TO_WIRE16(A) (A)
  119. #define DC_TO_WIRE32(A) (A)
  120. #define DC_FROM_WIRE16(A) (A)
  121. #define DC_FROM_WIRE32(A) (A)
  122. #define DC_TO_WIRE16_INPLACE(A)
  123. #define DC_TO_WIRE32_INPLACE(A)
  124. #define DC_FROM_WIRE16_INPLACE(A)
  125. #define DC_FROM_WIRE32_INPLACE(A)
  126. #else
  127. #define DC_TO_WIRE16(A) \
  128. (DCUINT16) (((DCUINT16)(((PDCUINT8)&(A))[1]) << 8) | \
  129. ((DCUINT16)(((PDCUINT8)&(A))[0])))
  130. #define DC_FROM_WIRE16(A) \
  131. (DCUINT16) (((DCUINT16)(((PDCUINT8)&(A))[1]) << 8) | \
  132. ((DCUINT16)(((PDCUINT8)&(A))[0])))
  133. #define DC_TO_WIRE32(A) \
  134. (DCUINT32) (((DCUINT32)(((PDCUINT8)&(A))[3]) << 24)| \
  135. ((DCUINT32)(((PDCUINT8)&(A))[2]) << 16)| \
  136. ((DCUINT32)(((PDCUINT8)&(A))[1]) << 8) | \
  137. ((DCUINT32)(((PDCUINT8)&(A))[0])))
  138. #define DC_FROM_WIRE32(A) \
  139. (DCUINT32) (((DCUINT32)(((PDCUINT8)&(A))[3]) << 24)| \
  140. ((DCUINT32)(((PDCUINT8)&(A))[2]) << 16)| \
  141. ((DCUINT32)(((PDCUINT8)&(A))[1]) << 8) | \
  142. ((DCUINT32)(((PDCUINT8)&(A))[0])))
  143. #define DC_TO_WIRE16_INPLACE(A) (A) = DC_TO_WIRE16(A)
  144. #define DC_TO_WIRE32_INPLACE(A) (A) = DC_TO_WIRE32(A)
  145. #define DC_FROM_WIRE16_INPLACE(A) (A) = DC_FROM_WIRE16(A)
  146. #define DC_FROM_WIRE32_INPLACE(A) (A) = DC_FROM_WIRE32(A)
  147. #endif
  148. /****************************************************************************/
  149. /* Unaligned pointer access macros -- first macros to extract an integer */
  150. /* from an unaligned pointer. Note that these macros assume that the */
  151. /* integer is in local byte order */
  152. /****************************************************************************/
  153. #ifndef DC_NO_UNALIGNED
  154. #define DC_EXTRACT_UINT16_UA(pA) (*(PDCUINT16_UA)(pA))
  155. #define DC_EXTRACT_INT16_UA(pA) (*(PDCINT16_UA)(pA))
  156. #define DC_EXTRACT_UINT32_UA(pA) (*(PDCUINT32_UA)(pA))
  157. #define DC_EXTRACT_INT32_UA(pA) (*(PDCINT32_UA)(pA))
  158. #else
  159. #ifndef DC_BIGEND
  160. #define DC_EXTRACT_UINT16_UA(pA) ((DCUINT16) (((PDCUINT8)(pA))[0]) | \
  161. (DCUINT16) ((((PDCUINT8)(pA))[1]) << 8) )
  162. #define DC_EXTRACT_INT16_UA(pA) ((DCINT16) (((PDCUINT8)(pA))[0]) | \
  163. (DCINT16) ((((PDCUINT8)(pA))[1]) << 8) )
  164. #define DC_EXTRACT_UINT32_UA(pA) ((DCUINT32) (((PDCUINT8)(pA))[0]) | \
  165. (DCUINT32) ((((PDCUINT8)(pA))[1]) << 8) | \
  166. (DCUINT32) ((((PDCUINT8)(pA))[2]) << 16) | \
  167. (DCUINT32) ((((PDCUINT8)(pA))[3]) << 24) )
  168. #define DC_EXTRACT_INT32_UA(pA) ((DCINT32) (((PDCUINT8)(pA))[0]) | \
  169. (DCINT32) ((((PDCUINT8)(pA))[1]) << 8) | \
  170. (DCINT32) ((((PDCUINT8)(pA))[2]) << 16) | \
  171. (DCINT32) ((((PDCUINT8)(pA))[3]) << 24) )
  172. #else
  173. #define DC_EXTRACT_UINT16_UA(pA) ((DCUINT16) (((PDCUINT8)(pA))[1]) | \
  174. (DCUINT16) ((((PDCUINT8)(pA))[0]) << 8) )
  175. #define DC_EXTRACT_INT16_UA(pA) ((DCINT16) (((PDCUINT8)(pA))[1]) | \
  176. (DCINT16) ((((PDCUINT8)(pA))[0]) << 8) )
  177. #define DC_EXTRACT_UINT32_UA(pA) ((DCUINT32) (((PDCUINT8)(pA))[3]) | \
  178. (DCUINT32) ((((PDCUINT8)(pA))[2]) << 8) | \
  179. (DCUINT32) ((((PDCUINT8)(pA))[1]) << 16) | \
  180. (DCUINT32) ((((PDCUINT8)(pA))[0]) << 24) )
  181. #define DC_EXTRACT_INT32_UA(pA) ((DCINT32) (((PDCUINT8)(pA))[3]) | \
  182. (DCINT32) ((((PDCUINT8)(pA))[2]) << 8) | \
  183. (DCINT32) ((((PDCUINT8)(pA))[1]) << 16) | \
  184. (DCINT32) ((((PDCUINT8)(pA))[0]) << 24) )
  185. #endif
  186. #endif
  187. /****************************************************************************/
  188. /* Now macros to insert an integer at an unaligned pointer value. Again, */
  189. /* the value inserted will be in local format. */
  190. /****************************************************************************/
  191. #ifndef DC_NO_UNALIGNED
  192. #define DC_INSERT_UINT16_UA(pA,V) (*(PDCUINT16_UA)(pA)) = (V)
  193. #define DC_INSERT_INT16_UA(pA,V) (*(PDCINT16_UA)(pA)) = (V)
  194. #define DC_INSERT_UINT32_UA(pA,V) (*(PDCUINT32_UA)(pA)) = (V)
  195. #define DC_INSERT_INT32_UA(pA,V) (*(PDCINT32_UA)(pA)) = (V)
  196. #else
  197. #ifndef DC_BIGEND
  198. #define DC_INSERT_UINT16_UA(pA,V) \
  199. { \
  200. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x00FF); \
  201. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x00FF); \
  202. }
  203. #define DC_INSERT_INT16_UA(pA,V) \
  204. { \
  205. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x00FF); \
  206. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x00FF); \
  207. }
  208. #define DC_INSERT_UINT32_UA(pA,V) \
  209. { \
  210. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x000000FF); \
  211. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x000000FF); \
  212. (((PDCUINT8)(pA))[2]) = (DCUINT8)(((V)>>16) & 0x000000FF); \
  213. (((PDCUINT8)(pA))[3]) = (DCUINT8)(((V)>>24) & 0x000000FF); \
  214. }
  215. #define DC_INSERT_INT32_UA(pA,V) \
  216. { \
  217. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x000000FF); \
  218. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x000000FF); \
  219. (((PDCUINT8)(pA))[2]) = (DCUINT8)(((V)>>16) & 0x000000FF); \
  220. (((PDCUINT8)(pA))[3]) = (DCUINT8)(((V)>>24) & 0x000000FF); \
  221. }
  222. #else
  223. #define DC_INSERT_UINT16_UA(pA,V) \
  224. { \
  225. (((PDCUINT8)(pA))[1]) = (DCUINT8)( (V) & 0x00FF); \
  226. (((PDCUINT8)(pA))[0]) = (DCUINT8)(((V)>>8) & 0x00FF); \
  227. }
  228. #define DC_INSERT_INT16_UA(pA,V) \
  229. { \
  230. (((PDCUINT8)(pA))[1]) = (DCUINT8)( (V) & 0x00FF); \
  231. (((PDCUINT8)(pA))[0]) = (DCUINT8)(((V)>>8) & 0x00FF); \
  232. }
  233. #define DC_INSERT_UINT32_UA(pA,V) \
  234. { \
  235. (((PDCUINT8)(pA))[3]) = (DCUINT8)( (V) & 0x000000FF); \
  236. (((PDCUINT8)(pA))[2]) = (DCUINT8)(((V)>>8) & 0x000000FF); \
  237. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>16) & 0x000000FF); \
  238. (((PDCUINT8)(pA))[0]) = (DCUINT8)(((V)>>24) & 0x000000FF); \
  239. }
  240. #define DC_INSERT_INT32_UA(pA,V) \
  241. { \
  242. (((PDCUINT8)(pA))[3]) = (DCUINT8)( (V) & 0x000000FF); \
  243. (((PDCUINT8)(pA))[2]) = (DCUINT8)(((V)>>8) & 0x000000FF); \
  244. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>16) & 0x000000FF); \
  245. (((PDCUINT8)(pA))[0]) = (DCUINT8)(((V)>>24) & 0x000000FF); \
  246. }
  247. #endif
  248. #endif
  249. /****************************************************************************/
  250. /* Now another version of these macros, to insert an integer at an */
  251. /* unaligned pointer value. This time, the value inserted should be in */
  252. /* wire format. */
  253. /****************************************************************************/
  254. #ifndef DC_NO_UNALIGNED
  255. #define DC_INSERT_WIRE_UINT16_UA(pA,V) \
  256. (*(PDCUINT16_UA)(pA)) = DC_TO_WIRE16(V)
  257. #define DC_INSERT_WIRE_INT16_UA(pA,V) \
  258. (*(PDCINT16_UA)(pA)) = DC_TO_WIRE16(V)
  259. #define DC_INSERT_WIRE_UINT32_UA(pA,V) \
  260. (*(PDCUINT32_UA)(pA)) = DC_TO_WIRE32(V)
  261. #define DC_INSERT_WIRE_INT32_UA(pA,V) \
  262. (*(PDCINT32_UA)(pA)) = DC_TO_WIRE32(V)
  263. #else
  264. #define DC_INSERT_WIRE_UINT16_UA(pA,V) \
  265. { \
  266. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x00FF); \
  267. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x00FF); \
  268. }
  269. #define DC_INSERT_WIRE_INT16_UA(pA,V) \
  270. { \
  271. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x00FF); \
  272. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x00FF); \
  273. }
  274. #define DC_INSERT_WIRE_UINT32_UA(pA,V) \
  275. { \
  276. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x000000FF); \
  277. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x000000FF); \
  278. (((PDCUINT8)(pA))[2]) = (DCUINT8)(((V)>>16) & 0x000000FF); \
  279. (((PDCUINT8)(pA))[3]) = (DCUINT8)(((V)>>24) & 0x000000FF); \
  280. }
  281. #define DC_INSERT_WIRE_INT32_UA(pA,V) \
  282. { \
  283. (((PDCUINT8)(pA))[0]) = (DCUINT8)( (V) & 0x000000FF); \
  284. (((PDCUINT8)(pA))[1]) = (DCUINT8)(((V)>>8) & 0x000000FF); \
  285. (((PDCUINT8)(pA))[2]) = (DCUINT8)(((V)>>16) & 0x000000FF); \
  286. (((PDCUINT8)(pA))[3]) = (DCUINT8)(((V)>>24) & 0x000000FF); \
  287. }
  288. #endif
  289. /****************************************************************************/
  290. /* Unaligned pointer in-place flipping macros. These macros flip an */
  291. /* integer field to or from wire format in-place, but do not do any */
  292. /* unaligned accesses while they are doing it. */
  293. /****************************************************************************/
  294. #ifndef DC_BIGEND
  295. #define DC_TO_WIRE16_INPLACE_UA(A)
  296. #define DC_TO_WIRE32_INPLACE_UA(A)
  297. #define DC_FROM_WIRE16_INPLACE_UA(A)
  298. #define DC_FROM_WIRE32_INPLACE_UA(A)
  299. #else
  300. #ifndef DC_NO_UNALIGNED
  301. #define DC_TO_WIRE16_INPLACE_UA(A) DC_TO_WIRE16_INPLACE(A)
  302. #define DC_TO_WIRE32_INPLACE_UA(A) DC_TO_WIRE32_INPLACE(A)
  303. #define DC_FROM_WIRE16_INPLACE_UA(A) DC_FROM_WIRE16_INPLACE(A)
  304. #define DC_FROM_WIRE32_INPLACE_UA(A) DC_FROM_WIRE32_INPLACE(A)
  305. #else
  306. #define DC_TO_WIRE16_INPLACE_UA(A) \
  307. { \
  308. DCUINT16 val; \
  309. val = DC_TO_WIRE16(A); \
  310. DC_INSERT_UINT16_UA(&(A), val) \
  311. }
  312. #define DC_TO_WIRE32_INPLACE_UA(A) \
  313. { \
  314. DCUINT32 val; \
  315. val = DC_TO_WIRE32(A); \
  316. DC_INSERT_UINT32_UA(&(A), val) \
  317. }
  318. #define DC_FROM_WIRE16_INPLACE_UA(A) \
  319. { \
  320. DCUINT16 val; \
  321. val = DC_FROM_WIRE16(A); \
  322. DC_INSERT_UINT16_UA(&(A), val) \
  323. }
  324. #define DC_FROM_WIRE32_INPLACE_UA(A) \
  325. { \
  326. DCUINT32 val; \
  327. val = DC_FROM_WIRE32(A); \
  328. DC_INSERT_UINT32_UA(&(A), val) \
  329. }
  330. #endif
  331. #endif
  332. /****************************************************************************/
  333. /* FLAG macro - parameter indicates bit which flag uses - use as follows: */
  334. /* */
  335. /* #define FILE_OPEN DCFLAG8(0) */
  336. /* #define FILE_LOCKED DCFLAG8(1) */
  337. /****************************************************************************/
  338. #define DCFLAG(X) ((DCUINT8) (1 << X))
  339. #define DCFLAG8(X) ((DCUINT8) (1 << X))
  340. #define DCFLAG16(X) ((DCUINT16) (1 << X))
  341. #define DCFLAG32(X) ((DCUINT32) (1 << X))
  342. #define DCFLAGN(X) ((DCUINT) (1 << X))
  343. /****************************************************************************/
  344. /* Flag manipulation macros: */
  345. /* */
  346. /* SET_FLAG : sets a flag (i.e. assigns 1 to it). */
  347. /* CLEAR_FLAG : clears a flag (i.e. assigns 0 to it). */
  348. /* TEST_FLAG : returns the value of a flag. */
  349. /* ASSIGN_FLAG : takes a boolean value and uses it to set or clear a */
  350. /* flag. */
  351. /****************************************************************************/
  352. #define SET_FLAG(var, flag) ((var) |= (flag))
  353. #ifndef CLEAR_FLAG
  354. #define CLEAR_FLAG(var, flag) ((var) &= ~(flag))
  355. #endif
  356. #define TEST_FLAG(var, flag) (((var) & (flag)) != 0)
  357. #define ASSIGN_FLAG(var, flag, value) \
  358. if (TRUE == value) \
  359. { \
  360. SET_FLAG(var, flag); \
  361. } \
  362. else \
  363. { \
  364. CLEAR_FLAG(var, flag); \
  365. }
  366. /****************************************************************************/
  367. /* Stamp type and macro: each module should use these when stamping its */
  368. /* data structures. */
  369. /****************************************************************************/
  370. typedef DCUINT32 DC_ID_STAMP;
  371. #define DC_MAKE_ID_STAMP(X1, X2, X3, X4) \
  372. ((DC_ID_STAMP) (((DCUINT32) X4) << 24) | \
  373. (((DCUINT32) X3) << 16) | \
  374. (((DCUINT32) X2) << 8) | \
  375. (((DCUINT32) X1) << 0) )
  376. #define MAKE_STAMP16(X1, X2) \
  377. ((DCUINT16) (((DCUINT16) X2) << 8) | \
  378. (((DCUINT16) X1) << 0) )
  379. #define MAKE_STAMP32(X1, X2, X3, X4) \
  380. ((DCUINT32) (((DCUINT32) X4) << 24) | \
  381. (((DCUINT32) X3) << 16) | \
  382. (((DCUINT32) X2) << 8) | \
  383. (((DCUINT32) X1) << 0) )
  384. /****************************************************************************/
  385. /* Other common macros. */
  386. /****************************************************************************/
  387. #define COM_SIZEOF_RECT(r) \
  388. (DCUINT32)((DCUINT32)((r).SRXMAX-(r).SRXMIN)* \
  389. (DCUINT32)((r).SRYMAX-(r).SRYMIN))
  390. /****************************************************************************/
  391. /* Macro to remove the "Unreferenced parameter" warning. */
  392. /****************************************************************************/
  393. #define DC_IGNORE_PARAMETER(PARAMETER) \
  394. PARAMETER;
  395. /****************************************************************************/
  396. /* Convert a non-zero value to 1. */
  397. /****************************************************************************/
  398. #define MAKE_BOOL(A) (!(!(A)))
  399. /****************************************************************************/
  400. /* This macro works on 32 bit unsigned ticks and returns TRUE if TIME is */
  401. /* between BEGIN and END (both inclusive) allowing for the wraparound. */
  402. /****************************************************************************/
  403. #define IN_TIME_RANGE(BEGIN, END, TIME) \
  404. (((BEGIN) < (END)) ? \
  405. (((TIME) >= (BEGIN)) && ((TIME) <= (END))) : \
  406. (((TIME) >= (BEGIN)) || ((TIME) <= (END))))
  407. /****************************************************************************/
  408. /* Minimum and maximum macros. */
  409. /****************************************************************************/
  410. #define DC_MIN(a, b) (((a) < (b)) ? (a) : (b))
  411. #define DC_MAX(a, b) (((a) > (b)) ? (a) : (b))
  412. /****************************************************************************/
  413. /* Convert BPP to number of colors. */
  414. /****************************************************************************/
  415. #define COLORS_FOR_BPP(BPP) (((BPP) > 8) ? 0 : (1 << (BPP)))
  416. /****************************************************************************/
  417. /* Normalize PALETTEINDEX macro across platforms */
  418. /****************************************************************************/
  419. #ifdef OS_WINCE
  420. #define DC_PALINDEX(i) ((COLORREF)(0x01000000 | (DWORD)(WORD)(i)))
  421. #else // OS_WINCE
  422. #define DC_PALINDEX(i) PALETTEINDEX(i)
  423. #endif // OS_WINCE
  424. #endif /* _H_ADCGMCRO */