DosOpenQueue (OS/2 1.x): Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:LEGACY:DosOpenQueue to DosOpenQueue (OS/2 1.x) |
mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This call opens a queue for the current process. | This call opens a queue for the current process. | ||
==Syntax== | ==Syntax== | ||
DosOpenQueue (OwnerPID, QueueHandle, QueueName) | |||
DosOpenQueue | |||
==Parameters== | ==Parameters== | ||
; | ;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:Return code descriptions are: | |||
*0 NO_ERROR | |||
Return code descriptions are: | *334 ERROR_QUE_NO_MEMORY | ||
*343 ERROR_QUE_NAME_NOT_EXIST | |||
* 0 | |||
* 334 | |||
* 343 | |||
==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\. | ||
== | ==Bindings== | ||
===C | ===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 | PUSHORT OwnerPID; /* Address to put queue owners' PID */ | ||
PHQUEUE | PHQUEUE QueueHandle; /* Address to put handle of queue */ | ||
PSZ | PSZ QueueName; /* Pointer to queue name string */ | ||
USHORT | USHORT rc; /* return code */ | ||
</PRE> | </PRE> | ||
===MASM | ===MASM=== | ||
<PRE> | <PRE> | ||
EXTRN DosOpenQueue:FAR | EXTRN DosOpenQueue:FAR | ||
Line 55: | Line 46: | ||
Returns WORD | Returns WORD | ||
</PRE> | </PRE> | ||
[[Category: | [[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