• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IoCopyCurrentIrpStackLocationToNext函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IoCopyCurrentIrpStackLocationToNext函数的典型用法代码示例。如果您正苦于以下问题:C++ IoCopyCurrentIrpStackLocationToNext函数的具体用法?C++ IoCopyCurrentIrpStackLocationToNext怎么用?C++ IoCopyCurrentIrpStackLocationToNext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IoCopyCurrentIrpStackLocationToNext函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PciPassIrpFromFdoToPdo

NTSTATUS
NTAPI
PciPassIrpFromFdoToPdo(IN PPCI_FDO_EXTENSION DeviceExtension,
                       IN PIRP Irp)
{
    PIO_STACK_LOCATION IoStackLocation;
    NTSTATUS Status;
    DPRINT1("Pci PassIrp ...\n");

    /* Get the stack location to check which function this is */
    IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
    if (IoStackLocation->MajorFunction == IRP_MJ_POWER)
    {
        /* Power IRPs are special since we have to notify the Power Manager */
        IoCopyCurrentIrpStackLocationToNext(Irp);
        PoStartNextPowerIrp(Irp);
        Status = PoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
    }
    else
    {
        /* For a normal IRP, just call the next driver in the stack */
        IoSkipCurrentIrpStackLocation(Irp);
        Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
    }

    /* Return the status back to the caller */
    return Status;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:28,代码来源:dispatch.c


示例2: vboxUsbPwrSetPowerDev

static NTSTATUS vboxUsbPwrSetPowerDev(IN PVBOXUSBDEV_EXT pDevExt, IN PIRP pIrp)
{
    PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);
    DEVICE_POWER_STATE enmDevPState = pSl->Parameters.Power.State.DeviceState;
    DEVICE_POWER_STATE enmCurDevPState = pDevExt->DdiState.PwrState.PowerState.DeviceState;
    NTSTATUS Status = STATUS_SUCCESS;

    if (enmDevPState > enmCurDevPState && enmCurDevPState == PowerDeviceD0)
    {
        Status = vboxUsbPwrIoWaitCompletionAndPostAsync(pDevExt, pIrp);
        Assert(NT_SUCCESS(Status));
        if (NT_SUCCESS(Status))
            return Status;
    }

    PoStartNextPowerIrp(pIrp);

    if (NT_SUCCESS(Status))
    {
        IoCopyCurrentIrpStackLocationToNext(pIrp);
        IoSetCompletionRoutine(pIrp, vboxUsbPwrIoPostDevCompletion, pDevExt, TRUE, TRUE, TRUE);
        Status = PoCallDriver(pDevExt->pLowerDO, pIrp);
    }
    else
    {
        pIrp->IoStatus.Status = Status;
        pIrp->IoStatus.Information = 0;

        IoCompleteRequest(pIrp, IO_NO_INCREMENT);
        vboxUsbDdiStateRelease(pDevExt);
    }

    return Status;
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:34,代码来源:VBoxUsbPwr.cpp


示例3: PciCallDownIrpStack

NTSTATUS
NTAPI
PciCallDownIrpStack(IN PPCI_FDO_EXTENSION DeviceExtension,
                    IN PIRP Irp)
{
    NTSTATUS Status;
    KEVENT Event;
    PAGED_CODE();
    DPRINT1("PciCallDownIrpStack ...\n");
    ASSERT_FDO(DeviceExtension);

    /* Initialize the wait event */
    KeInitializeEvent(&Event, SynchronizationEvent, 0);

    /* Setup a completion routine */
    IoCopyCurrentIrpStackLocationToNext(Irp);
    IoSetCompletionRoutine(Irp, PciSetEventCompletion, &Event, TRUE, TRUE, TRUE);

    /* Call the attached device */
    Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
    if (Status == STATUS_PENDING)
    {
        /* Wait for it to complete the request, and get its status */
        KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
        Status = Irp->IoStatus.Status;
    }

    /* Return that status back to the caller */
    return Status;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:30,代码来源:dispatch.c


示例4: DispatchForSCSI

NTSTATUS DispatchForSCSI(IN PDEVICE_OBJECT fido, IN PIRP Irp)
{
//	KdPrint((DRIVERNAME " - Enter DispatchForSCSI \n"));

	PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fido->DeviceExtension;
	
	PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp); 

	// Pass request down without additional processing
	NTSTATUS status;
	status = IoAcquireRemoveLock(&pdx->RemoveLock, Irp);
	if (!NT_SUCCESS(status))
		return CompleteRequest(Irp, status, 0);

	IoCopyCurrentIrpStackLocationToNext(Irp);
	
	IoSetCompletionRoutine( Irp,
							USBSCSICompletion,
							NULL,
							TRUE,
							TRUE,
							TRUE ); 
	status = IoCallDriver(pdx->LowerDeviceObject, Irp);
	IoReleaseRemoveLock(&pdx->RemoveLock, Irp);
	return status;
}
开发者ID:caidongyun,项目名称:libs,代码行数:26,代码来源:DriverEntry.cpp


示例5: XenStub_SendAndWaitForIrp

static NTSTATUS
XenStub_SendAndWaitForIrp(PDEVICE_OBJECT device_object, PIRP irp)
{
  NTSTATUS status;
  PXENSTUB_DEVICE_DATA xsdd = (PXENSTUB_DEVICE_DATA)device_object->DeviceExtension;
  KEVENT event;

  UNREFERENCED_PARAMETER(device_object);

  //KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));

  KeInitializeEvent(&event, NotificationEvent, FALSE);

  IoCopyCurrentIrpStackLocationToNext(irp);
  IoSetCompletionRoutine(irp, XenStub_Pnp_IoCompletion, &event, TRUE, TRUE, TRUE);

  status = IoCallDriver(xsdd->lower_do, irp);

  if (status == STATUS_PENDING)
  {
    //KdPrint((__DRIVER_NAME "     waiting ...\n"));
    KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
    //KdPrint((__DRIVER_NAME "     ... done\n"));
    status = irp->IoStatus.Status;
  }

  //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));

  return status;
}
开发者ID:stilltracy,项目名称:LICMX-Win,代码行数:30,代码来源:xenstub.c


示例6: LBKFltRead

NTSTATUS LBKFltRead(IN PDEVICE_OBJECT	pDevObj, IN PIRP pIrp) 
{
	PDEVICE_EXTENSION   pDevExt = (PDEVICE_EXTENSION) pDevObj->DeviceExtension;
	PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation( pIrp );
	PREADWRITE_IO_CONTEXT Context = NULL;

	DbgPrint("LBKFltRead was called \n");

	Context = ExAllocatePoolWithTag(NonPagedPool, sizeof(READWRITE_IO_CONTEXT), LBKFLT_TAG_NPAGED);
	if(NULL == Context){
		DbgPrint("Memory allocation failure for read io context \n");
		pIrp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
		pIrp->IoStatus.Information = 0;
		IoCompleteRequest(pIrp, IO_NO_INCREMENT);
		return STATUS_INSUFFICIENT_RESOURCES;
	}
	Context->liOffset = pIrpStack->Parameters.Read.ByteOffset;
	Context->ulLength = pIrpStack->Parameters.Read.Length;

	IoCopyCurrentIrpStackLocationToNext(pIrp);

	IoSetCompletionRoutine( pIrp,
							ReadIoCompletion,
							Context,
							TRUE,//InvokeOnSuccess
							TRUE, // InvokeOnError
							TRUE // InvokeOnCancel
							);
	return IoCallDriver(pDevExt->pTargetDeviceObject, pIrp);
}
开发者ID:dannydraper,项目名称:ByteGuard,代码行数:30,代码来源:LbkFlt.c


示例7: HidKmdfPowerPassThrough

NTSTATUS
HidKmdfPowerPassThrough(
    __in PDEVICE_OBJECT DeviceObject,
    __in PIRP Irp
    )
/*++

Routine Description:

    Pass through routine for power IRPs .

Arguments:

   DeviceObject - pointer to a device object.

   Irp - pointer to an I/O Request Packet.

Return Value:

      NT status code

--*/
{
    //
    // Must start the next power irp before skipping to the next stack location
    //
    PoStartNextPowerIrp(Irp);

    //
    // Copy current stack to next instead of skipping. We do this to preserve 
    // current stack information provided by hidclass driver to the minidriver
    //
    IoCopyCurrentIrpStackLocationToNext(Irp);
    return PoCallDriver(GET_NEXT_DEVICE_OBJECT(DeviceObject), Irp);
}
开发者ID:AdiCheo,项目名称:droidpad-pc-driver,代码行数:35,代码来源:hidkmdf.c


示例8: vbgdNtSendIrpSynchronously

/**
 * Helper to send a PnP IRP and wait until it's done.
 *
 * @param    pDevObj    Device object.
 * @param    pIrp       Request packet.
 * @param    fStrict    When set, returns an error if the IRP gives an error.
 * @return   NT status code
 */
static NTSTATUS vbgdNtSendIrpSynchronously(PDEVICE_OBJECT pDevObj, PIRP pIrp, BOOLEAN fStrict)
{
    KEVENT Event;

    KeInitializeEvent(&Event, SynchronizationEvent, FALSE);

    IoCopyCurrentIrpStackLocationToNext(pIrp);
    IoSetCompletionRoutine(pIrp, (PIO_COMPLETION_ROUTINE)vbgdNtPnpIrpComplete,
                           &Event, TRUE, TRUE, TRUE);

    NTSTATUS rc = IoCallDriver(pDevObj, pIrp);

    if (rc == STATUS_PENDING)
    {
        KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
        rc = pIrp->IoStatus.Status;
    }

    if (!fStrict
        && (rc == STATUS_NOT_SUPPORTED || rc == STATUS_INVALID_DEVICE_REQUEST))
    {
        rc = STATUS_SUCCESS;
    }

    Log(("VBoxGuest::vbgdNtSendIrpSynchronously: Returning 0x%x\n", rc));
    return rc;
}
开发者ID:Rootkitsmm,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:35,代码来源:VBoxGuest-win-pnp.cpp


示例9: ForwardIrpAndWait

NTSTATUS
ForwardIrpAndWait(
	IN PDEVICE_OBJECT DeviceObject,
	IN PIRP Irp)
{
	PDEVICE_OBJECT LowerDevice;
	KEVENT Event;
	NTSTATUS Status;

	ASSERT(!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO);
	LowerDevice = ((PPORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;

	KeInitializeEvent(&Event, NotificationEvent, FALSE);
	IoCopyCurrentIrpStackLocationToNext(Irp);

	TRACE_(CLASS_NAME, "Calling lower device %p\n", LowerDevice);
	IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);

	Status = IoCallDriver(LowerDevice, Irp);
	if (Status == STATUS_PENDING)
	{
		Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
		if (NT_SUCCESS(Status))
			Status = Irp->IoStatus.Status;
	}

	return Status;
}
开发者ID:GYGit,项目名称:reactos,代码行数:28,代码来源:misc.c


示例10: PPJoyBus_SendIrpSynchronously

NTSTATUS PPJoyBus_SendIrpSynchronously (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
 KEVENT		event;
 NTSTATUS	ntStatus;

 PAGED_CODE();

 KeInitializeEvent (&event,NotificationEvent,FALSE);

 IoCopyCurrentIrpStackLocationToNext (Irp);

 /* Set completion routine, to be called when lower driver is done with */
 /* this IRP. From this routine we signal the event when done.          */
 IoSetCompletionRoutine (Irp,PPJoyBus_CompletionRoutine,&event,TRUE,TRUE,TRUE);

 /* Call the lower level driver. */ 
 ntStatus= IoCallDriver(DeviceObject,Irp);

 /* Wait for the lower drivers to finish with the IRP. */
 if (ntStatus == STATUS_PENDING)
 {
  KeWaitForSingleObject (&event,Executive,KernelMode,FALSE,NULL);
  ntStatus= Irp->IoStatus.Status;
 }

 return ntStatus;
}
开发者ID:Cyborg11,项目名称:PPJoy,代码行数:27,代码来源:IRPUtil.c


示例11: PcForwardIrpSynchronous

NTSTATUS
NTAPI
PcForwardIrpSynchronous(
    IN  PDEVICE_OBJECT DeviceObject,
    IN  PIRP Irp)
{
    KEVENT Event;
    PPCLASS_DEVICE_EXTENSION DeviceExt;
    NTSTATUS Status;

    PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);

    DeviceExt = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;

    // initialize the notification event
    KeInitializeEvent(&Event, NotificationEvent, FALSE);

    IoCopyCurrentIrpStackLocationToNext(Irp);

    IoSetCompletionRoutine(Irp, CompletionRoutine, (PVOID)&Event, TRUE, TRUE, TRUE);

    // now call the driver
    Status = IoCallDriver(DeviceExt->PrevDeviceObject, Irp);
    // did the request complete yet
    if (Status == STATUS_PENDING)
    {
        // not yet, lets wait a bit
        KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
        Status = Irp->IoStatus.Status;
    }
    return Status;
}
开发者ID:RareHare,项目名称:reactos,代码行数:32,代码来源:irp.cpp


示例12: ForwardIrpAndWait

NTSTATUS NTAPI
ForwardIrpAndWait(
	IN PDEVICE_OBJECT DeviceObject,
	IN PIRP Irp)
{
	KEVENT Event;
	NTSTATUS Status;
	PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
	ASSERT(LowerDevice);

	KeInitializeEvent(&Event, NotificationEvent, FALSE);
	IoCopyCurrentIrpStackLocationToNext(Irp);

	IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);

	Status = IoCallDriver(LowerDevice, Irp);
	if (Status == STATUS_PENDING)
	{
		Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
		if (NT_SUCCESS(Status))
			Status = Irp->IoStatus.Status;
	}

	return Status;
}
开发者ID:RareHare,项目名称:reactos,代码行数:25,代码来源:misc.c


