19 #define EXPORT_PIPE_API
21 //============================================================================
23 //============================================================================
25 // Because the value of an invalid HANDLE returned by API functions differs
26 // between different functions and differs on different Windows platforms,
27 // this function checks wether the handle has a meaningfull value.
30 #define IsValidHandle( handle ) ((DWORD)(handle) + 1 > 1)
34 inline bool IsValidHandle( HANDLE handle
)
36 return INVALID_HANDLE_VALUE
!= handle
&& NULL
!= handle
;
44 EXPORT_PIPE_API HANDLE WINAPI
CreateSimplePipeA( LPCSTR lpName
);
45 EXPORT_PIPE_API HANDLE WINAPI
CreateSimplePipeW( LPCWSTR lpName
);
48 #define CreateSimplePipe CreateSimplePipeW
50 #define CreateSimplePipe CreateSimplePipeA
53 EXPORT_PIPE_API HANDLE WINAPI
OpenSimplePipeA( LPCSTR lpName
);
54 EXPORT_PIPE_API HANDLE WINAPI
OpenSimplePipeW( LPCWSTR lpName
);
57 #define OpenSimplePipe OpenSimplePipeW
59 #define OpenSimplePipe OpenSimplePipeA
62 EXPORT_PIPE_API HANDLE WINAPI
AcceptSimplePipeConnection( HANDLE hPipe
);
64 EXPORT_PIPE_API BOOL WINAPI
WaitForSimplePipeA( LPCSTR lpName
, DWORD dwTimeOut
);
65 EXPORT_PIPE_API BOOL WINAPI
WaitForSimplePipeW( LPCWSTR lpName
, DWORD dwTimeOut
);
68 #define WaitForSimplePipe WaitForSimplePipeW
70 #define WaitForSimplePipe WaitForSimplePipeA
74 EXPORT_PIPE_API BOOL WINAPI
WriteSimplePipe( HANDLE hPipe
, LPCVOID lpBuffer
, DWORD dwBytesToWrite
, LPDWORD lpBytesWritten
, BOOL bWait
);
75 EXPORT_PIPE_API BOOL WINAPI
ReadSimplePipe( HANDLE hPipe
, LPVOID lpBuffer
, DWORD dwBytesToRead
, LPDWORD lpBytesRead
, BOOL bWait
);
76 EXPORT_PIPE_API BOOL WINAPI
CloseSimplePipe( HANDLE hPipe
);
82 #endif // _PIPEIMPL_H_