update for HEAD-2003050101
[reactos.git] / lib / wsock32 / stubs.c
1 /* $Id$
2  *
3  * COPYRIGHT:   See COPYING in the top level directory
4  * PROJECT:     ReactOS WinSock DLL
5  * FILE:        stubs.c
6  * PURPOSE:     Stub functions
7  * PROGRAMMERS: Ge van Geldorp (ge@gse.nl)
8  * REVISIONS:
9  */
10
11 #include <windows.h>
12 #include <winsock2.h>
13
14 BOOL
15 STDCALL
16 AcceptEx(SOCKET ListenSocket,
17          SOCKET AcceptSocket,
18          PVOID OutputBuffer,
19          DWORD ReceiveDataLength,
20          DWORD LocalAddressLength,
21          DWORD RemoteAddressLength,
22          LPDWORD BytesReceived,
23          LPOVERLAPPED Overlapped)
24 {
25   OutputDebugString(L"w32sock AcceptEx stub called\n");
26
27   return FALSE;
28 }
29
30 INT
31 STDCALL
32 EnumProtocolsA(LPINT ProtocolCount,
33                LPVOID ProtocolBuffer,
34                LPDWORD BufferLength)
35 {
36   OutputDebugString(L"w32sock EnumProtocolsA stub called\n");
37
38   return SOCKET_ERROR;
39 }
40
41 INT
42 STDCALL
43 EnumProtocolsW(LPINT ProtocolCount,
44                LPVOID ProtocolBuffer,
45                LPDWORD BufferLength)
46 {
47   OutputDebugString(L"w32sock EnumProtocolsW stub called\n");
48
49   return SOCKET_ERROR;
50 }
51
52 VOID
53 STDCALL
54 GetAcceptExSockaddrs(PVOID OutputBuffer,
55                      DWORD ReceiveDataLength,
56                      DWORD LocalAddressLength,
57                      DWORD RemoteAddressLength,
58                      LPSOCKADDR* LocalSockaddr,
59                      LPINT LocalSockaddrLength,
60                      LPSOCKADDR* RemoteSockaddr,
61                      LPINT RemoteSockaddrLength)
62 {
63   OutputDebugString(L"w32sock GetAcceptExSockaddrs stub called\n");
64 }
65
66 INT
67 STDCALL
68 GetAddressByNameA(DWORD NameSpace,
69                   LPGUID ServiceType,
70                   LPSTR ServiceName,
71                   LPINT Protocols,
72                   DWORD Resolution,
73                   LPVOID /* really LPSERVICE_ASYNC_INFO */ ServiceAsyncInfo,
74                   LPVOID CsaddrBuffer,
75                   LPDWORD BufferLength,
76                   LPSTR AliasBuffer,
77                   LPDWORD AliasBufferLength)
78 {
79   OutputDebugString(L"w32sock GetAddressByNameA stub called\n");
80
81   return SOCKET_ERROR;
82 }
83
84 INT
85 STDCALL
86 GetAddressByNameW(DWORD NameSpace,
87                   LPGUID ServiceType,
88                   LPWSTR ServiceName,
89                   LPINT Protocols,
90                   DWORD Resolution,
91                   LPVOID /* really LPSERVICE_ASYNC_INFO */ ServiceAsyncInfo,
92                   LPVOID CsaddrBuffer,
93                   LPDWORD BufferLength,
94                   LPWSTR AliasBuffer,
95                   LPDWORD AliasBufferLength)
96 {
97   OutputDebugString(L"w32sock GetAddressByNameW stub called\n");
98
99   return SOCKET_ERROR;
100 }
101
102 INT
103 STDCALL
104 GetNameByTypeA(LPGUID ServiceType,
105                LPSTR ServiceName,
106                DWORD NameLength)
107 {
108   OutputDebugString(L"w32sock GetNameByTypeA stub called\n");
109
110   return SOCKET_ERROR;
111 }
112
113 INT
114 STDCALL
115 GetNameByTypeW(LPGUID ServiceType,
116                LPWSTR ServiceName,
117                DWORD NameLength)
118 {
119   OutputDebugString(L"w32sock GetNameByTypeW stub called\n");
120
121   return SOCKET_ERROR;
122 }
123
124 INT
125 STDCALL
126 GetServiceA(DWORD NameSpace,
127             LPGUID Guid,
128             LPSTR ServiceName,
129             DWORD Properties,
130             LPVOID Buffer,
131             LPDWORD BufferSize,
132             LPVOID /* Really LPSERVICE_ASYNC_INFO */ ServiceAsyncInfo)
133 {
134   OutputDebugString(L"w32sock GetServiceA stub called\n");
135
136   return SOCKET_ERROR;
137 }
138
139 INT
140 STDCALL
141 GetServiceW(DWORD NameSpace,
142             LPGUID Guid,
143             LPWSTR ServiceName,
144             DWORD Properties,
145             LPVOID Buffer,
146             LPDWORD BufferSize,
147             LPVOID /* Really LPSERVICE_ASYNC_INFO */ ServiceAsyncInfo)
148 {
149   OutputDebugString(L"w32sock GetServiceW stub called\n");
150
151   return SOCKET_ERROR;
152 }
153
154 INT
155 STDCALL
156 GetTypeByNameA(LPSTR ServiceName,
157                LPGUID ServiceType)
158 {
159   OutputDebugString(L"w32sock GetTypeByNameA stub called\n");
160
161   return SOCKET_ERROR;
162 }
163
164 INT
165 STDCALL
166 GetTypeByNameW(LPWSTR ServiceName,
167                LPGUID ServiceType)
168 {
169   OutputDebugString(L"w32sock GetTypeByNameW stub called\n");
170
171   return SOCKET_ERROR;
172 }
173
174 INT
175 STDCALL
176 SetServiceA(DWORD NameSpace,
177             DWORD Operation,
178             DWORD Flags,
179             LPVOID /* Really LPSERVICE_INFO */ ServiceInfo,
180             LPVOID /* Really LPSERVICE_ASYNC_INFOA */ ServiceAsyncInfo,
181             LPDWORD dwStatusFlags)
182 {
183   OutputDebugString(L"w32sock SetServiceA stub called\n");
184
185   return SOCKET_ERROR;
186 }
187
188 INT
189 STDCALL
190 SetServiceW(DWORD NameSpace,
191             DWORD Operation,
192             DWORD Flags,
193             LPVOID /* Really LPSERVICE_INFO */ ServiceInfo,
194             LPVOID /* Really LPSERVICE_ASYNC_INFOW */ ServiceAsyncInfo,
195             LPDWORD dwStatusFlags)
196 {
197   OutputDebugString(L"w32sock SetServiceW stub called\n");
198
199   return SOCKET_ERROR;
200 }
201
202 BOOL
203 STDCALL
204 TransmitFile(SOCKET Socket,
205              HANDLE File,
206              DWORD NumberOfBytesToWrite,
207              DWORD NumberOfBytesPerSend,
208              LPOVERLAPPED Overlapped,
209              LPVOID /* really LPTRANSMIT_FILE_BUFFERS */ TransmitBuffers,
210              DWORD Flags)
211 {
212   OutputDebugString(L"w32sock TransmitFile stub called\n");
213
214   return FALSE;
215 }
216
217 HANDLE
218 STDCALL
219 WSAAsyncGetHostByAddr(HWND Wnd,
220                       unsigned int Msg,
221                       const char *Addr,
222                       int Len,
223                       int Type,
224                       char *Buf,
225                       int BufLen)
226 {
227   OutputDebugString(L"w32sock WSAAsyncGetHostByAddr stub called\n");
228
229   return NULL;
230 }
231
232 HANDLE
233 STDCALL
234 WSAAsyncGetHostByName(HWND Wnd,
235                       unsigned int Msg,
236                       const char *Name,
237                       char *Buf,
238                       int BufLen)
239 {
240   OutputDebugString(L"w32sock WSAAsyncGetHostByName stub called\n");
241
242   return NULL;
243 }
244
245 HANDLE
246 STDCALL
247 WSAAsyncGetProtoByName(HWND Wnd,
248                        unsigned int Msg,
249                        const char *Name,
250                        char *Buf,
251                        int Buflen)
252 {
253   OutputDebugString(L"w32sock WSAAsyncGetProtoByName stub called\n");
254
255   return NULL;
256 }
257
258 HANDLE
259 STDCALL
260 WSAAsyncGetProtoByNumber(HWND Wnd,
261                          unsigned int Msg,
262                          int Number,
263                          char *Buf,
264                          int BufLen)
265 {
266   OutputDebugString(L"w32sock WSAAsyncGetProtoByNumber stub called\n");
267
268   return NULL;
269 }
270
271 HANDLE
272 STDCALL
273 WSAAsyncGetServByName(HWND Wnd,
274                       unsigned int Msg,
275                       const char *Name,
276                       const char *Proto,
277                       char *Buf,
278                       int BufLen)
279 {
280   OutputDebugString(L"w32sock WSAAsyncGetServByName stub called\n");
281
282   return NULL;
283 }
284
285 HANDLE
286 STDCALL
287 WSAAsyncGetServByPort(HWND Wnd,
288                       unsigned int Msg,
289                       int Port,
290                       const char *Proto,
291                       char *Buf,
292                       int BufLen)
293 {
294   OutputDebugString(L"w32sock WSAAsyncGetServByPort stub called\n");
295
296   return NULL;
297 }
298
299 INT
300 STDCALL
301 WSAAsyncSelect(SOCKET Sock,
302                HWND Wnd,
303                UINT Msg,
304                LONG Event)
305 {
306   OutputDebugString(L"w32sock WSAAsyncSelect stub called\n");
307
308   return SOCKET_ERROR;
309 }
310
311 int
312 STDCALL
313 WSACancelAsyncRequest(HANDLE AsyncTaskHandle)
314 {
315   OutputDebugString(L"w32sock WSACancelAsyncRequest stub called\n");
316
317   return SOCKET_ERROR;
318 }
319
320 int
321 STDCALL
322 WSACancelBlockingCall()
323 {
324   OutputDebugString(L"w32sock WSACancelBlockingCall stub called\n");
325
326   return SOCKET_ERROR;
327 }
328
329 int
330 STDCALL
331 WSACleanup()
332 {
333   OutputDebugString(L"w32sock WSACleanup stub called\n");
334
335   return SOCKET_ERROR;
336 }
337
338 int
339 STDCALL
340 WSAGetLastError(void)
341 {
342   OutputDebugString(L"w32sock WSAGetLastError stub called\n");
343
344   return WSANOTINITIALISED;
345 }
346
347 BOOL
348 STDCALL
349 WSAIsBlocking(VOID)
350 {
351   OutputDebugString(L"w32sock WSAIsBlocking stub called\n");
352
353   return FALSE;
354 }
355
356 int
357 STDCALL
358 WSARecvEx(SOCKET Sock,
359           char *Buf,
360           int Len,
361           int *Flags)
362 {
363   OutputDebugString(L"w32sock WSARecvEx stub called\n");
364
365   return SOCKET_ERROR;
366 }
367
368 FARPROC
369 STDCALL
370 WSASetBlockingHook(FARPROC BlockFunc)
371 {
372   OutputDebugString(L"w32sock WSASetBlockingHook stub called\n");
373
374   return NULL;
375 }
376
377 void
378 STDCALL WSASetLastError(int Error)
379 {
380   OutputDebugString(L"w32sock WSASetLastError stub called\n");
381 }
382
383 int
384 STDCALL
385 WSAStartup(WORD VersionRequested,
386            LPWSADATA WSAData)
387 {
388   OutputDebugString(L"w32sock WSAStartup stub called\n");
389
390   return WSASYSNOTREADY;
391 }
392
393 int
394 STDCALL
395 WSAUnhookBlockingHook(void)
396 {
397   OutputDebugString(L"w32sock WSAUnhookBlockingHook stub called\n");
398
399   return SOCKET_ERROR;
400 }
401
402 int
403 STDCALL
404 WSApSetPostRoutine(LPVOID /* really LPWPUPOSTMESSAGE */ PostRoutine)
405 {
406   OutputDebugString(L"w32sock WSApSetPostRoutine stub called\n");
407
408   return SOCKET_ERROR;
409 }
410
411 int
412 STDCALL
413 __WSAFDIsSet(SOCKET Sock,
414              fd_set *Set)
415 {
416   OutputDebugString(L"w32sock __WSAFDIsSet stub called\n");
417
418   return 0;
419 }
420
421 SOCKET
422 STDCALL
423 accept(SOCKET Sock,
424        struct sockaddr *Addr,
425        int *AddrLen)
426 {
427   OutputDebugString(L"w32sock accept stub called\n");
428
429   return INVALID_SOCKET;
430 }
431
432 INT
433 STDCALL
434 bind(SOCKET Sock,
435      CONST LPSOCKADDR Name,
436      INT NameLen)
437 {
438   OutputDebugString(L"w32sock bind stub called\n");
439
440   return SOCKET_ERROR;
441 }
442
443 int
444 STDCALL
445 closesocket(SOCKET Sock)
446 {
447   OutputDebugString(L"w32sock closesocket stub called\n");
448
449   return SOCKET_ERROR;
450 }
451
452 INT
453 STDCALL
454 connect(SOCKET Sock,
455         CONST LPSOCKADDR Name,
456         INT NameLen)
457 {
458   OutputDebugString(L"w32sock connect stub called\n");
459
460   return SOCKET_ERROR;
461 }
462
463 int
464 STDCALL
465 dn_expand(unsigned char *MessagePtr,
466           unsigned char *EndofMesOrig,
467           unsigned char *CompDomNam,
468           unsigned char *ExpandDomNam,
469           int Length)
470 {
471   OutputDebugString(L"w32sock dn_expand stub called\n");
472
473   return SOCKET_ERROR;
474 }
475
476 LPHOSTENT
477 STDCALL
478 gethostbyaddr(CONST CHAR *Addr,
479               INT Len,
480               INT Type)
481 {
482   OutputDebugString(L"w32sock gethostbyaddr stub called\n");
483
484   return NULL;
485 }
486
487 struct hostent *
488 STDCALL
489 gethostbyname(const char *Name)
490 {
491   OutputDebugString(L"w32sock gethostbyname stub called\n");
492
493   return NULL;
494 }
495
496 int
497 STDCALL
498 gethostname(char *Name,
499             int NameLen)
500 {
501   OutputDebugString(L"w32sock gethostname stub called\n");
502
503   return SOCKET_ERROR;
504 }
505
506 struct netent *
507 STDCALL
508 getnetbyname(char *Name)
509 {
510   OutputDebugString(L"w32sock getnetbyname stub called\n");
511
512   return NULL;
513 }
514
515 int
516 STDCALL
517 getpeername(SOCKET Sock,
518             struct sockaddr *Name,
519             int *NameLen)
520 {
521   OutputDebugString(L"w32sock getpeername stub called\n");
522
523   return SOCKET_ERROR;
524 }
525
526 LPPROTOENT
527 STDCALL
528 getprotobyname(CONST CHAR *Name)
529 {
530   OutputDebugString(L"w32sock getprotobyname stub called\n");
531
532   return NULL;
533 }
534
535 LPPROTOENT
536 STDCALL
537 getprotobynumber(INT Number)
538 {
539   OutputDebugString(L"w32sock getprotobynumber stub called\n");
540
541   return NULL;
542 }
543
544 struct servent *
545 STDCALL
546 getservbyname(const char *Name,
547               const char *Proto)
548 {
549   OutputDebugString(L"w32sock getservbyname stub called\n");
550
551   return NULL;
552 }
553
554 struct servent *
555 STDCALL
556 getservbyport(int Port,
557               const char *Proto)
558 {
559   OutputDebugString(L"w32sock getservbyport stub called\n");
560
561   return NULL;
562 }
563
564 int
565 STDCALL
566 getsockname(SOCKET Sock,
567             struct sockaddr *Name,
568             int *NameLen)
569 {
570   OutputDebugString(L"w32sock getsockname stub called\n");
571
572   return SOCKET_ERROR;
573 }
574
575 int
576 STDCALL
577 getsockopt(SOCKET Sock,
578            int Level,
579            int OptName,
580            char *OptVal,
581            int *OptLen)
582 {
583   OutputDebugString(L"w32sock getsockopt stub called\n");
584
585   return SOCKET_ERROR;
586 }
587
588 ULONG
589 STDCALL
590 htonl(ULONG HostLong)
591 {
592   return (((HostLong << 24) & 0xff000000) |
593           ((HostLong << 8) & 0x00ff0000) |
594           ((HostLong >> 8) & 0x0000ff00) |
595           ((HostLong >> 24) & 0x000000ff));
596 }
597
598 USHORT
599 STDCALL
600 htons(USHORT HostShort)
601 {
602   return (((HostShort << 8) & 0xff00) |
603           ((HostShort >> 8) & 0x00ff));
604 }
605
606 ULONG
607 STDCALL
608 inet_addr(CONST CHAR *cp)
609 {
610   OutputDebugString(L"w32sock inet_addr stub called\n");
611
612   return INADDR_NONE;
613 }
614
615 unsigned long
616 STDCALL
617 inet_network(const char *cp)
618 {
619   OutputDebugString(L"w32sock inet_network stub called\n");
620
621   return INADDR_NONE;
622 }
623
624 char *
625 STDCALL
626 inet_ntoa(struct in_addr in)
627 {
628   OutputDebugString(L"w32sock inet_ntoa stub called\n");
629
630   return NULL;
631 }
632
633 INT
634 STDCALL
635 ioctlsocket(SOCKET Sock,
636             LONG Cmd,
637             ULONG *Argp)
638 {
639   OutputDebugString(L"w32sock ioctlsocket stub called\n");
640
641   return SOCKET_ERROR;
642 }
643
644 int
645 STDCALL
646 listen(SOCKET Sock,
647        int BackLog)
648 {
649   OutputDebugString(L"w32sock listen stub called\n");
650
651   return SOCKET_ERROR;
652 }
653
654
655 ULONG
656 STDCALL
657 ntohl(ULONG NetLong)
658 {
659   return (((NetLong << 24) & 0xff000000) |
660           ((NetLong << 8) & 0x00ff0000) |
661           ((NetLong >> 8) & 0x0000ff00) |
662           ((NetLong >> 24) & 0x000000ff));
663 }
664
665 USHORT
666 STDCALL
667 ntohs(USHORT NetShort)
668 {
669   return (((NetShort << 8) & 0xff00) |
670           ((NetShort >> 8) & 0x00ff));
671 }
672
673 SOCKET
674 STDCALL
675 rcmd(char **AHost,
676      USHORT InPort,
677      char *LocUser,
678      char *RemUser,
679      char *Cmd,
680      int *Fd2p)
681 {
682   OutputDebugString(L"w32sock rcmd stub called\n");
683
684   return INVALID_SOCKET;
685 }
686
687 int
688 STDCALL
689 recv(SOCKET Sock,
690      char *Buf,
691      int Len,
692      int Flags)
693 {
694   OutputDebugString(L"w32sock recv stub called\n");
695
696   return SOCKET_ERROR;
697 }
698
699 int
700 STDCALL
701 recvfrom(SOCKET Sock,
702          char *Buf,
703          int Len,
704          int Flags,
705          struct sockaddr *From,
706          int *FromLen)
707 {
708   OutputDebugString(L"w32sock recvfrom stub called\n");
709
710   return SOCKET_ERROR;
711 }
712
713 SOCKET
714 STDCALL
715 rexec(char **AHost,
716       int InPort,
717       char *User,
718       char *Passwd,
719       char *Cmd,
720       int *Fd2p)
721 {
722   OutputDebugString(L"w32sock rexec stub called\n");
723
724   return INVALID_SOCKET;
725 }
726
727
728 SOCKET
729 STDCALL
730 rresvport(int *port)
731 {
732   OutputDebugString(L"w32sock rresvport stub called\n");
733
734   return INVALID_SOCKET;
735 }
736
737 void
738 STDCALL
739 s_perror(const char *str)
740 {
741   OutputDebugString(L"w32sock s_perror stub called\n");
742 }
743
744 INT
745 STDCALL
746 select(INT NumFds, 
747        LPFD_SET ReadFds, 
748        LPFD_SET WriteFds, 
749        LPFD_SET ExceptFds, 
750        CONST LPTIMEVAL TimeOut)
751 {
752   OutputDebugString(L"w32sock select stub called\n");
753
754   return SOCKET_ERROR;
755 }
756
757 int
758 STDCALL
759 send(SOCKET Sock,
760      const char *Buf,
761      int Len,
762      int Flags)
763 {
764   OutputDebugString(L"w32sock send stub called\n");
765
766   return SOCKET_ERROR;
767 }
768
769 INT
770 STDCALL
771 sendto(SOCKET Sock,
772        CONST CHAR *Buf,
773        INT Len,
774        INT Flags,
775        CONST LPSOCKADDR To, 
776        INT ToLen)
777 {
778   OutputDebugString(L"w32sock sendto stub called\n");
779
780   return SOCKET_ERROR;
781 }
782
783 int
784 STDCALL
785 sethostname(char *Name, int NameLen)
786 {
787   OutputDebugString(L"w32sock sethostname stub called\n");
788
789   return SOCKET_ERROR;
790 }
791
792 int
793 STDCALL
794 setsockopt(SOCKET Sock,
795            int Level,
796            int OptName,
797            const char *OptVal,
798            int OptLen)
799 {
800   OutputDebugString(L"w32sock setsockopt stub called\n");
801
802   return SOCKET_ERROR;
803 }
804
805 int
806 STDCALL
807 shutdown(SOCKET Sock,
808          int How)
809 {
810   OutputDebugString(L"w32sock shutdown stub called\n");
811
812   return SOCKET_ERROR;
813 }
814
815 SOCKET
816 STDCALL
817 socket(int AF,
818        int Type,
819        int Protocol)
820 {
821   OutputDebugString(L"w32sock socket stub called\n");
822
823   return INVALID_SOCKET;
824 }
825
826 BOOL
827 STDCALL
828 DllMain(HINSTANCE InstDLL,
829         DWORD Reason,
830         LPVOID Reserved)
831 {
832   return TRUE;
833 }
834