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.

140 lines
4.3 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dphelp.h
  6. * Content: header for dphelp.c
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 16-jul-96 andyco initial implementation
  12. * 25-jul-96 andyco added watchnewpid
  13. * 23-jan-97 kipo prototypes for winsock calls
  14. * 15-feb-97 andyco moved from ddhelp to the project formerly known as
  15. * ddhelp (playhelp? dplayhlp? dplay.exe? dphost?) Allowed
  16. * one process to host mulitple sessions
  17. * 29-jan-98 sohailm added support for stream enum sessions
  18. *
  19. ***************************************************************************/
  20. #ifndef __DPHELP_INCLUDED__
  21. #define __DPHELP_INCLUDED__
  22. #include "windows.h"
  23. #include "dplaysvr.h"
  24. #include "newdpf.h"
  25. //#include "winsock2.h"
  26. // we include dpsp.h since we'll be poking bits (sockaddr's)
  27. // into dpsp's header
  28. #include "dpsp.h"
  29. // backlog for listen() api. no constant in winsock, so we ask for the moon
  30. #define LISTEN_BACKLOG 60
  31. typedef struct _SPNODE * LPSPNODE;
  32. typedef struct _SPNODE
  33. {
  34. SOCKADDR_IN6 sockaddr; // socket addr of server
  35. DWORD pid;
  36. LPSPNODE pNextNode;
  37. } SPNODE;
  38. // protos
  39. // from dphelp.c
  40. extern HRESULT DPlayHelp_AddServer(LPDPHELPDATA phd);
  41. extern BOOL FAR PASCAL DPlayHelp_DeleteServer(LPDPHELPDATA phd,BOOL fFreeAll);
  42. extern HRESULT DPlayHelp_Init();
  43. extern void DPlayHelp_FreeServerList();
  44. extern DWORD WINAPI StreamAcceptThreadProc(LPVOID pvCast);
  45. extern DWORD WINAPI StreamReceiveThreadProc(LPVOID pvCast);
  46. extern void HandleIncomingMessage(LPBYTE pBuffer,DWORD dwBufferSize,SOCKADDR_IN6 * psockaddr);
  47. // from help.c
  48. extern void WatchNewPid(LPDPHELPDATA phd);
  49. // from reliable.c
  50. void RemoveSocketFromList(SOCKET socket);
  51. //prototypes for winsock calls
  52. typedef int (PASCAL FAR * cb_accept)(SOCKET s, struct sockaddr FAR * addr, int FAR * addrlen);
  53. extern cb_accept g_accept;
  54. typedef int (PASCAL FAR * cb_bind)(SOCKET s, const struct sockaddr FAR *addr, int namelen);
  55. extern cb_bind g_bind;
  56. typedef int (PASCAL FAR * cb_closesocket)(SOCKET s);
  57. extern cb_closesocket g_closesocket;
  58. typedef struct hostent FAR * (PASCAL FAR * cb_gethostbyname)(const char FAR * name);
  59. extern cb_gethostbyname g_gethostbyname;
  60. typedef int (PASCAL FAR * cb_gethostname)(char FAR * name, int namelen);
  61. extern cb_gethostname g_gethostname;
  62. typedef int (PASCAL FAR * cb_getpeername)(SOCKET s, struct sockaddr FAR * name, int FAR * namelen);
  63. extern cb_getpeername g_getpeername;
  64. typedef int (PASCAL FAR * cb_getsockname)(SOCKET s, struct sockaddr FAR * name, int FAR * namelen);
  65. extern cb_getsockname g_getsockname;
  66. typedef u_short (PASCAL FAR * cb_htons)(u_short hostshort);
  67. extern cb_htons g_htons;
  68. typedef int (PASCAL FAR * cb_listen)(
  69. SOCKET s,
  70. int backlog
  71. );
  72. extern cb_listen g_listen;
  73. typedef int (PASCAL FAR * cb_recv)(
  74. SOCKET s,
  75. char FAR * buf,
  76. int len,
  77. int flags
  78. );
  79. extern cb_recv g_recv;
  80. typedef int (PASCAL FAR * cb_recvfrom)(SOCKET s, char FAR * buf, int len, int flags,
  81. struct sockaddr FAR *from, int FAR * fromlen);
  82. extern cb_recvfrom g_recvfrom;
  83. typedef SOCKET (PASCAL FAR * cb_select)(
  84. int nfds,
  85. fd_set FAR * readfds,
  86. fd_set FAR * writefds,
  87. fd_set FAR *exceptfds,
  88. const struct timeval FAR * timeout
  89. );
  90. extern cb_select g_select;
  91. typedef int (PASCAL FAR * cb_send)(SOCKET s, const char FAR * buf, int len, int flags);
  92. extern cb_send g_send;
  93. typedef int (PASCAL FAR * cb_sendto)(SOCKET s, const char FAR * buf, int len, int flags,
  94. const struct sockaddr FAR *to, int tolen);
  95. extern cb_sendto g_sendto;
  96. typedef int (PASCAL FAR * cb_setsockopt)(SOCKET s, int level, int optname,
  97. const char FAR * optval, int optlen);
  98. extern cb_setsockopt g_setsockopt;
  99. typedef int (PASCAL FAR * cb_shutdown)(SOCKET s, int how);
  100. extern cb_shutdown g_shutdown;
  101. typedef SOCKET (PASCAL FAR * cb_socket)(int af, int type, int protocol);
  102. extern cb_socket g_socket;
  103. typedef int (PASCAL FAR * cb_WSAFDIsSet)(SOCKET, fd_set FAR *);
  104. extern cb_WSAFDIsSet g_WSAFDIsSet;
  105. typedef int (PASCAL FAR * cb_WSAGetLastError)(void);
  106. extern cb_WSAGetLastError g_WSAGetLastError;
  107. typedef int (PASCAL FAR * cb_WSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData);
  108. extern cb_WSAStartup g_WSAStartup;
  109. #endif