示例13: ImDiskDeviceControlLowerDevice

NTSTATUS
ImDiskDeviceControlLowerDevice(PIRP Irp, PDEVICE_EXTENSION DeviceExtension)
{
    PIO_STACK_LOCATION io_stack = IoGetCurrentIrpStackLocation(Irp);
    PIO_STACK_LOCATION lower_io_stack = IoGetNextIrpStackLocation(Irp);

    IoCopyCurrentIrpStackLocationToNext(Irp);

    if (io_stack->Parameters.DeviceIoControl.IoControlCode ==
        IOCTL_IMDISK_FSCTL_PASS_THROUGH)
    {
        lower_io_stack->MajorFunction = IRP_MJ_FILE_SYSTEM_CONTROL;
    }

    lower_io_stack->Parameters.DeviceIoControl.IoControlCode =
        *(PULONG)Irp->AssociatedIrp.SystemBuffer;

    lower_io_stack->Parameters.DeviceIoControl.InputBufferLength -=
        sizeof(ULONG);

    RtlMoveMemory(Irp->AssociatedIrp.SystemBuffer,
        (PUCHAR)Irp->AssociatedIrp.SystemBuffer + sizeof(ULONG),
        lower_io_stack->Parameters.DeviceIoControl.InputBufferLength);

    lower_io_stack->FileObject = DeviceExtension->file_object;

    return IoCallDriver(DeviceExtension->dev_object, Irp);
}
开发者ID:nnaabbcc,项目名称:exercise,代码行数:28,代码来源:lowerdev.cpp


