Alexandre Julliard | 942e6d7 | 1998-12-30 12:08:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Win32 pipes |
| 3 | * |
| 4 | * Copyright 1998 Alexandre Julliard |
| 5 | */ |
| 6 | |
| 7 | #include <assert.h> |
Alexandre Julliard | 942e6d7 | 1998-12-30 12:08:20 +0000 | [diff] [blame] | 8 | #include "winerror.h" |
Alexandre Julliard | 96c08d8 | 1999-02-28 13:27:56 +0000 | [diff] [blame] | 9 | #include "winbase.h" |
Alexandre Julliard | 942e6d7 | 1998-12-30 12:08:20 +0000 | [diff] [blame] | 10 | #include "server/request.h" |
| 11 | #include "server.h" |
| 12 | |
Alexandre Julliard | 942e6d7 | 1998-12-30 12:08:20 +0000 | [diff] [blame] | 13 | |
| 14 | /*********************************************************************** |
| 15 | * CreatePipe (KERNEL32.170) |
| 16 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 17 | BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, |
Alexandre Julliard | 942e6d7 | 1998-12-30 12:08:20 +0000 | [diff] [blame] | 18 | LPSECURITY_ATTRIBUTES sa, DWORD size ) |
| 19 | { |
| 20 | struct create_pipe_request req; |
| 21 | struct create_pipe_reply reply; |
Alexandre Julliard | 942e6d7 | 1998-12-30 12:08:20 +0000 | [diff] [blame] | 22 | int len; |
| 23 | |
| 24 | req.inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle); |
| 25 | CLIENT_SendRequest( REQ_CREATE_PIPE, -1, 1, &req, sizeof(req) ); |
| 26 | if (CLIENT_WaitReply( &len, NULL, 1, &reply, sizeof(reply) ) != ERROR_SUCCESS) |
| 27 | return FALSE; |
Alexandre Julliard | 96c08d8 | 1999-02-28 13:27:56 +0000 | [diff] [blame] | 28 | *hReadPipe = reply.handle_read; |
| 29 | *hWritePipe = reply.handle_write; |
Alexandre Julliard | 942e6d7 | 1998-12-30 12:08:20 +0000 | [diff] [blame] | 30 | return TRUE; |
| 31 | } |