Specifications
Operating System Routines
EXE$WRTMAILBOX
EXE$WRTMAILBOX
Sends a message to a mailbox.
Module
MBDRIVER
Input
Location Contents
R3 Message size
R4 Message address
R5 Address of mailbox UCB
Mailbox UCB fields
Output
Location Contents
R0 SS$_NORMAL, SS$_MBTOOSML, SS$_MBFULL,
SS$_INSFMEM, or SS$_NOPRIV
R1 and R2 Destroyed
Synchronization
Because EXE$WRTMAILBOX raises IPL to IPL$_MAILBOX and obtains the
MAILBOX spinlock in a multiprocessing environment, its caller cannot be
executing above IPL$_MAILBOX. EXE$WRTMAILBOX returns control to its
caller at the caller’s IPL. The caller retains any spinlocks it held at the time of
the call.
Description
EXE$WRTMAILBOX checks fields in the mailbox UCB (UCB$W_BUFQUO,
UCB$W_DEVBUFSIZ) to determine whether it can deliver a message of the
specified size to the mailbox. It also checks fields in the associated ORB to
determine whether the caller is sufficiently privileged to write to the mailbox.
Finally, it calls EXE$ALONONPAGED to allocate a block of nonpaged pool to
contain the message. If it fails any of these operations, EXE$WRTMAILBOX
returns error status to its caller.
If it is successful thus far, EXE$WRTMAILBOX creates a message and delivers it
to the mailbox’s message queue, adjusts its UCB fields accordingly, and returns
success status to its caller.
3–68