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

C++ IoMarkIrpPending函数代码示例

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

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



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

示例1: DispatchReadWriteFlush

NTSTATUS DispatchReadWriteFlush(PDEVICE_OBJECT fdo, PIRP Irp)
{
    KIRQL OldIrql;
    ULONG count;
    
    PDEVICE_EXTENSION  pdx   = (PDEVICE_EXTENSION) fdo->DeviceExtension;
    PIO_STACK_LOCATION stack = IoGetCurrentIrpStackLocation( Irp );

    if(stack->MajorFunction == IRP_MJ_WRITE)
    {
        if(stack->Parameters.Write.Length == 0)
        {
            return CompleteRequest( Irp, STATUS_SUCCESS, 0 );
        }

        // write 
        IoMarkIrpPending(Irp);
        
        StartPacket( &pdx->dqWrite, fdo, Irp, OnCancelWrite );
        
    }
    else if(stack->MajorFunction == IRP_MJ_READ) 
    {
        if(stack->Parameters.Read.Length == 0)
        {
            return CompleteRequest( Irp, STATUS_SUCCESS, 0 );
        }
        
        // read 
        IoAcquireRemoveLock( &pdx->RemoveLock, Irp   );
        IoMarkIrpPending   ( Irp                     );
        IoSetCancelRoutine ( Irp, OnCancelQueuedRead );
        
        KeAcquireSpinLock( &pdx->ReadIrpLock, &OldIrql                     );
        InsertTailList   ( &pdx->ReadIrpList, &Irp->Tail.Overlay.ListEntry );
        KeReleaseSpinLock( &pdx->ReadIrpLock, OldIrql                      );

        CompleteQueuedReads(pdx);
    } 
    else 
    {
        // flush
        IoMarkIrpPending( Irp );
        StartPacket     ( &pdx->dqWrite, fdo, Irp, OnCancelWrite );
    }

    return STATUS_PENDING;
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:48,代码来源:ReadWrite.cpp


示例2: BeepDeviceControl

NTSTATUS
NTAPI
BeepDeviceControl(IN PDEVICE_OBJECT DeviceObject,
                  IN PIRP Irp)
{
    PIO_STACK_LOCATION Stack;
    PBEEP_SET_PARAMETERS BeepParam;
    NTSTATUS Status;

    /* Get the stack location and parameters */
    Stack = IoGetCurrentIrpStackLocation(Irp);
    BeepParam = (PBEEP_SET_PARAMETERS)Irp->AssociatedIrp.SystemBuffer;

    /* We only support one IOCTL */
    if (Stack->Parameters.DeviceIoControl.IoControlCode != IOCTL_BEEP_SET)
    {
        /* Unsupported command */
        Status = STATUS_NOT_IMPLEMENTED;
    }
    else
    {
        /* Validate the input buffer length */
        if (Stack->Parameters.DeviceIoControl.InputBufferLength <
            sizeof(BEEP_SET_PARAMETERS))
        {
            /* Invalid buffer */
            Status = STATUS_INVALID_PARAMETER;
        }
        else if ((BeepParam->Frequency != 0) && !(BeepParam->Duration))
        {
            /* No duration, return imemdiately */
            Status = STATUS_SUCCESS;
        }
        else
        {
            /* We'll queue this request */
            Status = STATUS_PENDING;
        }
    }

    /* Set packet information */
    Irp->IoStatus.Status = Status;
    Irp->IoStatus.Information = 0;

    /* Check if we're completing or queuing a packet */
    if (Status == STATUS_PENDING)
    {
        /* Start the queue */
        IoMarkIrpPending(Irp);
        IoStartPacket(DeviceObject, Irp, NULL, BeepCancel);
    }
    else
    {
        /* Complete the request */
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
    }

    /* Return */
    return Status;
}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:60,代码来源:beep.c


示例3: vboxUsbPwrIoPostDevCompletion

static NTSTATUS vboxUsbPwrIoPostDevCompletion(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp, IN PVOID pvContext)
{
    PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pvContext;

    if (pIrp->PendingReturned)
    {
        IoMarkIrpPending(pIrp);
    }

    NTSTATUS Status = pIrp->IoStatus.Status;
    Assert(Status == STATUS_SUCCESS);
    if (NT_SUCCESS(Status))
    {
        PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);
        switch (pSl->MinorFunction)
        {
            case IRP_MN_SET_POWER:
            {
                pDevExt->DdiState.PwrState.PowerState.DeviceState = pSl->Parameters.Power.State.DeviceState;
                PoSetPowerState(pDevExt->pFDO, DevicePowerState, pSl->Parameters.Power.State);
                break;
            }
            default:
            {
                break;
            }
        }
    }

    PoStartNextPowerIrp(pIrp);
    vboxUsbDdiStateRelease(pDevExt);
    return STATUS_SUCCESS;
}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:33,代码来源:VBoxUsbPwr.cpp


