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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? filespy.c

?? 文件過濾驅動
?? C
?? 第 1 頁 / 共 5 頁
字號:
)
/*++

Routine Description:

    This routine is the main dispatch routine for the general purpose file
    system driver.  It simply passes requests onto the next driver in the
    stack, which is presumably a disk file system, while logging any
    relevant information if logging is turned on for this DeviceObject.

Arguments:

    DeviceObject - Pointer to the device object for this driver.
    Irp - Pointer to the request packet representing the I/O request.

Return Value:

    The function value is the status of the operation.

Note:

    This routine passes the I/O request through to the next driver
    *without* removing itself from the stack (like sfilter) since it could
    want to see the result of this I/O request.
    
    To remain in the stack, we have to copy the caller's parameters to the
    next stack location.  Note that we do not want to copy the caller's I/O
    completion routine into the next stack location, or the caller's routine
    will get invoked twice.  This is why we NULL out the Completion routine.
    If we are logging this device, we set our own Completion routine.
    
--*/
{
    PDEVICE_EXTENSION  pDeviceExtension;
    PIO_STACK_LOCATION pIrpStack,pNextIrpSp;
    UCHAR              loggingFlags = 0;
    KIRQL              oldIrql;

    pDeviceExtension = DeviceObject->DeviceExtension;

    pIrpStack = IoGetCurrentIrpStackLocation( Irp );
    pNextIrpSp = IoGetNextIrpStackLocation( Irp );

    //
    //  FileSpy needs to consume a stack location if it wants to receive
    //  a callback on the I/O operation's completion path.  FileSpy
    //  does not change any of the parameters, so just copy the caller's 
    //  parameters (which includes the caller's completion routine)
    //  to the next stack location.  FileSpy then must clear the completion 
    //  routine since we don't want the caller's routine to be called (resulting
    //  in that completion routine being called twice).  FileSpy will set
    //  its own completion routine in the case that it wants the completion.
    //
    RtlMoveMemory( pNextIrpSp, pIrpStack, sizeof( IO_STACK_LOCATION ) );
    IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE );
           
    if (SHOULD_LOG(DeviceObject)) {
        PRECORD_LIST       recordList;
        //
        // The ControlDevice is opened, so allocate the Record 
        // and log the Irp information if we have the memory.
        //
        recordList = SpyNewRecord(0);
        if (recordList) {
            loggingFlags |= LOG_ORIGINATING_IRP;
            SpyLogIrp( Irp, loggingFlags, recordList );

            //
            //  Since we are logging this operation, we want to 
            //  see its completion so register our completion
            //  routine.
            //
            IoSetCompletionRoutine(
                Irp,
                SpyPassThroughCompletion,
                (PVOID)recordList,
                TRUE,
                TRUE,
                TRUE);
        }
    }

    //
    // If this is a IRP_MJ_CLOSE see if the FileObject's name is being
    // cached and remove it from the cache if it is.  We want to do this
    // as long as the ControlDevice is opened so that we purge the
    // cache as accurately as possible.
    //
    ExAcquireSpinLock( &gControlDeviceStateLock, &oldIrql );
    if (gControlDeviceState == OPENED) {
        if (pIrpStack->MajorFunction == IRP_MJ_CLOSE) {
            SpyNameDelete(pIrpStack->FileObject);
        }
    }
    ExReleaseSpinLock( &gControlDeviceStateLock, oldIrql );

    //
    // Now call the appropriate file system driver with the request.
    //
    return IoCallDriver( pDeviceExtension->NextDriverDeviceObject, Irp );
}

DBGSTATIC
NTSTATUS
SpyPassThroughCompletion(
    IN PDEVICE_OBJECT  DeviceObject,
    IN PIRP            Irp,
    IN PVOID           Context
)
/*++

Routine Description:

    This routine is the completion routine SpyPassThrough.  This is used
    to log the information that can only be gathered after the I/O request
    has been completed.

    Once we are done logging all the information we care about, we append
    the record to the gOutputBufferList to be returned to the user.
    
    Note: This routine will only be set if we were trying to log the
        specified device when the Irp originated and we were able to
        allocate a record to store this logging information.

Arguments:

    DeviceObject - Pointer to the device object for this driver.
    Irp - Pointer to the request packet representing the I/O request.
    Context - Pointer to the RECORD_LIST structure in which we store the
        information we are logging.

Return Value:

    The function value is the status of the operation.

--*/
{
    PRECORD_LIST  recordList;
    UCHAR         loggingFlags = 0;

    recordList = (PRECORD_LIST)Context;

    if (SHOULD_LOG(DeviceObject))
    {
        loggingFlags |= LOG_COMPLETION_IRP;
        SpyLogIrp( Irp, loggingFlags, recordList );
        
        //
        // Add recordList to our gOutputBufferList so that it gets up to 
        // the user
        //
        SpyLog(recordList);       
    } else {
        if (recordList) {
            //
            // Context is set with a RECORD_LIST, but we are no longer
            // logging so free this record.
            //
            SpyFreeRecord(recordList);
        }
    }
    
    //
    // Propogate the IRP pending flag.  All completion routines
    // need to do this.
    //
    if (Irp->PendingReturned) {
        IoMarkIrpPending( Irp );
    }

    return STATUS_SUCCESS;
}

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

