osMailboxPeek function
Declaration:
SIZE osMailboxPeek(
  HANDLE Handle
  PVOID Buffer,
  SIZE Size
);
Parameters:
Handle

The handle to the mailbox object.

Buffer

A pointer to the buffer that will receive the message data.

Size

The maximum number of bytes to be read into the buffer.

Return value:

Returns the number of bytes successfully transferred, or zero on failure. Call the osGetLastError function to retrieve extended error information.

Description:

This function reads the message at the front of the mailbox without removing it. If the mailbox is empty, the function will fail.

When using this function, access to the mailbox must be synchronized during the data copy operation. For further information regarding mailbox functionality and synchronization requirements, refer to the mailbox objects section.

This function is available only when both the OS_USE_MAILBOX and OS_MBOX_PEEK_FUNC constants are set to 1.

Version:1.0
Header file:OS_Mailbox.h (include OS_API.h)
See also: HANDLE, mailboxes, OS_MBOX_PEEK_FUNC, OS_USE_MAILBOX, osCreateMailbox, osGetLastError, osMailboxPost, osMailboxPend, PVOID, SIZE
SpaceShadow documentation