NWExamineSemaphore

Returns the semaphore value

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Synchronization

Syntax

  #include <nwsync.h> 
  or 
  #include <nwcalls.h> 
   
  N_EXTERN_LIBRARY( NWCCODE )NWExamineSemaphore  ( 
     NWCONN_HANDLE   conn,  
     nuint32         semHandle,  
     pnint16         semValue,  
     pnuint16        semOpenCount);
  

Delphi Syntax

  uses calwin32 
   
  Function NWExamineSemaphore 
    (conn : NWCONN_HANDLE; 
     semHandle : nuint32; 
     semValue : pnint16; 
     semOpenCount : pnuint16 
  ) : NWCCODE;
  

Parameters

conn
(IN) Specifies the NetWare server connection handle.
semHandle
(IN) Specifies the semaphore handle obtained when the semaphore was opened by NWOpenSemaphore.
semValue
(OUT) Points to the current semaphore value (optional).
semOpenCount
(OUT) Points to the number of stations that currently have this semaphore open.

Return Values

These are common return values; see Return Values (NDK: Connection, Message, and NCP Extensions) for more information.

0x0000

SUCCESSFUL

0x8801

INVALID_CONNECTION

0x890A

NLM_INVALID_CONNECTION

0x89FF

LOCK_ERROR

Remarks

A semaphore value greater than 0 indicates the application can access the associated network resource. A negative value indicates the number of processes waiting to use the semaphore. If the semaphore value is negative, the application must either enter a waiting queue by calling NWWaitOnSemaphore or temporarily abandon its attempt to access the network resource.

semOpenCount indicates the number of processes holding the semaphore open. NWOpenSemaphore increments this value. NWCloseSemaphore decrements this value.

semValue is optional. Use NULL if a return value is not desired.

NCP Calls

See Also

NWCloseSemaphore, NWOpenSemaphore, NWSignalSemaphore, NWWaitOnSemaphore