# PollForMsg

Retrieves a message.

### Synopsis

`Boolean PollForMsg (Item msgPortItem, Item* msgItemPtr, Message** pMsgPtr, void** pMsgDataPtr, int32 *status)`

### Description

Retrieves a message from the specified port.`PollForMsg()` is used by the DataStreamer kernel thread and acquisition threads to poll for messages sent to them.

`PollForMsg()` calls `GetMsg()` to retrieve the message and then `LookupItem()` to find the pointer to the message. `PollForMsg()` returns immediately whether or not a is message waiting at the specified message port.

### Arguments

`msgPortItem`
  Item of the message port from which the message is retrieved.

`msgItemPtr`
  Pointer assigned to the item of the retrieved message. If `NULL`, no pointer is assigned.

`pMsgPtr`
  Pointer assigned to the retrieved message. If `NULL`, no pointer is assigned.

`pMsgDataPtr`
  Pointer assigned to data buffer of the retrieved message. If `NULL`, no pointer is assigned.

`status`
  Variable to which the Portfolio error code is assigned. `PollForMsg()` assigns status a value of zero if there were no errors.

### Return Value

Value
  Error Condition

`TRUE`
  None

`FALSE`
  `GetMsg()` or `LookupItem()` failed

See "Error Messages" in the 3DO Portfolio Reference Manual for a listing of error messages returned by `GetMsg()` or `LookupItem()`.

### Associated Files

MsgUtils.h

### See Also

`GetMsg, GetThisMsg, ReplyMsg, ReplySmallMsg, SetSCelMemoryFcns`