Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.24 KB

OpenSemaphore.md

File metadata and controls

53 lines (37 loc) · 1.24 KB

Home

Function name : OpenSemaphore

Group: Synchronization - Library: kernel32


The OpenSemaphore function returns a handle of an existing named semaphore object


Code examples:

Using the Semaphore object
Using the Semaphore object to allow only one instance of VFP application running

Declaration:

HANDLE OpenSemaphore(
  DWORD dwDesiredAccess,  // access
  BOOL bInheritHandle,    // inheritance option
  LPCTSTR lpName          // object name
);  

FoxPro declaration:

DECLARE INTEGER OpenSemaphore IN kernel32;
	INTEGER dwDesiredAccess,;
	INTEGER bInheritHandle,;
	STRING  lpName
  

Parameters:

fdwAccess Specifies the requested access to the semaphore object

fInherit Specifies whether the returned handle is inheritable

lpszSemName Points to a null-terminated string that names the semaphore to be opened. Name comparisons are case sensitive


Return value:

If the function succeeds, the return value is a handle of the semaphore object