示例4: IoMarkIrpPending

FORCEINLINE
VOID
FxIrp::MarkIrpPending(
    )
{
    IoMarkIrpPending(m_Irp);
}
开发者ID:AntejaVM,项目名称:WDF,代码行数:7,代码来源:fxirpkm.hpp


示例5: KBFReadCompleteRoutine

NTSTATUS KBFReadCompleteRoutine(IN PDEVICE_OBJECT aDeviceObjec, IN PIRP aIrp, IN PVOID aContext)
{
    PAGED_CODE();

    PIO_STACK_LOCATION irpStackLocation;
    ULONG_PTR buflen = 0;
    PUCHAR buf = NULL;

    irpStackLocation = IoGetCurrentIrpStackLocation(aIrp);

    if (NT_SUCCESS(aIrp->IoStatus.Status))
    {
        // 获得读取请求完成后输出的缓冲区
        buf = (PUCHAR)aIrp->AssociatedIrp.SystemBuffer;

        // 获得缓冲区长度
        buflen = aIrp->IoStatus.Information;

        for (size_t i = 0; i < buflen; ++i)
        {
            DbgPrint("wykbflt.sys : %2x\r\n", buf[i]);
        }
    }

    --gC2pKeyCount;

    if (aIrp->PendingReturned)
    {
        IoMarkIrpPending(aIrp);
    }

    return aIrp->IoStatus.Status;
}
开发者ID:killbug2004,项目名称:wy-windows-driver,代码行数:33,代码来源:wykbflt.cpp


示例6: on_query_capabilities_complete

static NTSTATUS DDKAPI 
on_query_capabilities_complete(DEVICE_OBJECT *device_object,
                               IRP *irp, void *context)
{
  libusb_device_t *dev = device_object->DeviceExtension;
  IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp);

  if(irp->PendingReturned)
    {
      IoMarkIrpPending(irp);
    }

  if(NT_SUCCESS(irp->IoStatus.Status))
    {
      if(!dev->is_filter)
        {
          /* apply registry setting */
          stack_location->Parameters.DeviceCapabilities.Capabilities
            ->SurpriseRemovalOK = dev->surprise_removal_ok;
        }

      /* save supported device power states */
      memcpy(dev->device_power_states, stack_location
             ->Parameters.DeviceCapabilities.Capabilities->DeviceState,
             sizeof(dev->device_power_states));
    }

  remove_lock_release(dev);

  return STATUS_SUCCESS;
}
开发者ID:btaratutin,项目名称:PIC--Microcontroller--Debugger,代码行数:31,代码来源:pnp.c


示例7: Pkt0DispatchWrite

