Jump to content

DosOpenQueue (OS/2 1.x): Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call opens a queue for the current process.
This call opens a queue for the current process.


==Syntax==
==Syntax==
<PRE>
  DosOpenQueue (OwnerPID, QueueHandle, QueueName)
  DosOpenQueue


    (OwnerPID, QueueHandle, QueueName)
</PRE>
==Parameters==
==Parameters==
; OwnerPID (PUSHORT) - output : Address of the process ID of the queue owner.  
;OwnerPID (PUSHORT) - output : Address of the process ID of the queue owner.
 
;QueueHandle (PHQUEUE) - output : Address of the write handle of the queue.
; 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.
 
; QueueName (PSZ) - input : Address of the name of the queue provided by a previous DosCreateQueue call.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 NO_ERROR
Return code descriptions are:
*334 ERROR_QUE_NO_MEMORY
 
*343 ERROR_QUE_NAME_NOT_EXIST
* 0         NO_ERROR  
* 334       ERROR_QUE_NO_MEMORY  
* 343       ERROR_QUE_NAME_NOT_EXIST


==Remarks==
==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.
A process that creates a queue has access to it with the handle returned by [[DosCreateQueue (OS/2 1.x)|DosCreateQueue]]. Before another process can place elements in the queue with [[DosWriteQueue (OS/2 1.x)|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\.  
When specifying the name for the queue, the ASCIIZ name string provided must include the prefix \QUEUES\.


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
#define INCL_DOSQUEUES
#define INCL_DOSQUEUES
Line 36: Line 27:
USHORT  rc = DosOpenQueue(OwnerPID, QueueHandle, QueueName);
USHORT  rc = DosOpenQueue(OwnerPID, QueueHandle, QueueName);


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


USHORT           rc;            /* return code */
USHORT rc;            /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosOpenQueue:FAR
EXTRN  DosOpenQueue:FAR
Line 55: Line 46:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Dos16]]

Latest revision as of 23:26, 25 January 2020

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