CDM_Unload

The CDM's last unload-time entry point that prepares the CDM for unloading and returns resources back to the system.

Thread Context:Blocking

Syntax

    LONG CDM_Unload (void);
    
    

Return Values

The following table lists return values and descriptions.

zero

Successful

nonzero

Unsuccessful

Remarks

CDM_Unload is the CDM's entry point from the OS when it receives an UNLOAD command for this CDM. CDM_Unload is then responsible for releasing all appropriate resources, cleaning up any HACBs it generated and issued, and deregistering the CDM. Upon entry into this function, the CDM needs to stay operational until all its pending I/O is flushed and NWPA stops any incoming I/O. To do this, the first call the CDM should make within CDM_Unload is to CDI_Unregister_CDM. It is during the context of CDI_Unregister_CDM that NWPA flushes pending I/O and stops new I/O for this CDM. Upon return from CDI_Unregister_CDM, the CDM is guaranteed not to have any pending I/O. It is at this point that the CDM starts cleaning up its resources.

WARNING:The CDM must abort any outstanding HACBs it generates and issues, such as Asynchronous Event Notification HACBs. Otherwise, the CDM causes the server to abend.