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.

440 lines
12 KiB

4 years ago
  1. AfdSpinLock Usage
  2. ~~~~~~~~~~~~~~~~~
  3. ACCEPT.C
  4. Function: AfdDeferAccept
  5. Protects: Endpoint->Common.VcListening.UnacceptedConnectionListHead
  6. Synopsis: Used when deferring an accept (putting a connection back
  7. on the endpoint's unaccepted connection queue).
  8. Strategy: None. Deferring accepted connections is a very low
  9. frequency operation (and is impossible in WinSock 1.1).
  10. BIND.C
  11. Function: AfdRestartGetAddress
  12. Protects: Endpoint->LocalAddress[Length]
  13. Synopsis: Used when allocating an endpoint's local address buffer
  14. to prevent multiple processors from allocating the buffer.
  15. Strategy: None. AfdGetAddress is only called during bind() and
  16. getsockname() APIs. The bind() call is certainly more
  17. interesting than getsockname(), but even bind() is only
  18. called once per socket, so it is unlikely there would be
  19. any benefit in tuning this.
  20. BLKCONN.C
  21. Function: AfdAddFreeConnection
  22. Protects: Endpoint->Common.VcListening.FreeConnectionListHead
  23. Synopsis: Used when adding free connections to the endpoint's
  24. free connection queue.
  25. Strategy: Use SLIST for free connection queue.
  26. Function: AfdFreeConnection
  27. Protects: Endpoint->Common.VcListening.FreeConnectionListHead
  28. Synopsis: Used when appending a reused connection to the endpoint's
  29. free connection queue.
  30. Strategy: Use SLIST for free connection queue.
  31. Function: AfdDereferenceConnection
  32. Protects: Connection->ReferenceCount
  33. Synopsis: Synchronizes access to reference count member.
  34. Strategy: Use InterlockedDecrement. If updated value is now zero,
  35. then acquire AfdSpinLock, and recheck the value for zero.
  36. If it's still zero, do the usual dereference stuff. This
  37. will eliminate all spinlock acquisitions on reference/
  38. dereference except the *last* dereference.
  39. Function: AfdGetFreeConnection
  40. Protects: Endpoint->Common.VcListening.FreeConnectionListHead
  41. Synopsis: Used when removing a free connection from the endpoint's
  42. free connection queue.
  43. Strategy: Use SLIST for free connection queue.
  44. Function: AfdGetReturnedConnection
  45. Protects: Endpoint->Common.VcListening.ReturnedConnectionListHead
  46. Synopsis: Used when scanning the returned connection queue for a
  47. specific sequence number.
  48. Strategy: None (for now).
  49. Function: AfdReferenceConnection
  50. Protects: Connection->ReferenceCount
  51. Synopsis: Synchronizes access to reference count member.
  52. Strategy: Use InterlockedIncrement instead.
  53. BLKENDP.C
  54. Function: AfdFreeQueuedConnections
  55. Protects: Endpoint->Common.VcListening.UnacceptedConnectionListHead
  56. Synopsis: Used when puring the endpoint's unaccepted connection
  57. queue.
  58. Strategy: None (for now).
  59. Function: AfdDereferenceEndpoint
  60. Protects: Endpoint->ReferenceCount
  61. Synopsis: Synchronizes access to reference count member.
  62. Strategy: Use InterlockedDecrement. If updated value is now zero,
  63. then acquire AfdSpinLock, and recheck the value for zero.
  64. If it's still zero, do the usual dereference stuff. This
  65. will eliminate all spinlock acquisitions on reference/
  66. dereference except the *last* dereference.
  67. Function: AfdReferenceEndpoint
  68. Protects: Endpoint->ReferenceCount
  69. Synopsis: Synchronizes access to reference count member.
  70. Strategy: Use InterlockedIncrement instead.
  71. CLOSE.C
  72. Function: AfdCleanup
  73. Protects:
  74. Synopsis:
  75. Strategy:
  76. CONNECT.C
  77. Function: AfdSetupConnectDataBuffers
  78. Protects: Endpoint->ConnectDataBuffers
  79. Synopsis: Used to guard connect data buffers when they're moved
  80. from an endpoint to a connection.
  81. Strategy: Do the "double compare" trick to avoid acquiring the
  82. spinlock if there are no connect data buffers on the
  83. endpoint.
  84. Function: AfdRestartConnect
  85. Protects: Connection->ConnectDataBuffers
  86. Synopsis: Used to guard connect data buffers after a connect
  87. completes.
  88. Strategy: Do the "double compare" trick to avoid acquiring the
  89. spinlock if there are no connect data buffers on the
  90. connection.
  91. DISCONN.C
  92. Function: AfdPartialDisconnect(1)
  93. Protects: Endpoint->DisconnectMode
  94. Synopsis: Used to guard the disconnect mode bits when shutting
  95. down a datagram endpoint.
  96. Strategy: Test a Bunch-O-Bits in the endpoint, and only if
  97. at least one of these is nonzero acquire the spinlock,
  98. then proceed with the current tests.
  99. Function: AfdPartialDisconnect(2)
  100. Protects: Connection->Common.Bufferring.Receive[Expedited]BytesTaken
  101. Synopsis: Used to guard access to the byte counters in the connection
  102. when receives are shutdown so that the connection can be
  103. aborted if necessary.
  104. Strategy: None (for now).
  105. Function: AfdDisconnectEventHandler
  106. Protects: Connection->ConnectDataBuffers
  107. Synopsis: Used to guard disconnect data buffers when a disconnect
  108. indication is received.
  109. Strategy: Do the "double compare" trick to avoid acquiring the
  110. spinlock if there are no connect data buffers on the
  111. connection.
  112. Function: AfdBeginAbort
  113. Protects: Bunch-O-Crap
  114. Synopsis:
  115. Strategy:
  116. Function: AfdBeginDisconnect
  117. Protects: Bunch-O-Crap, including disconnect buffers
  118. Synopsis:
  119. Strategy:
  120. Function: AfdRestartDisconnect
  121. Protects: DisconnectContext->DisconnectListEntry
  122. Synopsis: Guards access to AfdDisconnectListHead
  123. Strategy: AfdDisconnectListHead no longer used. Nuke it!
  124. LISTEN.C
  125. Function: AfdWaitForListen
  126. Protects:
  127. Synopsis:
  128. Strategy:
  129. Function: AfdCancelWaitForListen
  130. Protects:
  131. Synopsis:
  132. Strategy:
  133. Function: AfdConnectEventHandler
  134. Protects:
  135. Synopsis:
  136. Strategy:
  137. Function: AfdRestartAccept
  138. Protects:
  139. Synopsis:
  140. Strategy:
  141. MISC.C
  142. Function: AfdInsertNewEndpointInList
  143. Protects:
  144. Synopsis:
  145. Strategy:
  146. Function: AfdRemoveEndpointFromList
  147. Protects:
  148. Synopsis:
  149. Strategy:
  150. Function: AfdInterlockedRemoveEntryList
  151. Protects:
  152. Synopsis:
  153. Strategy:
  154. Function: AfdGetConnectData
  155. Protects:
  156. Synopsis:
  157. Strategy:
  158. Function: AfdSetConnectData
  159. Protects:
  160. Synopsis:
  161. Strategy:
  162. Function: AfdQueueWorkItem
  163. Protects:
  164. Synopsis:
  165. Strategy:
  166. Function: AfdDoWork
  167. Protects:
  168. Synopsis:
  169. Strategy:
  170. POLL.C
  171. Function: AfdPoll
  172. Protects:
  173. Synopsis:
  174. Strategy:
  175. Function: AfdCancelPoll
  176. Protects:
  177. Synopsis:
  178. Strategy:
  179. Function: AfdIndicatePollEvent
  180. Protects:
  181. Synopsis:
  182. Strategy:
  183. Function: AfdTimeoutPoll
  184. Protects:
  185. Synopsis:
  186. Strategy:
  187. RECEIVE.C
  188. Function: AfdReceive
  189. Protects:
  190. Synopsis:
  191. Strategy:
  192. Function: AfdRestartReceive
  193. Protects:
  194. Synopsis:
  195. Strategy:
  196. Function: AfdReceiveEventHandler
  197. Protects:
  198. Synopsis:
  199. Strategy:
  200. Function: AfdReceiveExpeditedEventHandler
  201. Protects:
  202. Synopsis:
  203. Strategy:
  204. Function: AfdQueryReceiveInformation
  205. Protects:
  206. Synopsis:
  207. Strategy:
  208. SEND.C
  209. Function: AfdRestartBufferSend
  210. Protects: Connection->VcDisconnectIrp
  211. Synopsis: Used to grab the disconnect IRP off a connection.
  212. Strategy: Use InterlockedExchange. Will require changes to
  213. blkconn!AfdFreeConnection.
  214. AfdBufferSpinLock Usage
  215. ~~~~~~~~~~~~~~~~~~~~~~~
  216. BUFFER.C
  217. Function: AfdGetBuffer
  218. Protects: Afd{Small|Medium|Large}BufferListHead
  219. Synopsis: Serializes access to the various buffer lists.
  220. Strategy: Use DaveC's SLIST instead. We'll still need the spinlock
  221. for PPC.
  222. Function: AfdReturnBuffer
  223. Protects: Afd{Small|Medium|Large}BufferListHead
  224. Synopsis: Serializes access to the various buffer lists.
  225. Strategy: Use DaveC's SLIST instead. We'll still need the spinlock
  226. for PPC.
  227. Endpoint->SpinLock Usage
  228. ~~~~~~~~~~~~~~~~~~~~~~~~
  229. ACCEPT.C
  230. Function: AfdAcceptCore
  231. Protects:
  232. Synopsis:
  233. Strategy:
  234. BLKCONN.C
  235. Function: AfdAddConnectedReference
  236. Protects: Connection->ConnectedReferenceAdded
  237. Synopsis:
  238. Strategy:
  239. Function: AfdDeleteConnectedReference
  240. Protects:
  241. Synopsis:
  242. Strategy:
  243. CLOSE.C
  244. Function: AfdCleanup
  245. Protects: Endpoint->{Receive|Peek}DatagramIrpListHead,
  246. Endpoint->Vc{Receive|Send}IrpListHead,
  247. Connection->CleanupBegun,
  248. Endpoint->TransmitIrp
  249. Synopsis:
  250. Strategy:
  251. CONNECT.C
  252. Function: AfdDoDatagramConnect
  253. Protects: Endpoint->Common.Datagram.RemoteAddress[Length]
  254. Synopsis:
  255. Strategy:
  256. Function: AfdRestartConnect
  257. Protects: Connection->ConnectedReferenceAdded
  258. Synopsis:
  259. Strategy:
  260. Function: AfdEnabledFailedConnectEvent
  261. Protects: Endpoint->EventsEnabled
  262. Synopsis:
  263. Strategy:
  264. DISCONN.C
  265. Function: AfdDisconnectEventHandler
  266. Protects: Connection->Vc{Receive|Send}IrpListHead,
  267. Connection->VcByteCounts
  268. Synopsis:
  269. Strategy:
  270. Function: AfdBeginAbort
  271. Protects: Connection->Vc{Receive|Send}IrpListHead,
  272. Synopsis:
  273. Strategy:
  274. Function: AfdRestartAbort
  275. Protects: Connection->Vc{Receive|Send}IrpListHead,
  276. Synopsis:
  277. Strategy:
  278. EVENTSEL.C
  279. Function: AfdEventSelect
  280. Protects: Endpoint->EventSelectStuff
  281. Synopsis:
  282. Strategy:
  283. Function: AfdEnumNetworkEvents
  284. Protects: Endpoint->EventSelectStuff
  285. Synopsis:
  286. Strategy:
  287. FASTIO.C
  288. Function:
  289. Protects:
  290. Synopsis:
  291. Strategy:
  292. POLL.C
  293. Function:
  294. Protects:
  295. Synopsis:
  296. Strategy:
  297. RECEIVE.C
  298. Function:
  299. Protects:
  300. Synopsis:
  301. Strategy:
  302. RECVDG.C
  303. Function:
  304. Protects:
  305. Synopsis:
  306. Strategy:
  307. RECVVC.C
  308. Function:
  309. Protects:
  310. Synopsis:
  311. Strategy:
  312. SEND.C
  313. Function:
  314. Protects:
  315. Synopsis:
  316. Strategy:
  317. TRANFILE.C
  318. Function:
  319. Protects:
  320. Synopsis:
  321. Strategy: