source: trunk/src/ws2_32/socket.cpp@ 7088

Last change on this file since 7088 was 7088, checked in by sandervl, 24 years ago

WSAEnumProtocolsA/W stubs added

File size: 4.1 KB
Line 
1/* $Id: socket.cpp,v 1.11 2001-10-17 10:22:37 sandervl Exp $ */
2/*
3 * based on Windows Sockets 1.1 specs
4 * (ftp.microsoft.com:/Advsys/winsock/spec11/WINSOCK.TXT)
5 *
6 * (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka.
7 *
8 * NOTE: If you make any changes to fix a particular app, make sure
9 * they don't break something else like Netscape or telnet and ftp
10 * clients and servers (www.winsite.com got a lot of those).
11 *
12 * NOTE 2: Many winsock structs such as servent, hostent, protoent, ...
13 * are used with 1-byte alignment for Win16 programs and 4-byte alignment
14 * for Win32 programs in winsock.h. winsock2.h uses forced 4-byte alignment.
15 * So we have non-forced (just as MSDN) ws_XXXXent (winsock.h), 4-byte forced
16 * ws_XXXXent32 (winsock2.h) and 1-byte forced ws_XXXXent16 (winsock16.h).
17 */
18
19
20/*****************************************************************************
21 * Includes *
22 *****************************************************************************/
23
24#include <odin.h>
25#include <winsock2.h>
26#include <debugtools.h>
27#include <odinwrap.h>
28
29
30ODINDEBUGCHANNEL(WS2_32-SOCKET)
31
32
33/***********************************************************************
34 * WSACreateEvent() (WS2_32.???)
35 *
36 */
37ODINFUNCTION0(WSAEVENT, WSACreateEvent)
38{
39 /* Create a manual-reset event, with initial state: unsignealed */
40
41 return CreateEventA(NULL, TRUE, FALSE, NULL);
42}
43
44ODINFUNCTION1(BOOL, WSASetEvent,
45 WSAEVENT, hEvent)
46{
47 return SetEvent(hEvent);
48}
49
50/***********************************************************************
51 * WSACloseEvent() (WS2_32.???)
52 *
53 */
54ODINFUNCTION1(BOOL, WSACloseEvent,
55 WSAEVENT, hEvent)
56{
57 return CloseHandle(hEvent);
58}
59
60/***********************************************************************
61 * WSASocketA() (WS2_32.???)
62 *
63 */
64ODINFUNCTION6(SOCKET, WSASocketA,
65 int, af,
66 int, type,
67 int, protocol,
68 LPWSAPROTOCOL_INFOA, lpProtocolInfo,
69 GROUP, g,
70 DWORD, dwFlags)
71{
72 dprintf(("WSASocketA incorrectly implemented"));
73 /*
74 FIXME: The "advanced" parameters of WSASocketA (lpProtocolInfo,
75 g, dwFlags) are ignored.
76 */
77
78 TRACE("WSASocketA af=%d type=%d protocol=%d protocol_info=%p group=%d flags=0x%lx\n",
79 af, type, protocol, lpProtocolInfo, g, dwFlags );
80
81 return ( socket (af, type, protocol) );
82}
83
84/***********************************************************************
85 * WSASocketA() (WS2_32.???)
86 *
87 */
88ODINFUNCTION6(SOCKET, WSASocketW,
89 int, af,
90 int, type,
91 int, protocol,
92 LPWSAPROTOCOL_INFOW, lpProtocolInfo,
93 GROUP, g,
94 DWORD, dwFlags)
95{
96 dprintf(("WSASocketW incorrectly implemented"));
97 /*
98 FIXME: The "advanced" parameters of WSASocketA (lpProtocolInfo,
99 g, dwFlags) are ignored.
100 */
101
102 TRACE("WSASocketW af=%d type=%d protocol=%d protocol_info=%p group=%d flags=0x%lx\n",
103 af, type, protocol, lpProtocolInfo, g, dwFlags );
104
105 return ( socket (af, type, protocol) );
106}
107//******************************************************************************
108//******************************************************************************
109ODINFUNCTION3(int, WSAEnumProtocolsA, LPINT, lpiProtocols,
110 LPWSAPROTOCOL_INFOA, lpProtocolBuffer,
111 LPDWORD, lpdwBufferLength)
112{
113 dprintf(("NOT IMPLEMENTED"));
114 return 0;
115}
116//******************************************************************************
117//******************************************************************************
118ODINFUNCTION3(int, WSAEnumProtocolsW, LPINT, lpiProtocols,
119 LPWSAPROTOCOL_INFOW, lpProtocolBuffer,
120 LPDWORD, lpdwBufferLength)
121{
122 dprintf(("NOT IMPLEMENTED"));
123 return 0;
124}
125//******************************************************************************
126//******************************************************************************
Note: See TracBrowser for help on using the repository browser.