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.

125 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. socket.h
  5. Abstract:
  6. This file contains definitions and prototypes used in socket.c
  7. Author:
  8. Shaun Pierce (shaunp) 15-Jun-1995
  9. Environment:
  10. User Mode -Win32 (Win95 flavor)
  11. Revision History:
  12. --*/
  13. #ifndef __SOCKET_H
  14. #define __SOCKET_H
  15. #include <windows.h>
  16. #include <winerror.h>
  17. #include <winsock.h>
  18. #include <wsipx.h>
  19. #include "wsnetbs.h"
  20. #include <nspapi.h>
  21. #ifndef LPUINT
  22. typedef UINT *LPUINT;
  23. #endif
  24. //
  25. // Definitions
  26. //
  27. //
  28. // Function prototypes
  29. //
  30. UINT InitializeWinSock();
  31. BOOL OpenSocket(
  32. IN INT iAddressFamily,
  33. IN INT iProtocol,
  34. OUT SOCKET *pSocket
  35. );
  36. UINT BindSocket(
  37. IN SOCKET Socket,
  38. IN INT iAddressFamily,
  39. IN INT iPort,
  40. IN PSOCKADDR pSockAddr,
  41. IN LPINT pSockAddrLen
  42. );
  43. UINT GetSocketAddr(
  44. IN SOCKET Socket,
  45. OUT PSOCKADDR pAddress,
  46. IN PUINT pAddressLen
  47. );
  48. BOOL CloseSocket(
  49. IN SOCKET Socket,
  50. IN USHORT interval
  51. );
  52. UINT InitializeSocket(
  53. IN INT iAddressFamily,
  54. IN PSOCKADDR pSockAddr,
  55. IN LPINT pSockAddrLen,
  56. OUT SOCKET *pSocket
  57. );
  58. UINT GetProtocolInfo(
  59. OUT PUSHORT pTotalProtocols,
  60. OUT PUSHORT pConnectionlessCount,
  61. OUT PUSHORT pConnectionlessMask,
  62. IN OUT PPROTOCOL_INFO pInfoBuffer,
  63. IN OUT PUSHORT pBufferLength
  64. );
  65. UINT ReceiveAny(
  66. IN SOCKET Socket,
  67. IN OUT PSOCKADDR pSockAddr,
  68. IN LPINT pSockAddrLen,
  69. IN OUT PCHAR pBuffer,
  70. IN OUT LPUINT pBufferLen
  71. );
  72. UINT SendTo(
  73. IN SOCKET Socket,
  74. IN OUT PSOCKADDR pSockAddr,
  75. IN UINT SockAddrLen,
  76. IN OUT PCHAR pBuffer,
  77. IN OUT LPUINT pBufferLen
  78. );
  79. extern "C" UINT ShutdownWinSock();
  80. //
  81. // External functions
  82. //
  83. extern UINT CountBits(
  84. IN DWORD x
  85. );
  86. #endif
  87.