Prevent endless loop in except2.
[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.h"
11
12
13 /***********************************************************************
14  *      CreatePipe    (KERNEL32.170)
15  */
16 BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
17                           LPSECURITY_ATTRIBUTES sa, DWORD size )
18 {
19     struct create_pipe_request *req = get_req_buffer();
20
21     req->inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle);
22     if (server_call( REQ_CREATE_PIPE )) return FALSE;
23     *hReadPipe  = req->handle_read;
24     *hWritePipe = req->handle_write;
25     return TRUE;
26 }