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

C++ IoReleaseRemoveLock函数代码示例

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

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



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

示例1: DiskDeviceControlWithLock

NTSTATUS
DiskDeviceControlWithLock(__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp) {

  PDokanDCB dcb;
  NTSTATUS status = STATUS_NOT_IMPLEMENTED;

  dcb = DeviceObject->DeviceExtension;

  if (GetIdentifierType(dcb) != DCB) {
    PrintIdType(dcb);
    DDbgPrint("   Device is not dcb so go out here\n");
    return STATUS_INVALID_PARAMETER;
  }

  status = IoAcquireRemoveLock(&dcb->RemoveLock, Irp);
  if (!NT_SUCCESS(status)) {
    DDbgPrint("IoAcquireRemoveLock failed with %#x", status);
    return STATUS_INSUFFICIENT_RESOURCES;
  }

  if (IsDeletePending(DeviceObject)) {
    DDbgPrint("Device is deleted, so go out here \n");
    IoReleaseRemoveLock(&dcb->RemoveLock, Irp);
    return STATUS_NO_SUCH_DEVICE;
  }
  status = DiskDeviceControl(DeviceObject, Irp);

  IoReleaseRemoveLock(&dcb->RemoveLock, Irp);

  return status;
}
开发者ID:destenson,项目名称:dokan-dev--dokany,代码行数:31,代码来源:device.c


示例2: DispatchControl

//========================================================================================
// Function:	DispatchControl
// Purpose:		This routine is the dispatch handler for the driver.  It is responsible
//				for processing the IRPs.
// Return Value:
//				STATUS_SUCCESS if the IRP was processed successfully, otherwise an error
//				indicating the reason for failure.
//========================================================================================
NTSTATUS
DispatchControl(
				IN    PDEVICE_OBJECT pDO,		// pDO - Pointer to device object.
				IN    PIRP pIrp					// pIrp - Pointer to the current IRP.
				)
{
	PDEVICE_EXTENSION dx;
	PIO_STACK_LOCATION pIrpStack;
	NTSTATUS Status;

	PAGED_CODE();

	pIrp->IoStatus.Information = 0;
	dx = (PDEVICE_EXTENSION)pDO->DeviceExtension;    // Get local info struct

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

	Status = IoAcquireRemoveLock (&dx->rmLock, NULL);
	if (!NT_SUCCESS (Status))
	{
		pIrp->IoStatus.Information = 0;
		pIrp->IoStatus.Status = Status;
		IoCompleteRequest (pIrp, IO_NO_INCREMENT);
		KdPrint(("<-- "__FUNCTION__"() IoAcquireRemoveLock() Status code: 0x%08x\n", Status));
		return Status;
	}

	if (dx->DevicePnPState != Started)
	{
		//
		// We fail all the IRPs that arrive before the device is started.
		//
		pIrp->IoStatus.Status = Status = STATUS_DEVICE_NOT_READY;
		IoCompleteRequest(pIrp, IO_NO_INCREMENT );
		IoReleaseRemoveLock(&dx->rmLock, NULL);
		KdPrint(("<-- "__FUNCTION__"() - STATUS_DEVICE_NOT_READY\n"));
		return Status;
	}

	pIrpStack = IoGetCurrentIrpStackLocation(pIrp);

	pIrp->IoStatus.Information = DispatchIOCTL(
		pIrpStack->Parameters.DeviceIoControl.IoControlCode, 
		(PUCHAR)pIrp->AssociatedIrp.SystemBuffer,
		pIrpStack->Parameters.DeviceIoControl.InputBufferLength,
		(PUCHAR)pIrp->AssociatedIrp.SystemBuffer,
		pIrpStack->Parameters.DeviceIoControl.OutputBufferLength,
		&Status
		);

	// We're done with I/O request.  Record the status of the I/O action.
	pIrp->IoStatus.Status = Status;

	// Don't boost priority when returning since this took little time.
	IoCompleteRequest(pIrp, IO_NO_INCREMENT);
	IoReleaseRemoveLock(&dx->rmLock, NULL);
	KdPrint(("<-- "__FUNCTION__"() Completion Status code: 0x%08x\n", Status));
	return Status;
}
开发者ID:allanchen1971,项目名称:20150830_BarCo_SMBIOS,代码行数:67,代码来源:PciBusFilter.c


示例3: IoReleaseRemoveLockAndWait

