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.

125 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 2001-2001 Microsoft Corporation
  3. Module Name:
  4. httptdi.h
  5. Abstract:
  6. Declarations for the TDI/MUX/SSL component that is common between
  7. ultdi and uctdi
  8. Author:
  9. Rajesh Sundaram (rajeshsu)
  10. Revision History:
  11. --*/
  12. #ifndef _HTTPTDI_H
  13. #define _HTTPTDI_H
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define IS_VALID_TDI_OBJECT( pobj ) \
  18. ( ( (pobj)->Handle != NULL ) && \
  19. ( (pobj)->pFileObject != NULL ) && \
  20. ( (pobj)->pDeviceObject != NULL ) )
  21. #define UxCloseTdiObject( pTdiObject ) \
  22. do \
  23. { \
  24. if ((pTdiObject)->pFileObject != NULL) \
  25. { \
  26. ObDereferenceObject( (pTdiObject)->pFileObject ); \
  27. (pTdiObject)->pFileObject = NULL; \
  28. } \
  29. \
  30. if ((pTdiObject)->Handle != NULL) \
  31. { \
  32. UlCloseSystemHandle( (pTdiObject)->Handle ); \
  33. (pTdiObject)->Handle = NULL; \
  34. } \
  35. } while (FALSE)
  36. //
  37. // A wrapper around a TDI object handle, with a pre-referenced
  38. // FILE_OBJECT pointer and the corresponding DEVICE_OBJECT pointer.
  39. //
  40. typedef struct _UX_TDI_OBJECT
  41. {
  42. HANDLE Handle;
  43. PFILE_OBJECT pFileObject;
  44. PDEVICE_OBJECT pDeviceObject;
  45. } UX_TDI_OBJECT, *PUX_TDI_OBJECT;
  46. NTSTATUS
  47. UxInitializeTdi(
  48. VOID
  49. );
  50. VOID
  51. UxTerminateTdi(
  52. VOID
  53. );
  54. NTSTATUS
  55. UxOpenTdiAddressObject(
  56. IN PTRANSPORT_ADDRESS pLocalAddress,
  57. IN ULONG LocalAddressLength,
  58. OUT PUX_TDI_OBJECT pTdiObject
  59. );
  60. NTSTATUS
  61. UxOpenTdiConnectionObject(
  62. IN CONNECTION_CONTEXT pConnectionContext,
  63. OUT PUX_TDI_OBJECT pTdiObject
  64. );
  65. NTSTATUS
  66. UxpOpenTdiObjectHelper(
  67. IN PUNICODE_STRING pTransportDeviceName,
  68. IN PVOID pEaBuffer,
  69. IN ULONG EaLength,
  70. OUT PUX_TDI_OBJECT pTdiObject
  71. );
  72. NTSTATUS
  73. UxSetEventHandler(
  74. IN PUX_TDI_OBJECT pUlTdiObject,
  75. IN ULONG EventType,
  76. IN PVOID pEventHandler,
  77. IN PVOID pEventContext
  78. );
  79. PIRP
  80. UxCreateDisconnectIrp(
  81. IN PUX_TDI_OBJECT pTdiObject,
  82. IN ULONG_PTR Flags,
  83. IN PIO_COMPLETION_ROUTINE pCompletionRoutine,
  84. IN PVOID pCompletionContext
  85. );
  86. VOID
  87. UxInitializeDisconnectIrp(
  88. IN PIRP pIrp,
  89. IN PUX_TDI_OBJECT pTdiObject,
  90. IN ULONG_PTR Flags,
  91. IN PIO_COMPLETION_ROUTINE pCompletionRoutine,
  92. IN PVOID pCompletionContext
  93. );
  94. #ifdef __cplusplus
  95. }; // extern "C"
  96. #endif
  97. #endif // _HTTPTDI_H