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.

149 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. internal.h
  5. Abstract:
  6. This module contains the code that is very specific to initialization
  7. and unload operations in the irenum driver
  8. Author:
  9. Brian Lieuallen, 7-13-2000
  10. Environment:
  11. Kernel mode
  12. Revision History :
  13. --*/
  14. #define UNICODE 1
  15. #define NO_INTERLOCKED_INTRINSICS
  16. #include <ntosp.h>
  17. #include <zwapi.h>
  18. #include <tdikrnl.h>
  19. #define UINT ULONG //tmp
  20. #include <irioctl.h>
  21. //#include <ircommtdi.h>
  22. #include <vuart.h>
  23. #include <ircomm.h>
  24. #include <ircommdbg.h>
  25. #include "buffer.h"
  26. #include <ntddser.h>
  27. #include "link.h"
  28. typedef struct _SEND_TRACKER {
  29. LONG ReferenceCount;
  30. PIRP CurrentWriteIrp;
  31. LONG IrpReferenceCount;
  32. PVOID CompletionContext;
  33. CONNECTION_CALLBACK CompletionRoutine;
  34. LONG BuffersOutstanding;
  35. LONG BytesRemainingInIrp;
  36. KTIMER Timer;
  37. KDPC TimerDpc;
  38. BOOLEAN TimerSet;
  39. NTSTATUS LastStatus;
  40. #if DBG
  41. BOOLEAN TimerExpired;
  42. BOOLEAN IrpCanceled;
  43. BOOLEAN SendAborted;
  44. #endif
  45. struct _TDI_CONNECTION *Connection;
  46. } SEND_TRACKER, *PSEND_TRACKER;
  47. typedef struct _SEND_CONTROL {
  48. PSEND_TRACKER CurrentSendTracker;
  49. LONG ProcessSendEntryCount;
  50. KSPIN_LOCK ControlLock;
  51. WORK_QUEUE_ITEM WorkItem;
  52. LONG WorkItemCount;
  53. BOOLEAN OutOfBuffers;
  54. } SEND_CONTROL, *PSEND_CONTROL;
  55. typedef struct _UART_CONTROL {
  56. PIRP CurrentIrp;
  57. PVOID CompletionContext;
  58. CONNECTION_CALLBACK CompletionRoutine;
  59. LONG DtrState;
  60. LONG RtsState;
  61. ULONG BaudRate;
  62. SERIAL_LINE_CONTROL LineControl;
  63. ULONG ModemStatus;
  64. } UART_CONTROL, *PUART_CONTROL;
  65. typedef struct _TDI_CONNECTION {
  66. LONG ReferenceCount;
  67. KEVENT CloseEvent;
  68. LINK_HANDLE LinkHandle;
  69. RECEIVE_CALLBACK ReceiveCallBack;
  70. PVOID ReceiveContext;
  71. EVENT_CALLBACK EventCallBack;
  72. PVOID EventContext;
  73. ULONG MaxSendPdu;
  74. BOOLEAN LinkUp;
  75. SEND_CONTROL Send;
  76. UART_CONTROL Uart;
  77. } TDI_CONNECTION, *PTDI_CONNECTION;
  78. VOID
  79. SendWorkItemRountine(
  80. PVOID Context
  81. );
  82. VOID
  83. ProcessSendAtPassive(
  84. PTDI_CONNECTION Connection
  85. );
  86. VOID
  87. RemoveRefereneToConnection(
  88. PTDI_CONNECTION Connection
  89. );
  90. #define ADD_REFERENCE_TO_CONNECTION(_connection) InterlockedIncrement(&_connection->ReferenceCount)
  91. #define REMOVE_REFERENCE_TO_CONNECTION(_connection) RemoveRefereneToConnection(_connection)