Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>
[wine] / scheduler / pipe.c
1 /*
2  * Win32 pipes
3  *
4  * Copyright 1998 Alexandre Julliard
5  */
6
7 #include <assert.h>
8 #include "winerror.h"
9 #include "winbase.h"
10 #include "server/request.h"
11 #include "server.h"
12
13
14 /***********************************************************************
15  *      CreatePipe    (KERNEL32.170)
16  */
17 BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
18                           LPSECURITY_ATTRIBUTES sa, DWORD size )
19 {
20     struct create_pipe_request req;
21     struct create_pipe_reply reply;
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;
28     *hReadPipe  = reply.handle_read;
29     *hWritePipe = reply.handle_write;
30     return TRUE;
31 }