VOID SerialCompleteImmediate( IN WDFDPC Dpc ) { PSERIAL_DEVICE_EXTENSION Extension = NULL; Extension = SerialGetDeviceExtension(WdfDpcGetParentObject(Dpc)); SerialDbgPrintEx(TRACE_LEVEL_INFORMATION, DBG_IOCTLS, ">SerialCompleteImmediate(%p)\n", Extension); SerialTryToCompleteCurrent( Extension, NULL, STATUS_SUCCESS, &Extension->CurrentImmediateRequest, NULL, NULL, Extension->ImmediateTotalTimer, NULL, SerialGetNextImmediate, SERIAL_REF_ISR ); SerialDbgPrintEx(TRACE_LEVEL_INFORMATION, DBG_IOCTLS, "<SerialCompleteImmediate\n"); }
/*++ Routine Description: This routine is merely used to truely complete an xoff counter request. It assumes that the status and the information fields of the request are already correctly filled in. Arguments: Dpc - Not Used. DeferredContext - Really points to the device extension. SystemContext1 - Not Used. SystemContext2 - Not Used. Return Value: None. --*/ _Use_decl_annotations_ VOID SerialCompleteXoff( WDFDPC Dpc ) { PSERIAL_DEVICE_EXTENSION extension = NULL; extension = SerialGetDeviceExtension(WdfDpcGetParentObject(Dpc)); TraceEvents(TRACE_LEVEL_INFORMATION, DBG_WRITE, "++SerialCompleteXoff(%p)\r\n", extension); SerialTryToCompleteCurrent(extension, NULL, STATUS_SUCCESS, &extension->CurrentXoffRequest, NULL, NULL, extension->XoffCountTimer, NULL, NULL, SERIAL_REF_ISR); TraceEvents(TRACE_LEVEL_INFORMATION, DBG_WRITE, "--SerialCompleteXoff\r\n"); }
/*++ Routine Description: This routine is merely used to complete any write. It assumes that the status and the information fields of the request are already correctly filled in. Arguments: Dpc - Not Used. DeferredContext - Really points to the device extension. SystemContext1 - Not Used. SystemContext2 - Not Used. Return Value: None. --*/ _Use_decl_annotations_ VOID SerialCompleteWrite( WDFDPC Dpc ) { PSERIAL_DEVICE_EXTENSION Extension = NULL; Extension = SerialGetDeviceExtension(WdfDpcGetParentObject(Dpc)); TraceEvents(TRACE_LEVEL_INFORMATION, DBG_WRITE, "++SerialCompleteWrite(%p) DPC\r\n", Extension); SerialTryToCompleteCurrent(Extension, NULL, STATUS_SUCCESS, &Extension->CurrentWriteRequest, Extension->WriteQueue, NULL, Extension->WriteRequestTotalTimer, SerialStartWrite, SerialGetNextWrite, SERIAL_REF_ISR); TraceEvents(TRACE_LEVEL_INFORMATION, DBG_WRITE, "--SerialCompleteWrite DPC\r\n"); }
static VOID XenVbd_EvtDpcEvent(WDFDPC dpc) { WDFDEVICE device = WdfDpcGetParentObject(dpc); PXENVBD_FILTER_DATA xvfd = GetXvfd(device); for (;;) { if (InterlockedCompareExchange(&xvfd->event_state, 1, 0) == 0) { /* was no event outstanding, now there is */ XenVbd_SendEvent(device); break; } if (InterlockedCompareExchange(&xvfd->event_state, 2, 1) != 0) { //FUNCTION_MSG("event already in progress\n"); /* event was outstanding. either we set the need new event flag or it was already set */ break; } /* event_state changed while we were looking at it, go around again */ } }