CDI_Complete_Message
Informs NWPA that a message request has been completed.
LONG CDI_Complete_Message ( LONG msgPutHandle, LONG npaCompletionCode, LONG appReturnCode );
The following table lists return values and descriptions.
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: