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.

244 lines
4.9 KiB

  1. /*++ BUILD Version: 0000 // Increment this if a change has global effects
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. private.h
  5. Abstract:
  6. Private definitions for NdisTapi.sys
  7. Author:
  8. Dan Knudson (DanKn) 20-Feb-1994
  9. Revision History:
  10. --*/
  11. //
  12. // Various definitions
  13. //
  14. typedef enum _PROVIDER_STATUS
  15. {
  16. PROVIDER_STATUS_ONLINE,
  17. PROVIDER_STATUS_OFFLINE,
  18. PROVIDER_STATUS_PENDING_INIT,
  19. PROVIDER_STATUS_PENDING_REINIT,
  20. PROVIDER_STATUS_PENDING_LINE_CREATE
  21. } PROVIDER_STATUS, *PPROVIDER_STATUS;
  22. typedef NDIS_STATUS (*REQUEST_PROC)(NDIS_HANDLE, PNDIS_REQUEST);
  23. typedef struct _DEVICE_INFO {
  24. ULONG DeviceID;
  25. HTAPI_LINE htLine;
  26. HDRV_LINE hdLine;
  27. } DEVICE_INFO, *PDEVICE_INFO;
  28. typedef struct _PROVIDER_INFO
  29. {
  30. struct _PROVIDER_INFO *Next;
  31. PROVIDER_STATUS Status;
  32. NDIS_HANDLE ProviderHandle;
  33. REQUEST_PROC RequestProc;
  34. ULONG ProviderID;
  35. ULONG NumDevices;
  36. ULONG DeviceIDBase;
  37. GUID Guid;
  38. NDIS_WAN_MEDIUM_SUBTYPE MediaType;
  39. ULONG_PTR TempID;
  40. ULONG CreateCount;
  41. KEVENT SyncEvent;
  42. PDEVICE_INFO DeviceInfo;
  43. } PROVIDER_INFO, *PPROVIDER_INFO;
  44. typedef enum _NDISTAPI_STATUS
  45. {
  46. NDISTAPI_STATUS_CONNECTED,
  47. NDISTAPI_STATUS_DISCONNECTED,
  48. NDISTAPI_STATUS_CONNECTING,
  49. NDISTAPI_STATUS_DISCONNECTING
  50. } NDISTAPI_STATUS, *PNDISTAPI_STATUS;
  51. typedef struct _KMDD_DEVICE_EXTENSION
  52. {
  53. //
  54. // Pointer to a list of registered providers. (Some may actually
  55. // not be currently registered, but they were at one point so we've
  56. // saved a placeholder for them should they come back online at some
  57. // point.)
  58. //
  59. PPROVIDER_INFO Providers;
  60. //
  61. // Whether TAPI has the the connection wrapper open
  62. //
  63. NDISTAPI_STATUS Status;
  64. ULONG RefCount;
  65. //
  66. // Pointer to the NdisTapi device object
  67. //
  68. PDEVICE_OBJECT DeviceObject;
  69. //
  70. // BaseID
  71. //
  72. ULONG ProviderBaseID;
  73. //
  74. // The number of line devices we told told TAPI we supported when
  75. // it opened us (some of which may not actually be online at any
  76. // given time)
  77. //
  78. ULONG NdisTapiNumDevices;
  79. //
  80. // Whether we have an outstanding provider init request
  81. //
  82. ULONG Flags;
  83. #define PENDING_LINECREATE 0x00000001
  84. #define CLEANUP_INITIATED 0x00000002
  85. #define EVENTIRP_CANCELED 0x00000004
  86. #define REQUESTIRP_CANCELED 0x00000008
  87. #define DUPLICATE_EVENTIRP 0x00000010
  88. #define CANCELIRP_NOTFOUND 0x00000020
  89. //
  90. // Count of irps canceled through the cancel routine or
  91. // cleanup routine
  92. //
  93. ULONG IrpsCanceledCount;
  94. //
  95. // Count of irps missing when a request is completed by
  96. // the underlying miniport
  97. //
  98. ULONG MissingRequests;
  99. //
  100. // Used to key irp request queue
  101. //
  102. ULONG ulRequestID;
  103. //
  104. // Value return to provider for next NEWCALL msg
  105. //
  106. ULONG htCall;
  107. //
  108. // Outstanding get-events request
  109. //
  110. PIRP EventsRequestIrp;
  111. //
  112. // List of events waiting for service by user-mode
  113. //
  114. LIST_ENTRY ProviderEventList;
  115. ULONG EventCount; // Number of events in queue
  116. //
  117. // List of requests sent to the providers
  118. //
  119. LIST_ENTRY ProviderRequestList;
  120. ULONG RequestCount; // Number of requests in queue
  121. PFILE_OBJECT NCPAFileObject;
  122. //
  123. // Synchronizes access to the device extension following fields
  124. //
  125. KSPIN_LOCK SpinLock;
  126. } KMDD_DEVICE_EXTENSION, *PKMDD_DEVICE_EXTENSION;
  127. typedef struct _PROVIDER_EVENT {
  128. //
  129. // List linkage
  130. //
  131. LIST_ENTRY Linkage;
  132. //
  133. // Event
  134. //
  135. NDIS_TAPI_EVENT Event;
  136. }PROVIDER_EVENT, *PPROVIDER_EVENT;
  137. typedef struct _PROVIDER_REQUEST
  138. {
  139. LIST_ENTRY Linkage; // Link into providerrequest list
  140. // ASSUMED to be first member!!!!
  141. PIRP Irp; // Original IRP
  142. PPROVIDER_INFO Provider; // Provider this is destined for
  143. ULONG RequestID; // unique identifier for request
  144. ULONG Flags; //
  145. #define INTERNAL_REQUEST 0x00000001
  146. PVOID Alignment1;
  147. NDIS_REQUEST NdisRequest; // NDIS_REQUEST storage
  148. PVOID Alignment2;
  149. ULONG Data[1]; // This field is a placeholder for an
  150. // NDIS_TAPI_XXX structure, the first
  151. // ULONG of which is always a request ID.
  152. } PROVIDER_REQUEST, *PPROVIDER_REQUEST;
  153. //
  154. // Our global device extension
  155. //
  156. PKMDD_DEVICE_EXTENSION DeviceExtension;
  157. #if DBG
  158. //
  159. // A var which determines the verboseness of the msgs printed by DBGOUT()
  160. //
  161. //
  162. LONG NdisTapiDebugLevel = 0;
  163. //
  164. // DbgPrint wrapper
  165. //
  166. #define DBGOUT(arg) DbgPrt arg
  167. #else
  168. #define DBGOUT(arg)
  169. #endif