1e66f31c5Sopenharmony_ci/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2e66f31c5Sopenharmony_ci *
3e66f31c5Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
4e66f31c5Sopenharmony_ci * of this software and associated documentation files (the "Software"), to
5e66f31c5Sopenharmony_ci * deal in the Software without restriction, including without limitation the
6e66f31c5Sopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7e66f31c5Sopenharmony_ci * sell copies of the Software, and to permit persons to whom the Software is
8e66f31c5Sopenharmony_ci * furnished to do so, subject to the following conditions:
9e66f31c5Sopenharmony_ci *
10e66f31c5Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
11e66f31c5Sopenharmony_ci * all copies or substantial portions of the Software.
12e66f31c5Sopenharmony_ci *
13e66f31c5Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14e66f31c5Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15e66f31c5Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16e66f31c5Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17e66f31c5Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18e66f31c5Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19e66f31c5Sopenharmony_ci * IN THE SOFTWARE.
20e66f31c5Sopenharmony_ci */
21e66f31c5Sopenharmony_ci
22e66f31c5Sopenharmony_ci#ifndef UV_WIN_INTERNAL_H_
23e66f31c5Sopenharmony_ci#define UV_WIN_INTERNAL_H_
24e66f31c5Sopenharmony_ci
25e66f31c5Sopenharmony_ci#include "uv.h"
26e66f31c5Sopenharmony_ci#include "../uv-common.h"
27e66f31c5Sopenharmony_ci
28e66f31c5Sopenharmony_ci#include "uv/tree.h"
29e66f31c5Sopenharmony_ci#include "winapi.h"
30e66f31c5Sopenharmony_ci#include "winsock.h"
31e66f31c5Sopenharmony_ci
32e66f31c5Sopenharmony_ci#define UV_LOOP_MAGIC 0x700B700BU
33e66f31c5Sopenharmony_ci
34e66f31c5Sopenharmony_ci#ifdef _MSC_VER
35e66f31c5Sopenharmony_ci# define INLINE __inline
36e66f31c5Sopenharmony_ci# define UV_THREAD_LOCAL __declspec( thread )
37e66f31c5Sopenharmony_ci#else
38e66f31c5Sopenharmony_ci# define INLINE inline
39e66f31c5Sopenharmony_ci# define UV_THREAD_LOCAL __thread
40e66f31c5Sopenharmony_ci#endif
41e66f31c5Sopenharmony_ci
42e66f31c5Sopenharmony_ci
43e66f31c5Sopenharmony_ci#ifdef _DEBUG
44e66f31c5Sopenharmony_ci
45e66f31c5Sopenharmony_ciextern UV_THREAD_LOCAL int uv__crt_assert_enabled;
46e66f31c5Sopenharmony_ci
47e66f31c5Sopenharmony_ci#define UV_BEGIN_DISABLE_CRT_ASSERT()                           \
48e66f31c5Sopenharmony_ci  {                                                             \
49e66f31c5Sopenharmony_ci    int uv__saved_crt_assert_enabled = uv__crt_assert_enabled;  \
50e66f31c5Sopenharmony_ci    uv__crt_assert_enabled = FALSE;
51e66f31c5Sopenharmony_ci
52e66f31c5Sopenharmony_ci
53e66f31c5Sopenharmony_ci#define UV_END_DISABLE_CRT_ASSERT()                             \
54e66f31c5Sopenharmony_ci    uv__crt_assert_enabled = uv__saved_crt_assert_enabled;      \
55e66f31c5Sopenharmony_ci  }
56e66f31c5Sopenharmony_ci
57e66f31c5Sopenharmony_ci#else
58e66f31c5Sopenharmony_ci#define UV_BEGIN_DISABLE_CRT_ASSERT()
59e66f31c5Sopenharmony_ci#define UV_END_DISABLE_CRT_ASSERT()
60e66f31c5Sopenharmony_ci#endif
61e66f31c5Sopenharmony_ci
62e66f31c5Sopenharmony_ci/*
63e66f31c5Sopenharmony_ci * TCP
64e66f31c5Sopenharmony_ci */
65e66f31c5Sopenharmony_ci
66e66f31c5Sopenharmony_citypedef enum {
67e66f31c5Sopenharmony_ci  UV__IPC_SOCKET_XFER_NONE = 0,
68e66f31c5Sopenharmony_ci  UV__IPC_SOCKET_XFER_TCP_CONNECTION,
69e66f31c5Sopenharmony_ci  UV__IPC_SOCKET_XFER_TCP_SERVER
70e66f31c5Sopenharmony_ci} uv__ipc_socket_xfer_type_t;
71e66f31c5Sopenharmony_ci
72e66f31c5Sopenharmony_citypedef struct {
73e66f31c5Sopenharmony_ci  WSAPROTOCOL_INFOW socket_info;
74e66f31c5Sopenharmony_ci  uint32_t delayed_error;
75e66f31c5Sopenharmony_ci} uv__ipc_socket_xfer_info_t;
76e66f31c5Sopenharmony_ci
77e66f31c5Sopenharmony_ciint uv__tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb);
78e66f31c5Sopenharmony_ciint uv__tcp_accept(uv_tcp_t* server, uv_tcp_t* client);
79e66f31c5Sopenharmony_ciint uv__tcp_read_start(uv_tcp_t* handle, uv_alloc_cb alloc_cb,
80e66f31c5Sopenharmony_ci    uv_read_cb read_cb);
81e66f31c5Sopenharmony_ciint uv__tcp_write(uv_loop_t* loop, uv_write_t* req, uv_tcp_t* handle,
82e66f31c5Sopenharmony_ci    const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb);
83e66f31c5Sopenharmony_ciint uv__tcp_try_write(uv_tcp_t* handle, const uv_buf_t bufs[],
84e66f31c5Sopenharmony_ci    unsigned int nbufs);
85e66f31c5Sopenharmony_ci
86e66f31c5Sopenharmony_civoid uv__process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle, uv_req_t* req);
87e66f31c5Sopenharmony_civoid uv__process_tcp_write_req(uv_loop_t* loop, uv_tcp_t* handle,
88e66f31c5Sopenharmony_ci    uv_write_t* req);
89e66f31c5Sopenharmony_civoid uv__process_tcp_accept_req(uv_loop_t* loop, uv_tcp_t* handle,
90e66f31c5Sopenharmony_ci    uv_req_t* req);
91e66f31c5Sopenharmony_civoid uv__process_tcp_connect_req(uv_loop_t* loop, uv_tcp_t* handle,
92e66f31c5Sopenharmony_ci    uv_connect_t* req);
93e66f31c5Sopenharmony_civoid uv__process_tcp_shutdown_req(uv_loop_t* loop,
94e66f31c5Sopenharmony_ci                                  uv_tcp_t* stream,
95e66f31c5Sopenharmony_ci                                  uv_shutdown_t* req);
96e66f31c5Sopenharmony_ci
97e66f31c5Sopenharmony_civoid uv__tcp_close(uv_loop_t* loop, uv_tcp_t* tcp);
98e66f31c5Sopenharmony_civoid uv__tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle);
99e66f31c5Sopenharmony_ci
100e66f31c5Sopenharmony_ciint uv__tcp_xfer_export(uv_tcp_t* handle,
101e66f31c5Sopenharmony_ci                        int pid,
102e66f31c5Sopenharmony_ci                        uv__ipc_socket_xfer_type_t* xfer_type,
103e66f31c5Sopenharmony_ci                        uv__ipc_socket_xfer_info_t* xfer_info);
104e66f31c5Sopenharmony_ciint uv__tcp_xfer_import(uv_tcp_t* tcp,
105e66f31c5Sopenharmony_ci                        uv__ipc_socket_xfer_type_t xfer_type,
106e66f31c5Sopenharmony_ci                        uv__ipc_socket_xfer_info_t* xfer_info);
107e66f31c5Sopenharmony_ci
108e66f31c5Sopenharmony_ci
109e66f31c5Sopenharmony_ci/*
110e66f31c5Sopenharmony_ci * UDP
111e66f31c5Sopenharmony_ci */
112e66f31c5Sopenharmony_civoid uv__process_udp_recv_req(uv_loop_t* loop, uv_udp_t* handle, uv_req_t* req);
113e66f31c5Sopenharmony_civoid uv__process_udp_send_req(uv_loop_t* loop, uv_udp_t* handle,
114e66f31c5Sopenharmony_ci    uv_udp_send_t* req);
115e66f31c5Sopenharmony_ci
116e66f31c5Sopenharmony_civoid uv__udp_close(uv_loop_t* loop, uv_udp_t* handle);
117e66f31c5Sopenharmony_civoid uv__udp_endgame(uv_loop_t* loop, uv_udp_t* handle);
118e66f31c5Sopenharmony_ci
119e66f31c5Sopenharmony_ci
120e66f31c5Sopenharmony_ci/*
121e66f31c5Sopenharmony_ci * Pipes
122e66f31c5Sopenharmony_ci */
123e66f31c5Sopenharmony_ciint uv__create_stdio_pipe_pair(uv_loop_t* loop,
124e66f31c5Sopenharmony_ci    uv_pipe_t* parent_pipe, HANDLE* child_pipe_ptr, unsigned int flags);
125e66f31c5Sopenharmony_ci
126e66f31c5Sopenharmony_ciint uv__pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb);
127e66f31c5Sopenharmony_ciint uv__pipe_accept(uv_pipe_t* server, uv_stream_t* client);
128e66f31c5Sopenharmony_ciint uv__pipe_read_start(uv_pipe_t* handle, uv_alloc_cb alloc_cb,
129e66f31c5Sopenharmony_ci    uv_read_cb read_cb);
130e66f31c5Sopenharmony_civoid uv__pipe_read_stop(uv_pipe_t* handle);
131e66f31c5Sopenharmony_ciint uv__pipe_write(uv_loop_t* loop,
132e66f31c5Sopenharmony_ci                   uv_write_t* req,
133e66f31c5Sopenharmony_ci                   uv_pipe_t* handle,
134e66f31c5Sopenharmony_ci                   const uv_buf_t bufs[],
135e66f31c5Sopenharmony_ci                   size_t nbufs,
136e66f31c5Sopenharmony_ci                   uv_stream_t* send_handle,
137e66f31c5Sopenharmony_ci                   uv_write_cb cb);
138e66f31c5Sopenharmony_civoid uv__pipe_shutdown(uv_loop_t* loop, uv_pipe_t* handle, uv_shutdown_t* req);
139e66f31c5Sopenharmony_ci
140e66f31c5Sopenharmony_civoid uv__process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle,
141e66f31c5Sopenharmony_ci    uv_req_t* req);
142e66f31c5Sopenharmony_civoid uv__process_pipe_write_req(uv_loop_t* loop, uv_pipe_t* handle,
143e66f31c5Sopenharmony_ci    uv_write_t* req);
144e66f31c5Sopenharmony_civoid uv__process_pipe_accept_req(uv_loop_t* loop, uv_pipe_t* handle,
145e66f31c5Sopenharmony_ci    uv_req_t* raw_req);
146e66f31c5Sopenharmony_civoid uv__process_pipe_connect_req(uv_loop_t* loop, uv_pipe_t* handle,
147e66f31c5Sopenharmony_ci    uv_connect_t* req);
148e66f31c5Sopenharmony_civoid uv__process_pipe_shutdown_req(uv_loop_t* loop, uv_pipe_t* handle,
149e66f31c5Sopenharmony_ci    uv_shutdown_t* req);
150e66f31c5Sopenharmony_ci
151e66f31c5Sopenharmony_civoid uv__pipe_close(uv_loop_t* loop, uv_pipe_t* handle);
152e66f31c5Sopenharmony_civoid uv__pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle);
153e66f31c5Sopenharmony_ci
154e66f31c5Sopenharmony_ci
155e66f31c5Sopenharmony_ci/*
156e66f31c5Sopenharmony_ci * TTY
157e66f31c5Sopenharmony_ci */
158e66f31c5Sopenharmony_civoid uv__console_init(void);
159e66f31c5Sopenharmony_ci
160e66f31c5Sopenharmony_ciint uv__tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
161e66f31c5Sopenharmony_ci    uv_read_cb read_cb);
162e66f31c5Sopenharmony_ciint uv__tty_read_stop(uv_tty_t* handle);
163e66f31c5Sopenharmony_ciint uv__tty_write(uv_loop_t* loop, uv_write_t* req, uv_tty_t* handle,
164e66f31c5Sopenharmony_ci    const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb);
165e66f31c5Sopenharmony_ciint uv__tty_try_write(uv_tty_t* handle, const uv_buf_t bufs[],
166e66f31c5Sopenharmony_ci    unsigned int nbufs);
167e66f31c5Sopenharmony_civoid uv__tty_close(uv_tty_t* handle);
168e66f31c5Sopenharmony_ci
169e66f31c5Sopenharmony_civoid uv__process_tty_read_req(uv_loop_t* loop, uv_tty_t* handle,
170e66f31c5Sopenharmony_ci    uv_req_t* req);
171e66f31c5Sopenharmony_civoid uv__process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle,
172e66f31c5Sopenharmony_ci    uv_write_t* req);
173e66f31c5Sopenharmony_ci#define uv__process_tty_accept_req(loop, handle, req) abort()
174e66f31c5Sopenharmony_ci#define uv__process_tty_connect_req(loop, handle, req) abort()
175e66f31c5Sopenharmony_civoid uv__process_tty_shutdown_req(uv_loop_t* loop,
176e66f31c5Sopenharmony_ci                                  uv_tty_t* stream,
177e66f31c5Sopenharmony_ci                                  uv_shutdown_t* req);
178e66f31c5Sopenharmony_civoid uv__tty_endgame(uv_loop_t* loop, uv_tty_t* handle);
179e66f31c5Sopenharmony_ci
180e66f31c5Sopenharmony_ci
181e66f31c5Sopenharmony_ci/*
182e66f31c5Sopenharmony_ci * Poll watchers
183e66f31c5Sopenharmony_ci */
184e66f31c5Sopenharmony_civoid uv__process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
185e66f31c5Sopenharmony_ci    uv_req_t* req);
186e66f31c5Sopenharmony_ci
187e66f31c5Sopenharmony_ciint uv__poll_close(uv_loop_t* loop, uv_poll_t* handle);
188e66f31c5Sopenharmony_civoid uv__poll_endgame(uv_loop_t* loop, uv_poll_t* handle);
189e66f31c5Sopenharmony_ci
190e66f31c5Sopenharmony_ci
191e66f31c5Sopenharmony_ci/*
192e66f31c5Sopenharmony_ci * Loop watchers
193e66f31c5Sopenharmony_ci */
194e66f31c5Sopenharmony_civoid uv__loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle);
195e66f31c5Sopenharmony_ci
196e66f31c5Sopenharmony_civoid uv__prepare_invoke(uv_loop_t* loop);
197e66f31c5Sopenharmony_civoid uv__check_invoke(uv_loop_t* loop);
198e66f31c5Sopenharmony_civoid uv__idle_invoke(uv_loop_t* loop);
199e66f31c5Sopenharmony_ci
200e66f31c5Sopenharmony_civoid uv__once_init(void);
201e66f31c5Sopenharmony_ci
202e66f31c5Sopenharmony_ci
203e66f31c5Sopenharmony_ci/*
204e66f31c5Sopenharmony_ci * Async watcher
205e66f31c5Sopenharmony_ci */
206e66f31c5Sopenharmony_civoid uv__async_close(uv_loop_t* loop, uv_async_t* handle);
207e66f31c5Sopenharmony_civoid uv__async_endgame(uv_loop_t* loop, uv_async_t* handle);
208e66f31c5Sopenharmony_ci
209e66f31c5Sopenharmony_civoid uv__process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle,
210e66f31c5Sopenharmony_ci    uv_req_t* req);
211e66f31c5Sopenharmony_ci
212e66f31c5Sopenharmony_ci
213e66f31c5Sopenharmony_ci/*
214e66f31c5Sopenharmony_ci * Signal watcher
215e66f31c5Sopenharmony_ci */
216e66f31c5Sopenharmony_civoid uv__signals_init(void);
217e66f31c5Sopenharmony_ciint uv__signal_dispatch(int signum);
218e66f31c5Sopenharmony_ci
219e66f31c5Sopenharmony_civoid uv__signal_close(uv_loop_t* loop, uv_signal_t* handle);
220e66f31c5Sopenharmony_civoid uv__signal_endgame(uv_loop_t* loop, uv_signal_t* handle);
221e66f31c5Sopenharmony_ci
222e66f31c5Sopenharmony_civoid uv__process_signal_req(uv_loop_t* loop, uv_signal_t* handle,
223e66f31c5Sopenharmony_ci    uv_req_t* req);
224e66f31c5Sopenharmony_ci
225e66f31c5Sopenharmony_ci
226e66f31c5Sopenharmony_ci/*
227e66f31c5Sopenharmony_ci * Spawn
228e66f31c5Sopenharmony_ci */
229e66f31c5Sopenharmony_civoid uv__process_proc_exit(uv_loop_t* loop, uv_process_t* handle);
230e66f31c5Sopenharmony_civoid uv__process_close(uv_loop_t* loop, uv_process_t* handle);
231e66f31c5Sopenharmony_civoid uv__process_endgame(uv_loop_t* loop, uv_process_t* handle);
232e66f31c5Sopenharmony_ci
233e66f31c5Sopenharmony_ci
234e66f31c5Sopenharmony_ci/*
235e66f31c5Sopenharmony_ci * FS
236e66f31c5Sopenharmony_ci */
237e66f31c5Sopenharmony_civoid uv__fs_init(void);
238e66f31c5Sopenharmony_ci
239e66f31c5Sopenharmony_ci
240e66f31c5Sopenharmony_ci/*
241e66f31c5Sopenharmony_ci * FS Event
242e66f31c5Sopenharmony_ci */
243e66f31c5Sopenharmony_civoid uv__process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
244e66f31c5Sopenharmony_ci    uv_fs_event_t* handle);
245e66f31c5Sopenharmony_civoid uv__fs_event_close(uv_loop_t* loop, uv_fs_event_t* handle);
246e66f31c5Sopenharmony_civoid uv__fs_event_endgame(uv_loop_t* loop, uv_fs_event_t* handle);
247e66f31c5Sopenharmony_ci
248e66f31c5Sopenharmony_ci
249e66f31c5Sopenharmony_ci/*
250e66f31c5Sopenharmony_ci * Stat poller.
251e66f31c5Sopenharmony_ci */
252e66f31c5Sopenharmony_civoid uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle);
253e66f31c5Sopenharmony_ci
254e66f31c5Sopenharmony_ci
255e66f31c5Sopenharmony_ci/*
256e66f31c5Sopenharmony_ci * Utilities.
257e66f31c5Sopenharmony_ci */
258e66f31c5Sopenharmony_civoid uv__util_init(void);
259e66f31c5Sopenharmony_ci
260e66f31c5Sopenharmony_ciuint64_t uv__hrtime(unsigned int scale);
261e66f31c5Sopenharmony_ci__declspec(noreturn) void uv_fatal_error(const int errorno, const char* syscall);
262e66f31c5Sopenharmony_ciint uv__convert_utf16_to_utf8(const WCHAR* utf16, size_t utf16len, char** utf8);
263e66f31c5Sopenharmony_ciint uv__copy_utf16_to_utf8(const WCHAR* utf16, size_t utf16len, char* utf8, size_t *size);
264e66f31c5Sopenharmony_ciint uv__convert_utf8_to_utf16(const char* utf8, WCHAR** utf16);
265e66f31c5Sopenharmony_ci
266e66f31c5Sopenharmony_citypedef int (WINAPI *uv__peersockfunc)(SOCKET, struct sockaddr*, int*);
267e66f31c5Sopenharmony_ci
268e66f31c5Sopenharmony_ciint uv__getsockpeername(const uv_handle_t* handle,
269e66f31c5Sopenharmony_ci                        uv__peersockfunc func,
270e66f31c5Sopenharmony_ci                        struct sockaddr* name,
271e66f31c5Sopenharmony_ci                        int* namelen,
272e66f31c5Sopenharmony_ci                        int delayed_error);
273e66f31c5Sopenharmony_ci
274e66f31c5Sopenharmony_ciint uv__random_rtlgenrandom(void* buf, size_t buflen);
275e66f31c5Sopenharmony_ci
276e66f31c5Sopenharmony_ci
277e66f31c5Sopenharmony_ci/*
278e66f31c5Sopenharmony_ci * Process stdio handles.
279e66f31c5Sopenharmony_ci */
280e66f31c5Sopenharmony_ciint uv__stdio_create(uv_loop_t* loop,
281e66f31c5Sopenharmony_ci                     const uv_process_options_t* options,
282e66f31c5Sopenharmony_ci                     BYTE** buffer_ptr);
283e66f31c5Sopenharmony_civoid uv__stdio_destroy(BYTE* buffer);
284e66f31c5Sopenharmony_civoid uv__stdio_noinherit(BYTE* buffer);
285e66f31c5Sopenharmony_ciint uv__stdio_verify(BYTE* buffer, WORD size);
286e66f31c5Sopenharmony_ciWORD uv__stdio_size(BYTE* buffer);
287e66f31c5Sopenharmony_ciHANDLE uv__stdio_handle(BYTE* buffer, int fd);
288e66f31c5Sopenharmony_ci
289e66f31c5Sopenharmony_ci
290e66f31c5Sopenharmony_ci/*
291e66f31c5Sopenharmony_ci * Winapi and ntapi utility functions
292e66f31c5Sopenharmony_ci */
293e66f31c5Sopenharmony_civoid uv__winapi_init(void);
294e66f31c5Sopenharmony_ci
295e66f31c5Sopenharmony_ci
296e66f31c5Sopenharmony_ci/*
297e66f31c5Sopenharmony_ci * Winsock utility functions
298e66f31c5Sopenharmony_ci */
299e66f31c5Sopenharmony_civoid uv__winsock_init(void);
300e66f31c5Sopenharmony_ci
301e66f31c5Sopenharmony_ciint uv__ntstatus_to_winsock_error(NTSTATUS status);
302e66f31c5Sopenharmony_ci
303e66f31c5Sopenharmony_ciBOOL uv__get_acceptex_function(SOCKET socket, LPFN_ACCEPTEX* target);
304e66f31c5Sopenharmony_ciBOOL uv__get_connectex_function(SOCKET socket, LPFN_CONNECTEX* target);
305e66f31c5Sopenharmony_ci
306e66f31c5Sopenharmony_ciint WSAAPI uv__wsarecv_workaround(SOCKET socket, WSABUF* buffers,
307e66f31c5Sopenharmony_ci    DWORD buffer_count, DWORD* bytes, DWORD* flags, WSAOVERLAPPED *overlapped,
308e66f31c5Sopenharmony_ci    LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
309e66f31c5Sopenharmony_ciint WSAAPI uv__wsarecvfrom_workaround(SOCKET socket, WSABUF* buffers,
310e66f31c5Sopenharmony_ci    DWORD buffer_count, DWORD* bytes, DWORD* flags, struct sockaddr* addr,
311e66f31c5Sopenharmony_ci    int* addr_len, WSAOVERLAPPED *overlapped,
312e66f31c5Sopenharmony_ci    LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine);
313e66f31c5Sopenharmony_ci
314e66f31c5Sopenharmony_ciint WSAAPI uv__msafd_poll(SOCKET socket, AFD_POLL_INFO* info_in,
315e66f31c5Sopenharmony_ci    AFD_POLL_INFO* info_out, OVERLAPPED* overlapped);
316e66f31c5Sopenharmony_ci
317e66f31c5Sopenharmony_ci/* Whether there are any non-IFS LSPs stacked on TCP */
318e66f31c5Sopenharmony_ciextern int uv_tcp_non_ifs_lsp_ipv4;
319e66f31c5Sopenharmony_ciextern int uv_tcp_non_ifs_lsp_ipv6;
320e66f31c5Sopenharmony_ci
321e66f31c5Sopenharmony_ci/* Ip address used to bind to any port at any interface */
322e66f31c5Sopenharmony_ciextern struct sockaddr_in uv_addr_ip4_any_;
323e66f31c5Sopenharmony_ciextern struct sockaddr_in6 uv_addr_ip6_any_;
324e66f31c5Sopenharmony_ci
325e66f31c5Sopenharmony_ci/*
326e66f31c5Sopenharmony_ci * Wake all loops with fake message
327e66f31c5Sopenharmony_ci */
328e66f31c5Sopenharmony_civoid uv__wake_all_loops(void);
329e66f31c5Sopenharmony_ci
330e66f31c5Sopenharmony_ci/*
331e66f31c5Sopenharmony_ci * Init system wake-up detection
332e66f31c5Sopenharmony_ci */
333e66f31c5Sopenharmony_civoid uv__init_detect_system_wakeup(void);
334e66f31c5Sopenharmony_ci
335e66f31c5Sopenharmony_ci#endif /* UV_WIN_INTERNAL_H_ */
336