Retail products


Traffic interception SDK

Control every TCP/IP network connection

  • Route connections via proxy
  • Redirect connections and modify the data
  • Block connections and applications
SSL interception SDK

View SSL in plaintext and modify it

  • View the SSL stream decrypted in plaintext
  • Redirect SSL connection and modify decrypted data
  • Browser shows "SSL lock" without warnings

Documentation


CWin32Semaphore Class Reference

#include <Win32Semaphore.h>

Inheritance diagram for CWin32Semaphore:
Collaboration diagram for CWin32Semaphore:

List of all members.


Public Member Functions

virtual void ReleaseObject ()
virtual BOOL Aquire (unsigned long ulMSTimeout=INFINITE)
virtual long Release (long lAmount=1)
 CWin32Semaphore (long lInitialCount, long lMaxCount, const char *pSemaphoreName=NULL)
virtual ~CWin32Semaphore ()
virtual BOOL IsFirst () const

Protected Member Functions

virtual HANDLE GetHandle () const
void SetFirst ()

Detailed Description

Definition at line 47 of file Win32Semaphore.h.


Constructor & Destructor Documentation

KOMODIA_NAMESPACE_START CWin32Semaphore::CWin32Semaphore ( long  lInitialCount,
long  lMaxCount,
const char *  pSemaphoreName = NULL 
)

Definition at line 49 of file Win32Semaphore.cpp.

00051                                                              : CGenericSemaphore(lInitialCount,
00052                                                                                  lMaxCount,
00053                                                                                  pSemaphoreName),
00054                                                                m_hSemaphore(0),
00055                                                                m_bDontDelete(FALSE)
00056 {
00057     //Create the semaphore
00058     m_hSemaphore=CreateSemaphore(NULL,
00059                                  lInitialCount,
00060                                  lMaxCount,
00061                                  pSemaphoreName);
00062 
00063     //Did we create the semaphore?
00064     if (!m_hSemaphore)
00065         throw std::string("Failed to create semaphore!");
00066 
00067     //Check if we are the owners
00068     if (pSemaphoreName && 
00069         GetLastError()!=ERROR_ALREADY_EXISTS)
00070         SetFirst();
00071 }

CWin32Semaphore::~CWin32Semaphore (  )  [virtual]

Definition at line 73 of file Win32Semaphore.cpp.

00074 {
00075     if (m_hSemaphore)
00076         //Close the semaphore
00077         CloseHandle(m_hSemaphore);
00078 }


Member Function Documentation

BOOL CWin32Semaphore::Aquire ( unsigned long  ulMSTimeout = INFINITE  )  [virtual]

Implements CGenericSemaphore.

Definition at line 80 of file Win32Semaphore.cpp.

00081 {
00082     DWORD dwWaitResult;
00083 
00084     //Wait for the semaphore
00085     dwWaitResult=WaitForSingleObject(m_hSemaphore,
00086                                      ulMSTimeout);
00087 
00088     //Check why did we quit
00089     return dwWaitResult==WAIT_TIMEOUT;
00090 }

HANDLE CWin32Semaphore::GetHandle (  )  const [protected, virtual]

Implements CWaitableObject.

Definition at line 109 of file Win32Semaphore.cpp.

00110 {
00111     return m_hSemaphore;
00112 }

BOOL CWaitableObject::IsFirst (  )  const [virtual, inherited]

Definition at line 54 of file WaitableObject.cpp.

00055 {
00056     return m_bFirst;
00057 }

long CWin32Semaphore::Release ( long  lAmount = 1  )  [virtual]

Implements CGenericSemaphore.

Definition at line 92 of file Win32Semaphore.cpp.

00093 {
00094     long lOld;
00095     BOOL bResult;
00096 
00097     //Release it
00098     bResult=ReleaseSemaphore(m_hSemaphore,
00099                              lAmount,
00100                              &lOld);
00101 
00102     //Check if it's an error
00103     if (bResult)
00104         return lOld;
00105     else
00106         return -1;
00107 }

void CWin32Semaphore::ReleaseObject (  )  [virtual]

Implements CWaitableObject.

Definition at line 114 of file Win32Semaphore.cpp.

00115 {
00116     Release();
00117 }

void CWaitableObject::SetFirst (  )  [protected, inherited]

Definition at line 49 of file WaitableObject.cpp.

00050 {
00051     m_bFirst=TRUE;
00052 }


The documentation for this class was generated from the following files: