EngInitializeSafeSemaphore function (winddi.h)

The EngInitializeSafeSemaphore function initializes the specified safe semaphore.

Syntax

ENGAPI BOOL EngInitializeSafeSemaphore(
  [out] ENGSAFESEMAPHORE *pssem
);

Parameters

[out] pssem

Pointer to the driver-allocated ENGSAFESEMAPHORE structure to be initialized.

Return value

EngInitializeSafeSemaphore returns TRUE upon success. Otherwise, it returns FALSE.

Remarks

EngInitializeSafeSemaphore and EngDeleteSafeSemaphore are thread-safe, operating under a lock and maintaining a reference count on the semaphore. This guarantees that only one semaphore is created regardless of the number of simultaneous calls to it, and that the semaphore exists until the last reference to it is released.

Once the safe semaphore is initialized, the driver can call EngAcquireSemaphore and EngReleaseSemaphore with the hsem member of the ENGSAFESEMAPHORE structure for synchronization.

Callers of EngInitializeSafeSemaphore should call EngDeleteSafeSemaphore when they no longer need the semaphore.

Requirements

Requirement Value
Minimum supported client Available in Windows 2000 and later versions of the Windows operating systems.
Target Platform Universal
Header winddi.h (include Winddi.h)
Library Win32k.lib
DLL Win32k.sys

See also

ENGSAFESEMAPHORE

EngAcquireSemaphore

EngDeleteSafeSemaphore

EngIsSemaphoreOwned

EngIsSemaphoreOwnedByCurrentThread

EngReleaseSemaphore