1 #ifndef CRYPTOPP_WINPIPES_H 2 #define CRYPTOPP_WINPIPES_H 6 #if !defined(NO_OS_DEPENDENCE) && defined(WINDOWS_PIPES_AVAILABLE) 19 WindowsHandle(HANDLE h = INVALID_HANDLE_VALUE,
bool own=
false);
20 WindowsHandle(
const WindowsHandle &h) : m_h(h.m_h), m_own(
false) {}
21 virtual ~WindowsHandle();
23 bool GetOwnership()
const {
return m_own;}
24 void SetOwnership(
bool own) {m_own = own;}
26 operator HANDLE()
const {
return m_h;}
27 HANDLE GetHandle()
const {
return m_h;}
28 bool HandleValid()
const;
29 void AttachHandle(HANDLE h,
bool own=
false);
30 HANDLE DetachHandle();
34 virtual void HandleChanged() {}
47 Err(HANDLE h,
const std::string& operation,
int error);
48 HANDLE GetHandle()
const {
return m_h;}
55 virtual HANDLE GetHandle()
const =0;
56 virtual void HandleError(
const char *operation)
const;
57 void CheckAndHandleError(
const char *operation, BOOL result)
const 58 {assert(result==TRUE || result==FALSE);
if (!result) HandleError(operation);}
67 bool MustWaitForResult() {
return true;}
68 bool Receive(byte* buf,
size_t bufLen);
69 unsigned int GetReceiveResult();
70 bool EofReceived()
const {
return m_eofReceived;}
72 HANDLE GetHandle()
const {
return m_event;}
78 OVERLAPPED m_overlapped;
90 bool MustWaitForResult() {
return true;}
91 void Send(
const byte* buf,
size_t bufLen);
92 unsigned int GetSendResult();
93 bool MustWaitForEof() {
return false; }
96 HANDLE GetHandle()
const {
return m_event;}
102 OVERLAPPED m_overlapped;
103 bool m_resultPending;
122 HANDLE GetHandle()
const {
return WindowsHandle::GetHandle();}
130 WindowsPipeSink(HANDLE h=INVALID_HANDLE_VALUE,
unsigned int maxBufferSize=0,
unsigned int autoFlushBound=16*1024)
137 HANDLE GetHandle()
const {
return WindowsHandle::GetHandle();}
143 #endif // WINDOWS_PIPES_AVAILABLE
container of wait objects
The operating system reported an error.
unsigned int GetMaxWaitObjectCount() const
Maximum number of wait objects that this object can return.
Abstract base classes that provide a uniform interface to this library.
unsigned int GetMaxWaitObjectCount() const
Maximum number of wait objects that this object can return.
Library configuration file.
Pipe-based implementation of NetworkReceiver.
void GetWaitObjects(WaitObjectContainer &container, CallStack const &callStack)
Retrieves waitable objects.
unsigned int GetMaxWaitObjectCount() const
Retrieves the maximum number of waitable objects.
Pipe-based implementation of NetworkSender.
Classes for an unlimited queue to store bytes.
void GetWaitObjects(WaitObjectContainer &container, CallStack const &callStack)
Retrieves waitable objects.
unsigned int GetMaxWaitObjectCount() const
Retrieves the maximum number of waitable objects.
Crypto++ library namespace.