3.1.4.1.99 FAX_StartMessagesEnumEx (Opnum 90)

The FAX_StartMessagesEnumEx (Opnum 90) method is called by the client. On success, the server MUST start enumerating messages in the specified archive folder.

Protocol version FAX_API_VERSION_0 (0x00000000), FAX_API_VERSION_1 (0x00010000), and FAX_API_VERSION_2 (0x00020000) fax servers SHOULD NOT implement this call. The fax client MUST NOT call this method if the protocol version reported by the server is FAX_API_VERSION_0 (0x00000000), FAX_API_VERSION_1 (0x00010000), or FAX_API_VERSION_2 (0x00020000). For more information, see FAX_ConnectFaxServer (section 3.1.4.1.10).

A fax client application calls the FAX_StartMessagesEnumEx to start enumerating messages from the archives. Each enumerated message has more information than those that are returned by the FAX_StartMessagesEnum (section 3.1.4.1.98) method, namely whether or not the message has a cover page, the type of receipts selected, the email address for receipts, and the flags from FAX_ENUM_MSG_FLAGS (section 2.2.53) enumeration.

The server MUST validate that the client's fax user account has access to the server. If this enumeration is attempted for all accounts, the server MUST validate that the client can query all accounts. On success, the server MUST create an enumeration handle and pass it back to the client so that the client can use the same enumeration handle for enumerating messages.

 error_status_t FAX_StartMessagesEnumEx(
   [in] handle_t hFaxHandle,
   [in] BOOL fAllAccounts,
   [in, string, unique] LPCWSTR lpcwstrAccountName,
   [in] FAX_ENUM_MESSAGE_FOLDER Folder,
   [in] DWORD level,
   [out, ref] PRPC_FAX_MSG_ENUM_HANDLE lpHandle
 );

hFaxHandle: The RPC binding handle for this call. The client SHOULD reuse the RPC binding handle used as an input hBinding argument for the FAX_ConnectFaxServer or FAX_ConnectionRefCount (section 3.1.4.1.11) method call used to connect to the fax server.

fAllAccounts: A flag indicating whether the messages for all accounts are enumerated. If this parameter is nonzero, the messages for all accounts are enumerated; otherwise, the lpcwstrAccountName parameter indicates which account is enumerated.

lpcwstrAccountName: A pointer to a constant null-terminated character string that indicates which account to enumerate. If this value is set to NULL, the current account's jobs are enumerated. Cross-account enumeration is currently not supported. The value for this parameter can be obtained using the FAX_EnumAccounts (section 3.1.4.1.18) method.

Folder: A FAX_ENUM_MESSAGE_FOLDER (section 2.2.2) enumeration that indicates the type of archive where the message resides. The FAX_MESSAGE_FOLDER_QUEUE value is invalid for this parameter.

level: A DWORD ([MS-DTYP] section 2.2.9) value that indicates the structure to return. This value MUST be set to 1.

lpHandle: A pointer to an enumeration handle return value.

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_ACCESS_DENIED

0x00000005

Access is denied. This error code is returned under any of the following conditions:

§ The caller does not have the required basic access rights to execute this call (ALL_FAX_USERS_ACCESS_RIGHTS).

§ The client's fax user account does not have access to query messages for all accounts. The value specified for the fAllAccounts parameter is not equal to zero, and the caller does not have the FAX_ACCESS_QUERY_ARCHIVES rights.

ERROR_INVALID_PARAMETER

0x00000057

The parameter is incorrect. This error code is returned under any of the following conditions:

§ The value specified for the level argument is not equal to 1.

§ The value specified for the Folder argument is not equal to FAX_MESSAGE_FOLDER_INBOX or FAX_MESSAGE_FOLDER_SENTITEMS.

§ The account name specified for the lpcwstrAccountName argument appears valid (pointer is not NULL), but the account name is not a valid fax account name.

§ The account name specified by the lpcwstrAccountName argument is a valid account name, but it refers to a different user than the caller.

ERROR_NO_MORE_ITEMS

0x00000103

No data is available. There are no messages to be enumerated.

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

A fax client application calls the FAX_StartMessagesEnumEx function to start enumerating messages in one of the archives. The enumerated messages have more information than those that are returned by FAX_StartMessagesEnum, namely, whether it has a cover page, the type of receipts selected, the email address for receipts, and the flags from FAX_ENUM_MSG_FLAGS.

The account name that lpcwstrAccountName indicates MUST be in one of the following formats. Any other format is invalid.

Format

Description

<machine_name>\<user_name>

For a local user that has machine_name as the local machine's name.

<domain_name>\<user_name>

For a nonlocal user.