This call opens an existing system semaphore that has been created by another process.
DosOpenSem
SemHandle (PHSEM) - output
A system semaphore that is created by a call to DosCreateSem with NoExclusive=1 specified returns a handle, which the creating process uses to access the semaphore. Another process that needs to access the semaphore must call DosOpenSem after the semaphore's creation. DosOpenSem merely returns the handle of the semaphore; it does not test or change the value of the semaphore.
If a process has access to any semaphores at the time it issues DosExecPgm to start a child process, the new process inherits the handles to these semaphores. However, the new process initially does not own any inherited semaphores, even if the parent process owns them at the time the child process is started. Semaphore ownership is obtained by a successful DosSemRequest call, and only one process can own the semaphore at a time.
When the last process that opened a particular semaphore with a DosCreateSem or DosOpenSem request closes its handle with a DosCloseSem request, the semaphore is deleted from memory and must be be redefined by its next user with a call to DosCreateSem.