next up previous contents
Next: 2.10 WD_CardUnregister() Up: 2. WD_xxx PCI/PCMCIA/ISA Functions Previous: 2.8 WD_CardRegister()   Contents


2.9 WD_CardCleanupSetup()


PURPOSE

$\bullet$Sets a list of transfer cleanup commands to be performed for the specified card on any of the following occasions:


PROTOTYPE

DWORD WD_CardCleanupSetup(
    HANDLE hWD,
    WD_CARD_CLEANUP *pCardCleanup)


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pCardCleanup WD_CARD_CLEANUP*  
$\gg$hCard DWORD Input
$\gg$Cmds WD_TRANSFER* Input
$\gg$dwCmds DWORD Input
$\gg$dwOptions DWORD Input


DESCRIPTION

Name Description
hWD Handle to WinDriver's kernel-mode driver as received from WD_Open() [5.2]
pCardCleanup Pointer to a card clean-up information structure:
$\bullet$ hCard Handle to the relevant card as received from WD_CardRegister() [2.8]
$\bullet$ Cmds Pointer to an array of cleanup transfer commands to be performed
$\bullet$ dwCmds Number of cleanup commands in the Cmds array
$\bullet$ bForceCleanup If 0: The cleanup transfer commands (Cmd) will be performed in either of the following cases:
$\bullet$When the application exist abnormally.
$\bullet$When the application exits normally but without calling WD_CardUnregister() [2.10] to un-register the card.

If the WD_FORCE_CLEANUP flag is set: The cleanup transfer commands will be performed both in the two cases described above, as well as in the following case:
$\bullet$When WD_CardUnregister() [2.10] is called to un-register the card.


RETURN VALUE

Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise [A].


REMARKS


EXAMPLE

WD_CARD_CLEANUP cleanup;
BZERO(cleanup);

/* Set-up the cleanup struct with the cleanup information */

dwStatus = WD_CardCleanupSetup(hWD, &cleanup);
if (dwStatus)
{
    printf("WD_CardCleanupSetup failed: %s\n", Stat2Str(dwStatus));
}