示例14: HidUmdfPowerPassThrough

NTSTATUS
HidUmdfPowerPassThrough(
    _In_ PDEVICE_OBJECT DeviceObject,
    _Inout_ PIRP Irp
    )
/*++

Routine Description:

    Pass through routine for power IRPs .

Arguments:

   DeviceObject - pointer to a device object.

   Irp - pointer to an I/O Request Packet.

Return Value:

      NT status code

--*/
{
    PoStartNextPowerIrp(Irp);
    IoCopyCurrentIrpStackLocationToNext(Irp);
    return PoCallDriver(GET_NEXT_DEVICE_OBJECT(DeviceObject), Irp);
}
开发者ID:Realhram,项目名称:wdk81,代码行数:27,代码来源:hidumdf.c


示例15: PdoSurpriseRemoval

static DECLSPEC_NOINLINE NTSTATUS
PdoSurpriseRemoval(
    IN  PXENFILT_PDO    Pdo,
    IN  PIRP            Irp
    )
{
    NTSTATUS            status;

    status = IoAcquireRemoveLock(&Pdo->Dx->RemoveLock, Irp);
    if (!NT_SUCCESS(status))
        goto fail1;

    __PdoSetDevicePnpState(Pdo, SurpriseRemovePending);
    Irp->IoStatus.Status = STATUS_SUCCESS;

    IoCopyCurrentIrpStackLocationToNext(Irp);
    IoSetCompletionRoutine(Irp,
                           __PdoSurpriseRemoval,
                           Pdo,
                           TRUE,
                           TRUE,
                           TRUE);

    status = IoCallDriver(Pdo->LowerDeviceObject, Irp);

    return status;

fail1:
    Irp->IoStatus.Status = status;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);

    return status;
}
开发者ID:HeidCloud,项目名称:win-xenbus,代码行数:33,代码来源:pdo.c


