DosResetEventSem

Syntax
DosResetEventSem( hevSemaphore, pulPostCount )

Parameters

 * HEV hevSemaphore (input):The handle of the semaphore to be reset.
 * PUL pulPostCount (output):The post count of the semaphore that was reset. This can not be set to NULL, it must be a valid pointer to ULONG.

Returns

 * APIRET rc:The following values can be returned:

Usage Explanation
DosResetEventSem resets the post count of an event semaphore.

Gotchas
The process calling DosResetEventSem must first obtain access to the semaphore in question or ERROR_INVALID_HANDLE will be returned.

Sample Code

 * 1) define INCL_DOSSEMAPHORES
 * 2) include 

HEV hevMySemaphore;     /* MySemaphore handle */ ULONG PostCount         /* storage for the post count of MySemaphore */

/* access is gained to the semaphore in question */ /* either by DosCreateEventSem ... */	/* ... or by DosOpenEventSem */ /* its handle is placed in hevMySemaphore */

/* process becomes owner of semaphore */ /* by way of successful call to DosRequestEventSem */

rc = DosResetEventSem(hevMySemaphore, &PostCount);

if (rc != 0) {	 /* We got an error to take care of. */	}