pszName (PSZ) - input

      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 mutex semaphores can be either private or shared, depending on flAttr They are identified by the semaphore handle that phmtx points to.

      By default, named semaphores are shared.

    phmtx (PHMTX) - output

      A pointer to the handle of the mutex semaphore.

    flAttr (ULONG) - input

      A set of flags that specify the attributes of the 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 shown in the following list:

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

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

    ulrc (APIRET) - returns

      Return Code.

      DosCreateMutexSem 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]