xref: /reactos/dll/win32/mswsock/stubs.c (revision 3d3a5aa0)
1 /*
2  * COPYRIGHT:       See COPYING in the top level directory
3  * PROJECT:         ReactOS WinSock DLL
4  * FILE:            stubs.c
5  * PURPOSE:         Stub functions
6  * PROGRAMMERS:     Ge van Geldorp (ge@gse.nl)
7  * REVISIONS:
8  */
9 
10 #include "precomp.h"
11 
12 #include <ws2spi.h>
13 #include <nspapi.h>
14 #include <svc.h>
15 
16 typedef DWORD (* LPFN_NSPAPI)(VOID);
17 typedef struct _NS_ROUTINE {
18     DWORD        dwFunctionCount;
19     LPFN_NSPAPI *alpfnFunctions;
20     DWORD        dwNameSpace;
21     DWORD        dwPriority;
22 } NS_ROUTINE, *PNS_ROUTINE, * FAR LPNS_ROUTINE;
23 
24 
25 /*
26  * @unimplemented
27  */
28 INT
29 WINAPI
EnumProtocolsA(LPINT ProtocolCount,LPVOID ProtocolBuffer,LPDWORD BufferLength)30 EnumProtocolsA(LPINT ProtocolCount,
31                LPVOID ProtocolBuffer,
32                LPDWORD BufferLength)
33 {
34   OutputDebugStringW(L"w32sock EnumProtocolsA stub called\n");
35 
36   return SOCKET_ERROR;
37 }
38 
39 
40 /*
41  * @unimplemented
42  */
43 INT
44 WINAPI
EnumProtocolsW(LPINT ProtocolCount,LPVOID ProtocolBuffer,LPDWORD BufferLength)45 EnumProtocolsW(LPINT ProtocolCount,
46                LPVOID ProtocolBuffer,
47                LPDWORD BufferLength)
48 {
49   OutputDebugStringW(L"w32sock EnumProtocolsW stub called\n");
50 
51   return SOCKET_ERROR;
52 }
53 
54 
55 /*
56  * @unimplemented
57  */
58 INT
59 WINAPI
GetAddressByNameA(DWORD NameSpace,LPGUID ServiceType,LPSTR ServiceName,LPINT Protocols,DWORD Resolution,LPSERVICE_ASYNC_INFO ServiceAsyncInfo,LPVOID CsaddrBuffer,LPDWORD BufferLength,LPSTR AliasBuffer,LPDWORD AliasBufferLength)60 GetAddressByNameA(DWORD NameSpace,
61                   LPGUID ServiceType,
62                   LPSTR ServiceName,
63                   LPINT Protocols,
64                   DWORD Resolution,
65                   LPSERVICE_ASYNC_INFO ServiceAsyncInfo,
66                   LPVOID CsaddrBuffer,
67                   LPDWORD BufferLength,
68                   LPSTR AliasBuffer,
69                   LPDWORD AliasBufferLength)
70 {
71   OutputDebugStringW(L"w32sock GetAddressByNameA stub called\n");
72 
73   return SOCKET_ERROR;
74 }
75 
76 
77 /*
78  * @unimplemented
79  */
80 INT
81 WINAPI
GetAddressByNameW(DWORD NameSpace,LPGUID ServiceType,LPWSTR ServiceName,LPINT Protocols,DWORD Resolution,LPSERVICE_ASYNC_INFO ServiceAsyncInfo,LPVOID CsaddrBuffer,LPDWORD BufferLength,LPWSTR AliasBuffer,LPDWORD AliasBufferLength)82 GetAddressByNameW(DWORD NameSpace,
83                   LPGUID ServiceType,
84                   LPWSTR ServiceName,
85                   LPINT Protocols,
86                   DWORD Resolution,
87                   LPSERVICE_ASYNC_INFO ServiceAsyncInfo,
88                   LPVOID CsaddrBuffer,
89                   LPDWORD BufferLength,
90                   LPWSTR AliasBuffer,
91                   LPDWORD AliasBufferLength)
92 {
93   OutputDebugStringW(L"w32sock GetAddressByNameW stub called\n");
94 
95   return SOCKET_ERROR;
96 }
97 
98 
99 /*
100  * @unimplemented
101  */
102 INT
103 WINAPI
GetServiceA(DWORD NameSpace,LPGUID Guid,LPSTR ServiceName,DWORD Properties,LPVOID Buffer,LPDWORD BufferSize,LPSERVICE_ASYNC_INFO ServiceAsyncInfo)104 GetServiceA(DWORD NameSpace,
105             LPGUID Guid,
106             LPSTR ServiceName,
107             DWORD Properties,
108             LPVOID Buffer,
109             LPDWORD BufferSize,
110             LPSERVICE_ASYNC_INFO ServiceAsyncInfo)
111 {
112   OutputDebugStringW(L"w32sock GetServiceA stub called\n");
113 
114   return SOCKET_ERROR;
115 }
116 
117 
118 /*
119  * @unimplemented
120  */
121 INT
122 WINAPI
GetServiceW(DWORD NameSpace,LPGUID Guid,LPWSTR ServiceName,DWORD Properties,LPVOID Buffer,LPDWORD BufferSize,LPSERVICE_ASYNC_INFO ServiceAsyncInfo)123 GetServiceW(DWORD NameSpace,
124             LPGUID Guid,
125             LPWSTR ServiceName,
126             DWORD Properties,
127             LPVOID Buffer,
128             LPDWORD BufferSize,
129             LPSERVICE_ASYNC_INFO ServiceAsyncInfo)
130 {
131   OutputDebugStringW(L"w32sock GetServiceW stub called\n");
132 
133   return SOCKET_ERROR;
134 }
135 
136 
137 /*
138  * @unimplemented
139  */
140 INT
141 WINAPI
GetTypeByNameA(LPSTR ServiceName,LPGUID ServiceType)142 GetTypeByNameA(LPSTR ServiceName,
143                LPGUID ServiceType)
144 {
145   OutputDebugStringW(L"w32sock GetTypeByNameA stub called\n");
146 
147   return SOCKET_ERROR;
148 }
149 
150 
151 /*
152  * @unimplemented
153  */
154 INT
155 WINAPI
GetTypeByNameW(LPWSTR ServiceName,LPGUID ServiceType)156 GetTypeByNameW(LPWSTR ServiceName,
157                LPGUID ServiceType)
158 {
159   OutputDebugStringW(L"w32sock GetTypeByNameW stub called\n");
160 
161   return SOCKET_ERROR;
162 }
163 
164 
165 /*
166  * @unimplemented
167  */
168 INT
169 WINAPI
MigrateWinsockConfiguration(DWORD Unknown1,DWORD Unknown2,DWORD Unknown3)170 MigrateWinsockConfiguration(DWORD Unknown1,
171                             DWORD Unknown2,
172                             DWORD Unknown3)
173 {
174   OutputDebugStringW(L"w32sock MigrateWinsockConfiguration stub called\n");
175 
176   return SOCKET_ERROR;
177 }
178 
179 
180 /*
181  * @unimplemented
182  */
183 INT
184 WINAPI
SetServiceA(DWORD NameSpace,DWORD Operation,DWORD Flags,LPSERVICE_INFOA ServiceInfo,LPSERVICE_ASYNC_INFO ServiceAsyncInfo,LPDWORD dwStatusFlags)185 SetServiceA(DWORD NameSpace,
186             DWORD Operation,
187             DWORD Flags,
188             LPSERVICE_INFOA ServiceInfo,
189             LPSERVICE_ASYNC_INFO ServiceAsyncInfo,
190             LPDWORD dwStatusFlags)
191 {
192   OutputDebugStringW(L"w32sock SetServiceA stub called\n");
193 
194   return SOCKET_ERROR;
195 }
196 
197 
198 /*
199  * @unimplemented
200  */
201 INT
202 WINAPI
SetServiceW(DWORD NameSpace,DWORD Operation,DWORD Flags,LPSERVICE_INFOW ServiceInfo,LPSERVICE_ASYNC_INFO ServiceAsyncInfo,LPDWORD dwStatusFlags)203 SetServiceW(DWORD NameSpace,
204             DWORD Operation,
205             DWORD Flags,
206             LPSERVICE_INFOW ServiceInfo,
207             LPSERVICE_ASYNC_INFO ServiceAsyncInfo,
208             LPDWORD dwStatusFlags)
209 {
210   OutputDebugStringW(L"w32sock SetServiceW stub called\n");
211 
212   return SOCKET_ERROR;
213 }
214 
215 
216 /*
217  * @unimplemented
218  */
219 int
220 WINAPI
WSARecvEx(SOCKET Sock,char * Buf,int Len,int * Flags)221 WSARecvEx(SOCKET Sock,
222           char *Buf,
223           int Len,
224           int *Flags)
225 {
226   OutputDebugStringW(L"w32sock WSARecvEx stub called\n");
227 
228   return SOCKET_ERROR;
229 }
230 
231 
232 /*
233  * @unimplemented
234  */
235 int
236 WINAPI
dn_expand(unsigned char * MessagePtr,unsigned char * EndofMesOrig,unsigned char * CompDomNam,unsigned char * ExpandDomNam,int Length)237 dn_expand(unsigned char *MessagePtr,
238           unsigned char *EndofMesOrig,
239           unsigned char *CompDomNam,
240           unsigned char *ExpandDomNam,
241           int Length)
242 {
243   OutputDebugStringW(L"w32sock dn_expand stub called\n");
244 
245   return SOCKET_ERROR;
246 }
247 
248 
249 /*
250  * @unimplemented
251  */
252 struct netent *
253 WINAPI
getnetbyname(const char * name)254 getnetbyname(const char *name)
255 {
256   OutputDebugStringW(L"w32sock getnetbyname stub called\n");
257 
258   return NULL;
259 }
260 
261 
262 /*
263  * @unimplemented
264  */
265 UINT
266 WINAPI
inet_network(const char * cp)267 inet_network(const char *cp)
268 {
269   OutputDebugStringW(L"w32sock inet_network stub called\n");
270 
271   return INADDR_NONE;
272 }
273 
274 
275 /*
276  * @unimplemented
277  */
278 SOCKET
279 WINAPI
rcmd(char ** AHost,USHORT InPort,char * LocUser,char * RemUser,char * Cmd,int * Fd2p)280 rcmd(char **AHost,
281      USHORT InPort,
282      char *LocUser,
283      char *RemUser,
284      char *Cmd,
285      int *Fd2p)
286 {
287   OutputDebugStringW(L"w32sock rcmd stub called\n");
288 
289   return INVALID_SOCKET;
290 }
291 
292 
293 /*
294  * @unimplemented
295  */
296 SOCKET
297 WINAPI
rexec(char ** AHost,int InPort,char * User,char * Passwd,char * Cmd,int * Fd2p)298 rexec(char **AHost,
299       int InPort,
300       char *User,
301       char *Passwd,
302       char *Cmd,
303       int *Fd2p)
304 {
305   OutputDebugStringW(L"w32sock rexec stub called\n");
306 
307   return INVALID_SOCKET;
308 }
309 
310 
311 /*
312  * @unimplemented
313  */
314 SOCKET
315 WINAPI
rresvport(int * port)316 rresvport(int *port)
317 {
318   OutputDebugStringW(L"w32sock rresvport stub called\n");
319 
320   return INVALID_SOCKET;
321 }
322 
323 
324 /*
325  * @unimplemented
326  */
327 void
328 WINAPI
s_perror(const char * str)329 s_perror(const char *str)
330 {
331   OutputDebugStringW(L"w32sock s_perror stub called\n");
332 }
333 
334 
335 /*
336  * @unimplemented
337  */
338 int
339 WINAPI
sethostname(char * Name,int NameLen)340 sethostname(char *Name, int NameLen)
341 {
342   OutputDebugStringW(L"w32sock sethostname stub called\n");
343 
344   return SOCKET_ERROR;
345 }
346 
347 
348 /*
349  * @unimplemented
350  */
351 BOOL
352 WINAPI
DllMain(HINSTANCE InstDLL,DWORD Reason,LPVOID Reserved)353 DllMain(HINSTANCE InstDLL,
354         DWORD Reason,
355         LPVOID Reserved)
356 {
357   return TRUE;
358 }
359 
360 
361 /*
362  * @unimplemented
363  */
364 INT
365 WINAPI
GetNameByTypeA(LPGUID lpServiceType,LPSTR lpServiceName,DWORD dwNameLength)366 GetNameByTypeA(LPGUID lpServiceType,LPSTR lpServiceName,DWORD dwNameLength)
367 {
368   OutputDebugStringW(L"w32sock GetNameByTypeA stub called\n");
369   return TRUE;
370 }
371 
372 
373 /*
374  * @unimplemented
375  */
376 INT
377 WINAPI
GetNameByTypeW(LPGUID lpServiceType,LPWSTR lpServiceName,DWORD dwNameLength)378 GetNameByTypeW(LPGUID lpServiceType,LPWSTR lpServiceName,DWORD dwNameLength)
379 {
380   OutputDebugStringW(L"w32sock GetNameByTypeW stub called\n");
381   return TRUE;
382 }
383 
384 /*
385  * @unimplemented
386  */
387 int
388 WINAPI
WSPStartup(IN WORD wVersionRequested,OUT LPWSPDATA lpWSPData,IN LPWSAPROTOCOL_INFOW lpProtocolInfo,IN WSPUPCALLTABLE UpcallTable,OUT LPWSPPROC_TABLE lpProcTable)389 WSPStartup(
390     IN WORD wVersionRequested,
391     OUT LPWSPDATA lpWSPData,
392     IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
393     IN WSPUPCALLTABLE UpcallTable,
394     OUT LPWSPPROC_TABLE lpProcTable
395     )
396 {
397   return TRUE;
398 }
399 
400 
401 /*
402  * @unimplemented
403  */
404 INT
405 WINAPI
NPLoadNameSpaces(IN OUT LPDWORD lpdwVersion,IN OUT LPNS_ROUTINE nsrBuffer,IN OUT LPDWORD lpdwBufferLength)406 NPLoadNameSpaces(
407     IN OUT LPDWORD lpdwVersion,
408     IN OUT LPNS_ROUTINE nsrBuffer,
409     IN OUT LPDWORD lpdwBufferLength
410     )
411 {
412   OutputDebugStringW(L"mswsock NPLoadNameSpaces stub called\n");
413 
414   *lpdwVersion = 1;
415 
416   return TRUE;
417 }
418 
419 
420 /*
421  * @unimplemented
422  */
423 VOID
424 WINAPI
StartWsdpService()425 StartWsdpService()
426 {
427   OutputDebugStringW(L"mswsock StartWsdpService stub called\n");
428 }
429 
430 
431 /*
432  * @unimplemented
433  */
434 VOID
435 WINAPI
StopWsdpService()436 StopWsdpService()
437 {
438   OutputDebugStringW(L"mswsock StopWsdpService stub called\n");
439 }
440 
441 
442 /*
443  * @unimplemented
444  *
445  * See https://www.geoffchappell.com/studies/windows/win32/services/svchost/dll/svchostpushserviceglobals.htm
446  */
447 VOID
448 WINAPI
SvchostPushServiceGlobals(PSVCHOST_GLOBAL_DATA lpGlobals)449 SvchostPushServiceGlobals(PSVCHOST_GLOBAL_DATA lpGlobals)
450 {
451   OutputDebugStringW(L"mswsock SvchostPushServiceGlobals stub called\n");
452 }
453 
454 
455 /*
456  * @unimplemented
457  */
458 VOID
459 WINAPI
ServiceMain(DWORD Unknown1,DWORD Unknown2)460 ServiceMain(DWORD Unknown1, DWORD Unknown2)
461 {
462   OutputDebugStringW(L"mswsock ServiceMain stub called\n");
463 }
464