Windows NT 4.0 source code leak
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.

251 lines
4.0 KiB

4 years ago
  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, *PPROVIDER_STATUS;
  20. typedef NDIS_STATUS (*REQUEST_PROC)(NDIS_HANDLE, PNDIS_REQUEST);
  21. typedef struct _PROVIDER_INFO
  22. {
  23. PROVIDER_STATUS Status;
  24. NDIS_HANDLE ProviderHandle;
  25. REQUEST_PROC RequestProc;
  26. ULONG ProviderID;
  27. ULONG NumDevices;
  28. ULONG DeviceIDBase;
  29. struct _PROVIDER_INFO *Next;
  30. } PROVIDER_INFO, *PPROVIDER_INFO;
  31. typedef enum _NDISTAPI_STATUS
  32. {
  33. NDISTAPI_STATUS_CONNECTED,
  34. NDISTAPI_STATUS_DISCONNECTED,
  35. NDISTAPI_STATUS_CONNECTING,
  36. NDISTAPI_STATUS_DISCONNECTING
  37. } NDISTAPI_STATUS, *PNDISTAPI_STATUS;
  38. typedef struct _DEVICE_EXTENSION
  39. {
  40. //
  41. // The following are set only in DriverEntry and are not
  42. // modified elsewhere
  43. //
  44. //
  45. // Pointer to the NdisTapi device object
  46. //
  47. PDEVICE_OBJECT DeviceObject;
  48. //
  49. // Length in bytes of the event data buf
  50. //
  51. ULONG EventDataQueueLength;
  52. //
  53. // Pointer to a circular event data buf
  54. //
  55. PCHAR EventData;
  56. //
  57. // Synchronizes access to the device extension following fields
  58. //
  59. KSPIN_LOCK SpinLock;
  60. //
  61. // Whether TAPI has the the connection wrapper open
  62. //
  63. NDISTAPI_STATUS Status;
  64. //
  65. // Event we use for synchronizing provider inits
  66. //
  67. KEVENT SyncEvent;
  68. //
  69. // The connection wrapper's device ID base as passed down by TAPI
  70. // when it connected.
  71. //
  72. ULONG NdisTapiDeviceIDBase;
  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. BOOLEAN ProviderInitPending;
  83. //
  84. // Pointer to a list of registered providers. (Some may actually
  85. // not be currently registered, but they were at one point so we've
  86. // saved a placeholder for them should they come back online at some
  87. // point.)
  88. //
  89. PPROVIDER_INFO Providers;
  90. //
  91. //
  92. //
  93. BOOLEAN CleanupWasInitiated;
  94. //
  95. // A special queue for QUERY/SET_INFO requests
  96. //
  97. KDEVICE_QUEUE DeviceQueue;
  98. //
  99. // Synchronizes access to the events buffer & related fields
  100. //
  101. KSPIN_LOCK EventSpinLock;
  102. //
  103. // Value return to provider for next NEWCALL msg
  104. //
  105. ULONG htCall;
  106. //
  107. // Outstanding get-events request
  108. //
  109. PIRP EventsRequestIrp;
  110. //
  111. // Pointer to next place to PUT event data (from provider)
  112. //
  113. PCHAR DataIn;
  114. //
  115. // Pointer to next place to GET event data (for user-mode request)
  116. //
  117. PCHAR DataOut;
  118. //
  119. // Number of valid events in queue
  120. //
  121. ULONG EventCount;
  122. //
  123. //
  124. //
  125. PFILE_OBJECT TapiSrvFileObject;
  126. //
  127. //
  128. //
  129. PFILE_OBJECT NCPAFileObject;
  130. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  131. typedef struct _PROVIDER_REQUEST
  132. {
  133. NDIS_REQUEST NdisRequest;
  134. PPROVIDER_INFO Provider;
  135. //
  136. // This field is a placeholder for an NDIS_TAPI_XXX structure, the
  137. // first ULONG of which is always a request ID.
  138. //
  139. ULONG Data[1];
  140. } PROVIDER_REQUEST, *PPROVIDER_REQUEST;
  141. //
  142. // Our global device extension
  143. //
  144. PDEVICE_EXTENSION DeviceExtension;
  145. #if DBG
  146. //
  147. // A var which determines the verboseness of the msgs printed by DBGOUT()
  148. //
  149. //
  150. ULONG NdisTapiDebugLevel = 0;
  151. //
  152. // DbgPrint wrapper
  153. //
  154. #define DBGOUT(arg) DbgPrt arg
  155. #else
  156. #define DBGOUT(arg)
  157. #endif