亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? fpfilter.c

?? FPFilter is a sample disk filter driver that demonstrates how a disk failure prediction filter drive
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
            //
            // if removing last paging device, need to set DO_POWER_PAGABLE
            // bit here, and possible re-set it below on failure.
            //

            setPagable = FALSE;
            if (!irpStack->Parameters.UsageNotification.InPath &&
                deviceExtension->PagingPathCount == 1 ) {

                //
                // removing the last paging file
                // must have DO_POWER_PAGABLE bits set
                //

                if (TEST_FLAG(DeviceObject->Flags, DO_POWER_INRUSH)) {
                    DebugPrint((3, "FPFilterDispatchPnp: last paging file "
                                "removed but DO_POWER_INRUSH set, so not "
                                "setting PAGABLE bit "
                                "for DO %p\n", DeviceObject));
                } else {
                    DebugPrint((2, "FPFilterDispatchPnp: Setting  PAGABLE "
                                "bit for DO %p\n", DeviceObject));
                    SET_FLAG(DeviceObject->Flags, DO_POWER_PAGABLE);
                    setPagable = TRUE;
                }

            }

            //
            // send the irp synchronously
            //

            status = FPFilterForwardIrpSynchronous(DeviceObject, Irp);

            //
            // now deal with the failure and success cases.
            // note that we are not allowed to fail the irp
            // once it is sent to the lower drivers.
            //

            if (NT_SUCCESS(status)) {

                IoAdjustPagingPathCount(
                    &deviceExtension->PagingPathCount,
                    irpStack->Parameters.UsageNotification.InPath);

                if (irpStack->Parameters.UsageNotification.InPath) {
                    if (deviceExtension->PagingPathCount == 1) {

                        //
                        // first paging file addition
                        //

                        DebugPrint((3, "FPFilterDispatchPnp: Clearing PAGABLE bit "
                                    "for DO %p\n", DeviceObject));
                        CLEAR_FLAG(DeviceObject->Flags, DO_POWER_PAGABLE);
                    }
                }

            } else {

                //
                // cleanup the changes done above
                //

                if (setPagable == TRUE) {
                    CLEAR_FLAG(DeviceObject->Flags, DO_POWER_PAGABLE);
                    setPagable = FALSE;
                }

            }

            //
            // set the event so the next one can occur.
            //

            KeSetEvent(&deviceExtension->PagingPathCountEvent,
                       IO_NO_INCREMENT, FALSE);
        }

        default:
        {
            DebugPrint((3,
               "FPFilterDispatchPnp: Forwarding irp"));
            //
            // Simply forward all other Irps
            //
            IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
            lockHeld = FALSE;
            status = FPFilterSendToNextDriver(DeviceObject, Irp);
            irpCompleted = TRUE;
        }
    }

    if (! irpCompleted)
    {
        Irp->IoStatus.Status = status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
    }
    
    if (lockHeld)
    {
        IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
    }

    return status;

} // end FPFilterDispatchPnp()


NTSTATUS
FPFilterIrpCompletion(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp,
    IN PVOID Context
    )

/*++

Routine Description:

    Forwarded IRP completion routine. Set an event and return
    STATUS_MORE_PROCESSING_REQUIRED. Irp forwarder will wait on this
    event and then re-complete the irp after cleaning up.

Arguments:

    DeviceObject is the device object of the WMI driver
    Irp is the WMI irp that was just completed
    Context is a PKEVENT that forwarder will wait on

Return Value:

    STATUS_MORE_PORCESSING_REQUIRED

--*/

{
    PKEVENT Event = (PKEVENT) Context;

    UNREFERENCED_PARAMETER(DeviceObject);
    UNREFERENCED_PARAMETER(Irp);

    KeSetEvent(Event, IO_NO_INCREMENT, FALSE);

    return(STATUS_MORE_PROCESSING_REQUIRED);

} // end FPFilterIrpCompletion()


NTSTATUS
FPFilterStartDevice(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp
    )
/*++

Routine Description:

    This routine is called when a Pnp Start Irp is received.
    It will schedule a completion routine to initialize and register with WMI.

Arguments:

    DeviceObject - a pointer to the device object

    Irp - a pointer to the irp


Return Value:

    Status of processing the Start Irp

--*/
{
    PDEVICE_EXTENSION   deviceExtension;
    KEVENT              event;
    NTSTATUS            status;

    PAGED_CODE();

    deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;

    status = FPFilterForwardIrpSynchronous(DeviceObject, Irp);

    FPFilterSyncFilterWithTarget(DeviceObject,
                                 deviceExtension->TargetDeviceObject);

    return status;
}


