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.

102 lines
2.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. aap.hxx
  7. This file contains the global declarations for the Asynchronous
  8. Accept Pool package.
  9. The Asynchronous Accept Pool (AAP) package enables applications
  10. requiring incoming data connections to operate as well behaved
  11. citizens of the Asynchronous Thread Queue (ATQ) environment.
  12. FILE HISTORY:
  13. KeithMo 01-Mar-1995 Created.
  14. */
  15. #ifndef _AAP_HXX_
  16. #define _AAP_HXX_
  17. //
  18. // AAP_HANDLE is an opaque pointer to an AAP_CONTEXT structure.
  19. //
  20. typedef struct _AAP_CONTEXT * AAP_HANDLE;
  21. //
  22. // LPAAP_CALLBACK is a pointer to an AAP callback. The callback
  23. // receives the following parameters:
  24. //
  25. // UserContext - A user-specified context value associated
  26. // with a given AAP_HANDLE.
  27. //
  28. // SocketStatus - The status of the accept operation. This
  29. // will either be 0 (success) or one of the WSA* error
  30. // codes.
  31. //
  32. // The remaining parameters are only valid if SocketStatus
  33. // is zero.
  34. //
  35. // AcceptedSocket - The new connected socket returned by the
  36. // accept() API. It is the callback's responsibility to
  37. // close this socket.
  38. //
  39. // RemoteAddress - The address of the remote connecting client.
  40. //
  41. // RemoteAddressLength - The length (in BYTEs) of RemoteAddress.
  42. //
  43. // The callback returns TRUE if it wants additional callbacks on
  44. // the current listening socket.
  45. //
  46. typedef BOOL (* LPAAP_CALLBACK)( LPVOID UserContext,
  47. SOCKERR SocketStatus,
  48. SOCKET AcceptedSocket,
  49. LPSOCKADDR RemoteAddress,
  50. INT RemoteAddressLength );
  51. //
  52. // Public prototypes.
  53. //
  54. APIERR
  55. AapInitialize(
  56. VOID
  57. );
  58. VOID
  59. AapTerminate(
  60. VOID
  61. );
  62. AAP_HANDLE
  63. AapAcquire(
  64. LPAAP_CALLBACK AapCallback,
  65. LPVOID UserContext
  66. );
  67. VOID
  68. AapRelease(
  69. AAP_HANDLE AapHandle
  70. );
  71. APIERR
  72. AapAccept(
  73. AAP_HANDLE AapHandle
  74. );
  75. APIERR
  76. AapAbort(
  77. AAP_HANDLE AapHandle
  78. );
  79. #endif // _AAP_HXX_