OpenLocalSemaphore
Allocates a local semaphore and gives the NLM access to it
#include <nwsemaph.h>
LONG OpenLocalSemaphore (
LONG initialValue);
If successful, returns a semaphore handle. On failure, returns zero.
This function creates and initializes the semaphore to initialValue. The initialValue parameter indicates the number of threads that can access the resource at a time. A call to SignalLocalSemaphore increments this value. A call to WaitOnLocalSemaphore decrements this value.
WARNING:Developers must make sure to close local semaphores that are opened in an NLM because they are not automatically closed when an NLM unloads. If a local semaphore is opened but not closed before the NLM unloads, the server abends.