示例16: my_ioctl_pop

NTSTATUS my_ioctl_pop(PDEVICE_OBJECT deviceObject, PIRP Irp) {
	NTSTATUS status = STATUS_SUCCESS;

	DbgPrint("my_ioctl_pop called\n");

	IoCopyCurrentIrpStackLocationToNext(Irp);
	IoSetCompletionRoutine(Irp, (PIO_COMPLETION_ROUTINE) my_completion_routine, NULL, TRUE, TRUE, TRUE);

	device_extension_t* device_extension = (device_extension_t*) deviceObject->DeviceExtension;
	status = IoCallDriver(device_extension->next, Irp);
	if (status != STATUS_SUCCESS) {
		DbgPrint("Error: filtered driver send back an error: 0x%08X\n", status);
		goto cleanup;
	}

	// Remaining actions after the filtered drivers
	PCHAR c = (PCHAR) Irp->AssociatedIrp.SystemBuffer;
	char old = *c;
	if (*c >= 65 && *c <= 65 + 26) {
		*c += 32;
		DbgPrint("Translate: %d=>%c\n", old, *c);
		Irp->IoStatus.Information = 1;
	} else {
		status = STATUS_UNSUCCESSFUL;
		DbgPrint("Error: input is not upper case: %c\n", *c);
	}

cleanup:
	return status;
}
开发者ID:ChibiTomo,项目名称:sandbox,代码行数:30,代码来源:filter.c