VOID IoReleaseRemoveLockAndWait(PIO_REMOVE_LOCK lock, PVOID tag)
{
//	PAGED_CODE();
	lock->removing = TRUE;
	IoReleaseRemoveLock(lock, tag);
	IoReleaseRemoveLock(lock, NULL);
	KeWaitForSingleObject(&lock->evRemove, Executive, KernelMode, FALSE, NULL);
}
开发者ID:banduladh,项目名称:meplayer,代码行数:8,代码来源:RemoveLock.c


示例4: YtDispatchFilterPower

NTSTATUS
YtDispatchFilterPower(
	IN PDEVICE_OBJECT DeviceObject,
	IN PIRP Irp
	)
{
	PDEVICE_EXTENSION deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
	NTSTATUS status;

	if (KeGetCurrentIrql() <= DISPATCH_LEVEL)
	{
		status = IoAcquireRemoveLock(&deviceExtension->RemoveLock, Irp);
		if(!NT_SUCCESS(status))
		{
			Irp->IoStatus.Status = status;
			Irp->IoStatus.Information = 0;

			IoCompleteRequest(Irp, IO_NO_INCREMENT);
			return status;
		}

	}

	PoStartNextPowerIrp(Irp);
	IoSkipCurrentIrpStackLocation(Irp);

	status = PoCallDriver(deviceExtension->TargetDeviceObject, Irp);

	if (KeGetCurrentIrql() <= DISPATCH_LEVEL)
			IoReleaseRemoveLock(&deviceExtension->RemoveLock, NULL);

	return status;
}
开发者ID:virl,项目名称:yttrium,代码行数:33,代码来源:filterdispatch.cpp


示例5: DkDefault

NTSTATUS DkDefault(PDEVICE_OBJECT pDevObj, PIRP pIrp)
{
    NTSTATUS            ntStat = STATUS_SUCCESS;
    PDEVICE_EXTENSION   pDevExt = NULL;
    PIO_STACK_LOCATION  pStack = NULL;
    PDEVICE_OBJECT      pNextDevObj = NULL;

    pDevExt = (PDEVICE_EXTENSION) pDevObj->DeviceExtension;

    ntStat = IoAcquireRemoveLock(&pDevExt->removeLock, (PVOID) pIrp);
    if (!NT_SUCCESS(ntStat))
    {
        DkDbgVal("Error acquire lock!", ntStat);
        DkCompleteRequest(pIrp, ntStat, 0);
        return ntStat;
    }

    pStack = IoGetCurrentIrpStackLocation(pIrp);

    DkDbgVal("DkDefault", pStack->MajorFunction);
    pNextDevObj = pDevExt->pNextDevObj;

    IoSkipCurrentIrpStackLocation(pIrp);
    ntStat = IoCallDriver(pNextDevObj, pIrp);

    IoReleaseRemoveLock(&pDevExt->removeLock, (PVOID) pIrp);

    return ntStat;
}
开发者ID:jue-jiang,项目名称:usbpcap,代码行数:29,代码来源:USBPcapMain.c


示例6: 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


示例7: 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


示例8: DispatchPower