static NTSTATUS
Pkt0DispatchWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
    PIO_WORKITEM work_item;
    KIRQL old_irql;
    NTSTATUS status;

    work_item = IoAllocateWorkItem(DeviceObject);
    if (work_item == NULL) {
        return Pkt0CompleteIrp(Irp, STATUS_INSUFFICIENT_RESOURCES, 0);
    }

    KeAcquireSpinLock(&Pkt0ContextLock, &old_irql);
    if (Pkt0Context->closing) {
        status = Pkt0CompleteIrp(Irp, STATUS_PIPE_CLOSING, 0);
    } else {
        InsertTailList(&Pkt0Context->irp_write_queue, &Irp->Tail.Overlay.ListEntry);
        IoMarkIrpPending(Irp);
        status = STATUS_PENDING;
    }
    KeReleaseSpinLock(&Pkt0ContextLock, old_irql);

    if (status == STATUS_PENDING) {
        IoQueueWorkItemEx(work_item, Pkt0DeferredWrite, DelayedWorkQueue, NULL);
    } else {
        IoFreeWorkItem(work_item);
    }

    return status;
}
开发者ID:Juniper,项目名称:contrail-vrouter,代码行数:30,代码来源:vr_pkt0.c


示例8: EncryptedIoQueueAddIrp

NTSTATUS EncryptedIoQueueAddIrp (EncryptedIoQueue *queue, PIRP irp)
{
	NTSTATUS status;

	InterlockedIncrement (&queue->OutstandingIoCount);
	if (queue->StopPending)
	{
		Dump ("STATUS_DEVICE_NOT_READY  out=%d\n", queue->OutstandingIoCount);
		status = STATUS_DEVICE_NOT_READY;
		goto err;
	}

	status = IoAcquireRemoveLock (&queue->RemoveLock, irp);
	if (!NT_SUCCESS (status))
		goto err;

#ifdef TC_TRACE_IO_QUEUE
	{
		PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation (irp);
		Dump ("* %I64d [%I64d] %c len=%d out=%d\n", irpSp->MajorFunction == IRP_MJ_WRITE ? irpSp->Parameters.Write.ByteOffset : irpSp->Parameters.Read.ByteOffset, GetElapsedTime (&queue->LastPerformanceCounter), irpSp->MajorFunction == IRP_MJ_WRITE ? 'W' : 'R', irpSp->MajorFunction == IRP_MJ_WRITE ? irpSp->Parameters.Write.Length : irpSp->Parameters.Read.Length, queue->OutstandingIoCount);
	}
#endif

	IoMarkIrpPending (irp);

	ExInterlockedInsertTailList (&queue->MainThreadQueue, &irp->Tail.Overlay.ListEntry, &queue->MainThreadQueueLock);
	KeSetEvent (&queue->MainThreadQueueNotEmptyEvent, IO_DISK_INCREMENT, FALSE);
	
	return STATUS_PENDING;

err:
	DecrementOutstandingIoCount (queue);
	return status;
}
开发者ID:BitMerc,项目名称:veracrypt,代码行数:34,代码来源:EncryptedIoQueue.c


示例9: MyIoCompletion

NTSTATUS MyIoCompletion(IN PDEVICE_OBJECT  DeviceObject, IN PIRP  Irp, IN PVOID  Context)
{
	Debug("Enter MyIoCompletion");
	
	if(NT_SUCCESS(Irp->IoStatus.Status))
	{
		PKEYBOARD_INPUT_DATA tKeyData = (PKEYBOARD_INPUT_DATA )Irp->AssociatedIrp.SystemBuffer;
		if(tKeyData->Flags)
		{
			g_CurMakeCode	= tKeyData->MakeCode;
			if(0 != g_ShareEvent && (g_Status & INTERCEPT))
			{
				KeSetEvent((PRKEVENT)g_ShareEvent,(KPRIORITY)0, false); //弹起
			}
		}
		if(!(g_Status & ENABLE))  //按下与弹起
		{
			ULONG tBufLen	= Irp->IoStatus.Information;
			ULONG tNumKeys	= tBufLen / sizeof(KEYBOARD_INPUT_DATA);

			for(int i=0;i<tNumKeys;++i)
				tKeyData[i].MakeCode = 0x00;
		}
		KdPrint(("扫描码:%x,%s\n",tKeyData->MakeCode,tKeyData->Flags?"弹起":"按下"));
	}

	if(Irp->PendingReturned)
	{
		IoMarkIrpPending(Irp);
	}

	Debug("Leave MyIoCompletion");
	return Irp->IoStatus.Status;
}
开发者ID:r0cu3,项目名称:WindowsDriver,代码行数:34,代码来源:SysMain.cpp


