From 842d0f7290d2ac08f9e3a149363477274b9b95cd Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 14 Aug 2017 22:19:28 +0000 Subject: __ntapi_ipc_create_pipe(): refine, change polling strategy. The canonical way of polling an i/o handle by requesting a zero-byte read/write operation and then waiting on the event (or apc routine) that was specified for that i/o operation fails to work on the writing end of a byte-stream pipe. Specifically, the request completes immediately, therefore not allowing us to employ it for a controlled poll operation. Following this patch, the writing end of the pipe is opened with the NT_FILE_SYNCHRONOUS_IO_ALERT flag set. With this flag set, zero-byte writes block, which makes them perfectly suitable for a polling operation, but less so for non-blocking i/o. With some effort, however, the latter can be achieved and be both robust and reliable. --- include/ntapi/nt_ipc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/ntapi/nt_ipc.h b/include/ntapi/nt_ipc.h index 80760c1..ad5aacd 100644 --- a/include/ntapi/nt_ipc.h +++ b/include/ntapi/nt_ipc.h @@ -30,7 +30,7 @@ typedef int32_t __stdcall ntapi_ipc_create_pipe( __out void ** hpipe_read, __out void ** hpipe_write, - __in uint32_t advisory_buffer_size __optional); + __in uint32_t advisory_buffer_size); typedef int32_t __stdcall ntapi_ipc_connect_by_attr( -- cgit v1.2.3