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.

115 lines
2.9 KiB

  1. //=================================================================
  2. //
  3. // Ws2_32Api.h
  4. //
  5. // Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #ifndef _WS2_32API_H_
  9. #define _WS2_32API_H_
  10. /******************************************************************************
  11. * #includes to Register this class with the CResourceManager.
  12. *****************************************************************************/
  13. extern const GUID g_guidWs2_32Api;
  14. extern const TCHAR g_tstrWs2_32[];
  15. /******************************************************************************
  16. * Function pointer typedefs. Add new functions here as required.
  17. *****************************************************************************/
  18. // Included through #include<winsock2.h>
  19. /******************************************************************************
  20. * Wrapper class for Ws2_32 load/unload, for registration with CResourceManager.
  21. ******************************************************************************/
  22. class CWs2_32Api : public CDllWrapperBase
  23. {
  24. private:
  25. // Member variables (function pointers) pointing to Ws2_32 functions.
  26. // Add new functions here as required.
  27. LPFN_WSASTARTUP m_pfnWSAStartUp;
  28. LPFN_WSAENUMPROTOCOLS m_pfnWSAEnumProtocols;
  29. LPFN_WSAIOCTL m_pfnWSAIoctl;
  30. LPFN_WSASOCKET m_pfnWSASocket;
  31. LPFN_BIND m_pfnBind;
  32. LPFN_CLOSESOCKET m_pfnCloseSocket;
  33. LPFN_WSACLEANUP m_pfnWSACleanup;
  34. LPFN_WSAGETLASTERROR m_pfnWSAGetLastError;
  35. public:
  36. // Constructor and destructor:
  37. CWs2_32Api(LPCTSTR a_tstrWrappedDllName);
  38. ~CWs2_32Api();
  39. // Inherrited initialization function.
  40. virtual bool Init();
  41. // Member functions wrapping Ws2_32 functions.
  42. // Add new functions here as required:
  43. int WSAStartUp
  44. (
  45. WORD a_wVersionRequested,
  46. LPWSADATA a_lpWSAData
  47. );
  48. int WSAEnumProtocols
  49. (
  50. LPINT a_lpiProtocols,
  51. LPWSAPROTOCOL_INFO a_lpProtocolBuffer,
  52. LPDWORD a_lpdwBufferLength
  53. );
  54. int WSAIoctl
  55. (
  56. SOCKET a_s,
  57. DWORD a_dwIoControlCode,
  58. LPVOID a_lpvInBuffer,
  59. DWORD a_cbInBuffer,
  60. LPVOID a_lpvOutBuffer,
  61. DWORD a_cbOutBuffer,
  62. LPDWORD a_lpcbBytesReturned,
  63. LPWSAOVERLAPPED a_lpOverlapped,
  64. LPWSAOVERLAPPED_COMPLETION_ROUTINE a_lpCompletionRoutine
  65. );
  66. SOCKET WSASocket
  67. (
  68. int a_af,
  69. int a_type,
  70. int a_protocol,
  71. LPWSAPROTOCOL_INFO a_lpProtocolInfo,
  72. GROUP a_g,
  73. DWORD a_dwFlags
  74. );
  75. int Bind
  76. (
  77. SOCKET a_s,
  78. const struct sockaddr FAR * a_name,
  79. int a_namelen
  80. );
  81. int CloseSocket
  82. (
  83. SOCKET a_s
  84. );
  85. int WSACleanup();
  86. int WSAGetLastError();
  87. };
  88. #endif