Routine Description:

    This function completes all requests on the gControlDeviceObject 
    (FileSpy's device object) and passes all other requests on to the 
    SpyPassThrough function.

Arguments:

    DeviceObject - Pointer to the device object for this driver.
    Irp - Pointer to the request packet representing the I/O request.

Return Value:

    If this is a request on the gControlDeviceObject, STATUS_SUCCESS 
    will be returned unless the device is already attached.  In that case,
    STATUS_DEVICE_ALREADY_ATTACHED is returned.

    If this is a request on a device other than the gControlDeviceObject,
    the function will return the value of SpyPassThrough().

--*/
{
    ULONG              status = STATUS_SUCCESS;
    PIO_STACK_LOCATION irpStack;
    KIRQL              oldIrql;
    
    
    if (DeviceObject == gControlDeviceObject) {
        //
        //  A request is being made on our device object, gControlDeviceObject.
        //
        Irp->IoStatus.Information = 0;
    
        irpStack = IoGetCurrentIrpStackLocation( Irp );
       
        switch (irpStack->MajorFunction) {
            case IRP_MJ_CLOSE:
        
                SpyCloseControlDevice();
                break;

            default:
                status = STATUS_INVALID_PARAMETER;
        }

        Irp->IoStatus.Status = status;

        //
        //  We have completed all processing for this IRP, so tell the 
        //  I/O Manager.  This IRP will not be passed any further down
        //  the stack since no drivers below FileSpy care about this 
        //  I/O operation that was directed to FileSpy.
        //
        IoCompleteRequest( Irp, IO_NO_INCREMENT );
        return status;
    }

    return SpyPassThrough( DeviceObject, Irp );
}

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

Routine Description:

    This is the routine that is associated with IRP_MJ_CREATE irp.  If the 
    DeviceObject is the ControlDevice, we do the creation work for the 
    ControlDevice and complete the irp.  Otherwise, we pass through
    this irp for another device to complete.
    
    Note: Some of the code in this function duplicates the functions 
        SpyDispatch and SpyPassThrough, but a design decision was made that 
        it was worth the code duplication to break out the irp handlers 
        that can be pagable code.
    
Arguments:

    DeviceObject - Pointer to the device object for this driver.
    Irp - Pointer to the request packet representing the I/O request.
    
Return Value:

    If DeviceObject == gControlDeviceObject, then this function will 
    complete the Irp and return the status of that completion.  Otherwise,
    this function returns the result of calling SpyPassThrough.
    
--*/
{
    ULONG               status = STATUS_SUCCESS;
    PIO_STACK_LOCATION  pIrpStack;
    KIRQL               oldIrql;

    if (DeviceObject == gControlDeviceObject) {
        //
        // A CREATE request is being made on our gControlDeviceObject
        //
        ExAcquireSpinLock( &gControlDeviceStateLock, &oldIrql );
        if (gControlDeviceState != CLOSED) {
            status = STATUS_DEVICE_ALREADY_ATTACHED;
        } else {
            gControlDeviceState = OPENED;
        }
        ExReleaseSpinLock( &gControlDeviceStateLock, oldIrql );

        //
        // Since this is our gControlDeviceObject, we complete the
        // irp here.
        //
        Irp->IoStatus.Status = status;
        IoCompleteRequest( Irp, IO_NO_INCREMENT );
        return status;
    }

    //
    //
    // This is a CREATE so we need to invalidate the name currently
    // stored in the name cache for this FileObject.  We need to do
    // this as long as our ControlDevice is open so that we keep the
    // name cache up-to-date.
    //
    pIrpStack = IoGetCurrentIrpStackLocation( Irp );
    ExAcquireSpinLock( &gControlDeviceStateLock, &oldIrql );
    if (gControlDeviceState == OPENED) {
        SpyNameDelete(pIrpStack->FileObject);
    }
    ExReleaseSpinLock( &gControlDeviceStateLock, oldIrql );

    // This is NOT our gControlDeviceObject, so let SpyPassThrough handle
    // it appropriately
    //
    return SpyPassThrough( DeviceObject, Irp );
}

DBGSTATIC
BOOLEAN
SpyFastIoCheckIfPossible(
    IN PFILE_OBJECT      FileObject,
    IN PLARGE_INTEGER    FileOffset,
    IN ULONG             Length,
    IN BOOLEAN           Wait,
    IN ULONG             LockKey,
    IN BOOLEAN           CheckForReadOperation,
    OUT PIO_STATUS_BLOCK IoStatus,
    IN PDEVICE_OBJECT    DeviceObject
)
/*++

Routine Description:

    This routine is the fast I/O "pass through" routine for checking to see
    whether fast I/O is possible for this file.

    This function simply invokes the next driver's cooresponding routine, or
    returns FALSE if the next driver does not implement the function.

Arguments:

    FileObject - Pointer to the file object to be operated on.

    FileOffset - Byte offset in the file for the operation.

    Length - Length of the operation to be performed.

    Wait - Indicates whether or not the caller is willing to wait if the
        appropriate locks, etc. cannot be acquired

    LockKey - Provides the caller's key for file locks.

    CheckForReadOperation - Indicates whether the caller is checking for a
        read (TRUE) or a write operation.

    IoStatus - Pointer to a variable to receive the I/O status of the
        operation.

    DeviceObject - Pointer to this driver's device object, the device on
        which the operation is to occur.

Return Value:

    The function value is TRUE or FALSE based on whether or not fast I/O
    is possible for this file.

--*/
{
    PDEVICE_OBJECT    deviceObject;
    PFAST_IO_DISPATCH fastIoDispatch;
    BOOLEAN           returnValue;
    PRECORD_LIST      recordList;
    BOOLEAN           shouldLog;
    
    PAGED_CODE();

    if (DeviceObject->DeviceExtension == NULL) {
        return FALSE;
    }
    
    if (shouldLog = SHOULD_LOG(DeviceObject)) {
        //
        // Log the necessary information for the start of the Fast I/O 
        // operation
        //
        recordList = SpyLogFastIoStart(
            CHECK_IF_POSSIBLE,
            0,
            FileObject,
            FileOffset,
            Length,
            Wait );
    }

    //
    // Pass through logic for this type of Fast I/O
    //
    deviceObject = 
        ((PDEVICE_EXTENSION) (DeviceObject->DeviceExtension))->
            NextDriverDeviceObject;
    if (!deviceObject) {
        returnValue = FALSE;
        goto SpyFastIoCheckIfPossible_Exit;
    }
    fastIoDispatch = deviceObject->DriverObject->FastIoDispatch;

    if (VALID_FAST_IO_DISPATCH_HANDLER( fastIoDispatch, FastIoCheckIfPossible )) {
        returnValue = (fastIoDispatch->FastIoCheckIfPossible)( FileObject,
                                                               FileOffset,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线免费看| 国产综合久久久久久久久久久久| 亚洲一区二区三区四区五区黄| 喷水一区二区三区| 91官网在线观看| 国产色一区二区| 免费一区二区视频| 欧美精品乱人伦久久久久久| 中文字幕一区二区三区在线播放| 蜜臂av日日欢夜夜爽一区| 欧洲一区二区三区在线| 中文av一区二区| 国产呦萝稀缺另类资源| 4438x亚洲最大成人网| 亚洲美女一区二区三区| 成人丝袜高跟foot| 国产亚洲精品资源在线26u| 日本视频在线一区| 欧美日韩国产成人在线91| 夜夜嗨av一区二区三区网页| 成人免费电影视频| 久久久噜噜噜久噜久久综合| 蜜桃精品视频在线| 日韩一级片在线观看| 婷婷综合另类小说色区| 色婷婷av一区二区三区软件 | 亚洲成人av在线电影| 91免费在线视频观看| 国产精品网站一区| 99精品视频一区二区三区| 国产精品色噜噜| jizzjizzjizz欧美| 综合久久一区二区三区| k8久久久一区二区三区| 综合久久久久久久| 色婷婷综合久久久久中文一区二区 | 欧美电视剧免费观看| 日韩国产精品91| 日韩午夜电影av| 久久精品国产成人一区二区三区| 欧美日韩国产成人在线免费| 日韩不卡一区二区三区| 日韩视频一区二区在线观看| 免费人成精品欧美精品| 欧美精品一区二区三| 国产精品乡下勾搭老头1| 国产精品视频第一区| 日本韩国视频一区二区| 午夜精品福利在线| 日韩精品一区二区三区四区| 国产美女视频一区| 中文字幕一区二区三区不卡| 91丨九色丨蝌蚪富婆spa| 亚洲第一久久影院| 中文字幕人成不卡一区| 色噜噜狠狠色综合欧洲selulu| 亚洲综合清纯丝袜自拍| 日韩女优电影在线观看| 国产成人aaaa| 亚洲精品视频在线观看网站| 欧美日韩久久一区| 国产在线不卡一区| 亚洲一区二区三区激情| 日韩亚洲欧美中文三级| 成人福利电影精品一区二区在线观看| 亚洲三级久久久| 欧美www视频| 色综合视频在线观看| 青青草国产成人99久久| 亚洲国产成人自拍| 6080亚洲精品一区二区| 成人免费视频一区| 日韩国产欧美视频| 国产精品久久网站| 日韩欧美一区在线| 91豆麻精品91久久久久久| 狠狠久久亚洲欧美| 性做久久久久久久久| 久久蜜臀中文字幕| 欧美日韩国产综合一区二区三区| 国产主播一区二区三区| 亚洲成人先锋电影| 亚洲欧洲精品一区二区精品久久久| 欧美军同video69gay| 99久久综合国产精品| 老色鬼精品视频在线观看播放| 亚洲欧美成人一区二区三区| 日韩视频一区二区三区在线播放 | 国产精品国产三级国产| 精品久久99ma| 在线不卡a资源高清| 不卡的av网站| 国产福利一区二区三区在线视频| 男女激情视频一区| 亚洲电影第三页| 亚洲自拍偷拍麻豆| 国产精品国产馆在线真实露脸| 精品国产伦一区二区三区观看方式 | 欧美日韩美少妇| 色噜噜狠狠成人网p站| 成人18视频在线播放| 国产aⅴ精品一区二区三区色成熟| 青青草原综合久久大伊人精品| 性感美女久久精品| 亚洲乱码国产乱码精品精小说 | 国产欧美va欧美不卡在线| 欧美电影免费观看高清完整版在 | 国产精品久久久一本精品| 久久网站最新地址| 精品国产乱码久久| 日韩美女一区二区三区四区| 欧美日韩国产精选| 欧美日韩在线亚洲一区蜜芽| 色婷婷国产精品| 欧美日韩在线播放三区四区| 欧美自拍偷拍一区| 欧美系列日韩一区| 欧美日韩国产一二三| 欧美美女一区二区在线观看| 欧美日韩国产综合一区二区| 欧美精品三级日韩久久| 正在播放亚洲一区| 欧美成人一区二区三区片免费 | 日韩欧美成人激情| 精品国产成人系列| 国产精品色哟哟网站| 亚洲色图另类专区| 亚洲国产精品一区二区久久恐怖片 | av动漫一区二区| 在线这里只有精品| 精品污污网站免费看| 日韩精品一区二区三区中文不卡| 久久在线观看免费| 国产精品色哟哟| 一个色综合av| 麻豆一区二区三| 懂色一区二区三区免费观看 | 国产麻豆精品在线观看| 成人国产在线观看| 欧美视频在线一区| 精品少妇一区二区三区视频免付费 | 日韩av一级片| 福利一区福利二区| 欧美综合久久久| 精品成人私密视频| 亚洲视频每日更新| 蜜桃一区二区三区在线观看| 国产成人免费在线观看不卡| 色婷婷久久综合| 久久先锋资源网| 亚洲一区二区欧美日韩| 国产在线不卡视频| 欧美视频完全免费看| 精品国产乱码久久| 亚洲影院理伦片| 国产伦精品一区二区三区视频青涩| 99精品在线免费| 久久伊人中文字幕| 亚洲午夜久久久久| 在线播放日韩导航| 日本一区二区久久| 丝袜亚洲精品中文字幕一区| 丁香五精品蜜臀久久久久99网站| 欧美日韩一区高清| 国产精品盗摄一区二区三区| 日本欧美在线观看| 色哟哟亚洲精品| 久久精品夜色噜噜亚洲a∨| 亚洲国产视频直播| 成人高清视频在线| 精品国产乱码久久久久久牛牛| 亚洲一二三四在线| 波多野结衣在线aⅴ中文字幕不卡| 91精品国产高清一区二区三区蜜臀| 欧美韩日一区二区三区| 久久精品国产一区二区三| 在线亚洲免费视频| 国产精品色哟哟网站| 国产一区二区在线免费观看| 欧美日韩国产成人在线免费| 亚洲日本欧美天堂| 成人禁用看黄a在线| 久久久久久97三级| 久久福利视频一区二区| 欧美二区三区的天堂| 亚洲最色的网站| 91精品福利视频| 亚洲视频一二区| 色婷婷久久综合| 亚洲精品国产一区二区精华液 | 精品国产露脸精彩对白| 卡一卡二国产精品| 日韩欧美国产不卡| 美日韩一区二区三区| 日韩一区二区在线观看视频| 午夜精品视频一区| 91精品中文字幕一区二区三区| 亚洲国产精品久久人人爱蜜臀| 在线观看www91| 天天做天天摸天天爽国产一区|