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.

206 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. ipinip\driver.h
  5. Abstract:
  6. Headers for driver.c
  7. Revision History:
  8. --*/
  9. //
  10. // The number of IRP_MJ_CREATEs we have received
  11. //
  12. ULONG g_ulNumCreates;
  13. //
  14. // The state of the driver
  15. //
  16. DWORD g_dwDriverState;
  17. //
  18. // The lock to protect the driver state
  19. //
  20. RT_LOCK g_rlStateLock;
  21. //
  22. // The mutext that serializes binds and unbinds
  23. //
  24. WAN_RESOURCE g_wrBindMutex;
  25. //
  26. // The state of the driver.
  27. //
  28. #define DRIVER_STOPPED 0
  29. #define DRIVER_STARTING 1
  30. #define DRIVER_STARTED 2
  31. //
  32. // Timeout value for start is 10 seconds.
  33. // So in 100ns it becomes
  34. //
  35. #define START_TIMEOUT (LONGLONG)(10 * 1000 * 1000 * 10)
  36. //
  37. // The event to signal when we have started
  38. //
  39. KEVENT g_keStartEvent;
  40. //
  41. // The event to signal when all the threads go to 0 and state is STOPPED
  42. //
  43. KEVENT g_keStateEvent;
  44. //
  45. // Event to signal when our close adapter function is done
  46. //
  47. KEVENT g_keCloseEvent;
  48. //
  49. // The number of "threads" in the driver
  50. //
  51. ULONG g_ulNumThreads;
  52. NTSTATUS
  53. DriverEntry(
  54. IN PDRIVER_OBJECT DriverObject,
  55. IN PUNICODE_STRING RegistryPath
  56. );
  57. NTSTATUS
  58. WanDispatch(
  59. IN PDEVICE_OBJECT DeviceObject,
  60. IN PIRP Irp
  61. );
  62. VOID
  63. WanUnload(
  64. PDRIVER_OBJECT DriverObject
  65. );
  66. BOOLEAN
  67. WanpSetupExternalName(
  68. PUNICODE_STRING pusNtName,
  69. PWCHAR pwcDosName,
  70. BOOLEAN bCreate
  71. );
  72. NTSTATUS
  73. WanpStartDriver(
  74. VOID
  75. );
  76. VOID
  77. WanpStopDriver(
  78. VOID
  79. );
  80. NTSTATUS
  81. WanpRegisterWithIp(
  82. VOID
  83. );
  84. VOID
  85. WanpDeregisterWithIp(
  86. VOID
  87. );
  88. BOOLEAN
  89. EnterDriverCode(
  90. VOID
  91. );
  92. VOID
  93. ExitDriverCode(
  94. VOID
  95. );
  96. VOID
  97. WanpSetDemandDialCallback(
  98. BOOLEAN bSetPointer
  99. );
  100. BOOLEAN
  101. WanpInitializeDriverStructures(
  102. VOID
  103. );
  104. NDIS_STATUS
  105. WanpInitializeNdis(
  106. VOID
  107. );
  108. NTSTATUS
  109. OpenRegKey(
  110. OUT PHANDLE phHandle,
  111. IN PUNICODE_STRING pusKeyName
  112. );
  113. NTSTATUS
  114. GetRegDWORDValue(
  115. HANDLE KeyHandle,
  116. PWCHAR ValueName,
  117. PULONG ValueData
  118. );
  119. VOID
  120. WanpDeinitializeNdis(
  121. VOID
  122. );
  123. VOID
  124. WanNdisUnload(
  125. VOID
  126. );
  127. BOOLEAN
  128. IsEntryOnList(
  129. PLIST_ENTRY pleHead,
  130. PLIST_ENTRY pleEntry
  131. );
  132. VOID
  133. WanpInitializeResource(
  134. IN PWAN_RESOURCE pLock
  135. );
  136. VOID
  137. WanpAcquireResource(
  138. IN PWAN_RESOURCE pLock
  139. );
  140. VOID
  141. WanpReleaseResource(
  142. IN PWAN_RESOURCE pLock
  143. );
  144. INT
  145. ConvertGuidToString(
  146. IN GUID *pGuid,
  147. OUT PWCHAR pwszGuid
  148. );
  149. VOID
  150. WanpClearPendingIrps(
  151. VOID
  152. );