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.

160 lines
3.6 KiB

  1. /*----------------------------------------------------------------------------
  2. %%File: mso.h
  3. %%Unit: Event Monitor
  4. %%Contact: daleg
  5. Typedef file for Rules Engine of Event Monitor.
  6. ----------------------------------------------------------------------------*/
  7. #ifndef MSO_H
  8. #define MSO_H
  9. #ifndef MSOEXTERN_C_BEGIN
  10. #if defined(__cplusplus)
  11. #define MSOEXTERN_C extern "C"
  12. #define MSOEXTERN_C_BEGIN extern "C" {
  13. #define MSOEXTERN_C_END }
  14. #else
  15. #define MSOEXTERN_C
  16. #define MSOEXTERN_C_BEGIN
  17. #define MSOEXTERN_C_END
  18. #endif
  19. #endif // MSOEXTERN_C_BEGIN
  20. #define FEWER_SEGS(sz)
  21. #define VSZASSERT static unsigned char vszAssertFile[] = __FILE__;
  22. typedef long IDS; // emkwd.h
  23. #define OFC_CALLBACK MSOAPICALLTYPE
  24. typedef unsigned short WCHAR;
  25. typedef unsigned short WORD;
  26. typedef unsigned int UINT;
  27. #ifndef _WINDEF_ // windef.h makes uchar (same as mso.h w/ -J)
  28. typedef char BYTE;
  29. #endif
  30. typedef int BOOL;
  31. typedef unsigned long DWORD;
  32. #ifndef cbXchar
  33. #ifndef ANSI_XCHAR
  34. typedef unsigned short XCHAR;
  35. #define cbXchar 2
  36. #else /* ANSI_XCHAR */
  37. typedef unsigned char XCHAR;
  38. #define cbXchar 1
  39. #endif /* !ANSI_XCHAR */
  40. #endif /* !cbXchar */
  41. typedef WORD LID;
  42. typedef DWORD LCID;
  43. #define MSOAPICALLTYPE __stdcall
  44. #define MSOCDECLCALLTYPE __cdecl
  45. #ifndef MSOAPI_
  46. #define MSOAPI_(t) t MSOAPICALLTYPE
  47. #endif /* !MSOAPI_ */
  48. #ifndef MSOAPIX_
  49. #define MSOAPIX_(t) t MSOAPICALLTYPE
  50. #endif /* !MSOAPIX_ */
  51. #ifndef MSOCDECLAPI_
  52. #define MSOCDECLAPI_(t) t MSOCDECLCALLTYPE
  53. #endif /* !MSOCDECLAPI_ */
  54. #ifndef MSOMACAPI_
  55. #define MSOMACAPI_(t) t
  56. #endif /* !MSOMACAPI_ */
  57. #if !defined(WIN) && defined(NT)
  58. #define WIN
  59. #endif /* !WIN && NT */
  60. #ifdef WIN
  61. #define Win(foo) foo
  62. #define WinMac(win,mac) win
  63. #define WinElse(win,foo) win
  64. #define Nt(foo) foo
  65. #define NtElse(nt,notnt) nt
  66. #else
  67. #define Win(foo)
  68. #define WinMac(win,mac) mac
  69. #define WinElse(win,foo) foo
  70. #define Nt(foo)
  71. #define NtElse(nt,notnt) notnt
  72. #endif
  73. #ifdef MAC
  74. #define Mac(foo) foo
  75. #define MacElse(mac, notmac) mac
  76. #define NotMac(foo)
  77. #else
  78. #define Mac(foo)
  79. #define MacElse(mac, notmac) notmac
  80. #define NotMac(foo) foo
  81. #endif
  82. #define _MAX_PATH 260 /* max. length of full pathname */
  83. #define MsoStrcpy strcpy
  84. #define MsoStrcat strcat
  85. #define MsoStrlen strlen
  86. #define MsoSzIndexRight strrchr
  87. #define MsoMemcpy memcpy
  88. #define MsoMemset memset
  89. #define MsoMemcmp memcmp
  90. #define MsoMemmove memmove
  91. #define MsoCchSzLen(sz) (strlen(sz))
  92. #define MsoCchWzLen(xsz) (wcslen(xsz))
  93. #define MsoRgwchToRgch(rgchFrom, cchFrom, rgchTo, cchTo) \
  94. (PbCopyRgb((rgchFrom), (rgchTo), (cchFrom)), (cchFrom))
  95. MSOAPI_(WCHAR) MsoWchToUpper(WCHAR wch);
  96. #ifdef RULE_COMPILER
  97. #define LANGIDFROMLCID(lcid) ((WORD )(lcid))
  98. #define msoStrip 0x01 // REVIEW PREHASH
  99. #endif /* RULE_COMPILER */
  100. #define MsoWzToSz(p, rgch) (p)
  101. #ifdef STANDALONE_WORD
  102. #include "word.h"
  103. #define TRUE 1
  104. #define FALSE 0
  105. #else /* !STANDALONE_WORD */
  106. #include <windows.h>
  107. #include <string.h>
  108. ///#include "sys.h"
  109. #endif /* STANDALONE_WORD */
  110. #include <ctype.h>
  111. _inline ChUpper(unsigned char ch)
  112. {
  113. return (islower(ch) ? toupper(ch) : ch);
  114. }
  115. void __cdecl Fail(const char *lsz, ...); // Print failure msg
  116. #ifndef FReportLszProc
  117. #define FReportLszProc(lszExtra, lszFile, line) TRUE
  118. #endif /* !FReportLszProc */
  119. /* Breaks into the debugger. Works (more or less) on all supported
  120. systems. */
  121. #ifndef MAC
  122. #define MsoDebugBreakInline() {__asm int 3}
  123. #else /* MAC */
  124. #define MsoDebugBreakInline() Debugger()
  125. #endif /* !MAC */
  126. #endif /* !MSO_H */