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.

156 lines
4.4 KiB

  1. /*****************************************************************************
  2. msoemtyp.h
  3. Owner: DaleG
  4. Copyright (c) 1997 Microsoft Corporation
  5. Typedef file for Rules Engine of Event Monitor.
  6. *****************************************************************************/
  7. #ifndef MSOEMTYP_H
  8. #define MSOEMTYP_H
  9. #ifndef MSO_H
  10. #pragma message ("MsoEMTyp.h file included before Mso.h. Including Mso.h.")
  11. #include "mso.h"
  12. #endif
  13. MSOEXTERN_C_BEGIN // ***************** Begin extern "C" ********************
  14. #ifndef MSOCP_DEFINED
  15. typedef long MSOCP; // Character position
  16. #define msocpNil ((MSOCP) -1)
  17. #define msocp0 ((MSOCP) 0)
  18. #define msocpMax ((MSOCP) 0x7FFFFFFF)
  19. #define MSOCP_DEFINED
  20. #endif /* !MSOCP_DEFINED */
  21. // Define Bit Field type
  22. typedef unsigned short MSOBF;
  23. #if !defined(WORD_BUILD) && !defined(WIN_CALLBACK)
  24. #define WIN_CALLBACK OFC_CALLBACK
  25. #endif /* !WORD_BUILD */
  26. // Character Byte Manipulators
  27. #define MsoLowByteWch(w) (unsigned char)((w) & 0x00ff)
  28. #define MsoHighByteWch(w) (unsigned char)(((WORD)(w) >> 8) & 0x00ff)
  29. #ifndef cbXchar
  30. #ifndef ANSI_XCHAR
  31. typedef unsigned short XCHAR;
  32. #define cbXchar 2
  33. #else /* ANSI_XCHAR */
  34. typedef unsigned char XCHAR;
  35. #define cbXchar 1
  36. #endif /* !ANSI_XCHAR */
  37. #endif /* !cbXchar */
  38. #ifndef ANSI_XCHAR
  39. #define MsoLowByteXch(xch) MsoLowByteWch(xch)
  40. #define MsoHighByteXch(xch) MsoHighByteWch(xch)
  41. #define CchXsz(xsz) MsoCchWzLen(xsz)
  42. #define SzFromXsz(xszFrom, szTo) \
  43. MsoWzToSz(xszFrom, szTo)
  44. #define CchCopyRgxchToRgch MsoRgwchToRgch
  45. #define CopyRgxchToRgch(pxchSrc, pchDest, pcch) \
  46. (*pcch = MsoRgwchToRgch(pxchSrc, *pcch, pchDest, 2 * (*pcch)))
  47. #else /* ANSI_XCHAR */
  48. #define MsoLowByteXch(xch) (xch)
  49. #define MsoHighByteXch(xch) (0)
  50. #define CchXsz(xsz) MsoCchSzLen(xsz)
  51. #define SzFromXsz(xszFrom, szTo) \
  52. strcpy(szTo, xszFrom)
  53. #define CchCopyRgxchToRgch(rgchFrom, cchFrom, rgchTo, cchTo) \
  54. (PbCopyRgb((rgchFrom), (rgchTo), (cchFrom)), (cchFrom))
  55. #define CopyRgxchToRgch(pxchSrc, pchDest, pcch) \
  56. memmove(pchDest, pxchSrc, *(pcch))
  57. #endif /* !ANSI_XCHAR */
  58. int FNeNcRgxch(const XCHAR *pxch1, const XCHAR *pxch2, int cch);
  59. #if !WORD_BUILD && !STANDALONE_WORD
  60. typedef void *LPV;
  61. // Split value struct. Overlays two shorts on long, byte-reversable indifferent
  62. typedef struct _SV
  63. {
  64. #ifndef MAC
  65. short wValue1; // Low, short
  66. short wValue2; // High, long
  67. #else /* MAC */
  68. short wValue2; // High, long
  69. short wValue1; // Low, short
  70. #endif /* !MAC */
  71. } SV;
  72. // SV as seen as chars
  73. typedef struct _SVC
  74. {
  75. #ifndef MAC
  76. char ch1; // Low, 1st byte
  77. char ch2; // 2nd byte
  78. char ch3; // 3rd byte
  79. char ch4; // 4th byte
  80. #else /* MAC */
  81. char ch3; // 3rd byte
  82. char ch4; // 4th byte
  83. char ch1; // Low, 1st byte
  84. char ch2; // 2nd byte
  85. #endif /* !MAC */
  86. } SVC;
  87. // SV unioned with long
  88. typedef union _SVL
  89. {
  90. long lValue; // As long
  91. SV sv; // Split version
  92. SVC svc; // As chars
  93. } SVL;
  94. #endif /* !WORD_BUILD && !STANDALONE_WORD */
  95. #ifndef NORULES
  96. #include "emrule.h"
  97. #include "emutil.h"
  98. #include "emact.h"
  99. #ifdef DYN_RULES
  100. #include "emruloci.h"
  101. #endif /* DYN_RULES */
  102. #endif /* !NORULES */
  103. #if defined(DEBUG) && !defined(STANDALONE)
  104. MSOAPI_(void) MsoInitEmMemMark( // Init EM Mem marking
  105. struct MSOINST *hMsoInst,
  106. long lparam,
  107. int bt
  108. );
  109. MSOAPI_(void) MsoMarkEmPv(void *pv); // Mark EM Memory
  110. #else /* !DEBUG || STANDALONE */
  111. #define MsoInitEmMemMark(hMsoInst, lparam, bt)
  112. #define MsoMarkEmPv(pv)
  113. #endif /* DEBUG && !STANDALONE */
  114. MSOEXTERN_C_END // ****************** End extern "C" *********************
  115. #endif /* !MSOEMTYP_H */