Leaked source code of windows server 2003
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.

136 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. Async.h
  5. Abstract:
  6. Global definitions for the WinSock asynchronous processing thread.
  7. Author:
  8. Keith Moore (keithmo) 18-Jun-1992
  9. Revision History:
  10. --*/
  11. #ifndef _ASYNC_H_
  12. #define _ASYNC_H_
  13. //
  14. // Context block.
  15. //
  16. typedef struct _WINSOCK_CONTEXT_BLOCK {
  17. LIST_ENTRY AsyncThreadQueueListEntry;
  18. HANDLE TaskHandle;
  19. DWORD OpCode;
  20. union {
  21. struct {
  22. HWND hWnd;
  23. unsigned int wMsg;
  24. PCHAR Filter;
  25. int Length;
  26. int Type;
  27. PCHAR Buffer;
  28. int BufferLength;
  29. } AsyncGetHost;
  30. struct {
  31. HWND hWnd;
  32. unsigned int wMsg;
  33. PCHAR Filter;
  34. PCHAR Buffer;
  35. int BufferLength;
  36. } AsyncGetProto;
  37. struct {
  38. HWND hWnd;
  39. unsigned int wMsg;
  40. PCHAR Filter;
  41. PCHAR Protocol;
  42. PCHAR Buffer;
  43. int BufferLength;
  44. } AsyncGetServ;
  45. } Overlay;
  46. } WINSOCK_CONTEXT_BLOCK, *PWINSOCK_CONTEXT_BLOCK;
  47. //
  48. // Opcodes for processing by the winsock asynchronous processing
  49. // thread.
  50. //
  51. #define WS_OPCODE_GET_HOST_BY_ADDR 0x01
  52. #define WS_OPCODE_GET_HOST_BY_NAME 0x02
  53. #define WS_OPCODE_GET_PROTO_BY_NUMBER 0x03
  54. #define WS_OPCODE_GET_PROTO_BY_NAME 0x04
  55. #define WS_OPCODE_GET_SERV_BY_PORT 0x05
  56. #define WS_OPCODE_GET_SERV_BY_NAME 0x06
  57. //
  58. // Initialization/termination functions.
  59. //
  60. BOOL
  61. SockAsyncGlobalInitialize(
  62. VOID
  63. );
  64. VOID
  65. SockAsyncGlobalTerminate(
  66. VOID
  67. );
  68. BOOL
  69. SockCheckAndInitAsyncThread(
  70. VOID
  71. );
  72. VOID
  73. SockTerminateAsyncThread(
  74. VOID
  75. );
  76. BOOL
  77. SockIsAsyncThreadInitialized (
  78. VOID
  79. );
  80. //
  81. // Work queue functions.
  82. //
  83. PWINSOCK_CONTEXT_BLOCK
  84. SockAllocateContextBlock(
  85. DWORD AdditionalSpace
  86. );
  87. VOID
  88. SockFreeContextBlock(
  89. IN PWINSOCK_CONTEXT_BLOCK ContextBlock
  90. );
  91. VOID
  92. SockQueueRequestToAsyncThread(
  93. IN PWINSOCK_CONTEXT_BLOCK ContextBlock
  94. );
  95. INT
  96. SockCancelAsyncRequest(
  97. IN HANDLE TaskHandle
  98. );
  99. #endif // _ASYNC_H_