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.

160 lines
5.0 KiB

  1. /*++ BUILD Version: 0009 // Increment this if a change has global effects
  2. Copyright (c) 1987-1993 Microsoft Corporation
  3. Module Name:
  4. rxcep.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. implementing the redirector file system connection engine.
  8. Revision History:
  9. Balan Sethu Raman (SethuR) 06-Feb-95 Created
  10. Notes:
  11. The Connection engine is designed to map and emulate the TDI specs. as closely
  12. as possible. This implies that on NT we will have a very efficient mechanism
  13. which fully exploits the underlying TDI implementation.
  14. --*/
  15. #ifndef _RXCEP_H_
  16. #define _RXCEP_H_
  17. //
  18. // The following definition provide a rudimentary profiling mechanism by having a counter
  19. // associated with each of the procedure definitions. This counter is incremented for every
  20. // invocation.
  21. //
  22. // Notes: we should think about some means of sorting all the counts so as to provide a global
  23. // picture of the redirector.
  24. //
  25. #define RxProfile(CATEGORY,ProcName) {\
  26. RxDbgTrace(0,(DEBUG_TRACE_ALWAYS), ("%s@IRQL %d\n", #ProcName , KeGetCurrentIrql() )); \
  27. }
  28. #include <rxworkq.h>
  29. #include <rxce.h> // Rx Connection Engine
  30. #include <rxcehdlr.h> // Rx Connection engine handler definitions
  31. #include <mrx.h> // RDBSS related definitions
  32. //
  33. // The following data structures are related to coordination between multiple callout
  34. // ( calls by wrappers to other components ) made by the wrapper.
  35. typedef struct _RX_CALLOUT_PARAMETERS_BLOCK_ {
  36. struct _RX_CALLOUT_PARAMETERS_BLOCK_ *pNextCallOutParameterBlock;
  37. struct _RX_CALLOUT_CONTEXT_ *pCallOutContext;
  38. NTSTATUS CallOutStatus;
  39. ULONG CallOutId;
  40. } RX_CALLOUT_PARAMETERS_BLOCK,
  41. *PRX_CALLOUT_PARAMETERS_BLOCK;
  42. typedef
  43. VOID
  44. (NTAPI *PRX_CALLOUT_ROUTINE) (
  45. IN OUT PRX_CALLOUT_PARAMETERS_BLOCK pParametersBlock);
  46. typedef struct _RX_CALLOUT_CONTEXT_ {
  47. PRX_CALLOUT_ROUTINE pRxCallOutInitiation;
  48. PRX_CALLOUT_ROUTINE pRxCallOutCompletion;
  49. LONG NumberOfCallOuts;
  50. LONG NumberOfCallOutsInitiated;
  51. LONG NumberOfCallOutsCompleted;
  52. KSPIN_LOCK SpinLock;
  53. PRDBSS_DEVICE_OBJECT pRxDeviceObject;
  54. PRX_CALLOUT_PARAMETERS_BLOCK pCallOutParameterBlock;
  55. } RX_CALLOUT_CONTEXT,
  56. *PRX_CALLOUT_CONTEXT;
  57. // The following data structures implement the mechanism for initiating callouts to
  58. // multiple transports for setting up a connection. The mini redirectors specify
  59. // a number of local address handles for which they want to initiate a connection
  60. // setup request to a remote server. They are in the desired order of importance.
  61. //
  62. // This mechanism allows for initiating all the callouts asynchronously and waiting
  63. // for the best one to complete. Once it is done the connect request is completed
  64. //
  65. // This mechanism also provides the necessary infrastructure to cleanup the
  66. // connection engine data structures after a connect request was completed. In other
  67. // words the mini redirector need not wait for all the transports to complete, it
  68. // merely waits for the best one to complete.
  69. //
  70. // These data structures are based on the generic Callout data structures defined in
  71. // rxcep.h
  72. typedef struct _RX_CREATE_CONNECTION_CALLOUT_CONTEXT_ {
  73. RX_CALLOUT_CONTEXT;
  74. RXCE_CONNECTION_CREATE_OPTIONS CreateOptions;
  75. // Results to be passed back to the original callout request
  76. PRXCE_CONNECTION_COMPLETION_ROUTINE pCompletionRoutine;
  77. PRXCE_CONNECTION_COMPLETION_CONTEXT pCompletionContext;
  78. // TDI Connection context
  79. PRXCE_VC pConnectionContext;
  80. // Callout id of the desired winner. It is originally set to the callout Id
  81. // associated with the first address and later modified depending upon the
  82. // completion status.
  83. ULONG BestPossibleWinner;
  84. // The callout that was selected as the winner.
  85. ULONG WinnerCallOutId;
  86. // The winner was found and the Completion event was signalled. This enables the
  87. // hystersis between the completion of the callout request and cleanup.
  88. BOOLEAN WinnerFound;
  89. // Once the winner is found we ensure that all callouts have been properly
  90. // initiated before the request is completed.
  91. BOOLEAN CompletionRoutineInvoked;
  92. RX_WORK_QUEUE_ITEM WorkQueueItem;
  93. PKEVENT pCleanUpEvent;
  94. } RX_CREATE_CONNECTION_CALLOUT_CONTEXT,
  95. *PRX_CREATE_CONNECTION_CALLOUT_CONTEXT;
  96. typedef struct _RX_CREATE_CONNECTION_PARAMETERS_BLOCK_ {
  97. RX_CALLOUT_PARAMETERS_BLOCK;
  98. RXCE_CONNECTION Connection;
  99. RXCE_VC Vc;
  100. // TDI context for async continuation
  101. PIRP pConnectIrp;
  102. PULONG IrpRefCount;
  103. } RX_CREATE_CONNECTION_PARAMETERS_BLOCK,
  104. *PRX_CREATE_CONNECTION_PARAMETERS_BLOCK;
  105. //
  106. // Miscellanous routines to support constuction/destruction of connection engine
  107. // data structures
  108. //
  109. extern NTSTATUS
  110. NTAPI
  111. RxCeInit();
  112. extern VOID
  113. NTAPI
  114. RxCeTearDown();
  115. #endif // _RXCEP_H_