TcpIpDog.h
上传用户:kklily621
上传日期:2013-06-25
资源大小:252k
文件大小:4k
开发平台:

Visual C++

  1. /*=============================================================================================
  2. /*  
  3. TcpIpDog.h
  4. Project : XFILTER 1.0 Personal Firewall
  5. Author : Tony Zhu
  6. Create Date : 2001/08/21
  7. Email : xstudio@xfilt.com
  8. URL : http://www.xfilt.com
  9. Copyright (c) 2001-2002 XStudio Technology.
  10. All Rights Reserved.
  11. WARNNING: 
  12. */
  13. //=============================================================================================
  14. //DllMain Procedure
  15. BOOL WINAPI DllMain(
  16. HINSTANCE hModule, 
  17.     DWORD ul_reason_for_call, 
  18.     LPVOID lpReserved
  19. );
  20. //=============================================================================================
  21. //Export Functions
  22. int WSPAPI WSPStartup (
  23. WORD wVersionRequested,               
  24. LPWSPDATA lpWSPData,                 
  25. LPWSAPROTOCOL_INFOW lpProtocolInfo,   
  26. WSPUPCALLTABLE UpcallTable,           
  27. LPWSPPROC_TABLE lpProcTable           
  28. );
  29. int WINAPI XfIoControl(
  30. int iControlType, 
  31. XFILTER_IO_CONTROL *ioControl
  32. );
  33. //=============================================================================================
  34. //Socket Private functions
  35. BOOL QueryAccess();
  36. void XfShutdown(SOCKET s);
  37. BOOL AddAcl(
  38. TCHAR *sPathName, 
  39. BYTE bAction = ACL_ACTION_PASS
  40. );
  41. BOOL GetHookProvider(
  42. IN WSAPROTOCOL_INFOW *pProtocolInfo, 
  43. OUT TCHAR *sPathName
  44. );
  45. void GetRightEntryIdItem(
  46. IN WSAPROTOCOL_INFOW *pProtocolInfo, 
  47. OUT TCHAR *sItem
  48. );
  49. //=============================================================================================
  50. //Winsock 2 service provider hook functions
  51. SOCKET WSPAPI WSPSocket(
  52. int af,                               
  53. int type,                             
  54. int protocol,                         
  55. LPWSAPROTOCOL_INFOW lpProtocolInfo,   
  56. GROUP g,                              
  57. DWORD dwFlags,                        
  58. LPINT lpErrno
  59. );
  60. int WSPAPI WSPCloseSocket(
  61. SOCKET s,
  62. LPINT lpErrno
  63. );
  64.  
  65. int WSPAPI WSPConnect(
  66. SOCKET s,
  67. const struct sockaddr FAR * name,
  68. int namelen,
  69. LPWSABUF lpCallerData,
  70. LPWSABUF lpCalleeData,
  71. LPQOS lpSQOS,
  72. LPQOS lpGQOS,
  73. LPINT lpErrno
  74. );
  75. SOCKET WSPAPI WSPAccept(
  76. SOCKET s,
  77. struct sockaddr FAR *addr,
  78. LPINT addrlen,
  79. LPCONDITIONPROC lpfnCondition,
  80. DWORD dwCallbackData,
  81. LPINT lpErrno
  82. );
  83.  
  84. int WSPAPI WSPSend(
  85. SOCKET s,
  86. LPWSABUF lpBuffers,
  87. DWORD dwBufferCount,
  88. LPDWORD lpNumberOfBytesSent,
  89. DWORD dwFlags,
  90. LPWSAOVERLAPPED lpOverlapped,
  91. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  92. LPWSATHREADID lpThreadId,
  93. LPINT lpErrno
  94. );
  95. int WSPAPI WSPSendTo(
  96. SOCKET s,
  97. LPWSABUF lpBuffers,
  98. DWORD dwBufferCount,
  99. LPDWORD lpNumberOfBytesSent,
  100. DWORD dwFlags,
  101. const struct sockaddr FAR * lpTo,
  102. int iTolen,
  103. LPWSAOVERLAPPED lpOverlapped,
  104. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  105. LPWSATHREADID lpThreadId,
  106. LPINT lpErrno
  107. );
  108. int WSPAPI WSPRecv(
  109. SOCKET s,
  110. LPWSABUF lpBuffers,
  111. DWORD dwBufferCount,
  112. LPDWORD lpNumberOfBytesRecvd,
  113. LPDWORD lpFlags,
  114. LPWSAOVERLAPPED lpOverlapped,
  115. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  116. LPWSATHREADID lpThreadId,
  117. LPINT lpErrno
  118. );
  119.  
  120. int WSPAPI WSPRecvFrom (
  121. SOCKET s,
  122. LPWSABUF lpBuffers,
  123. DWORD dwBufferCount,
  124. LPDWORD lpNumberOfBytesRecvd,
  125. LPDWORD lpFlags,
  126. struct sockaddr FAR * lpFrom,
  127. LPINT lpFromlen,
  128. LPWSAOVERLAPPED lpOverlapped,
  129. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  130. LPWSATHREADID lpThreadId,
  131. LPINT lpErrno
  132. );