DosOpenQueue (OS/2 1.x)

From EDM2
Jump to: navigation, search

This call opens a queue for the current process.

Syntax

DosOpenQueue (OwnerPID, QueueHandle, QueueName)

Parameters

OwnerPID (PUSHORT) - output 
Address of the process ID of the queue owner.
QueueHandle (PHQUEUE) - output 
Address of the write handle of the queue.
QueueName (PSZ) - input 
Address of the name of the queue provided by a previous DosCreateQueue call.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 334 ERROR_QUE_NO_MEMORY
  • 343 ERROR_QUE_NAME_NOT_EXIST

Remarks

A process that creates a queue has access to it with the handle returned by DosCreateQueue. Before another process can place elements in the queue with DosWriteQueue, the process must first obtain the queue handle by issuing DosOpenQueue.

When specifying the name for the queue, the ASCIIZ name string provided must include the prefix \QUEUES\.

Bindings

C

#define INCL_DOSQUEUES

USHORT  rc = DosOpenQueue(OwnerPID, QueueHandle, QueueName);

PUSHORT OwnerPID;      /* Address to put queue owners' PID */
PHQUEUE QueueHandle;   /* Address to put handle of queue */
PSZ     QueueName;     /* Pointer to queue name string */

USHORT  rc;            /* return code */

MASM

EXTRN  DosOpenQueue:FAR
INCL_DOSQUEUES      EQU 1

PUSH@  WORD    OwnerPID      ;Queue owners' PID (returned)
PUSH@  WORD    QueueHandle   ;Queue handle (returned)
PUSH@  ASCIIZ  QueueName     ;Queue name string
CALL   DosOpenQueue

Returns WORD