next up previous contents
Next: 3.4 WD_IntCount() Up: 3. Low Level WD_xxx Previous: 3.2 WD_IntEnable()   Contents


3.3 WD_IntWait()


PURPOSE

$\bullet$Waits for an interrupt.


PROTOTYPE

DWORD WD_IntWait(
    HANDLE hWD,
    WD_INTERRUPT *pInterrupt);


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pInterrupt WD_INTERRUPT*  
$\gg$hInterrupt HANDLE Input
$\gg$dwOptions DWORD N/A
$\gg$Cmd WD_TRANSFER* N/A
$\gg$dwCmds DWORD N/A
$\gg$kpCall WD_KERNEL_PLUGIN_CALL N/A
$\gg$fEnableOk DWORD N/A
$\gg$dwCounter DWORD Output
$\gg$dwLost DWORD Output
$\gg$fStopped DWORD Output


DESCRIPTION

Name Description
hWD The handle to WinDriver's kernel-mode driver received from WD_Open() [5.2]
pInterrupt Pointer to an interrupt information structure:
hInterrupt Interrupt handle. The handle is returned by WD_CardRegister() [2.8] in pCardReg->Card.Item[i].I.Int.hInterrupt.
dwCounter Number of interrupts received
dwLost Number of interrupts that were acknowledge in kernel mode but not yet handled in user mode
fStopped Set by the function to any of the following values:
$\bullet$0 - an interrupt occurred $\bullet$INTERRUPT_STOPPED - an interrupt was disabled while waiting for interrupts $\bullet$INTERRUPT_INTERRUPTED - while waiting for an interrupt, WD_IntWait() [3.3] was interrupted without an actual hardware interrupt (see also Remark 3.3 below)


RETURN VALUE

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


REMARKS


EXAMPLE

for (;;)
{
    WD_IntWait(hWD, &Intrp);
    if (Intrp.fStopped)
        break;

    ProcessInterrupt(Intrp.dwCounter);
}