ExamineSemaphore
Returns the current value and open count of a local semaphore
#include <\nlm\nit\nwsync.h>
int ExamineSemaphore (
long semaphoreHandle,
int *semaphoreValue,
WORD *openCount);
For cross-platform functionality, call NWExamineSemaphore.
The semaphoreValue is decremented for each WaitOnSemaphore and incremented for each SignalSemaphore. A positive semaphoreValue indicates that the application can access the associated network resource. If semaphoreValue is zero or negative, the application must either enter a waiting queue by calling the function WaitOnSemaphore, or temporarily abandon its attempt to access the network resource.
The openCount indicates the number of processes holding the semaphore open. OpenSemaphore increments this value. CloseSemaphore decrements this value.
CloseSemaphore, OpenSemaphore, SignalSemaphore, WaitOnSemaphore