3.2.4.14 Retrieving a Format Name for a Queue Context Handle

The client application is required to provide a buffer into which the format name string is to be placed.

The client MUST execute the following steps:

  • Invoke the rpc_ACHandleToFormatName method with the following parameter values:

    • hQueue := iOpenQueueContext.Handle

    • lpwcsFormatName := A Unicode character array into which the server copies a format name, or NULL.

    • dwFormatNameRPCBufferLen := The length of the lpwcsFormatName buffer; or, if lpwcsFormatName is NULL, 0x00000000.

    • pdwLength := The length of the lpwcsFormatName buffer; or, if lpwcsFormatName is NULL, 0x00000000. In the event that the buffer provided for the lpwcsFormatName parameter is not large enough to contain the resulting format name, the server sets the value of this parameter to the length of the entire format name.

  • If the rpc_ACHandleToFormatName method returns MQ_OK (0x00000000), lpwcsFormatName contains a null-terminated format name.

  • Else, if

    MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL (0xc00e001f) is returned, the server could not copy the entire format name into the buffer provided by the lpwcsFormatName parameter. The pdwLength out-parameter contains the length of the full format name including the terminating null character, in Unicode characters. Repeat the call to the rpc_ACHandleToFormatName method with a sufficiently large lpwcsFormatName buffer to retrieve the entire format name result.