102 snprintf(
name,
size,
"\\\\?\\pipe\\uv\\%p-%lu", ptr, GetCurrentProcessId());
112 handle->pipe.conn.ipc_remote_pid = 0;
113 handle->pipe.conn.ipc_data_frame.payload_remaining = 0;
115 handle->pipe.conn.ipc_xfer_queue_length = 0;
117 handle->pipe.conn.non_overlapped_writes_tail =
NULL;
129 handle->pipe.conn.readfile_thread_handle =
NULL;
130 InitializeCriticalSection(&
handle->pipe.conn.readfile_thread_lock);
142 pipeHandle = CreateFileW(
name,
143 GENERIC_READ | GENERIC_WRITE,
147 FILE_FLAG_OVERLAPPED,
159 if (GetLastError() == ERROR_ACCESS_DENIED) {
160 pipeHandle = CreateFileW(
name,
161 GENERIC_READ | FILE_WRITE_ATTRIBUTES,
165 FILE_FLAG_OVERLAPPED,
174 if (GetLastError() == ERROR_ACCESS_DENIED) {
175 pipeHandle = CreateFileW(
name,
176 GENERIC_WRITE | FILE_READ_ATTRIBUTES,
180 FILE_FLAG_OVERLAPPED,
195 if (
pipe->u.fd == -1)
196 CloseHandle(
pipe->handle);
206 char*
name,
size_t nameSize) {
209 char* ptr = (
char*)
handle;
214 pipeHandle = CreateNamedPipeA(
name,
215 access | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC,
216 PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 65536, 65536, 0,
224 err = GetLastError();
225 if (
err != ERROR_PIPE_BUSY &&
err != ERROR_ACCESS_DENIED) {
233 if (CreateIoCompletionPort(pipeHandle,
237 err = GetLastError();
242 handle->handle = pipeHandle;
248 CloseHandle(pipeHandle);
258 DWORD duplex_flags) {
262 DWORD mode = PIPE_READMODE_BYTE | PIPE_WAIT;
263 DWORD current_mode = 0;
271 if (!SetNamedPipeHandleState(pipeHandle, &
mode,
NULL,
NULL)) {
272 err = GetLastError();
273 if (
err == ERROR_ACCESS_DENIED) {
280 if (!GetNamedPipeHandleState(pipeHandle, ¤t_mode,
NULL,
NULL,
283 }
else if (current_mode & PIPE_NOWAIT) {
284 SetLastError(ERROR_ACCESS_DENIED);
290 if (
err == ERROR_INVALID_PARAMETER) {
291 SetLastError(WSAENOTSOCK);
313 if (CreateIoCompletionPort(pipeHandle,
321 handle->handle = pipeHandle;
323 handle->flags |= duplex_flags;
330 uv_pipe_accept_t*
req, BOOL firstInstance) {
334 CreateNamedPipeW(
handle->name,
335 PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | WRITE_DAC |
336 (firstInstance ? FILE_FLAG_FIRST_PIPE_INSTANCE : 0),
337 PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
338 PIPE_UNLIMITED_INSTANCES, 65536, 65536, 0,
NULL);
345 if (CreateIoCompletionPort(
req->pipeHandle,
373 FlushFileBuffers(
handle->handle);
393 handle->stream.conn.write_reqs_pending == 0) {
404 req->cb(
req, UV_ECANCELED);
441 WT_EXECUTELONGFUNCTION);
451 err = GetLastError();
461 handle->reqs_pending == 0) {
475 socket = WSASocketW(FROM_PROTOCOL_INFO,
480 WSA_FLAG_OVERLAPPED);
483 if (
socket != INVALID_SOCKET)
486 handle->pipe.conn.ipc_xfer_queue_length = 0;
490 UnregisterWait(
handle->read_req.wait_handle);
494 CloseHandle(
handle->read_req.event_handle);
500 DeleteCriticalSection(&
handle->pipe.conn.readfile_thread_lock);
525 int i,
err, nameSize;
526 uv_pipe_accept_t*
req;
540 handle->pipe.serv.accept_reqs = (uv_pipe_accept_t*)
542 if (!
handle->pipe.serv.accept_reqs) {
546 for (
i = 0;
i <
handle->pipe.serv.pending_instances;
i++) {
555 nameSize = MultiByteToWideChar(CP_UTF8, 0,
name, -1,
NULL, 0) *
sizeof(WCHAR);
561 if (!MultiByteToWideChar(CP_UTF8,
566 nameSize /
sizeof(WCHAR))) {
567 err = GetLastError();
577 &
handle->pipe.serv.accept_reqs[0],
579 err = GetLastError();
580 if (
err == ERROR_ACCESS_DENIED) {
582 }
else if (
err == ERROR_PATH_NOT_FOUND ||
err == ERROR_INVALID_NAME) {
620 while (WaitNamedPipeW(
handle->name, 30000)) {
655 nameSize = MultiByteToWideChar(CP_UTF8, 0,
name, -1,
NULL, 0) *
sizeof(WCHAR);
661 if (!MultiByteToWideChar(CP_UTF8,
666 nameSize /
sizeof(WCHAR))) {
667 err = GetLastError();
673 if (GetLastError() == ERROR_PIPE_BUSY) {
677 WT_EXECUTELONGFUNCTION)) {
678 err = GetLastError();
688 err = GetLastError();
699 err = GetLastError();
716 CloseHandle(pipeHandle);
740 r = CancelIoEx(
handle->handle, &
handle->read_req.u.io.overlapped);
741 assert(
r || GetLastError() == ERROR_NOT_FOUND);
746 volatile HANDLE* thread_ptr = &
handle->pipe.conn.readfile_thread_handle;
748 EnterCriticalSection(&
handle->pipe.conn.readfile_thread_lock);
750 thread = *thread_ptr;
751 if (thread ==
NULL) {
760 r = CancelSynchronousIo(thread);
761 assert(
r || GetLastError() == ERROR_NOT_FOUND);
763 thread = *thread_ptr;
767 LeaveCriticalSection(&
handle->pipe.conn.readfile_thread_lock);
797 for (
i = 0;
i <
handle->pipe.serv.pending_instances;
i++) {
798 pipeHandle =
handle->pipe.serv.accept_reqs[
i].pipeHandle;
800 CloseHandle(pipeHandle);
831 if (
handle->reqs_pending == 0) {
841 uv_pipe_accept_t*
req, BOOL firstInstance) {
854 memset(&(
req->u.io.overlapped), 0,
sizeof(
req->u.io.overlapped));
856 if (!ConnectNamedPipe(
req->pipeHandle, &
req->u.io.overlapped) &&
857 GetLastError() != ERROR_IO_PENDING) {
858 if (GetLastError() == ERROR_PIPE_CONNECTED) {
861 CloseHandle(
req->pipeHandle);
879 uv_pipe_accept_t*
req;
885 if (
QUEUE_EMPTY(&server->pipe.conn.ipc_xfer_queue)) {
887 return WSAEWOULDBLOCK;
890 q =
QUEUE_HEAD(&server->pipe.conn.ipc_xfer_queue);
892 server->pipe.conn.ipc_xfer_queue_length--;
907 req = server->pipe.serv.pending_accepts;
911 return WSAEWOULDBLOCK;
916 pipe_client->handle =
req->pipeHandle;
920 server->pipe.serv.pending_accepts =
req->next_pending;
940 handle->stream.serv.connection_cb =
cb;
952 return ERROR_NOT_SUPPORTED;
961 handle->stream.serv.connection_cb =
cb;
966 for (
i = 0;
i <
handle->pipe.serv.pending_instances;
i++) {
975 uv_read_t*
req = (uv_read_t*)
arg;
978 volatile HANDLE* thread_ptr = &
handle->pipe.conn.readfile_thread_handle;
979 CRITICAL_SECTION*
lock = &
handle->pipe.conn.readfile_thread_lock;
990 if (!DuplicateHandle(GetCurrentProcess(),
996 DUPLICATE_SAME_ACCESS)) {
997 err = GetLastError();
1002 EnterCriticalSection(
lock);
1005 err = ERROR_OPERATION_ABORTED;
1009 *thread_ptr = thread;
1011 LeaveCriticalSection(
lock);
1019 err = GetLastError();
1022 assert(thread == *thread_ptr);
1028 EnterCriticalSection(
lock);
1029 LeaveCriticalSection(
lock);
1033 CloseHandle(thread);
1059 result = WriteFile(
handle->handle,
1060 req->write_buffer.base,
1061 req->write_buffer.len,
1084 if (!PostQueuedCompletionStatus(
handle->loop->iocp,
1085 req->u.io.overlapped.InternalHigh,
1087 &
req->u.io.overlapped)) {
1103 if (!PostQueuedCompletionStatus(
handle->loop->iocp,
1104 req->u.io.overlapped.InternalHigh,
1106 &
req->u.io.overlapped)) {
1124 handle->pipe.conn.readfile_thread_handle =
NULL;
1127 WT_EXECUTELONGFUNCTION)) {
1133 memset(&
req->u.io.overlapped, 0,
sizeof(
req->u.io.overlapped));
1140 result = ReadFile(
handle->handle,
1144 &
req->u.io.overlapped);
1146 if (!result && GetLastError() != ERROR_IO_PENDING) {
1154 if (!RegisterWaitForSingleObject(&
req->wait_handle,
1156 INFINITE, WT_EXECUTEINWAITTHREAD)) {
1184 handle->read_cb = read_cb;
1185 handle->alloc_cb = alloc_cb;
1207 if (
handle->pipe.conn.non_overlapped_writes_tail) {
1209 handle->pipe.conn.non_overlapped_writes_tail->next_req;
1211 handle->pipe.conn.non_overlapped_writes_tail =
req;
1214 handle->pipe.conn.non_overlapped_writes_tail =
req;
1222 if (
handle->pipe.conn.non_overlapped_writes_tail) {
1225 if (
req ==
handle->pipe.conn.non_overlapped_writes_tail) {
1226 handle->pipe.conn.non_overlapped_writes_tail =
NULL;
1228 handle->pipe.conn.non_overlapped_writes_tail->next_req =
1245 WT_EXECUTELONGFUNCTION)) {
1263 size_t heap_buffer_length, heap_buffer_offset;
1271 for (
i = 0;
i < nbufs;
i++)
1280 heap_buffer_length =
sizeof *coalesced_write_req +
1284 heap_buffer =
uv__malloc(heap_buffer_length);
1285 if (heap_buffer ==
NULL)
1286 return ERROR_NOT_ENOUGH_MEMORY;
1290 coalesced_write_req->
req = *user_req;
1291 coalesced_write_req->
req.coalesced = 1;
1292 coalesced_write_req->
user_req = user_req;
1293 heap_buffer_offset =
sizeof *coalesced_write_req;
1296 data_start = &heap_buffer[heap_buffer_offset];
1297 for (
i = 0;
i < nbufs;
i++) {
1298 memcpy(&heap_buffer[heap_buffer_offset],
1301 heap_buffer_offset +=
bufs[
i].len;
1303 assert(heap_buffer_offset == heap_buffer_length);
1306 *req_out = &coalesced_write_req->
req;
1307 *write_buf_out =
uv_buf_init(data_start, (
unsigned int) data_length);
1335 memset(&
req->u.io.overlapped, 0,
sizeof(
req->u.io.overlapped));
1337 req->event_handle = CreateEvent(
NULL, 0, 0,
NULL);
1338 if (
req->event_handle ==
NULL) {
1348 }
else if (nbufs == 1 && !copy_always) {
1350 write_buf =
bufs[0];
1367 err = GetLastError();
1371 req->u.io.queued_bytes = 0;
1376 handle->stream.conn.write_reqs_pending++;
1380 req->write_buffer = write_buf;
1382 if (
handle->stream.conn.write_reqs_pending == 0) {
1387 req->u.io.queued_bytes = write_buf.
len;
1388 handle->write_queue_size +=
req->u.io.queued_bytes;
1391 result = WriteFile(
handle->handle,
1395 &
req->u.io.overlapped);
1397 if (!result && GetLastError() != ERROR_IO_PENDING) {
1398 err = GetLastError();
1399 CloseHandle(
req->event_handle);
1406 req->u.io.queued_bytes = 0;
1409 req->u.io.queued_bytes = write_buf.
len;
1410 handle->write_queue_size +=
req->u.io.queued_bytes;
1411 if (WaitForSingleObject(
req->event_handle, INFINITE) !=
1413 err = GetLastError();
1414 CloseHandle(
req->event_handle);
1419 CloseHandle(
req->event_handle);
1424 handle->stream.conn.write_reqs_pending++;
1427 result = WriteFile(
handle->handle,
1431 &
req->u.io.overlapped);
1433 if (!result && GetLastError() != ERROR_IO_PENDING) {
1434 return GetLastError();
1439 req->u.io.queued_bytes = 0;
1442 req->u.io.queued_bytes = write_buf.
len;
1443 handle->write_queue_size +=
req->u.io.queued_bytes;
1447 if (!RegisterWaitForSingleObject(&
req->wait_handle,
1449 INFINITE, WT_EXECUTEINWAITTHREAD)) {
1450 return GetLastError();
1457 handle->stream.conn.write_reqs_pending++;
1470 *
pid = GetCurrentProcessId();
1480 size_t data_buf_count,
1485 size_t buf_count, buf_index;
1495 for (
i = 0;
i < data_buf_count;
i++)
1496 data_length += data_bufs[
i].
len;
1501 if (send_handle !=
NULL) {
1505 if (send_tcp_handle->type != UV_TCP)
1506 return ERROR_NOT_SUPPORTED;
1518 buf_count = 1 + data_buf_count;
1519 if (send_handle !=
NULL)
1531 return ERROR_NOT_ENOUGH_MEMORY;
1536 memset(&frame_header, 0,
sizeof frame_header);
1537 bufs[buf_index++] =
uv_buf_init((
char*) &frame_header,
sizeof frame_header);
1539 if (send_handle !=
NULL) {
1541 switch (xfer_type) {
1553 bufs[buf_index++] =
uv_buf_init((
char*) &xfer_info,
sizeof xfer_info);
1556 if (data_length > 0) {
1561 for (
i = 0;
i < data_buf_count;
i++)
1562 bufs[buf_index++] = data_bufs[
i];
1570 if (
bufs != stack_bufs) {
1623 if (
error == ERROR_BROKEN_PIPE) {
1645 handle->pipe.conn.ipc_xfer_queue_length++;
1653 DWORD bytes_read, bytes_read_now;
1656 while (bytes_read <
count) {
1658 (
char*)
buffer + bytes_read,
1662 return GetLastError();
1665 bytes_read += bytes_read_now;
1675 DWORD suggested_bytes,
1692 if (max_bytes >
buf.len)
1693 max_bytes =
buf.len;
1696 if (!ReadFile(
handle->handle,
buf.base, max_bytes, &bytes_read,
NULL)) {
1709 uint32_t* data_remaining = &
handle->pipe.conn.ipc_data_frame.payload_remaining;
1712 if (*data_remaining > 0) {
1716 *data_remaining -= bytes_read;
1728 handle->handle, &frame_header,
sizeof frame_header);
1746 }
else if (xfer_flags == 0) {
1765 return sizeof frame_header;
1776 return sizeof frame_header +
sizeof xfer_info;
1781 err = WSAECONNABORTED;
1811 if (
err != ERROR_OPERATION_ABORTED)
1834 if (bytes_read == 0)
1840 if (bytes_read > avail)
1844 avail -= bytes_read;
1863 handle->write_queue_size -=
req->u.io.queued_bytes;
1869 UnregisterWait(
req->wait_handle);
1872 if (
req->event_handle) {
1873 CloseHandle(
req->event_handle);
1883 if (
req->coalesced) {
1893 handle->stream.conn.write_reqs_pending--;
1896 handle->pipe.conn.non_overlapped_writes_tail) {
1901 if (
handle->stream.conn.shutdown_req !=
NULL &&
1902 handle->stream.conn.write_reqs_pending == 0) {
1912 uv_pipe_accept_t*
req = (uv_pipe_accept_t*) raw_req;
1925 req->next_pending =
handle->pipe.serv.pending_accepts;
1926 handle->pipe.serv.pending_accepts =
req;
1928 if (
handle->stream.serv.connection_cb) {
1933 CloseHandle(
req->pipeHandle);
2008 pipe->pipe.conn.eof_timer->data =
pipe;
2016 if (
pipe->pipe.conn.eof_timer !=
NULL) {
2025 if (
pipe->pipe.conn.eof_timer !=
NULL) {
2048 HasOverlappedIoCompleted(&
pipe->read_req.u.io.overlapped)) {
2068 if (
pipe->pipe.conn.eof_timer) {
2086 DWORD duplex_flags = 0;
2105 DUPLICATE_SAME_ACCESS))
2123 if (!(
access.AccessFlags & FILE_WRITE_DATA) ||
2124 !(
access.AccessFlags & FILE_READ_DATA)) {
2129 if (
access.AccessFlags & FILE_WRITE_DATA)
2131 if (
access.AccessFlags & FILE_READ_DATA)
2139 duplex_flags) == -1) {
2161 unsigned int name_size;
2162 unsigned int name_len;
2186 sizeof tmp_name_info,
2219 if (name_len == 0) {
2225 name_len /=
sizeof(WCHAR);
2228 addrlen = WideCharToMultiByte(CP_UTF8,
2248 addrlen = WideCharToMultiByte(CP_UTF8,
2279 return handle->pipe.conn.ipc_xfer_queue_length;
2312 if (
handle->pipe.conn.ipc_xfer_queue_length == 0)
2319 SID_IDENTIFIER_AUTHORITY sid_world = { SECURITY_WORLD_SID_AUTHORITY };
2320 PACL old_dacl, new_dacl;
2321 PSECURITY_DESCRIPTOR sd;
2334 if (!AllocateAndInitializeSid(&sid_world,
2337 0, 0, 0, 0, 0, 0, 0,
2339 error = GetLastError();
2343 if (GetSecurityInfo(
handle->handle,
2345 DACL_SECURITY_INFORMATION,
2351 error = GetLastError();
2355 memset(&ea, 0,
sizeof(EXPLICIT_ACCESS));
2357 ea.grfAccessPermissions |= GENERIC_READ | FILE_WRITE_ATTRIBUTES;
2359 ea.grfAccessPermissions |= GENERIC_WRITE | FILE_READ_ATTRIBUTES;
2360 ea.grfAccessPermissions |= SYNCHRONIZE;
2361 ea.grfAccessMode = SET_ACCESS;
2362 ea.grfInheritance = NO_INHERITANCE;
2363 ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
2364 ea.Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
2365 ea.Trustee.ptstrName = (LPTSTR)everyone;
2367 if (SetEntriesInAcl(1, &ea, old_dacl, &new_dacl)) {
2368 error = GetLastError();
2372 if (SetSecurityInfo(
handle->handle,
2374 DACL_SECURITY_INFORMATION,
2379 error = GetLastError();
2386 LocalFree((HLOCAL) new_dacl);
2388 LocalFree((HLOCAL) sd);
static mcore_handle handle
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
static static fork const void static count close
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd socket
void uv_fatal_error(const int errorno, const char *syscall)
#define DECREASE_ACTIVE_COUNT(loop, handle)
static INLINE void uv_want_endgame(uv_loop_t *loop, uv_handle_t *handle)
static INLINE HANDLE uv__get_osfhandle(int fd)
#define INCREASE_ACTIVE_COUNT(loop, handle)
#define uv__handle_close(handle)
#define DECREASE_PENDING_REQ_COUNT(handle)
#define uv__handle_closing(handle)
#define INVALID_HANDLE_VALUE
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc pid
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause access
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname pipe
static const void static count static fd struct stat static buf struct pollfd unsigned static timeout void static offset void static length char static len const struct iovec static count unsigned long static filedes static sched_yield static flags static oldfd static pause unsigned static seconds static protocol struct sockaddr addrlen
assert(limit<=UINT32_MAX/2)
#define QUEUE_DATA(ptr, type, field)
#define QUEUE_INSERT_TAIL(h, q)
#define GET_REQ_ERROR(req)
static INLINE void uv_insert_pending_req(uv_loop_t *loop, uv_req_t *req)
#define SET_REQ_SUCCESS(req)
#define UNREGISTER_HANDLE_REQ(loop, handle, req)
#define REGISTER_HANDLE_REQ(loop, handle, req)
#define POST_COMPLETION_FOR_REQ(loop, req)
#define SET_REQ_ERROR(req, error)
#define container_of(ptr, type, member)
_W64 unsigned int uintptr_t
static INLINE void uv_stream_init(uv_loop_t *loop, uv_stream_t *handle, uv_handle_type type)
static INLINE void uv_connection_init(uv_stream_t *handle)
WSAPROTOCOL_INFOW socket_info
uv__ipc_socket_xfer_info_t xfer_info
uv__ipc_socket_xfer_type_t xfer_type
UV_HANDLE_FIELDS UV_STREAM_FIELDS int ipc
int uv_pipe_bind(uv_pipe_t *handle, const char *name)
uv_handle_type uv_pipe_pending_type(uv_pipe_t *handle)
int uv_pipe_init(uv_loop_t *loop, uv_pipe_t *handle, int ipc)
int uv_pipe_pending_count(uv_pipe_t *handle)
int uv_pipe_listen(uv_pipe_t *handle, int backlog, uv_connection_cb cb)
void uv_pipe_pending_instances(uv_pipe_t *handle, int count)
void uv_pipe_connect(uv_connect_t *req, uv_pipe_t *handle, const char *name, uv_connect_cb cb)
int uv_pipe_chmod(uv_pipe_t *handle, int mode)
int uv_pipe_open(uv_pipe_t *handle, uv_file fd)
int uv_pipe_getpeername(const uv_pipe_t *handle, char *buffer, size_t *size)
int uv_pipe_getsockname(const uv_pipe_t *handle, char *buffer, size_t *size)
int uv__tcp_xfer_import(uv_tcp_t *tcp, uv__ipc_socket_xfer_type_t xfer_type, uv__ipc_socket_xfer_info_t *xfer_info)
uv__ipc_socket_xfer_type_t
@ UV__IPC_SOCKET_XFER_NONE
@ UV__IPC_SOCKET_XFER_TCP_CONNECTION
@ UV__IPC_SOCKET_XFER_TCP_SERVER
int uv__tcp_xfer_export(uv_tcp_t *handle, int pid, uv__ipc_socket_xfer_type_t *xfer_type, uv__ipc_socket_xfer_info_t *xfer_info)
static void eof_timer_stop(uv_pipe_t *pipe)
static DWORD WINAPI uv_pipe_writefile_thread_proc(void *parameter)
void uv_pipe_close(uv_loop_t *loop, uv_pipe_t *handle)
STATIC_ASSERT(sizeof(uv__ipc_frame_header_t)==16)
static void CALLBACK post_completion_write_wait(void *context, BOOLEAN timed_out)
static const int pipe_prefix_len
int uv_stdio_pipe_server(uv_loop_t *loop, uv_pipe_t *handle, DWORD access, char *name, size_t nameSize)
static int uv__pipe_write_data(uv_loop_t *loop, uv_write_t *req, uv_pipe_t *handle, const uv_buf_t bufs[], size_t nbufs, uv_write_cb cb, int copy_always)
int uv__pipe_write(uv_loop_t *loop, uv_write_t *req, uv_pipe_t *handle, const uv_buf_t bufs[], size_t nbufs, uv_stream_t *send_handle, uv_write_cb cb)
void uv_pipe_endgame(uv_loop_t *loop, uv_pipe_t *handle)
static void uv_unique_pipe_name(char *ptr, char *name, size_t size)
static DWORD WINAPI pipe_shutdown_thread_proc(void *parameter)
static void eof_timer_cb(uv_timer_t *timer)
static void uv_pipe_read_eof(uv_loop_t *loop, uv_pipe_t *handle, uv_buf_t buf)
static void eof_timer_init(uv_pipe_t *pipe)
static int uv__pipe_read_exactly(HANDLE h, void *buffer, DWORD count)
static int uv__build_coalesced_write_req(uv_write_t *user_req, const uv_buf_t bufs[], size_t nbufs, uv_write_t **req_out, uv_buf_t *write_buf_out)
static DWORD uv__pipe_get_ipc_remote_pid(uv_pipe_t *handle)
void uv__pipe_read_stop(uv_pipe_t *handle)
static DWORD uv__pipe_read_data(uv_loop_t *loop, uv_pipe_t *handle, DWORD suggested_bytes, DWORD max_bytes)
static int uv_set_pipe_handle(uv_loop_t *loop, uv_pipe_t *handle, HANDLE pipeHandle, int fd, DWORD duplex_flags)
static void eof_timer_close_cb(uv_handle_t *handle)
static void uv_insert_non_overlapped_write_req(uv_pipe_t *handle, uv_write_t *req)
void uv_process_pipe_read_req(uv_loop_t *loop, uv_pipe_t *handle, uv_req_t *req)
static DWORD WINAPI uv_pipe_zero_readfile_thread_proc(void *arg)
void uv_process_pipe_write_req(uv_loop_t *loop, uv_pipe_t *handle, uv_write_t *req)
void uv_process_pipe_shutdown_req(uv_loop_t *loop, uv_pipe_t *handle, uv_shutdown_t *req)
static void uv_pipe_queue_accept(uv_loop_t *loop, uv_pipe_t *handle, uv_pipe_accept_t *req, BOOL firstInstance)
static void eof_timer_start(uv_pipe_t *pipe)
@ UV__IPC_FRAME_VALID_FLAGS
@ UV__IPC_FRAME_HAS_SOCKET_XFER
@ UV__IPC_FRAME_XFER_FLAGS
@ UV__IPC_FRAME_XFER_IS_TCP_CONNECTION
static void CALLBACK post_completion_read_wait(void *context, BOOLEAN timed_out)
static void uv__pipe_queue_ipc_xfer_info(uv_pipe_t *handle, uv__ipc_socket_xfer_type_t xfer_type, uv__ipc_socket_xfer_info_t *xfer_info)
static void uv_pipe_read_error(uv_loop_t *loop, uv_pipe_t *handle, int error, uv_buf_t buf)
static int pipe_alloc_accept(uv_loop_t *loop, uv_pipe_t *handle, uv_pipe_accept_t *req, BOOL firstInstance)
static DWORD WINAPI pipe_connect_thread_proc(void *parameter)
static const int64_t eof_timeout
int uv_pipe_read_start(uv_pipe_t *handle, uv_alloc_cb alloc_cb, uv_read_cb read_cb)
void uv__pipe_interrupt_read(uv_pipe_t *handle)
int uv_pipe_accept(uv_pipe_t *server, uv_stream_t *client)
static void uv_pipe_read_error_or_eof(uv_loop_t *loop, uv_pipe_t *handle, int error, uv_buf_t buf)
static const int default_pending_pipe_instances
int uv__pipe_write_ipc(uv_loop_t *loop, uv_write_t *req, uv_pipe_t *handle, const uv_buf_t data_bufs[], size_t data_buf_count, uv_stream_t *send_handle, uv_write_cb cb)
void uv_process_pipe_accept_req(uv_loop_t *loop, uv_pipe_t *handle, uv_req_t *raw_req)
static void uv_pipe_queue_read(uv_loop_t *loop, uv_pipe_t *handle)
static DWORD uv__pipe_read_ipc(uv_loop_t *loop, uv_pipe_t *handle)
static void uv_queue_non_overlapped_write(uv_pipe_t *handle)
static void eof_timer_destroy(uv_pipe_t *pipe)
static int uv__pipe_getname(const uv_pipe_t *handle, char *buffer, size_t *size)
static uv_write_t * uv_remove_non_overlapped_write_req(uv_pipe_t *handle)
static HANDLE open_named_pipe(const WCHAR *name, DWORD *duplex_flags)
static void close_pipe(uv_pipe_t *pipe)
static void uv_pipe_connection_init(uv_pipe_t *handle)
void uv_pipe_cleanup(uv_loop_t *loop, uv_pipe_t *handle)
static char pipe_prefix[]
void uv_process_pipe_connect_req(uv_loop_t *loop, uv_pipe_t *handle, uv_connect_t *req)
static const uv_buf_t uv_null_buf_
static char bufs[4][128]
Buffers for uint64_to_str() and uint64_to_nicestr()
static void lock(volatile int *lk)
void error(const char *msg)
void * uv__malloc(size_t size)
void * uv__calloc(size_t count, size_t size)
@ UV_HANDLE_BLOCKING_WRITES
@ UV_HANDLE_CANCELLATION_PENDING
@ UV_HANDLE_NON_OVERLAPPED_PIPE
#define UV_REQ_INIT(req, typ)
void(* uv_write_cb)(uv_write_t *req, int status)
void(* uv_connection_cb)(uv_stream_t *server, int status)
UV_EXTERN int uv_translate_sys_error(int sys_errno)
UV_EXTERN int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
UV_EXTERN int uv_timer_init(uv_loop_t *, uv_timer_t *handle)
UV_EXTERN uv_buf_t uv_buf_init(char *base, unsigned int len)
UV_EXTERN int uv_read_stop(uv_stream_t *)
UV_EXTERN int uv_timer_stop(uv_timer_t *handle)
UV_EXTERN void uv_unref(uv_handle_t *)
void(* uv_read_cb)(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
void(* uv_alloc_cb)(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
void(* uv_connect_cb)(uv_connect_t *req, int status)
UV_EXTERN uv_pid_t uv_os_getppid(void)
sNtQueryInformationFile pNtQueryInformationFile
sRtlNtStatusToDosError pRtlNtStatusToDosError
@ FilePipeLocalInformation
#define FILE_SYNCHRONOUS_IO_NONALERT
#define FILE_SYNCHRONOUS_IO_ALERT
#define STATUS_BUFFER_OVERFLOW
if(dbg->bits==RZ_SYS_BITS_64)
static const z80_opcode fd[]