CDI_Complete_Message

Informs NWPA that a message request has been completed.

Thread Context:Non-Blocking

Syntax

    LONG CDI_Complete_Message (
       LONG   msgPutHandle,
       LONG   npaCompletionCode,
       LONG   appReturnCode
       );
    
    

Parameters

msgPutHandle
(IN) Handle to the CDM message (CDMMessageStruct) from which the SuperHACB being completed was built. The value of this parameter is obtained from the msgPutHandle field of the CDMMessageStruct.
npaCompletionCode
(IN) This is zero for no error or nonzero if it should contain an error code (see the Remarks section for possible values).
appReturnCode
(IN) Application return code. This parameter passes specific information directly from the CDM to an NWPA application.

Return Values

The following table lists return values and descriptions.

zero

Successful

nonzero

Unsuccessful

Remarks

This function is used by a CDM to notify NWPA that a specific HACB request has been completed. CDI_Complete_Message is generally called within the context of the CDM's CDM_Callback function, which is the point where the CDM is notified that a HACB request has been completed. CDM_Callback is responsible for checking the value in the HACB's hacbCompletion field to determine the request's completion status. If the field value is zero, it indicates that the request completed without error, and CDI_Complete_Message should be called with npaCompletionCode = 0x00000000 (ERROR_NO_ERROR_FOUND). If the field value is nonzero, it indicates that an error occurred while processing the request. In the error case, CDM_Callback can do one of the following:

Option

Description

Option 1

Map the error into one of the NWPA completion codes applicable to the condition and call CDI_Complete_Message with npaCompletionCode equal to this code.

Option 2

Spawn a blocking, error handling thread using NPA_Spawn_Thread and return. The spawned error handling thread can request sense information and try to remedy the error. If the error is remedied and the request can be completed successfully, then CDI_Complete_Message should be called within the context of the error handling function with npaCompletionCode = 0x00000000. However, if the error cannot be remedied, then the error handling function should perform the tasks prescribed in option 1. If the error is severe enough, the device might need to be deactivated.

Additionally, CDI_Complete_Message provides the channel for a CDM to ripple specific information up to an application. For example, a tape application might require an I/O request to return the actual number of blocks read/written from/to a device. The CDM provides this information via the appReturnCode parameter.

WARNING:If a nonzero value is returned by CDM_Execute_CDMMessage, do not attempt to complete the message using CDI_Complete_Message because this abends the server.

npaCompletionCode can have the following values:

0X00000000

ERROR_NO_ERROR_FOUND

0X00000002

ERROR_MESSAGE_POSTPONED

0X00000003

ERROR_ABORT_UNCLEAN

0X00000007

ERROR_FUNCTION_NOT_SUPPORTED

0x0000000A

ERROR_ABORT_CLEAN

0x00000010

ERROR_CORRECTED_MEDIA_ERROR

0x00000011

ERROR_MEDIA_ERROR

0x00000012

ERROR_DEVICE_ERROR

0x00000013

ERROR_ADAPTER_ERROR

0x00000014

ERROR_NOT_SUPPORTED_BY_DEVICE

0x00000015

ERROR_NOT_SUPPORTED_BY_DRIVER

0x00000016

ERROR_PARAMETER_ERROR

0x00000017

ERROR_MEDIA_NOT_PRESENT

0x00000018

ERROR_MEDIA_CHANGED

0x00000019

ERROR_PREVIOUSLY_WRITTEN

0x00000037

ERROR_FAILOVER_PATH_NOT_ACTIVE

0x0000001A

ERROR_MEDIA_NOT_FORMATTED

0x0000001B

ERROR_BLANK_MEDIA

0x0000001C

ERROR_END_OF_MEDIA

0x0000001D

ERROR_FILE_MARK_DETECTED

0x0000001E

ERROR_SET_MARK_DETECTED

0x0000001F

ERROR_WRITE_PROTECTED

0x00000020

ERROR_OK_EARLY_WARNING

0x00000021

ERROR_BEGINNING_OF_MEDIA

0x00000022

ERROR_MEDIA_NOT_FOUND

0x00000023

ERROR_MEDIA_NOT_REMOVED

0x00000024

ERROR_UNKNOWN_COMPLETION

0x00000028

ERROR_IO_ERROR

0x00000029

ERROR_CHANGER_SOURCE_EMPTY

0x0000002A

ERROR_CHANGER_DEST_FULL

0x0000002B

ERROR_CHANGER_JAMMED

0x0000002D

ERROR_MAGAZINE_NOT_PRESENT

0x0000002E

ERROR_MAGAZINE_SOURCE_EMPTY

0x0000002F

ERROR_MAGAZINE_DEST_FULL

0x00000030

ERROR_MAGAZINE_JAMMED

0x00000031

ERROR_ABORT_CAUSED_PRIOR_ERROR

0x00000032

ERROR_CHANGER_ERROR

0x00000033

ERROR_MAGAZINE_ERROR

0x00000034

ERROR_BLOCKSIZE_MISMATCH

0x00000035

ERROR_DECOMPRESSION_ALGORITHM_MISMATCH