pszName (PSZ) - input

      A pointer to the ASCIIZ name of the semaphore.

      Semaphore names are validated by the file system, and must include the prefix \SEM32\. A maximum of 255 characters is allowed. If these requirements are not met, ERROR_INVALID_NAME is returned. If the semaphore already exists, ERROR_DUPLICATE_NAME is returned.

      If this field is null, the semaphore is unnamed. Unnamed event semaphores can be either private or shared, depending on flAttr. They are identified by the semaphore handle that phev points to.

      By default, all named semaphores are shared.

    phev (PHEV) - output

      A pointer to the handle of the event semaphore.

    flAttr (ULONG) - input

      A set of flags that specify the attributes of the event semaphore.

      If the DC_SEM_SHARED bit is set, the semaphore is shared. Otherwise, this flag should be set to 0L. This bit is checked only if the semaphore is unnamed (that is, if pszName is null), because all named semaphores are shared.

    fState (BOOL32) - input

      Initial state of the semaphore.

      Possible values are defined in the list below:

    • FALSE The initial state of the semaphore is "reset."

    • TRUE
      The initial state of the semaphore is "posted."

    ulrc (APIRET) - returns

      Return Code.

      DosCreateEventSem returns one of the following values:

    • NO_ERROR 8
        ERROR_NOT_ENOUGH_MEMORY
      87
        ERROR_INVALID_PARAMETER
      123
        ERROR_INVALID_NAME
      285
        ERROR_DUPLICATE_NAME
      290
        ERROR_TOO_MANY_HANDLES
      For a full list of error codes, see Errors.


    [Back] [Next]