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.

156 lines
4.9 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. * 12-jan-2000 aarono added support for rsip
  19. *
  20. ***************************************************************************/
  21. #ifndef __DPHELP_INCLUDED__
  22. #define __DPHELP_INCLUDED__
  23. #include "windows.h"
  24. #include "dplaysvr.h"
  25. #include "newdpf.h"
  26. #include "winsock.h"
  27. // we include dpsp.h since we'll be poking bits (sockaddr's)
  28. // into dpsp's header
  29. #include "dpsp.h"
  30. // backlog for listen() api. no constant in winsock, so we ask for the moon
  31. #define LISTEN_BACKLOG 60
  32. typedef struct _SPNODE * LPSPNODE;
  33. typedef struct _SPNODE
  34. {
  35. SOCKADDR_IN sockaddr; // socket addr of server
  36. DWORD pid;
  37. LPSPNODE pNextNode;
  38. } SPNODE;
  39. // protos
  40. // from dphelp.c
  41. extern HRESULT DPlayHelp_AddServer(LPDPHELPDATA phd);
  42. extern BOOL FAR PASCAL DPlayHelp_DeleteServer(LPDPHELPDATA phd,BOOL fFreeAll);
  43. extern HRESULT DPlayHelp_Init();
  44. extern HRESULT StartupIP();
  45. extern void DPlayHelp_FreeServerList();
  46. extern DWORD WINAPI StreamAcceptThreadProc(LPVOID pvCast);
  47. extern DWORD WINAPI StreamReceiveThreadProc(LPVOID pvCast);
  48. extern void HandleIncomingMessage(LPBYTE pBuffer,DWORD dwBufferSize,SOCKADDR_IN * psockaddr);
  49. // from help.c
  50. extern void WatchNewPid(LPDPHELPDATA phd);
  51. // from reliable.c
  52. void RemoveSocketFromList(SOCKET socket);
  53. //prototypes for winsock calls
  54. typedef int (PASCAL FAR * cb_accept)(SOCKET s, struct sockaddr FAR * addr, int FAR * addrlen);
  55. extern cb_accept g_accept;
  56. typedef int (PASCAL FAR * cb_bind)(SOCKET s, const struct sockaddr FAR *addr, int namelen);
  57. extern cb_bind g_bind;
  58. typedef int (PASCAL FAR * cb_closesocket)(SOCKET s);
  59. extern cb_closesocket g_closesocket;
  60. typedef struct hostent FAR * (PASCAL FAR * cb_gethostbyname)(const char FAR * name);
  61. extern cb_gethostbyname g_gethostbyname;
  62. typedef int (PASCAL FAR * cb_gethostname)(char FAR * name, int namelen);
  63. extern cb_gethostname g_gethostname;
  64. typedef int (PASCAL FAR * cb_getpeername)(SOCKET s, struct sockaddr FAR * name, int FAR * namelen);
  65. extern cb_getpeername g_getpeername;
  66. typedef int (PASCAL FAR * cb_getsockname)(SOCKET s, struct sockaddr FAR * name, int FAR * namelen);
  67. extern cb_getsockname g_getsockname;
  68. typedef u_short (PASCAL FAR * cb_htons)(u_short hostshort);
  69. extern cb_htons g_htons;
  70. typedef char FAR * (PASCAL FAR * cb_inet_ntoa)(struct in_addr in);
  71. extern cb_inet_ntoa g_inet_ntoa;
  72. typedef int (PASCAL FAR * cb_listen)(
  73. SOCKET s,
  74. int backlog
  75. );
  76. extern cb_listen g_listen;
  77. typedef int (PASCAL FAR * cb_recv)(
  78. SOCKET s,
  79. char FAR * buf,
  80. int len,
  81. int flags
  82. );
  83. extern cb_recv g_recv;
  84. typedef int (PASCAL FAR * cb_recvfrom)(SOCKET s, char FAR * buf, int len, int flags,
  85. struct sockaddr FAR *from, int FAR * fromlen);
  86. extern cb_recvfrom g_recvfrom;
  87. typedef SOCKET (PASCAL FAR * cb_select)(
  88. int nfds,
  89. fd_set FAR * readfds,
  90. fd_set FAR * writefds,
  91. fd_set FAR *exceptfds,
  92. const struct timeval FAR * timeout
  93. );
  94. extern cb_select g_select;
  95. typedef int (PASCAL FAR * cb_send)(SOCKET s, const char FAR * buf, int len, int flags);
  96. extern cb_send g_send;
  97. typedef int (PASCAL FAR * cb_sendto)(SOCKET s, const char FAR * buf, int len, int flags,
  98. const struct sockaddr FAR *to, int tolen);
  99. extern cb_sendto g_sendto;
  100. typedef int (PASCAL FAR * cb_setsockopt)(SOCKET s, int level, int optname,
  101. const char FAR * optval, int optlen);
  102. extern cb_setsockopt g_setsockopt;
  103. typedef int (PASCAL FAR * cb_shutdown)(SOCKET s, int how);
  104. extern cb_shutdown g_shutdown;
  105. typedef SOCKET (PASCAL FAR * cb_socket)(int af, int type, int protocol);
  106. extern cb_socket g_socket;
  107. typedef int (PASCAL FAR * cb_WSAFDIsSet)(SOCKET, fd_set FAR *);
  108. extern cb_WSAFDIsSet g_WSAFDIsSet;
  109. typedef int (PASCAL FAR * cb_WSAGetLastError)(void);
  110. extern cb_WSAGetLastError g_WSAGetLastError;
  111. typedef int (PASCAL FAR * cb_WSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData);
  112. extern cb_WSAStartup g_WSAStartup;
  113. typedef unsigned short (PASCAL FAR * cb_ntohs)(unsigned short netshort);
  114. extern cb_ntohs g_ntohs;
  115. typedef unsigned long (PASCAL FAR * cb_htonl)(unsigned long hostlong);
  116. extern cb_htonl g_htonl;
  117. typedef unsigned long (PASCAL FAR * cb_inet_addr)(const char *cp);
  118. extern cb_inet_addr g_inet_addr;
  119. extern BOOL gbInit,gbIPStarted;
  120. #endif