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.

79 lines
2.9 KiB

  1. /***************************************************************************
  2. *
  3. * TD.H
  4. *
  5. * This module contains Transport Driver defines and structures
  6. *
  7. * Copyright Microsoft, 1998
  8. *
  9. *
  10. ****************************************************************************/
  11. /*
  12. * Maximum number of zero byte reads before we will drop the client connection
  13. */
  14. #define MAXIMUM_ZERO_BYTE_READS 100
  15. /*
  16. * TD error message structure
  17. */
  18. typedef struct _TDERRORMESSAGE {
  19. ULONG Error;
  20. char * pMessage;
  21. } TDERRORMESSAGE, * PTDERRORMESSAGE;
  22. /*
  23. * TD structure
  24. */
  25. typedef struct _TD {
  26. PSDCONTEXT pContext;
  27. ULONG PdFlag; // pd flags (PD_?)
  28. SDCLASS SdClass; // class of sd (PdAsync, PdReli, ...)
  29. PDPARAMS Params; // pd parameters
  30. PCLIENTMODULES pClient; // pointer to winstation client data structure
  31. PPROTOCOLSTATUS pStatus; // pointer to winstation status structure
  32. PFILE_OBJECT pFileObject; // file object for transport I/O
  33. PDEVICE_OBJECT pDeviceObject; // device object for transport I/O
  34. ULONG LastError; // error code of last protocol error
  35. ULONG ReadErrorCount; // count of consecutive read errors
  36. ULONG ReadErrorThreshold; // max allowed consecutive read errors
  37. ULONG WriteErrorCount; // count of consecutive write errors
  38. ULONG WriteErrorThreshold; // max allowed consecutive write errors
  39. ULONG ZeroByteReadCount; // count of consecutive zero byte reads
  40. ULONG PortNumber; // network listen port number
  41. ULONG OutBufHeader; // number of reserved header bytes for this td
  42. ULONG OutBufTrailer; // number of reserved trailer bytes for this td
  43. ULONG OutBufLength; // length of input/output buffers
  44. LIST_ENTRY IoBusyOutBuf; // pointer to i/o busy outbufs
  45. KEVENT SyncWriteEvent; // event waited on by SyncWrite
  46. PKTHREAD pInputThread; // input thread pointer
  47. LONG InBufCount; // count of INBUFs to allocate
  48. KSPIN_LOCK InBufListLock; // spinlock to protect INBUF Busy/Done lists
  49. LIST_ENTRY InBufBusyHead; // list of busy INBUFs (waiting for input)
  50. LIST_ENTRY InBufDoneHead; // list of completed INBUFs (with input data)
  51. ULONG InBufHeader; // number of reserved header bytes for this td
  52. KEVENT InputEvent; // input event
  53. ULONG fClosing: 1; // stack driver is closing
  54. ULONG fCallbackInProgress: 1; // modem callback in progress
  55. ULONG fSyncWriteWaiter: 1; // there is a waiter in SyncWrite
  56. PVOID pPrivate; // pointer to private pd data
  57. PVOID pAfd; // pointer to private afd data
  58. LIST_ENTRY WorkItemHead; // preallocated workitem list.
  59. PDEVICE_OBJECT pSelfDeviceObject;// device object for this driver
  60. ULONG UserBrokenReason; // broken reason sent down from the user
  61. } TD, * PTD;