NTSTATUS
FPFilterRemoveDevice(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp
    )
/*++

Routine Description:

    This routine is called when the device is to be removed.
    It will de-register itself from WMI first, detach itself from the
    stack before deleting itself.

Arguments:

    DeviceObject - a pointer to the device object

    Irp - a pointer to the irp


Return Value:

    Status of removing the device

--*/
{
    NTSTATUS            status;
    PDEVICE_EXTENSION   deviceExtension;

    PAGED_CODE();

    deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;

    status = FPFilterForwardIrpSynchronous(DeviceObject, Irp);

    IoReleaseRemoveLockAndWait(&deviceExtension->RemoveLock, Irp);

    IoDetachDevice(deviceExtension->TargetDeviceObject);
    IoDeleteDevice(DeviceObject);

    return status;
}


NTSTATUS
FPFilterSendToNextDriver(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp
    )

/*++

Routine Description:

    This routine sends the Irp to the next driver in line
    when the Irp is not processed by this driver.

Arguments:

    DeviceObject
    Irp

Return Value:

    NTSTATUS

--*/

{
    PDEVICE_EXTENSION   deviceExtension;

    IoSkipCurrentIrpStackLocation(Irp);
    deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;

    return IoCallDriver(deviceExtension->TargetDeviceObject, Irp);

} // end FPFilterSendToNextDriver()

NTSTATUS
FPFilterDispatchPower(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp
    )
{
    PDEVICE_EXTENSION deviceExtension;

    PoStartNextPowerIrp(Irp);
    IoSkipCurrentIrpStackLocation(Irp);

    deviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
    return PoCallDriver(deviceExtension->TargetDeviceObject, Irp);

} // end FPFilterDispatchPower

NTSTATUS
FPFilterForwardIrpSynchronous(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp
    )

/*++

Routine Description:

    This routine sends the Irp to the next driver in line
    when the Irp needs to be processed by the lower drivers
    prior to being processed by this one.

Arguments:

    DeviceObject
    Irp

Return Value:

    NTSTATUS

--*/

{
    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);

    //
    // 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;

} // end FPFilterForwardIrpSynchronous()


NTSTATUS
FPFilterDeviceControl(
    PDEVICE_OBJECT DeviceObject,
    PIRP Irp
    )

/*++

Routine Description:

    This device control dispatcher handles only the failure prediction
    device control. All others are passed down to the disk drivers.

Arguments:

    DeviceObject - Context for the activity.
    Irp          - The device control argument block.

Return Value:

    Status is returned.

--*/

{
    PDEVICE_EXTENSION  deviceExtension = DeviceObject->DeviceExtension;
    PIO_STACK_LOCATION currentIrpStack = IoGetCurrentIrpStackLocation(Irp);
    PSTORAGE_PREDICT_FAILURE checkFailure;
    NTSTATUS status;

    DebugPrint((2, "FPFilterDeviceControl: DeviceObject %X Irp %X\n",
                    DeviceObject, Irp));

    //
    // Acquire the remove lock so that device will not be removed while
    // processing this irp.
    //
    status = IoAcquireRemoveLock(&deviceExtension->RemoveLock, Irp);

    if (!NT_SUCCESS(status))
        {
        DebugPrint((3, "FpFilterDeviceControl: Remove lock failed IOCTL Irp type [%x]\n",
                 currentIrpStack->Parameters.DeviceIoControl.IoControlCode));
        Irp->IoStatus.Information = 0;
        Irp->IoStatus.Status = status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
        return status;
    }


    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode ==
        IOCTL_STORAGE_PREDICT_FAILURE)
    {

        //
        // Verify user buffer is large enough for the failure prediction data
        //

        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength <
                sizeof(STORAGE_PREDICT_FAILURE))
        {
            //
            // Indicate unsuccessful status and no data transferred.
            //

            status = STATUS_BUFFER_TOO_SMALL;
            Irp->IoStatus.Information = sizeof(STORAGE_PREDICT_FAILURE);

        } else {

            //
            // If underlying device stack supports failure prediction then
            // most likely there is another filter driver and/or support for
            // SMART in the disk stack. We'll call down to get its opinion
            // first before making our own decision as to if the device
            // is predicting failure.

            status = FPFilterForwardIrpSynchronous(DeviceObject, Irp);

            //
            // Here we decide if  we want to predict whether the device
            // will fail or not. We can do many interesting things such
            // as sending a hardware request to the physical device,
            // doing some statistical analysis, whatever makes sense for
            // the device in question.
            //
            checkFailure = Irp->AssociatedIrp.SystemBuffer;

            if (NT_SUCCESS(status))
            {
                //
                // Since a driver lower on the stack has an opinion then we
                // abide by it. We could also do more sophisticated analysis

            } else {
                RtlZeroMemory(checkFailure, sizeof(STORAGE_PREDICT_FAILURE));

                checkFailure->PredictFailure = (deviceExtension->PredictFailure) ?
                                                      1 : 0;
                status = STATUS_SUCCESS;
                Irp->IoStatus.Information = sizeof(STORAGE_PREDICT_FAILURE);
            }
        }

        //
        // Complete request.
        //

        Irp->IoStatus.Status = status;

        IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);

        IoCompleteRequest(Irp, IO_NO_INCREMENT);
    } else {

        //
        // Pass unrecognized device control requests
        // down to next driver layer.
        //

        IoReleaseRemoveLock(&deviceExtension->RemoveLock, Irp);
        status = FPFilterSendToNextDriver(DeviceObject, Irp);
    }
    
    return(status);
} // end FPFilterDeviceControl()