//========================================================================================
// Function:	DispatchPower
// Purpose:		This routine is the dispatch routine for power irps.
//				Does nothing except forwarding the IRP to the next device in the stack.
// Return Value:
//				NT status code
//========================================================================================
NTSTATUS
DispatchPower(
	IN PDEVICE_OBJECT	fido,			// fido - Pointer to the device object.
	IN PIRP				irp				// Irp - Pointer to the request packet.
	)
{
	PDEVICE_EXTENSION dx;
	NTSTATUS ntStatus;

	dx = (PDEVICE_EXTENSION)fido->DeviceExtension;

	PoStartNextPowerIrp(irp);

	//acquire remove lock
	ntStatus=IoAcquireRemoveLock(&dx->rmLock, irp);
	if (!NT_SUCCESS(ntStatus))
	{
		//complete irp if cannot acquire remove lock
		irp->IoStatus.Status=ntStatus;
		irp->IoStatus.Information=0;
		IoCompleteRequest(irp, IO_NO_INCREMENT);
		return ntStatus;
	}

	IoSkipCurrentIrpStackLocation(irp);
	ntStatus = PoCallDriver(dx->lowerdo, irp);

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


示例9: PassIRP

//========================================================================================
// Function:	PassIRP
// Purpose:		Free all the allocated resources, etc.
// Return Value:
//				NT status code
//========================================================================================
NTSTATUS PassIRP(
	IN PDEVICE_OBJECT fido,
	IN PIRP irp					// Irp - pointer to an I/O Request Packet.
	)
{
	PDEVICE_EXTENSION dx;
	NTSTATUS ntStatus;

	dx = (PDEVICE_EXTENSION)fido->DeviceExtension;

	// acquire remove lock
	ntStatus = IoAcquireRemoveLock(&dx->rmLock, irp);
	if (!NT_SUCCESS(ntStatus))
	{
		//complete irp if cannot acquire remove lock
		irp->IoStatus.Status=ntStatus;
		irp->IoStatus.Information=0;
		IoCompleteRequest(irp, IO_NO_INCREMENT);
		return ntStatus;
	}

	IoSkipCurrentIrpStackLocation(irp);
	ntStatus = IoCallDriver(dx->lowerdo, irp);

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


示例10: 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


示例11: V4vDispatchWmi

static NTSTATUS NTAPI
V4vDispatchWmi(PDEVICE_OBJECT fdo, PIRP irp)
{
    NTSTATUS          status;
    PXENV4V_EXTENSION pde = V4vGetDeviceExtension(fdo);

    TraceVerbose(("====> '%s'.\n", __FUNCTION__));

    // We don't support WMI, so just pass it on down the stack

    status = IoAcquireRemoveLock(&pde->removeLock, irp);
    if (!NT_SUCCESS(status)) {
        TraceError(("failed to acquire IO lock - error: 0x%x\n", status));        
        return V4vSimpleCompleteIrp(irp, status);
    }

    IoSkipCurrentIrpStackLocation(irp);
    status = IoCallDriver(pde->ldo, irp);

    IoReleaseRemoveLock(&pde->removeLock, irp);

    TraceVerbose(("<==== '%s'.\n", __FUNCTION__));
 
    return status;
}
开发者ID:meisners,项目名称:oxt-windows,代码行数:25,代码来源:xenv4v.c


示例12: VolumeFilterDispatchIrp

NTSTATUS VolumeFilterDispatchIrp (PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
	VolumeFilterExtension *Extension = (VolumeFilterExtension *) DeviceObject->DeviceExtension;
	PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation (Irp);
	NTSTATUS status;

	ASSERT (!Extension->bRootDevice && Extension->IsVolumeFilterDevice);

	switch (irpSp->MajorFunction)
	{
	case IRP_MJ_DEVICE_CONTROL:
		return DispatchControl (DeviceObject, Irp, Extension, irpSp);

	case IRP_MJ_PNP:
		return DispatchPnp (DeviceObject, Irp, Extension, irpSp);

	case IRP_MJ_POWER:
		return DispatchPower (DeviceObject, Irp, Extension, irpSp);

	default:
		status = IoAcquireRemoveLock (&Extension->Queue.RemoveLock, Irp);
		if (!NT_SUCCESS (status))
			return TCCompleteIrp (Irp, status, 0);

		status = PassIrp (Extension->LowerDeviceObject, Irp);

		IoReleaseRemoveLock (&Extension->Queue.RemoveLock, Irp);
		return status;
	}
}
开发者ID:ChiefGyk,项目名称:VeraCrypt,代码行数:30,代码来源:VolumeFilter.c


示例13: YtFilterShutdownFlush

NTSTATUS
YtFilterShutdownFlush(
	IN PDEVICE_OBJECT DeviceObject,
	IN PIRP Irp
	)
{
	PDEVICE_EXTENSION deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
	NTSTATUS status;

	if (KeGetCurrentIrql() <= DISPATCH_LEVEL)
	{
		status = IoAcquireRemoveLock(&deviceExtension->RemoveLock, Irp);
		if(!NT_SUCCESS(status))
		{
			Irp->IoStatus.Status = status;
			Irp->IoStatus.Information = 0;

			IoCompleteRequest(Irp, IO_NO_INCREMENT);
			return status;
		}

	}
/*	DebugPrint(("YtFilterShutdownFlush: DeviceObject %X Irp %X\n",
					DeviceObject, Irp));*/
	//Set current stack back one.
	Irp->CurrentLocation++,
	Irp->Tail.Overlay.CurrentStackLocation++;

	status = IoCallDriver(deviceExtension->TargetDeviceObject, Irp);

	if (KeGetCurrentIrql() <= DISPATCH_LEVEL)
		IoReleaseRemoveLock(&deviceExtension->RemoveLock, NULL);

	return status;
}
开发者ID:virl,项目名称:yttrium,代码行数:35,代码来源:filterdispatch.cpp


示例14: OnCancelWrite

VOID OnCancelWrite(IN PDEVICE_OBJECT fdo, IN PIRP Irp)
{
    PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
    
    CancelRequest( &pdx->dqWrite, Irp );
    
    IoReleaseRemoveLock( &pdx->RemoveLock, Irp );
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:8,代码来源:ReadWrite.cpp


示例15: SwdmDispatchWrite

NTSTATUS
SwdmDispatchWrite(
    IN PDEVICE_OBJECT  DeviceObject,
    IN PIRP  Irp
    )
{
	PVOID Buf;		//Buffer provided by user program
	ULONG BufLen;	//Buffer length for user provided buffer
	LONGLONG Offset;//Buffer Offset
	PVOID DataBuf;  //Buffer provided by Driver
	ULONG DataLen;  //Buffer length for Driver Data Buffer
	ULONG ByteTransferred;
	PIO_STACK_LOCATION pStk;
	PDEVICE_EXTENSION pCtx;
	//NTSTATUS status;

	DbgPrintEx( DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "IRP_MJ_WRITE : Begin\r\n");

	//Get I/o Stack Location & Device Extension
	pStk = IoGetCurrentIrpStackLocation(Irp);
	pCtx = DeviceObject->DeviceExtension;

	//Get User Input Buffer & Length 
	BufLen = pStk->Parameters.Write.Length;
	Offset = pStk->Parameters.Read.ByteOffset.QuadPart;
	Buf = (PUCHAR)(Irp->AssociatedIrp.SystemBuffer) + Offset;

	//Get Driver Data Buffer & Length
	DataBuf = pCtx->DataBuffer;
	DataLen = 1024;
	
	IoAcquireRemoveLock(&pCtx->RemoveLock, Irp);

	DbgPrintEx( DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "Input Buffer Length : %d\r\n", BufLen);
	DbgPrintEx( DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "Driver Data Length : %d\r\n", DataLen);

	if (BufLen <= DataLen) {
		ByteTransferred = BufLen;	
	} else {
		ByteTransferred = DataLen;
	}

	ByteTransferred = BufLen;
	RtlZeroMemory(
		pCtx->DataBuffer,
		1024);

	RtlCopyMemory(
		DataBuf,
		Buf, 
		ByteTransferred);

	IoReleaseRemoveLock(&pCtx->RemoveLock, Irp);
	CompleteRequest(Irp, STATUS_SUCCESS, ByteTransferred);

	DbgPrintEx( DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "IRP_MJ_WRITE : End\r\n");
	return STATUS_SUCCESS;
}
开发者ID:uri247,项目名称:pmgmt,代码行数:58,代码来源:Driver.c


示例16: PdoSystemPower

static NTSTATUS
PdoSystemPower(
    IN  PXENFILT_THREAD Self,
    IN  PVOID           Context
    )
{
    PXENFILT_PDO        Pdo = Context;
    PKEVENT             Event;

    Event = ThreadGetEvent(Self);

    for (;;) {
        PIRP                Irp;
        PIO_STACK_LOCATION  StackLocation;
        UCHAR               MinorFunction;

        if (Pdo->SystemPowerIrp == NULL) {
            (VOID) KeWaitForSingleObject(Event,
                                         Executive,
                                         KernelMode,
                                         FALSE,
                                         NULL);
            KeClearEvent(Event);
        }

        if (ThreadIsAlerted(Self))
            break;

        Irp = Pdo->SystemPowerIrp;

        if (Irp == NULL)
            continue;

        Pdo->SystemPowerIrp = NULL;
        KeMemoryBarrier();

        StackLocation = IoGetCurrentIrpStackLocation(Irp);
        MinorFunction = StackLocation->MinorFunction;

        switch (StackLocation->MinorFunction) {
        case IRP_MN_SET_POWER:
            (VOID) __PdoSetSystemPower(Pdo, Irp);
            break;

        case IRP_MN_QUERY_POWER:
            (VOID) __PdoQuerySystemPower(Pdo, Irp);
            break;

        default:
            ASSERT(FALSE);
            break;
        }

        IoReleaseRemoveLock(&Pdo->Dx->RemoveLock, Irp);
    }

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


示例17: PdoStartDevice

static DECLSPEC_NOINLINE NTSTATUS
PdoStartDevice(
    IN  PXENFILT_PDO    Pdo,
    IN  PIRP            Irp
    )
{
    POWER_STATE         PowerState;
    NTSTATUS            status;

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

    status = PdoForwardIrpSynchronously(Pdo, Irp);
    if (!NT_SUCCESS(status))
        goto fail2;

    __PdoSetSystemPowerState(Pdo, PowerSystemWorking);
    __PdoSetDevicePowerState(Pdo, PowerDeviceD0);

    PowerState.DeviceState = PowerDeviceD0;
    PoSetPowerState(Pdo->Dx->DeviceObject,
                    DevicePowerState,
                    PowerState);

    __PdoSetDevicePnpState(Pdo, Started);

    IoReleaseRemoveLock(&Pdo->Dx->RemoveLock, Irp);

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

    return STATUS_SUCCESS;

fail2:
    IoReleaseRemoveLock(&Pdo->Dx->RemoveLock, Irp);

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

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


示例18: dc_forward_irp

NTSTATUS dc_forward_irp(dev_hook *hook, PIRP irp)
{
	NTSTATUS status;

	IoSkipCurrentIrpStackLocation(irp);
	status = IoCallDriver(hook->orig_dev, irp);
			
	IoReleaseRemoveLock(&hook->remv_lock, irp);
	return status;
}
开发者ID:capturePointer,项目名称:diskcryptor,代码行数:10,代码来源:misc_irp.c


示例19: UsageNotificationCompletionRoutine

NTSTATUS UsageNotificationCompletionRoutine(PDEVICE_OBJECT fido, PIRP Irp, PDEVICE_EXTENSION pdx)
{							// UsageNotificationCompletionRoutine
	if (Irp->PendingReturned)
		IoMarkIrpPending(Irp);
	// If lower driver cleared pageable flag, we must do the same
	if (!(pdx->LowerDeviceObject->Flags & DO_POWER_PAGABLE))
		fido->Flags &= ~DO_POWER_PAGABLE;
	IoReleaseRemoveLock(&pdx->RemoveLock, Irp);
	return STATUS_SUCCESS;
}							// UsageNotificationCompletionRoutine
开发者ID:caidongyun,项目名称:libs,代码行数:10,代码来源:DriverEntry.cpp


示例20: DispatchAny

NTSTATUS DispatchAny(IN PDEVICE_OBJECT fido, IN PIRP Irp)
{							// DispatchAny
	PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fido->DeviceExtension;
	PIO_STACK_LOCATION stack = IoGetCurrentIrpStackLocation(Irp);
#if DBG
	static char* irpname[] = 
	{
		"IRP_MJ_CREATE",
		"IRP_MJ_CREATE_NAMED_PIPE",
		"IRP_MJ_CLOSE",
		"IRP_MJ_READ",
		"IRP_MJ_WRITE",
		"IRP_MJ_QUERY_INFORMATION",
		"IRP_MJ_SET_INFORMATION",
		"IRP_MJ_QUERY_EA",
		"IRP_MJ_SET_EA",
		"IRP_MJ_FLUSH_BUFFERS",
		"IRP_MJ_QUERY_VOLUME_INFORMATION",
		"IRP_MJ_SET_VOLUME_INFORMATION",
		"IRP_MJ_DIRECTORY_CONTROL",
		"IRP_MJ_FILE_SYSTEM_CONTROL",
		"IRP_MJ_DEVICE_CONTROL",
		"IRP_MJ_INTERNAL_DEVICE_CONTROL",
		"IRP_MJ_SHUTDOWN",
		"IRP_MJ_LOCK_CONTROL",
		"IRP_MJ_CLEANUP",
		"IRP_MJ_CREATE_MAILSLOT",
		"IRP_MJ_QUERY_SECURITY",
		"IRP_MJ_SET_SECURITY",
		"IRP_MJ_POWER",
		"IRP_MJ_SYSTEM_CONTROL",
		"IRP_MJ_DEVICE_CHANGE",
		"IRP_MJ_QUERY_QUOTA",
		"IRP_MJ_SET_QUOTA",
		"IRP_MJ_PNP",
	};

	UCHAR type = stack->MajorFunction;
// 	if (type >= arraysize(irpname))
// 		KdPrint((DRIVERNAME " - Unknown IRP, major type %X\n", type));
// 	else
// 		KdPrint((DRIVERNAME " - %s\n", irpname[type]));

#endif
	
	// Pass request down without additional processing
	NTSTATUS status;
	status = IoAcquireRemoveLock(&pdx->RemoveLock, Irp);
	if (!NT_SUCCESS(status))
		return CompleteRequest(Irp, status, 0);
	IoSkipCurrentIrpStackLocation(Irp);
	status = IoCallDriver(pdx->LowerDeviceObject, Irp);
	IoReleaseRemoveLock(&pdx->RemoveLock, Irp);
	return status;
}							// DispatchAny
开发者ID:caidongyun,项目名称:libs,代码行数:55,代码来源:DriverEntry.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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