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

00047                                                                                              : CGenericSemaphore(lInitialCount,lMaxCount,pSemaphoreName),
00048                                                                                                  m_hSemaphore(0),
00049                                                                                                  m_bDontDelete(FALSE)
00050 {
00051     //Create the semaphore
00052     m_hSemaphore=CreateSemaphore(NULL,
00053                                  lInitialCount,
00054                                  lMaxCount,
00055                                  pSemaphoreName);
00056 
00057     //Check if we are the owners
00058     if (pSemaphoreName && 
00059         GetLastError()!=ERROR_ALREADY_EXISTS)
00060         SetFirst();
00061 }

CWin32Semaphore::~CWin32Semaphore (  )  [virtual]

Definition at line 63 of file Win32Semaphore.cpp.

00064 {
00065     if (m_hSemaphore)
00066         //Close the semaphore
00067         CloseHandle(m_hSemaphore);
00068 }


Member Function Documentation

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

Implements CGenericSemaphore.

Definition at line 70 of file Win32Semaphore.cpp.

00071 {
00072     DWORD dwWaitResult;
00073 
00074     //Wait for the semaphore
00075     dwWaitResult=WaitForSingleObject(m_hSemaphore,ulMSTimeout);
00076 
00077     //Check why did we quit
00078     return dwWaitResult==WAIT_TIMEOUT;
00079 }

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

Implements CWaitableObject.

Definition at line 96 of file Win32Semaphore.cpp.

00097 {
00098     return m_hSemaphore;
00099 }

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

00082 {
00083     long lOld;
00084     BOOL bResult;
00085 
00086     //Release it
00087     bResult=ReleaseSemaphore(m_hSemaphore,lAmount,&lOld);
00088 
00089     //Check if it's an error
00090     if (bResult)
00091         return lOld;
00092     else
00093         return -1;
00094 }

void CWin32Semaphore::ReleaseObject (  )  [virtual]

Implements CWaitableObject.

Definition at line 101 of file Win32Semaphore.cpp.

00102 {
00103     Release();
00104 }

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: