1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/********************************************************/
/* ntapi: Native API core library */
/* Copyright (C) 2013--2017 Z. Gilboa */
/* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */
/********************************************************/
#include <psxtypes/psxtypes.h>
#include <ntapi/nt_object.h>
#include <ntapi/nt_file.h>
#include <ntapi/nt_socket.h>
#include <ntapi/ntapi.h>
#include "ntapi_impl.h"
int32_t __cdecl __ntapi_sc_listen(
__in nt_socket * hssocket,
__in uint32_t backlog,
__in uint32_t afdflags __optional,
__out nt_iosb volatile * iosb __optional)
{
nt_afd_listen_info afd_listen;
nt_iosb volatile siosb;
iosb = iosb ? iosb : &siosb;
/* afd_listen */
afd_listen.unknown = 0;
afd_listen.flags = afdflags;
afd_listen.backlog = backlog;
hssocket->iostatus = __ntapi->zw_device_io_control_file(
hssocket->hsocket,
hssocket->hevent,
0,
0,
iosb,
NT_AFD_IOCTL_LISTEN,
&afd_listen,
sizeof(afd_listen),
0,
0);
return hssocket->iostatus
? __ntapi->sc_wait(hssocket,iosb,0)
: NT_STATUS_SUCCESS;
}
|