22 #ifndef UV_WIN_REQ_INL_H_
23 #define UV_WIN_REQ_INL_H_
31 #define SET_REQ_STATUS(req, status) \
32 (req)->u.io.overlapped.Internal = (ULONG_PTR) (status)
34 #define SET_REQ_ERROR(req, error) \
35 SET_REQ_STATUS((req), NTSTATUS_FROM_WIN32((error)))
40 #define SET_REQ_SUCCESS(req) \
41 SET_REQ_STATUS((req), STATUS_SUCCESS)
43 #define GET_REQ_STATUS(req) \
44 ((NTSTATUS) (req)->u.io.overlapped.Internal)
46 #define REQ_SUCCESS(req) \
47 (NT_SUCCESS(GET_REQ_STATUS((req))))
49 #define GET_REQ_ERROR(req) \
50 (pRtlNtStatusToDosError(GET_REQ_STATUS((req))))
52 #define GET_REQ_SOCK_ERROR(req) \
53 (uv_ntstatus_to_winsock_error(GET_REQ_STATUS((req))))
56 #define REGISTER_HANDLE_REQ(loop, handle, req) \
58 INCREASE_ACTIVE_COUNT((loop), (handle)); \
59 uv__req_register((loop), (req)); \
62 #define UNREGISTER_HANDLE_REQ(loop, handle, req) \
64 DECREASE_ACTIVE_COUNT((loop), (handle)); \
65 uv__req_unregister((loop), (req)); \
69 #define UV_SUCCEEDED_WITHOUT_IOCP(result) \
70 ((result) && (handle->flags & UV_HANDLE_SYNC_BYPASS_IOCP))
72 #define UV_SUCCEEDED_WITH_IOCP(result) \
73 ((result) || (GetLastError() == ERROR_IO_PENDING))
76 #define POST_COMPLETION_FOR_REQ(loop, req) \
77 if (!PostQueuedCompletionStatus((loop)->iocp, \
80 &((req)->u.io.overlapped))) { \
81 uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus"); \
86 return CONTAINING_RECORD(overlapped,
uv_req_t, u.io.overlapped);
92 if (
loop->pending_reqs_tail) {
100 current = current->next_req;
101 }
while(current !=
loop->pending_reqs_tail);
104 req->next_req =
loop->pending_reqs_tail->next_req;
105 loop->pending_reqs_tail->next_req =
req;
114 #define DELEGATE_STREAM_REQ(loop, req, method, handle_at) \
116 switch (((uv_handle_t*) (req)->handle_at)->type) { \
118 uv_process_tcp_##method##_req(loop, \
119 (uv_tcp_t*) ((req)->handle_at), \
123 case UV_NAMED_PIPE: \
124 uv_process_pipe_##method##_req(loop, \
125 (uv_pipe_t*) ((req)->handle_at), \
130 uv_process_tty_##method##_req(loop, \
131 (uv_tty_t*) ((req)->handle_at), \
146 if (
loop->pending_reqs_tail ==
NULL)
149 first =
loop->pending_reqs_tail->next_req;
153 while (next !=
NULL) {
155 next =
req->next_req != first ?
req->next_req :
NULL;
205 case UV_PROCESS_EXIT:
209 case UV_FS_EVENT_REQ:
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
void uv_process_fs_event_req(uv_loop_t *loop, uv_req_t *req, uv_fs_event_t *handle)
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 accept
assert(limit<=UINT32_MAX/2)
#define DELEGATE_STREAM_REQ(loop, req, method, handle_at)
static INLINE void uv_insert_pending_req(uv_loop_t *loop, uv_req_t *req)
static INLINE int uv_process_reqs(uv_loop_t *loop)
static INLINE uv_req_t * uv_overlapped_to_req(OVERLAPPED *overlapped)
void uv_process_poll_req(uv_loop_t *loop, uv_poll_t *handle, uv_req_t *req)
void uv_process_pipe_shutdown_req(uv_loop_t *loop, uv_pipe_t *handle, uv_shutdown_t *req)
void uv_process_udp_recv_req(uv_loop_t *loop, uv_udp_t *handle, uv_req_t *req)
void uv_process_proc_exit(uv_loop_t *loop, uv_process_t *handle)
void uv_process_udp_send_req(uv_loop_t *loop, uv_udp_t *handle, uv_udp_send_t *req)
void uv_process_signal_req(uv_loop_t *loop, uv_signal_t *handle, uv_req_t *req)
void uv_process_async_wakeup_req(uv_loop_t *loop, uv_async_t *handle, uv_req_t *req)
int read(izstream &zs, T *x, Items items)