示例10: FinishDevPoUpIrp

NTSTATUS NTAPI FinishDevPoUpIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PDEVICE_EXTENSION DeviceExtension)
{
    NTSTATUS           ntStatus;

    FreeBT_DbgPrint(3, ("FBTUSB: FinishDevPoUpIrp: Entered\n"));

    ntStatus = Irp->IoStatus.Status;
    if(Irp->PendingReturned)
    {
        IoMarkIrpPending(Irp);

    }

    if(!NT_SUCCESS(ntStatus))
    {
        PoStartNextPowerIrp(Irp);

        FreeBT_DbgPrint(3, ("FBTUSB: FinishDevPoUpIrp::"));
        FreeBT_IoDecrement(DeviceExtension);

        return STATUS_SUCCESS;

    }

    SetDeviceFunctional(DeviceObject, Irp, DeviceExtension);

    FreeBT_DbgPrint(3, ("FBTUSB: FinishDevPoUpIrp: Leaving\n"));

    return STATUS_MORE_PROCESSING_REQUIRED;

}
开发者ID:RPG-7,项目名称:reactos,代码行数:31,代码来源:fbtpwr.c


示例11: Pkt0DispatchRead

static NTSTATUS
Pkt0DispatchRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
    struct pkt0_packet *pkt = NULL;
    KIRQL old_irql;
    PLIST_ENTRY entry;
    NTSTATUS status;

    KeAcquireSpinLock(&Pkt0ContextLock, &old_irql);
    if (Pkt0Context->closing) {
        status = Pkt0CompleteIrp(Irp, STATUS_PIPE_CLOSING, 0);
    } else if (IsListEmpty(&Pkt0Context->pkt_read_queue)) {
        InsertTailList(&Pkt0Context->irp_read_queue, &Irp->Tail.Overlay.ListEntry);
        IoMarkIrpPending(Irp);
        status = STATUS_PENDING;
    } else {
        entry = RemoveHeadList(&Pkt0Context->pkt_read_queue);
        pkt = CONTAINING_RECORD(entry, struct pkt0_packet, list_entry);
    }
    KeReleaseSpinLock(&Pkt0ContextLock, old_irql);

    if (pkt != NULL) {
        status = Pkt0TransferPacketToUser(Irp, pkt);
    }

    return status;
}
开发者ID:Juniper,项目名称:contrail-vrouter,代码行数:27,代码来源:vr_pkt0.c


示例12: AFSWriteComplete

//
// AFSWriteComplete
//
static
NTSTATUS
AFSWriteComplete( IN PDEVICE_OBJECT DeviceObject,
                  IN PIRP Irp,
                  IN PVOID Context)
{
    UNREFERENCED_PARAMETER(DeviceObject);
    UNREFERENCED_PARAMETER(Irp);
    UNREFERENCED_PARAMETER(Context);
    BOOLEAN bPending = FALSE;

    //
    // Indicate the library/IRP pair is done with the request
    //

    AFSClearLibraryRequest();

    if (Irp->PendingReturned) {

        bPending = TRUE;

        IoMarkIrpPending(Irp);
    }

    AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,
                  AFS_TRACE_LEVEL_VERBOSE,
                  "AFSWriteComplete Irp %p%s\n",
                  Irp,
                  bPending ? " PENDING" : ""));

    return STATUS_CONTINUE_COMPLETION;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:35,代码来源:AFSWrite.cpp


示例13: CompletionRoutineDevUsgNotify

