3.1.4.1.24 FAX_EnumMessages (Opnum 65)

The FAX_EnumMessages (Opnum 65) method is called by the client.

In response, the server MUST validate that the hEnum argument passed by the client was created as part of a prior FAX_StartMessagesEnum (section 3.1.4.1.98) call. The server MUST validate that the dwNumMessages argument is not zero.

On success, the server MUST return information about the messages. The server MUST also return the size of the information returned and the number of messages for which it could successfully retrieve the information. The latter value MUST NOT exceed dwNumMessages.

The client SHOULD free the returned buffer.

 error_status_t FAX_EnumMessages(
   [in, ref] RPC_FAX_MSG_ENUM_HANDLE hEnum,
   [in] DWORD dwNumMessages,
   [out, size_is(, *lpdwBufferSize)] 
     LPBYTE* lppBuffer,
   [out, ref] LPDWORD lpdwBufferSize,
   [out, ref] LPDWORD lpdwNumMessagesRetrieved
 );

hEnum:  The enumeration handle returned through the lpHandle output argument by FAX_StartMessagesEnum.

dwNumMessages: A DWORD ([MS-DTYP] section 2.2.9) value indicating the maximum number of messages the caller requires to enumerate. This value MUST NOT be zero.

lppBuffer: A pointer to a buffer of FAX_MESSAGEW (section 2.2.38) structures. This buffer contains lpdwNumMessagesRetrieved entries.

lpdwBufferSize: A pointer to a DWORD in which to return the size, in bytes, of the buffer.

lpdwNumMessagesRetrieved: A pointer to a DWORD value indicating the actual number of messages retrieved. This value SHOULD NOT exceed dwNumMessages.

Return Values: This method MUST return 0x00000000 (ERROR_SUCCESS) for success; otherwise, it MUST return one of the following error codes, one of the fax-specific errors that are defined in section 2.2.52, or one of the other standard errors defined in [MS-ERREF] section 2.2.

Return value/code

Description

ERROR_NOT_ENOUGH_MEMORY

0x00000008

The fax server failed to allocate memory for the return buffer.

ERROR_INVALID_PARAMETER

0x00000057

This error code is returned if any of the following conditions are met:

§ One or more of the pointer values specified by the following arguments are NULL: lppBuffer, lpdwBufferSize, and lpdwNumMessagesRetrieved.

§ The hEnum parameter is NULL.<89>

§ The maximum number of messages, specified by the dwNumMessages argument, is set to zero.

ERROR_BUFFER_OVERFLOW

0x0000006F

The fax server encountered an integer overflow condition while processing the request for the maximum number of messages specified by the dwNumMessages argument.

ERROR_NO_MORE_ITEMS

0x00000103

No more data is available. The method reached the end of the lppBuffer message buffer and there are no more messages to be enumerated.

FAX_ERR_SRV_OUTOFMEMORY

0x00001B59

The fax server failed to allocate memory needed for internal execution of the command.

The client expects that this method is incremental and uses an internal context cursor to point to the next set of messages to retrieve for each call. The cursor is set to point to the beginning of the messages in the archive after a successful call to FAX_StartMessagesEnum. Each successful call to FAX_EnumMessages advances the cursor by the number of messages retrieved. After the cursor reaches the end of the enumeration, the method fails with the 0x00000103 (ERROR_NO_MORE_ITEMS) error code. The FAX_EndMessagesEnum (section 3.1.4.1.16) method SHOULD then be called.

Exceptions Thrown: No exceptions are thrown except those that are thrown by the underlying RPC protocol, [MS-RPCE].