1 /* Async WINSOCK DNS services
3 * (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka.
4 * (C) 1999 Marcus Meissner
6 * NOTE: If you make any changes to fix a particular app, make sure
7 * they don't break something else like Netscape or telnet and ftp
8 * clients and servers (www.winsite.com got a lot of those).
11 * - Add WSACancel* and correct handle management. (works rather well for
13 * - Verify & Check all calls for correctness
14 * (currently only WSAGetHostByName*, WSAGetServByPort* calls)
15 * - Check error returns.
16 * - mirc/mirc32 Finger @linux.kernel.org sometimes fails in threaded mode.
18 * - This implementation did ignore the "NOTE:" section above (since the
19 * whole stuff did not work anyway to other changes).
25 #include <sys/types.h>
29 #include <sys/ioctl.h>
30 #ifdef HAVE_SYS_FILIO_H
31 # include <sys/filio.h>
34 #include <sys/ioccom.h>
35 #ifdef HAVE_SYS_SOCKIO_H
36 # include <sys/sockio.h>
41 # include <sys/so_ioctl.h>
44 #ifdef HAVE_SYS_PARAM_H
45 # include <sys/param.h>
51 #ifdef HAVE_SYS_WAIT_H
54 #ifdef HAVE_SYS_SOCKET_H
55 #include <sys/socket.h>
57 #ifdef HAVE_NETINET_IN_H
58 # include <netinet/in.h>
60 #ifdef HAVE_ARPA_INET_H
61 # include <arpa/inet.h>
66 #ifdef HAVE_SYS_ERRNO_H
67 #include <sys/errno.h>
74 #ifdef HAVE_ARPA_NAMESER_H
75 # include <arpa/nameser.h>
81 #include "wine/winbase16.h"
85 #include "wine/winsock16.h"
87 #include "wine/port.h"
88 #include "debugtools.h"
90 DEFAULT_DEBUG_CHANNEL(winsock
);
93 /* critical section to protect some non-rentrant net function */
94 CRITICAL_SECTION csWSgetXXXbyYYY
= CRITICAL_SECTION_INIT("csWSgetXXXbyYYY");
96 /* protoptypes of some functions in socket.c
98 UINT16
wsaErrno(void);
99 UINT16
wsaHerrno(int errnr
);
101 #define AQ_WIN16 0x00
102 #define AQ_WIN32 0x04
103 #define HB_WIN32(hb) (hb->flags & AQ_WIN32)
104 #define AQ_NUMBER 0x00
106 #define AQ_COPYPTR1 0x10
107 #define AQ_DUPLOWPTR1 0x20
108 #define AQ_MASKPTR1 0x30
109 #define AQ_COPYPTR2 0x40
110 #define AQ_DUPLOWPTR2 0x80
111 #define AQ_MASKPTR2 0xC0
114 #define AQ_GETPROTO 1
118 /* ----------------------------------- helper functions - */
120 static int list_size(char** l
, int item_size
)
125 j
+= (item_size
) ? item_size
: strlen(l
[i
]) + 1;
126 j
+= (i
+ 1) * sizeof(char*); }
130 static int list_dup(char** l_src
, char* ref
, char* base
, int item_size
)
132 /* base is either either equal to ref or 0 or SEGPTR */
135 char** l_to
= (char**)ref
;
138 for(j
=0;l_src
[j
];j
++) ;
139 p
+= (j
+ 1) * sizeof(char*);
141 { l_to
[i
] = base
+ (p
- ref
);
142 k
= ( item_size
) ? item_size
: strlen(l_src
[i
]) + 1;
143 memcpy(p
, l_src
[i
], k
); p
+= k
; }
150 static int hostent_size(struct hostent
* p_he
)
154 { size
= sizeof(struct hostent
);
155 size
+= strlen(p_he
->h_name
) + 1;
156 size
+= list_size(p_he
->h_aliases
, 0);
157 size
+= list_size(p_he
->h_addr_list
, p_he
->h_length
); }
161 /* Copy hostent to p_to, fix up inside pointers using p_base (different for
162 * Win16 (linear vs. segmented). Return -neededsize on overrun.
164 static int WS_copy_he(char *p_to
,char *p_base
,int t_size
,struct hostent
* p_he
, int flag
)
166 char* p_name
,*p_aliases
,*p_addr
,*p
;
167 struct ws_hostent16
*p_to16
= (struct ws_hostent16
*)p_to
;
168 struct ws_hostent32
*p_to32
= (struct ws_hostent32
*)p_to
;
169 int size
= hostent_size(p_he
) +
171 (flag
& AQ_WIN16
) ? sizeof(struct ws_hostent16
) : sizeof(struct ws_hostent32
)
172 - sizeof(struct hostent
)
178 p
+= (flag
& AQ_WIN16
) ?
179 sizeof(struct ws_hostent16
) : sizeof(struct ws_hostent32
);
181 strcpy(p
, p_he
->h_name
); p
+= strlen(p
) + 1;
183 p
+= list_dup(p_he
->h_aliases
, p
, p_base
+ (p
- (char*)p_to
), 0);
185 list_dup(p_he
->h_addr_list
, p
, p_base
+ (p
- (char*)p_to
), p_he
->h_length
);
189 p_to16
->h_addrtype
= (INT16
)p_he
->h_addrtype
;
190 p_to16
->h_length
= (INT16
)p_he
->h_length
;
191 p_to16
->h_name
= (SEGPTR
)(p_base
+ (p_name
- p_to
));
192 p_to16
->h_aliases
= (SEGPTR
)(p_base
+ (p_aliases
- p_to
));
193 p_to16
->h_addr_list
= (SEGPTR
)(p_base
+ (p_addr
- p_to
));
197 p_to32
->h_addrtype
= p_he
->h_addrtype
;
198 p_to32
->h_length
= p_he
->h_length
;
199 p_to32
->h_name
= (p_base
+ (p_name
- p_to
));
200 p_to32
->h_aliases
= (char **)(p_base
+ (p_aliases
- p_to
));
201 p_to32
->h_addr_list
= (char **)(p_base
+ (p_addr
- p_to
));
209 static int protoent_size(struct protoent
* p_pe
)
213 { size
= sizeof(struct protoent
);
214 size
+= strlen(p_pe
->p_name
) + 1;
215 size
+= list_size(p_pe
->p_aliases
, 0); }
219 /* Copy protoent to p_to, fix up inside pointers using p_base (different for
220 * Win16 (linear vs. segmented). Return -neededsize on overrun.
222 static int WS_copy_pe(char *p_to
,char *p_base
,int t_size
,struct protoent
* p_pe
, int flag
)
224 char* p_name
,*p_aliases
,*p
;
225 struct ws_protoent16
*p_to16
= (struct ws_protoent16
*)p_to
;
226 struct ws_protoent32
*p_to32
= (struct ws_protoent32
*)p_to
;
227 int size
= protoent_size(p_pe
) +
229 (flag
& AQ_WIN16
) ? sizeof(struct ws_protoent16
) : sizeof(struct ws_protoent32
)
230 - sizeof(struct protoent
)
236 p
+= (flag
& AQ_WIN16
) ?
237 sizeof(struct ws_protoent16
) : sizeof(struct ws_protoent32
);
239 strcpy(p
, p_pe
->p_name
); p
+= strlen(p
) + 1;
241 list_dup(p_pe
->p_aliases
, p
, p_base
+ (p
- (char*)p_to
), 0);
245 p_to16
->p_proto
= (INT16
)p_pe
->p_proto
;
246 p_to16
->p_name
= (SEGPTR
)(p_base
) + (p_name
- p_to
);
247 p_to16
->p_aliases
= (SEGPTR
)((p_base
) + (p_aliases
- p_to
));
251 p_to32
->p_proto
= p_pe
->p_proto
;
252 p_to32
->p_name
= (p_base
) + (p_name
- p_to
);
253 p_to32
->p_aliases
= (char **)((p_base
) + (p_aliases
- p_to
));
261 static int servent_size(struct servent
* p_se
)
265 size
+= sizeof(struct servent
);
266 size
+= strlen(p_se
->s_proto
) + strlen(p_se
->s_name
) + 2;
267 size
+= list_size(p_se
->s_aliases
, 0);
272 /* Copy servent to p_to, fix up inside pointers using p_base (different for
273 * Win16 (linear vs. segmented). Return -neededsize on overrun.
274 * Take care of different Win16/Win32 servent structs (packing !)
276 static int WS_copy_se(char *p_to
,char *p_base
,int t_size
,struct servent
* p_se
, int flag
)
278 char* p_name
,*p_aliases
,*p_proto
,*p
;
279 struct ws_servent16
*p_to16
= (struct ws_servent16
*)p_to
;
280 struct ws_servent32
*p_to32
= (struct ws_servent32
*)p_to
;
281 int size
= servent_size(p_se
) +
283 (flag
& AQ_WIN16
) ? sizeof(struct ws_servent16
) : sizeof(struct ws_servent32
)
284 - sizeof(struct servent
)
290 p
+= (flag
& AQ_WIN16
) ?
291 sizeof(struct ws_servent16
) : sizeof(struct ws_servent32
);
293 strcpy(p
, p_se
->s_name
); p
+= strlen(p
) + 1;
295 strcpy(p
, p_se
->s_proto
); p
+= strlen(p
) + 1;
297 list_dup(p_se
->s_aliases
, p
, p_base
+ (p
- p_to
), 0);
301 p_to16
->s_port
= (INT16
)p_se
->s_port
;
302 p_to16
->s_name
= (SEGPTR
)(p_base
+ (p_name
- p_to
));
303 p_to16
->s_proto
= (SEGPTR
)(p_base
+ (p_proto
- p_to
));
304 p_to16
->s_aliases
= (SEGPTR
)(p_base
+ (p_aliases
- p_to
));
308 p_to32
->s_port
= p_se
->s_port
;
309 p_to32
->s_name
= (p_base
+ (p_name
- p_to
));
310 p_to32
->s_proto
= (p_base
+ (p_proto
- p_to
));
311 p_to32
->s_aliases
= (char **)(p_base
+ (p_aliases
- p_to
));
317 static HANDLE __ws_async_handle
= 0xdead;
319 /* Generic async query struct. we use symbolic names for the different queries
322 typedef struct _async_query
{
326 #define host_name ptr1
327 #define host_addr ptr1
328 #define serv_name ptr1
329 #define proto_name ptr1
331 #define serv_proto ptr2
333 #define host_len int1
334 #define proto_number int1
335 #define serv_port int1
337 #define host_type int2
341 HANDLE16 async_handle
;
348 /****************************************************************************
349 * The async query function.
351 * It is either called as a thread startup routine or directly. It has
352 * to free the passed arg from the process heap and PostMessageA the async
353 * result or the error code.
356 * - errorhandling not verified.
358 static DWORD WINAPI
_async_queryfun(LPVOID arg
) {
359 async_query
*aq
= (async_query
*)arg
;
362 char *targetptr
= (HB_WIN32(aq
)?(char*)aq
->sbuf
:(char*)MapSL(aq
->sbuf
));
364 switch (aq
->flags
& AQ_GETMASK
) {
367 char *copy_hostent
= targetptr
;
368 #if HAVE_LINUX_GETHOSTBYNAME_R_6
371 struct hostent hostentry
;
372 int locerr
= ENOBUFS
;
374 extrabuf
=HeapAlloc(GetProcessHeap(),0,ebufsize
) ;
376 int res
= (aq
->flags
& AQ_NAME
) ?
377 gethostbyname_r(aq
->host_name
,
378 &hostentry
, extrabuf
, ebufsize
, &he
, &locerr
):
379 gethostbyaddr_r(aq
->host_addr
,aq
->host_len
,aq
->host_type
,
380 &hostentry
, extrabuf
, ebufsize
, &he
, &locerr
);
381 if( res
!= ERANGE
) break;
383 extrabuf
=HeapReAlloc(GetProcessHeap(),0,extrabuf
,ebufsize
) ;
385 if (!he
) fail
= ((locerr
< 0) ? wsaErrno() : wsaHerrno(locerr
));
387 EnterCriticalSection( &csWSgetXXXbyYYY
);
388 he
= (aq
->flags
& AQ_NAME
) ?
389 gethostbyname(aq
->host_name
):
390 gethostbyaddr(aq
->host_addr
,aq
->host_len
,aq
->host_type
);
391 if (!he
) fail
= ((h_errno
< 0) ? wsaErrno() : wsaHerrno(h_errno
));
394 size
= WS_copy_he(copy_hostent
,(char*)aq
->sbuf
,aq
->sbuflen
,he
,aq
->flags
);
400 #if HAVE_LINUX_GETHOSTBYNAME_R_6
401 HeapFree(GetProcessHeap(),0,extrabuf
);
403 LeaveCriticalSection( &csWSgetXXXbyYYY
);
409 char *copy_protoent
= targetptr
;
410 EnterCriticalSection( &csWSgetXXXbyYYY
);
411 pe
= (aq
->flags
& AQ_NAME
)?
412 getprotobyname(aq
->proto_name
) :
413 getprotobynumber(aq
->proto_number
);
415 size
= WS_copy_pe(copy_protoent
,(char*)aq
->sbuf
,aq
->sbuflen
,pe
,aq
->flags
);
421 if (aq
->flags
& AQ_NAME
)
422 MESSAGE("protocol %s not found; You might want to add "
423 "this to /etc/protocols\n", debugstr_a(aq
->proto_name
) );
425 MESSAGE("protocol number %d not found; You might want to add "
426 "this to /etc/protocols\n", aq
->proto_number
);
429 LeaveCriticalSection( &csWSgetXXXbyYYY
);
434 char *copy_servent
= targetptr
;
435 EnterCriticalSection( &csWSgetXXXbyYYY
);
436 se
= (aq
->flags
& AQ_NAME
)?
437 getservbyname(aq
->serv_name
,aq
->serv_proto
) :
438 getservbyport(aq
->serv_port
,aq
->serv_proto
);
440 size
= WS_copy_se(copy_servent
,(char*)aq
->sbuf
,aq
->sbuflen
,se
,aq
->flags
);
446 if (aq
->flags
& AQ_NAME
)
447 MESSAGE("service %s protocol %s not found; You might want to add "
448 "this to /etc/services\n", debugstr_a(aq
->serv_name
) ,
449 aq
->serv_proto
? debugstr_a(aq
->serv_proto
):"*");
451 MESSAGE("service on port %d protocol %s not found; You might want to add "
452 "this to /etc/services\n", aq
->serv_port
,
453 aq
->serv_proto
? debugstr_a(aq
->serv_proto
):"*");
456 LeaveCriticalSection( &csWSgetXXXbyYYY
);
460 PostMessageA(aq
->hWnd
,aq
->uMsg
,aq
->async_handle
,size
|(fail
<<16));
461 HeapFree(GetProcessHeap(),0,arg
);
465 /****************************************************************************
466 * The main async help function.
468 * It either starts a thread or just calls the function directly for platforms
469 * with no thread support. This relies on the fact that PostMessage() does
470 * not actually call the windowproc before the function returns.
472 static HANDLE16
__WSAsyncDBQuery(
473 HWND hWnd
, UINT uMsg
,INT int1
,LPCSTR ptr1
, INT int2
, LPCSTR ptr2
,
474 void *sbuf
, INT sbuflen
, UINT flags
482 /* allocate buffer to copy protocol- and service name to */
483 /* note: this is done in the calling thread so we can return */
484 /* a decent error code if the Alloc fails */
486 switch (flags
& AQ_MASKPTR1
) {
488 case AQ_COPYPTR1
: xbuflen
+= int1
; break;
489 case AQ_DUPLOWPTR1
: xbuflen
+= strlen(ptr1
) + 1; break;
492 switch (flags
& AQ_MASKPTR2
) {
494 case AQ_COPYPTR2
: xbuflen
+= int2
; break;
495 case AQ_DUPLOWPTR2
: xbuflen
+= strlen(ptr2
) + 1; break;
498 if(!(aq
= HeapAlloc(GetProcessHeap(),0,sizeof(async_query
) + xbuflen
))) {
499 SetLastError(WSAEWOULDBLOCK
); /* insufficient resources */
504 if (ptr1
) switch (flags
& AQ_MASKPTR1
) {
506 case AQ_COPYPTR1
: memcpy(pto
, ptr1
, int1
); ptr1
= pto
; pto
+= int1
; break;
507 case AQ_DUPLOWPTR1
: pfm
= ptr1
; ptr1
= pto
; do *pto
++ = tolower(*pfm
); while (*pfm
++); break;
509 if (ptr2
) switch (flags
& AQ_MASKPTR2
) {
511 case AQ_COPYPTR2
: memcpy(pto
, ptr2
, int2
); ptr2
= pto
; pto
+= int2
; break;
512 case AQ_DUPLOWPTR2
: pfm
= ptr2
; ptr2
= pto
; do *pto
++ = tolower(*pfm
); while (*pfm
++); break;
521 aq
->async_handle
= ++__ws_async_handle
;
523 aq
->sbuf
= (SEGPTR
)sbuf
;
524 aq
->sbuflen
= sbuflen
;
527 if (CreateThread(NULL
,0,_async_queryfun
,aq
,0,NULL
) == INVALID_HANDLE_VALUE
)
530 return __ws_async_handle
;
534 /***********************************************************************
535 * WSAAsyncGetHostByAddr (WINSOCK.102)
537 HANDLE16 WINAPI
WSAAsyncGetHostByAddr16(HWND16 hWnd
, UINT16 uMsg
, LPCSTR addr
,
538 INT16 len
, INT16 type
, SEGPTR sbuf
, INT16 buflen
)
540 TRACE("hwnd %04x, msg %04x, addr %08x[%i]\n",
541 hWnd
, uMsg
, (unsigned)addr
, len
);
542 return __WSAsyncDBQuery(hWnd
,uMsg
,len
,addr
,type
,NULL
,(void*)sbuf
,buflen
,
543 AQ_NUMBER
|AQ_COPYPTR1
|AQ_WIN16
|AQ_GETHOST
);
546 /***********************************************************************
547 * WSAAsyncGetHostByAddr (WS2_32.102)
549 HANDLE WINAPI
WSAAsyncGetHostByAddr(HWND hWnd
, UINT uMsg
, LPCSTR addr
,
550 INT len
, INT type
, LPSTR sbuf
, INT buflen
)
552 TRACE("hwnd %04x, msg %04x, addr %08x[%i]\n",
553 hWnd
, uMsg
, (unsigned)addr
, len
);
554 return __WSAsyncDBQuery(hWnd
,uMsg
,len
,addr
,type
,NULL
,sbuf
,buflen
,
555 AQ_NUMBER
|AQ_COPYPTR1
|AQ_WIN32
|AQ_GETHOST
);
558 /***********************************************************************
559 * WSAAsyncGetHostByName (WINSOCK.103)
561 HANDLE16 WINAPI
WSAAsyncGetHostByName16(HWND16 hWnd
, UINT16 uMsg
, LPCSTR name
,
562 SEGPTR sbuf
, INT16 buflen
)
564 TRACE("hwnd %04x, msg %04x, host %s, buffer %i\n",
565 hWnd
, uMsg
, (name
)?name
:"<null>", (int)buflen
);
566 return __WSAsyncDBQuery(hWnd
,uMsg
,0,name
,0,NULL
,(void*)sbuf
,buflen
,
567 AQ_NAME
|AQ_DUPLOWPTR1
|AQ_WIN16
|AQ_GETHOST
);
570 /***********************************************************************
571 * WSAAsyncGetHostByName (WS2_32.103)
573 HANDLE WINAPI
WSAAsyncGetHostByName(HWND hWnd
, UINT uMsg
, LPCSTR name
,
574 LPSTR sbuf
, INT buflen
)
576 TRACE("hwnd %04x, msg %08x, host %s, buffer %i\n",
577 (HWND16
)hWnd
, uMsg
, (name
)?name
:"<null>", (int)buflen
);
578 return __WSAsyncDBQuery(hWnd
,uMsg
,0,name
,0,NULL
,sbuf
,buflen
,
579 AQ_NAME
|AQ_DUPLOWPTR1
|AQ_WIN32
|AQ_GETHOST
);
582 /***********************************************************************
583 * WSAAsyncGetProtoByName (WINSOCK.105)
585 HANDLE16 WINAPI
WSAAsyncGetProtoByName16(HWND16 hWnd
, UINT16 uMsg
, LPCSTR name
,
586 SEGPTR sbuf
, INT16 buflen
)
588 TRACE("hwnd %04x, msg %08x, protocol %s\n",
589 (HWND16
)hWnd
, uMsg
, (name
)?name
:"<null>" );
590 return __WSAsyncDBQuery(hWnd
,uMsg
,0,name
,0,NULL
,(void*)sbuf
,buflen
,
591 AQ_NAME
|AQ_DUPLOWPTR1
|AQ_WIN16
|AQ_GETPROTO
);
594 /***********************************************************************
595 * WSAAsyncGetProtoByName (WS2_32.105)
597 HANDLE WINAPI
WSAAsyncGetProtoByName(HWND hWnd
, UINT uMsg
, LPCSTR name
,
598 LPSTR sbuf
, INT buflen
)
600 TRACE("hwnd %04x, msg %08x, protocol %s\n",
601 (HWND16
)hWnd
, uMsg
, (name
)?name
:"<null>" );
602 return __WSAsyncDBQuery(hWnd
,uMsg
,0,name
,0,NULL
,sbuf
,buflen
,
603 AQ_NAME
|AQ_DUPLOWPTR1
|AQ_WIN32
|AQ_GETPROTO
);
607 /***********************************************************************
608 * WSAAsyncGetProtoByNumber (WINSOCK.104)
610 HANDLE16 WINAPI
WSAAsyncGetProtoByNumber16(HWND16 hWnd
,UINT16 uMsg
,INT16 number
,
611 SEGPTR sbuf
, INT16 buflen
)
613 TRACE("hwnd %04x, msg %04x, num %i\n", hWnd
, uMsg
, number
);
614 return __WSAsyncDBQuery(hWnd
,uMsg
,number
,NULL
,0,NULL
,(void*)sbuf
,buflen
,
615 AQ_GETPROTO
|AQ_NUMBER
|AQ_WIN16
);
618 /***********************************************************************
619 * WSAAsyncGetProtoByNumber (WS2_32.104)
621 HANDLE WINAPI
WSAAsyncGetProtoByNumber(HWND hWnd
, UINT uMsg
, INT number
,
622 LPSTR sbuf
, INT buflen
)
624 TRACE("hwnd %04x, msg %04x, num %i\n", hWnd
, uMsg
, number
);
625 return __WSAsyncDBQuery(hWnd
,uMsg
,number
,NULL
,0,NULL
,sbuf
,buflen
,
626 AQ_GETPROTO
|AQ_NUMBER
|AQ_WIN32
);
629 /***********************************************************************
630 * WSAAsyncGetServByName (WINSOCK.107)
632 HANDLE16 WINAPI
WSAAsyncGetServByName16(HWND16 hWnd
, UINT16 uMsg
, LPCSTR name
,
633 LPCSTR proto
, SEGPTR sbuf
, INT16 buflen
)
635 TRACE("hwnd %04x, msg %04x, name %s, proto %s\n",
636 hWnd
, uMsg
, (name
)?name
:"<null>", (proto
)?proto
:"<null>");
637 return __WSAsyncDBQuery(hWnd
,uMsg
,0,name
,0,proto
,(void*)sbuf
,buflen
,
638 AQ_GETSERV
|AQ_NAME
|AQ_DUPLOWPTR1
|AQ_DUPLOWPTR2
|AQ_WIN16
);
641 /***********************************************************************
642 * WSAAsyncGetServByName (WS2_32.107)
644 HANDLE WINAPI
WSAAsyncGetServByName(HWND hWnd
, UINT uMsg
, LPCSTR name
,
645 LPCSTR proto
, LPSTR sbuf
, INT buflen
)
647 TRACE("hwnd %04x, msg %04x, name %s, proto %s\n",
648 hWnd
, uMsg
, (name
)?name
:"<null>", (proto
)?proto
:"<null>");
649 return __WSAsyncDBQuery(hWnd
,uMsg
,0,name
,0,proto
,sbuf
,buflen
,
650 AQ_GETSERV
|AQ_NAME
|AQ_DUPLOWPTR1
|AQ_DUPLOWPTR2
|AQ_WIN32
);
653 /***********************************************************************
654 * WSAAsyncGetServByPort (WINSOCK.106)
656 HANDLE16 WINAPI
WSAAsyncGetServByPort16(HWND16 hWnd
, UINT16 uMsg
, INT16 port
,
657 LPCSTR proto
, SEGPTR sbuf
, INT16 buflen
)
659 TRACE("hwnd %04x, msg %04x, port %i, proto %s\n",
660 hWnd
, uMsg
, port
, (proto
)?proto
:"<null>" );
661 return __WSAsyncDBQuery(hWnd
,uMsg
,port
,NULL
,0,proto
,(void*)sbuf
,buflen
,
662 AQ_GETSERV
|AQ_NUMBER
|AQ_DUPLOWPTR2
|AQ_WIN16
);
665 /***********************************************************************
666 * WSAAsyncGetServByPort (WS2_32.106)
668 HANDLE WINAPI
WSAAsyncGetServByPort(HWND hWnd
, UINT uMsg
, INT port
,
669 LPCSTR proto
, LPSTR sbuf
, INT buflen
)
671 TRACE("hwnd %04x, msg %04x, port %i, proto %s\n",
672 hWnd
, uMsg
, port
, (proto
)?proto
:"<null>" );
673 return __WSAsyncDBQuery(hWnd
,uMsg
,port
,NULL
,0,proto
,sbuf
,buflen
,
674 AQ_GETSERV
|AQ_NUMBER
|AQ_DUPLOWPTR2
|AQ_WIN32
);
677 /***********************************************************************
678 * WSACancelAsyncRequest (WS2_32.108)
680 INT WINAPI
WSACancelAsyncRequest(HANDLE hAsyncTaskHandle
)
682 FIXME("(%08x),stub\n", hAsyncTaskHandle
);
686 /***********************************************************************
687 * WSACancelAsyncRequest (WINSOCK.108)
689 INT16 WINAPI
WSACancelAsyncRequest16(HANDLE16 hAsyncTaskHandle
)
691 return (HANDLE16
)WSACancelAsyncRequest((HANDLE
)hAsyncTaskHandle
);