//========================================================================================
// Function:	CompletionRoutineStartDevice of DispatchPnp
// Purpose:		PNP DEVICE USAGE NOTIFICATION irp completion routine
// Return Value:
//				NT status code
//========================================================================================
NTSTATUS
CompletionRoutineDevUsgNotify(
	IN PDEVICE_OBJECT	fido,			// fido - pointer to a device object.
	IN PIRP				irp,			// irp - pointer to an I/O Request Packet.
	IN PVOID			Context			// Context - pointer to an event object.
	)
{
	PDEVICE_EXTENSION dx;

	UNREFERENCED_PARAMETER(Context);

	dx = (PDEVICE_EXTENSION)fido->DeviceExtension;

	if (irp->PendingReturned)
		IoMarkIrpPending(irp);

	//On the way up, pagable might become clear. Mimic the driver below us.
	if (!(dx->lowerdo->Flags & DO_POWER_PAGABLE))
	{
		fido->Flags &= ~DO_POWER_PAGABLE;
	}

	IoReleaseRemoveLock(&dx->rmLock, irp);
	return STATUS_SUCCESS;
}
开发者ID:allanchen1971,项目名称:20150830_BarCo_SMBIOS,代码行数:31,代码来源:PciBusFilter.c


示例14: SecLabReceivePacket

