1998-12-30 13:08:20 +01:00
|
|
|
/*
|
|
|
|
* Win32 pipes
|
|
|
|
*
|
|
|
|
* Copyright 1998 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include "winerror.h"
|
1999-02-28 14:27:56 +01:00
|
|
|
#include "winbase.h"
|
1998-12-30 13:08:20 +01:00
|
|
|
#include "server/request.h"
|
|
|
|
#include "server.h"
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CreatePipe (KERNEL32.170)
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
|
1998-12-30 13:08:20 +01:00
|
|
|
LPSECURITY_ATTRIBUTES sa, DWORD size )
|
|
|
|
{
|
|
|
|
struct create_pipe_request req;
|
|
|
|
struct create_pipe_reply reply;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
req.inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle);
|
|
|
|
CLIENT_SendRequest( REQ_CREATE_PIPE, -1, 1, &req, sizeof(req) );
|
|
|
|
if (CLIENT_WaitReply( &len, NULL, 1, &reply, sizeof(reply) ) != ERROR_SUCCESS)
|
|
|
|
return FALSE;
|
1999-02-28 14:27:56 +01:00
|
|
|
*hReadPipe = reply.handle_read;
|
|
|
|
*hWritePipe = reply.handle_write;
|
1998-12-30 13:08:20 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|