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.

154 lines
3.6 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. dtable.hxx
  5. Abstract:
  6. Dispatch table manager defintions.
  7. Notes:
  8. History:
  9. Oct-01-1993 VibhasC Created.
  10. ----------------------------------------------------------------------------*/
  11. /****************************************************************************
  12. * include files
  13. ***************************************************************************/
  14. #ifndef __DTABLE_HXX__
  15. #define __DTABLE_HXX__
  16. #include "nulldefs.h"
  17. extern "C"
  18. {
  19. #include <stdio.h>
  20. }
  21. #include "cgcommon.hxx"
  22. #include "idict.hxx"
  23. #include "listhndl.hxx"
  24. #include "nodeskl.hxx"
  25. //
  26. // This is the dispatch table manager class. We chose to do this using a class
  27. // derived from a simple array dictionary, because for MIDL's mixed model
  28. // of stub generation, mop dispatch table generation needs to know a little
  29. // more info about a procedure during dispatch table generation than normal
  30. // stubs.
  31. //
  32. // Each entry in the this class is a pointer to a special structure that
  33. // keeps the name of the function, along with some other information. This is
  34. // used by MIDL's code generator to register procedures for final emission into
  35. // the dispatch table. This class is NOT responsible for mangling names of the
  36. // procedures. It is the responsibility of the code generator to mangle names
  37. // before registering with the dispatch table.
  38. //
  39. #define INITIAL_SIZE_FOR_DISPATCH_TABLE 10
  40. #define INCREMENT_FOR_DISPATCH_TABLE 10
  41. //
  42. // Additional info about dispatch table entries.
  43. // These may overlap in the table: Read the comment about GetProcList.
  44. typedef enum
  45. {
  46. DTF_NONE = 0x0000
  47. ,DTF_INTERPRETER = 0x0001
  48. ,DTF_PICKLING_PROC = 0x0008
  49. } DISPATCH_TABLE_FLAGS;
  50. //
  51. // A dispatch table entry. The dispatch table class owns the structure, but
  52. // does not own the name pointer. therefore while destroying the contents
  53. // of this structure, DONT free the procedure name.
  54. //
  55. typedef struct
  56. {
  57. //
  58. // The name of the procedure to be registered.
  59. //
  60. PNAME pName;
  61. //
  62. // The node_skl of the procedure.
  63. //
  64. node_skl * pNode;
  65. //
  66. // Additional info that qualifies the procedure entry.
  67. //
  68. DISPATCH_TABLE_FLAGS Flags;
  69. } DISPATCH_TABLE_ENTRY;
  70. //
  71. // The actual dispatch table class.
  72. //
  73. class DISPATCH_TABLE : public IDICT
  74. {
  75. private:
  76. public:
  77. //
  78. // The constructor.
  79. //
  80. DISPATCH_TABLE() : IDICT(
  81. INITIAL_SIZE_FOR_DISPATCH_TABLE,
  82. INCREMENT_FOR_DISPATCH_TABLE
  83. )
  84. {
  85. }
  86. //
  87. // The destructor.
  88. //
  89. ~DISPATCH_TABLE();
  90. //
  91. // Register the procedure.
  92. //
  93. void RegisterProcedure( node_skl * pProcName,
  94. DISPATCH_TABLE_FLAGS Flags );
  95. //
  96. // Return the count of number of procedures in the table.
  97. //
  98. unsigned short GetCount()
  99. {
  100. return GetNumberOfElements();
  101. }
  102. //
  103. // Get a list of procedures which conform to the specified flags. Return
  104. // the count of such procedures. The flags field allows the caller to
  105. // select a set of procedures which have certain properties. For example,
  106. // the caller may want all procedures which are either mops procedures or
  107. // normal procedures. The flags field should specify all the necessary
  108. // flags which identify a mops dispatch table entry. This function will
  109. // use the flags param as a filter for the dispatch table entries.
  110. //
  111. unsigned short GetProcList( ITERATOR& ProcList,
  112. DISPATCH_TABLE_FLAGS );
  113. };
  114. #endif // __DTABLE_HXX__