示例17: PdoForwardIrpSynchronously

static NTSTATUS
PdoForwardIrpSynchronously(
    IN  PXENFILT_PDO    Pdo,
    IN  PIRP            Irp
    )
{
    KEVENT              Event;
    NTSTATUS            status;

    ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);

    KeInitializeEvent(&Event, NotificationEvent, FALSE);

    IoCopyCurrentIrpStackLocationToNext(Irp);
    IoSetCompletionRoutine(Irp,
                           __PdoForwardIrpSynchronously,
                           &Event,
                           TRUE,
                           TRUE,
                           TRUE);

    status = IoCallDriver(Pdo->LowerDeviceObject, Irp);
    if (status == STATUS_PENDING) {
        (VOID) KeWaitForSingleObject(&Event,
                                     Executive,
                                     KernelMode,
                                     FALSE,
                                     NULL);
        status = Irp->IoStatus.Status;
    } else {
        ASSERT3U(status, ==, Irp->IoStatus.Status);
    }

    return status;
}
开发者ID:HeidCloud,项目名称:win-xenbus,代码行数:35,代码来源:pdo.c


示例18: PdoDispatchDefault

static DECLSPEC_NOINLINE NTSTATUS
PdoDispatchDefault(
    IN  PXENFILT_PDO    Pdo,
    IN  PIRP            Irp
    )
{
    NTSTATUS            status;

    status = IoAcquireRemoveLock(&Pdo->Dx->RemoveLock, Irp);
    if (!NT_SUCCESS(status))
        goto fail1;

    IoCopyCurrentIrpStackLocationToNext(Irp);
    IoSetCompletionRoutine(Irp,
                           __PdoDispatchDefault,
                           Pdo,
                           TRUE,
                           TRUE,
                           TRUE);

    status = IoCallDriver(Pdo->LowerDeviceObject, Irp);

    return status;

fail1:
    Error("fail1 (%08x)\n", status);

    Irp->IoStatus.Status = status;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);

    return status;
}
开发者ID:HeidCloud,项目名称:win-xenbus,代码行数:32,代码来源:pdo.c


