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
 CWin32Semaphore (long lInitialCount, long lMaxCount, const char *pSemaphoreName, bool bLater)
void SetHandle (HANDLE hSemaphore)
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 {
00056     //Create the semaphore
00057     m_hSemaphore=CreateSemaphore(NULL,
00058                                  lInitialCount,
00059                                  lMaxCount,
00060                                  pSemaphoreName);
00061 
00062     //Did we create the semaphore?
00063     if (!m_hSemaphore)
00064         throw std::string("Failed to create semaphore!");
00065 
00066     //Check if we are the owners
00067     if (pSemaphoreName && 
00068         GetLastError()!=ERROR_ALREADY_EXISTS)
00069         SetFirst();
00070 }

CWin32Semaphore::~CWin32Semaphore (  )  [virtual]

Definition at line 83 of file Win32Semaphore.cpp.

00084 {
00085     if (m_hSemaphore)
00086         //Close the semaphore
00087         CloseHandle(m_hSemaphore);
00088 }

CWin32Semaphore::CWin32Semaphore ( long  lInitialCount,
long  lMaxCount,
const char *  pSemaphoreName,
bool  bLater 
) [protected]

Definition at line 72 of file Win32Semaphore.cpp.

00075                                               : CGenericSemaphore(lInitialCount,
00076                                                                   lMaxCount,
00077                                                                   pSemaphoreName),
00078                                                 m_hSemaphore(NULL)
00079 
00080 {
00081 }


Member Function Documentation

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

Implements CGenericSemaphore.

Definition at line 95 of file Win32Semaphore.cpp.

00096 {
00097     DWORD dwWaitResult;
00098 
00099     //Wait for the semaphore
00100     dwWaitResult=WaitForSingleObject(m_hSemaphore,
00101                                      ulMSTimeout);
00102 
00103     //Check why did we quit
00104     return dwWaitResult==WAIT_TIMEOUT;
00105 }

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

Implements CWaitableObject.

Definition at line 124 of file Win32Semaphore.cpp.

00125 {
00126     return m_hSemaphore;
00127 }

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 107 of file Win32Semaphore.cpp.

00108 {
00109     long lOld;
00110     BOOL bResult;
00111 
00112     //Release it
00113     bResult=ReleaseSemaphore(m_hSemaphore,
00114                              lAmount,
00115                              &lOld);
00116 
00117     //Check if it's an error
00118     if (bResult)
00119         return lOld;
00120     else
00121         return -1;
00122 }

void CWin32Semaphore::ReleaseObject (  )  [virtual]

Implements CWaitableObject.

Definition at line 129 of file Win32Semaphore.cpp.

00130 {
00131     Release();
00132 }

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

Definition at line 49 of file WaitableObject.cpp.

00050 {
00051     m_bFirst=TRUE;
00052 }

void CWin32Semaphore::SetHandle ( HANDLE  hSemaphore  )  [protected]

Definition at line 90 of file Win32Semaphore.cpp.

00091 {
00092     m_hSemaphore=hSemaphore;
00093 }


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