NTSTATUS SecLabReceivePacket(PADAPT	pAdapt,IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp)
{	
	// 某一时刻只有一个读IRP被允许存放在队列中

	NdisAcquireSpinLock(&ReadIrpLock);
	if(ReadIrp!=NULL /*&& ReadCount!=0*/)
	{
		NdisReleaseSpinLock(&ReadIrpLock);
		return CompleteIrp(Irp,STATUS_UNSUCCESSFUL,0);
	}

	// 看是否成功取出封包数据
	if( PickPacketFromList(pAdapt,Irp))
	{
        ReadCount=0;
		ReadIrp=NULL;
		NdisReleaseSpinLock(&ReadIrpLock);
		return STATUS_SUCCESS;
	}

	// 如果队列中没有封包数据,就将此IRP排队
	ReadIrp = Irp;
	ReadCount=1;

	// Mark Irp as pending and set Cancel routine
	Irp->IoStatus.Information = 0;
	Irp->IoStatus.Status = STATUS_PENDING;
	IoMarkIrpPending(Irp);
	IoSetCancelRoutine(Irp,SecLabCancelIrp);

	NdisReleaseSpinLock(&ReadIrpLock);

	return STATUS_PENDING;
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:NDIS,代码行数:34,代码来源:passthru.c


示例15: FFSQueueRequest

NTSTATUS
FFSQueueRequest(
	IN PFFS_IRP_CONTEXT IrpContext)
{
	ASSERT(IrpContext);

	ASSERT((IrpContext->Identifier.Type == FFSICX) &&
			(IrpContext->Identifier.Size == sizeof(FFS_IRP_CONTEXT)));

	// IsSynchronous means we can block (so we don't requeue it)
	IrpContext->IsSynchronous = TRUE;

	SetFlag(IrpContext->Flags, IRP_CONTEXT_FLAG_REQUEUED);

	IoMarkIrpPending(IrpContext->Irp);

	ExInitializeWorkItem(
			&IrpContext->WorkQueueItem,
			FFSDeQueueRequest,
			IrpContext);

	ExQueueWorkItem(&IrpContext->WorkQueueItem, CriticalWorkQueue);

	return STATUS_PENDING;
}
开发者ID:layerfsd,项目名称:ffsfsd,代码行数:25,代码来源:dispatch.c


示例16: CompletionRoutineStartDevice

//========================================================================================
// Function:	CompletionRoutineStartDevice of DispatchPnp
// Purpose:		The completion routine for plug & play irps that needs to be
//				processed first by the lower drivers.
// Return Value:
//				NT status code
//========================================================================================
NTSTATUS
CompletionRoutineStartDevice(
	IN PDEVICE_OBJECT	fido,			// fido - pointer to a device object.
	IN PIRP				irp,			// irp - pointer to an I/O Request Packet.
	IN PVOID			Context			// Context - pointer to an event object.
	)
{
	PDEVICE_EXTENSION dx;

	UNREFERENCED_PARAMETER(Context);

	dx = (PDEVICE_EXTENSION)fido->DeviceExtension;

	//Must do this if we don't return STATUS_MORE_PROCESSING_REQUIRED
	if (irp->PendingReturned)
		IoMarkIrpPending(irp);

	if (NT_SUCCESS(irp->IoStatus.Status))
	{
		//As we are successfully now back, we will
		//first set our state to Started.
		SET_NEW_PNP_STATE(dx, Started);

		//On the way up inherit FILE_REMOVABLE_MEDIA during Start.
		//This characteristic is available only after the driver stack is started!.
		if (dx->lowerdo->Characteristics & FILE_REMOVABLE_MEDIA)
		{
			fido->Characteristics |= FILE_REMOVABLE_MEDIA;
		}
	}

	IoReleaseRemoveLock(&dx->rmLock, irp);
	return STATUS_SUCCESS;
}
开发者ID:allanchen1971,项目名称:20150830_BarCo_SMBIOS,代码行数:41,代码来源:PciBusFilter.c


示例17: Serenum_FDOPowerComplete

NTSTATUS
Serenum_FDOPowerComplete (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp,
                          IN PVOID Context)
/*++
--*/
{
    POWER_STATE powerState;
    POWER_STATE_TYPE powerType;
    PIO_STACK_LOCATION stack;
    PFDO_DEVICE_DATA data;

    UNREFERENCED_PARAMETER(Context);


    if (Irp->PendingReturned) {
        IoMarkIrpPending(Irp);
    }


    data = (PFDO_DEVICE_DATA)DeviceObject->DeviceExtension;
    stack = IoGetCurrentIrpStackLocation(Irp);
    powerType = stack->Parameters.Power.Type;
    powerState = stack->Parameters.Power.State;

    switch (stack->MinorFunction) {
    case IRP_MN_SET_POWER:
        switch (powerType) {
        case DevicePowerState:
            //
            // Powering Up
            //
            ASSERT(powerState.DeviceState < data->DeviceState);
            data->DeviceState = powerState.DeviceState;

            PoSetPowerState(data->Self, powerType, powerState);
            break;

        default:
           break;
        }
        break;

    case IRP_MN_QUERY_POWER:
        ASSERT(IRP_MN_QUERY_POWER != stack->MinorFunction);
        break;

    default:
        //
        // Basically, this is ASSERT(0)
        //
        ASSERT(0xBADBAD == IRP_MN_QUERY_POWER);
        break;
    }


    PoStartNextPowerIrp(Irp);
    Serenum_DecIoCount(data);

    return STATUS_SUCCESS; // Continue completion...
}
开发者ID:kcrazy,项目名称:winekit,代码行数:60,代码来源:power.c


示例18: WaitWakeCompletionRoutine

NTSTATUS
WaitWakeCompletionRoutine(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp,
    IN PDEVICE_EXTENSION DeviceExtension
    )
/*++
 
Routine Description:

    This is the IoSet completion routine for the wait wake irp.

Arguments:

    DeviceObject - pointer to device object
    Irp - I/O request packet
    DeviceExtension - pointer to device extension

Return Value:

    NT status value

--*/
{
    MobiUsb_DbgPrint(3, ("file mobipwr: WaitWakeCompletionRoutine - begins\n"));

    if(Irp->PendingReturned) {

        IoMarkIrpPending(Irp);
    }

    //
    // Nullify the WaitWakeIrp pointer-the Irp is released 
    // as part of the completion process. If it's already NULL, 
    // avoid race with the CancelWaitWake routine.
    //

    if(InterlockedExchangePointer(&DeviceExtension->WaitWakeIrp, NULL)) {

        PoStartNextPowerIrp(Irp);

        return STATUS_SUCCESS;
    }

    //
    // CancelWaitWake has run. 
    // If FlagWWCancel != 0, complete the Irp.
    // If FlagWWCancel == 0, CancelWaitWake completes it.
    //
    if(InterlockedExchange(&DeviceExtension->FlagWWCancel, 1)) {

        PoStartNextPowerIrp(Irp);

        return STATUS_CANCELLED;
    }

    MobiUsb_DbgPrint(3, ("file mobipwr: WaitWakeCompletionRoutine - ends\n"));

    return STATUS_MORE_PROCESSING_REQUIRED;
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:60,代码来源:mobipwr.c


示例19: Notification_Recieve

NTSTATUS Notification_Recieve(NOTIFICATION_QUEUE *queue, PIRP irp) {
	PIO_STACK_LOCATION irpstack = IoGetCurrentIrpStackLocation(irp);
	KIRQL irq;

	if(irpstack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PGNOTIFICATION)) {
		irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
		irp->IoStatus.Information = 0;
		IoCompleteRequest(irp, IO_NO_INCREMENT);

		return STATUS_BUFFER_TOO_SMALL;
	}
	
	KeAcquireSpinLock(&queue->lock, &irq);

	if(IsListEmpty(&queue->notification_list)) {
		PGIRPNODE *irpnode;
		KIRQL crirq;

		irpnode = ExAllocateFromNPagedLookasideList(&queue->lookaside);

		InitializeListHead(&irpnode->entry);

		irpnode->irp = irp;
		//irp->Tail.Overlay.DriverContext[0] = irpnode;

		InsertTailList(&queue->irp_list, &irpnode->entry);

		IoMarkIrpPending(irp);

		IoAcquireCancelSpinLock(&crirq);

#pragma warning(push)
#pragma warning(disable:4311 4312)
		//IoSetCancelRoutine generates warnings in 32-bit due to silly macroisms.
		IoSetCancelRoutine(irp, Notification_OnCancel);
#pragma warning(pop)

		IoReleaseCancelSpinLock(crirq);
		
		KeReleaseSpinLock(&queue->lock, irq);

		return STATUS_PENDING;
	}
	else {
		PGNOTIFYNODE *notifynode = (PGNOTIFYNODE*)RemoveHeadList(&queue->notification_list);
		PGNOTIFICATION *notification = irp->AssociatedIrp.SystemBuffer;

		RtlCopyMemory(notification, &notifynode->notification, sizeof(PGNOTIFICATION));
		ExFreeToNPagedLookasideList(&queue->lookaside, notifynode);
		--queue->queued;
		
		KeReleaseSpinLock(&queue->lock, irq);

		irp->IoStatus.Status = STATUS_SUCCESS;
		irp->IoStatus.Information = sizeof(PGNOTIFICATION);
		IoCompleteRequest(irp, IO_NO_INCREMENT);

		return STATUS_SUCCESS;
	}
}
开发者ID:Tudi,项目名称:PG2-firewall,代码行数:60,代码来源:notifyqueue.c


示例20: MouseFilterInvertorYCompletion

NTSTATUS MouseFilterInvertorYCompletion(PDEVICE_OBJECT pFiDO, PIRP pIrp, PVOID pContext)
{
    ULONG_PTR i = 0;
	PMOUSE_INPUT_DATA MouseData = NULL;
	ULONG_PTR EventCount = pIrp->IoStatus.Information / sizeof(MOUSE_INPUT_DATA);

	DbgPrint("Mouse Filter: Entry in MouseFilterInvertorYCompletion\n");

	if (NT_SUCCESS(pIrp->IoStatus.Status)) {
		MouseData = (PMOUSE_INPUT_DATA)pIrp->AssociatedIrp.SystemBuffer;
        for (i = 0; i < EventCount; ++i) {
			if (MouseData[i].Flags & MOUSE_MOVE_ABSOLUTE) {
				MouseData[i].LastY = 0xFFFF - MouseData[i].LastY;
			} else {
				MouseData[i].LastY *= -1;
			}
		}
	}

	if (pIrp->PendingReturned) {
		IoMarkIrpPending(pIrp);
	}

	return pIrp->IoStatus.Status;
}
开发者ID:Vipon,项目名称:mipt,代码行数:25,代码来源:viponMouse.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ IoMessage_argCount函数代码示例发布时间:2022-05-30
下一篇:
C++ IoGetRelatedDeviceObject函数代码示例发布时间: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