本文整理汇总了C++中IRP::Complete方法的典型用法代码示例。如果您正苦于以下问题:C++ IRP::Complete方法的具体用法?C++ IRP::Complete怎么用?C++ IRP::Complete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRP
的用法示例。
在下文中一共展示了IRP::Complete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __serial_check_fds
static void __serial_check_fds(SERIAL_DEVICE* serial)
{
IRP* irp;
IRP* prev;
SERIAL_TTY* tty;
uint32 result = 0;
memset(&serial->tv, 0, sizeof(struct timeval));
tty = serial->tty;
/* scan every pending */
irp = list_peek(serial->pending_irps);
while (irp)
{
DEBUG_SVC("MajorFunction %u", irp->MajorFunction);
switch (irp->MajorFunction)
{
case IRP_MJ_READ:
if (FD_ISSET(tty->fd, &serial->read_fds))
{
irp->IoStatus = STATUS_SUCCESS;
serial_process_irp_read(serial, irp);
}
break;
case IRP_MJ_WRITE:
if (FD_ISSET(tty->fd, &serial->write_fds))
{
irp->IoStatus = STATUS_SUCCESS;
serial_process_irp_write(serial, irp);
}
break;
case IRP_MJ_DEVICE_CONTROL:
if (serial_tty_get_event(tty, &result))
{
DEBUG_SVC("got event result %u", result);
irp->IoStatus = STATUS_SUCCESS;
stream_write_uint32(irp->output, result);
irp->Complete(irp);
}
break;
default:
DEBUG_SVC("no request found");
break;
}
prev = irp;
irp = (IRP*)list_next(serial->pending_irps, irp);
if (prev->IoStatus == STATUS_SUCCESS)
{
list_remove(serial->pending_irps, prev);
wait_obj_set(serial->in_event);
}
}
}