VOID
FPFilterUnload(
    IN PDRIVER_OBJECT DriverObject
    )

/*++

Routine Description:

    Free all the allocated resources, etc.

Arguments:

    DriverObject - pointer to a driver object.

Return Value:

    VOID.

--*/
{
    PAGED_CODE();

    return;
}

#if DBG

VOID
FPFilterDebugPrint(
    ULONG DebugPrintLevel,
    PCCHAR DebugMessage,
    ...
    )

/*++

Routine Description:

    Debug print for all FPFilter

Arguments:

    Debug print level between 0 and 3, with 3 being the most verbose.

Return Value:

    None

--*/

{
    va_list ap;

    va_start(ap, DebugMessage);


    if ((DebugPrintLevel <= (FPFilterDebug & 0x0000ffff)) ||
        ((1 << (DebugPrintLevel + 15)) & FPFilterDebug)) {

        _vsnprintf(FPFilterDebugBuffer, DEBUG_BUFFER_LENGTH, DebugMessage, ap);

        DbgPrint(FPFilterDebugBuffer);
    }

    va_end(ap);

}
#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产清纯白嫩初高生在线观看91| 国产成人在线视频网站| 91女厕偷拍女厕偷拍高清| 久久综合色8888| 久久精品国产久精国产| 欧美一二三四区在线| 美女网站色91| 欧美zozo另类异族| 九色综合狠狠综合久久| 欧美mv日韩mv国产网站app| 蜜桃91丨九色丨蝌蚪91桃色| 日韩欧美视频一区| 国产在线精品免费| 国产女人18水真多18精品一级做 | 国产盗摄视频一区二区三区| 欧美国产禁国产网站cc| eeuss影院一区二区三区| 亚洲三级在线观看| 色综合久久久久久久久久久| 亚洲午夜久久久久中文字幕久| 欧美日韩国产综合久久| 久久国产精品色| 国产精品入口麻豆九色| 色噜噜狠狠一区二区三区果冻| 亚洲图片欧美一区| 精品久久久久久久人人人人传媒 | 久久99国内精品| 国产日韩欧美不卡在线| 99国产精品99久久久久久| 亚洲高清在线精品| 久久五月婷婷丁香社区| 99re8在线精品视频免费播放| 亚洲一卡二卡三卡四卡无卡久久| 538在线一区二区精品国产| 国产一区高清在线| 亚洲精品你懂的| 日韩女优视频免费观看| 暴力调教一区二区三区| 天天av天天翘天天综合网| 精品国产免费视频| jizz一区二区| 秋霞影院一区二区| 国产精品久久久久7777按摩| 欧美高清性hdvideosex| 成人午夜在线播放| 免费观看成人鲁鲁鲁鲁鲁视频| 国产偷v国产偷v亚洲高清| 欧美三区在线视频| 成人国产一区二区三区精品| 爽好多水快深点欧美视频| 国产欧美精品国产国产专区| 在线播放欧美女士性生活| 成人免费看片app下载| 婷婷六月综合亚洲| 日韩伦理av电影| 久久综合资源网| 欧美日韩国产123区| www.爱久久.com| 激情综合五月婷婷| 亚洲国产精品尤物yw在线观看| 国产欧美一区二区精品忘忧草| 欧美精品视频www在线观看| 成人妖精视频yjsp地址| 蜜桃一区二区三区在线观看| 一区二区三区加勒比av| 国产亚洲精品7777| 欧美成人性战久久| 91精品国产全国免费观看| 91黄色激情网站| 日韩欧美电影在线| 欧美午夜片在线观看| 国产**成人网毛片九色 | 欧美大片在线观看一区| 欧美日韩国产小视频在线观看| 99久久精品国产毛片| 国产激情视频一区二区在线观看 | 亚洲亚洲精品在线观看| 中文字幕色av一区二区三区| 久久久91精品国产一区二区精品| 91精品国产福利在线观看| 欧美日韩视频在线第一区 | 日韩福利电影在线| 亚洲伊人色欲综合网| 国产精品成人网| 欧美激情一区二区在线| 久久久久久9999| 久久亚洲影视婷婷| 久久久久久久久99精品| 久久精品一区二区三区不卡牛牛 | 国产欧美日韩一区二区三区在线观看| 欧美一区午夜精品| 欧美日韩高清一区二区三区| 在线国产亚洲欧美| 欧美中文字幕亚洲一区二区va在线| 99精品视频在线免费观看| 99久久99精品久久久久久| av午夜精品一区二区三区| 日韩欧美国产一区在线观看| 欧美日韩国产区一| 欧美高清视频一二三区 | 亚洲精品一区二区三区四区高清 | 国产精品自拍在线| 丁香桃色午夜亚洲一区二区三区| 丰满放荡岳乱妇91ww| 色婷婷精品大视频在线蜜桃视频| 91一区一区三区| 欧美三级三级三级| 日韩精品一区国产麻豆| 国产欧美日产一区| 亚洲精品视频自拍| 日韩黄色小视频| 国产福利91精品一区二区三区| 91在线视频官网| 欧美日韩国产片| 久久综合久久鬼色中文字| 国产精品成人免费在线| 亚洲午夜在线电影| 韩国精品主播一区二区在线观看| 成人av在线影院| 欧美性视频一区二区三区| 欧美一区二区三区四区高清| 欧美一区二区三区播放老司机| 欧美一级免费观看| 欧洲国产伦久久久久久久| 91精品国产福利在线观看 | 欧美精品一二三| 日韩精品一区二区三区中文不卡| 久久嫩草精品久久久久| 国产精品区一区二区三| 亚洲图片欧美激情| 亚洲一区二区不卡免费| 美女视频第一区二区三区免费观看网站| 午夜精品久久久久久久久久 | 欧美日韩国产不卡| 精品欧美久久久| 免费的国产精品| 国产精品一区在线观看你懂的| 99在线精品视频| 欧美日韩高清一区| 久久五月婷婷丁香社区| 亚洲日本免费电影| 国产真实乱子伦精品视频| 99久久久无码国产精品| 欧美性做爰猛烈叫床潮| 精品国精品国产| 亚洲国产精华液网站w| 亚洲国产一区二区视频| 韩国视频一区二区| 成人av电影观看| 日韩欧美电影一二三| 亚洲图片激情小说| 蜜臀av性久久久久蜜臀aⅴ流畅| 成人在线综合网| 欧美在线短视频| 国产香蕉久久精品综合网| 亚洲欧洲韩国日本视频| 奇米一区二区三区av| 大尺度一区二区| 91精品国产欧美日韩| 国产精品激情偷乱一区二区∴| 日韩精品久久理论片| 99视频精品在线| 精品国产乱码久久久久久免费| 一区二区三区在线视频播放| 美日韩一区二区三区| 成人免费高清视频在线观看| 欧美精品丝袜中出| 亚洲区小说区图片区qvod| 日本aⅴ精品一区二区三区| 99久精品国产| 久久久欧美精品sm网站| 天堂精品中文字幕在线| 成人激情动漫在线观看| 国产亚洲综合性久久久影院| 奇米综合一区二区三区精品视频| 播五月开心婷婷综合| 久久蜜桃av一区二区天堂| 香蕉乱码成人久久天堂爱免费| 成人18视频日本| 337p粉嫩大胆色噜噜噜噜亚洲| 午夜精品视频在线观看| 色噜噜偷拍精品综合在线| 中文字幕免费一区| 国产69精品久久99不卡| 精品国产sm最大网站| 婷婷夜色潮精品综合在线| 在线观看视频一区| 亚洲免费在线观看视频| 丁香婷婷综合激情五月色| 欧美三区在线视频| 亚洲国产视频网站| 在线观看日韩高清av| 国产精品123区| 日韩视频一区二区| 一区二区三区国产| 欧美日韩一区二区在线视频| 亚洲精品免费播放| 色婷婷精品久久二区二区蜜臀av| 国产精品乱码一区二三区小蝌蚪| 国产乱人伦偷精品视频免下载 |