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.

86 lines
2.1 KiB

  1. /*----------------------------------------------------------------------------
  2. %%File: EMDYN.C
  3. %%Unit: Event Monitor (mntr)
  4. %%Contact: daleg
  5. Event Monitor Sample Application, Main Program.
  6. The purpose of this application is to demonstrate how to process events
  7. using the Event Monitor's Rule Compiler and rule engine.
  8. ----------------------------------------------------------------------------*/
  9. #include "mso.h"
  10. #include "msoem.h"
  11. #if FEATURE_NYI // include'er file will give name
  12. DEBUGASSERTSZ
  13. #endif
  14. #include "emruloci.h"
  15. #if FEATURE_DEAD
  16. extern MSOKWTB vkwtbEmCHAR_KEYTABLE;
  17. #endif
  18. #include "emact.h"
  19. #include "msolex.h"
  20. #if 0
  21. #include "emtest.h"
  22. #include "emintf.c"
  23. #include "emfn.c"
  24. #endif
  25. /* F L O A D D Y N E M R U L E S */
  26. /*----------------------------------------------------------------------------
  27. %%Function: FLoadDynEmRules
  28. %%Contact: daleg
  29. Load rules dynamically from a file or a data structure, depending upon
  30. #ifdef
  31. ----------------------------------------------------------------------------*/
  32. #ifdef DYN_RULES_FROM_STRUCT
  33. #include "emruli.oci"
  34. #endif /* DYN_RULES_FROM_STRUCT */
  35. int FLoadDynEmRules(void)
  36. {
  37. int docii;
  38. #ifndef DYN_RULES_FROM_STRUCT
  39. /* Read opcodes from a disk file */
  40. if (!MsoFReadDynOciRules("em", &docii))
  41. return fFalse;
  42. #else /* DYN_RULES_FROM_STRUCT */
  43. /* Get opcodes from a structure */
  44. vlpruls->pociiDynRules = (PV) vrgociiEm;
  45. docii = IMaxRg(vrgociiEm, MSOOCII);
  46. vlpruls->rgpchDynNames = _rgszEmRulNames;
  47. #endif /* !DYN_RULES_FROM_STRUCT */
  48. #define NON_CONST_OCI_VTABLE
  49. #ifdef NON_CONST_OCI_VTABLE
  50. /* Insert Mso functions into OCI vtable */
  51. if (!MsoFCopyBaseRulRgpfnoci(vpfnociEm))
  52. return fFalse;
  53. #endif /* NON_CONST_OCI_VTABLE */
  54. /* Generate rulebase nodes from opcode stream */
  55. return MsoFLoadDynRulesPocii(vlpruls->pociiDynRules, docii,
  56. vpfnociEm, vrgocadEm,
  57. vrgcbOciArgEm, IMaxRg(vpfnociEm, MSOPFNOCI),
  58. DebugElse(vlpruls->rgpchDynNames, pNil));
  59. }