示例19: FPFilterForwardIrpSynchronous

//
// This Irp Forwarding func is interested im what comes back, so it is symchronous and has a cmpletion routine (above)
//
NTSTATUS
FPFilterForwardIrpSynchronous(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp
    )
{
    PDEVICE_EXTENSION   deviceExtension;
    KEVENT event;
    NTSTATUS status;

    KeInitializeEvent(&event, NotificationEvent, FALSE);
    deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;

    // copy the irpstack for the next device
    IoCopyCurrentIrpStackLocationToNext(Irp);

    // set a completion routine
    IoSetCompletionRoutine(Irp, FPFilterIrpCompletion,  &event, TRUE, TRUE, TRUE);

	// FPFilterIrpCOmpletion returns MORE_PROCESSING_REQUIRED
	// so the code that calls FPFilterForwardIrpSynchronous needs to call IoCompleteRequest()

    // call the next lower device
    status = IoCallDriver(deviceExtension->TargetDeviceObject, Irp);

    // wait for the actual completion
    if (status == STATUS_PENDING) 
	{
        KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
        status = Irp->IoStatus.Status;
    }

    return status;
} 
开发者ID:hanappe,项目名称:low-energy-boinc,代码行数:37,代码来源:entry.c


示例20: Bus_SendIrpSynchronously

NTSTATUS
Bus_SendIrpSynchronously (
    __in PDEVICE_OBJECT DeviceObject,
    __in PIRP Irp
    )
/*++
Routine Description:

    Sends the Irp down to lower driver and waits for it to
    come back by setting a completion routine.

Arguments:
    DeviceObject - Pointer to deviceobject
    Irp          - Pointer to a PnP Irp.

Return Value:

    NT Status is returned.

--*/
{
    KEVENT   event;
    NTSTATUS status;

    PAGED_CODE();

    KeInitializeEvent(&event, NotificationEvent, FALSE);

    IoCopyCurrentIrpStackLocationToNext(Irp);

    IoSetCompletionRoutine(Irp,
                           Bus_CompletionRoutine,
                           &event,
                           TRUE,
                           TRUE,
                           TRUE
                           );

    status = IoCallDriver(DeviceObject, Irp);

    //
    // Wait for lower drivers to be done with the Irp.
    // Important thing to note here is when you allocate
    // the memory for an event in the stack you must do a
    // KernelMode wait instead of UserMode to prevent
    // the stack from getting paged out.
    //

    if (status == STATUS_PENDING) {
       KeWaitForSingleObject(&event,
                             Executive,
                             KernelMode,
                             FALSE,
                             NULL
                             );
       status = Irp->IoStatus.Status;
    }

    return status;
}
开发者ID:wl500g,项目名称:usbip-no-glib,代码行数:60,代码来源:pnp.c



注:本文中的IoCopyCurrentIrpStackLocationToNext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IoCreateDevice函数代码示例发布时间:2022-05-30
下一篇:
C++ IoCompleteRequest函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap