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

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

?? ctxinit.c

?? 文件系統過濾驅動程序的框架
?? C
?? 第 1 頁 / 共 2 頁
字號:
            CtxFreeResource( streamContext->Resource );
        }
        
        //
        //  Free the file name
        //
        
        if (streamContext->FileName.Buffer != NULL) {
        
            CtxFreeUnicodeString(&streamContext->FileName);
        }

        DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                    ("[Ctx]: Stream context cleanup complete.\n") );

        break;

    case FLT_STREAMHANDLE_CONTEXT:

        streamHandleContext = (PCTX_STREAMHANDLE_CONTEXT) Context;

        DebugTrace( DEBUG_TRACE_STREAMHANDLE_CONTEXT_OPERATIONS,
                    ("[Ctx]: Cleaning up stream handle context for file %wZ (StreamContext = %p)\n",
                     &streamHandleContext->FileName,
                     streamHandleContext) );        
            
        //
        //  Delete the resource and memory the memory allocated for the resource
        //
        
        if (streamHandleContext->Resource != NULL) {
        
            ExDeleteResourceLite( streamHandleContext->Resource );
            CtxFreeResource( streamHandleContext->Resource );
        }
        
        //
        //  Free the file name
        //
        
        if (streamHandleContext->FileName.Buffer != NULL) {
        
            CtxFreeUnicodeString(&streamHandleContext->FileName);
        }

        DebugTrace( DEBUG_TRACE_STREAMHANDLE_CONTEXT_OPERATIONS,
                    ("[Ctx]: Stream handle context cleanup complete.\n") );

        break;
        
    }
    
}

//
//  Instance setup/teardown routines.
//

NTSTATUS
CtxInstanceSetup (
    IN PCFLT_RELATED_OBJECTS FltObjects,
    IN FLT_INSTANCE_SETUP_FLAGS Flags,
    IN DEVICE_TYPE VolumeDeviceType,
    IN FLT_FILESYSTEM_TYPE VolumeFilesystemType
    )
/*++

Routine Description:

    This routine is called whenever a new instance is created on a volume. This
    gives us a chance to decide if we need to attach to this volume or not.

Arguments:

    FltObjects - Pointer to the FLT_RELATED_OBJECTS data structure containing
        opaque handles to this filter, instance and its associated volume.

    Flags - Flags describing the reason for this attach request.

Return Value:

    STATUS_SUCCESS - attach
    STATUS_FLT_DO_NOT_ATTACH - do not attach

--*/
{
    PCTX_INSTANCE_CONTEXT instanceContext = NULL;
    NTSTATUS status = STATUS_SUCCESS;
    ULONG volumeNameLength;

    UNREFERENCED_PARAMETER( Flags );
    UNREFERENCED_PARAMETER( VolumeDeviceType );
    UNREFERENCED_PARAMETER( VolumeFilesystemType );

    DebugTrace( DEBUG_TRACE_INSTANCES, 
                ("[Ctx]: Instance setup started (Volume = %p, Instance = %p)\n",
                 FltObjects->Volume, 
                 FltObjects->Instance) );



    //
    //  Allocate and initialize the context for this volume
    //


    //
    //  Allocate the instance context
    //

    DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS,
                ("[Ctx]: Allocating instance context (Volume = %p, Instance = %p)\n",
                 FltObjects->Volume, 
                 FltObjects->Instance) );

    status = FltAllocateContext( FltObjects->Filter,
                                 FLT_INSTANCE_CONTEXT,
                                 CTX_INSTANCE_CONTEXT_SIZE,
                                 NonPagedPool,
                                 &instanceContext );

    if( !NT_SUCCESS( status )) {

        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS | DEBUG_TRACE_ERROR,
                    ("[Ctx]: Failed to allocate instance context (Volume = %p, Instance = %p, Status = 0x%x)\n",
                     FltObjects->Volume, 
                     FltObjects->Instance,
                     status) );

        goto CtxInstanceSetupCleanup;
    }

    //
    //  Get the NT volume name length
    //

    status = FltGetVolumeName( FltObjects->Volume, NULL, &volumeNameLength );

    if( !NT_SUCCESS( status ) && 
        (status != STATUS_BUFFER_TOO_SMALL) ) {

        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS | DEBUG_TRACE_ERROR,
                    ("[Ctx]: Unexpected failure in FltGetVolumeName. (Volume = %p, Instance = %p, Status = 0x%x)\n",
                     FltObjects->Volume, 
                     FltObjects->Instance,
                     status) );

        goto CtxInstanceSetupCleanup;
    }

    //
    //  Allocate a string big enough to take the volume name 
    //

    instanceContext->VolumeName.MaximumLength = (USHORT) volumeNameLength;
    status = CtxAllocateUnicodeString( &instanceContext->VolumeName );
    
    if( !NT_SUCCESS( status )) {

        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS | DEBUG_TRACE_ERROR,
                    ("[Ctx]: Failed to allocate volume name string. (Volume = %p, Instance = %p, Status = 0x%x)\n",
                     FltObjects->Volume, 
                     FltObjects->Instance,
                     status) );

        goto CtxInstanceSetupCleanup;
    }
    
    //
    //  Get the NT volume name
    //

    status = FltGetVolumeName( FltObjects->Volume, &instanceContext->VolumeName, &volumeNameLength );

    if( !NT_SUCCESS( status ) ) {

        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS | DEBUG_TRACE_ERROR,
                    ("[Ctx]: Unexpected failure in FltGetVolumeName. (Volume = %p, Instance = %p, Status = 0x%x)\n",
                     FltObjects->Volume, 
                     FltObjects->Instance,
                     status) );

        goto CtxInstanceSetupCleanup;
    }


    instanceContext->Instance = FltObjects->Instance;
    instanceContext->Volume = FltObjects->Volume;
   
    //
    //  Set the instance context.
    //

    DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS,
                ("[Ctx]: Setting instance context %p for volume %wZ (Volume = %p, Instance = %p)\n",
                 instanceContext,
                 &instanceContext->VolumeName,
                 FltObjects->Volume, 
                 FltObjects->Instance) );

    status = FltSetInstanceContext( FltObjects->Instance,
                                    FLT_SET_CONTEXT_KEEP_IF_EXISTS,
                                    instanceContext,
                                    NULL );

    if( !NT_SUCCESS( status )) {

        DebugTrace( DEBUG_TRACE_INSTANCES | DEBUG_TRACE_ERROR,
                    ("[Ctx]: Failed to set instance context for volume %wZ (Volume = %p, Instance = %p, Status = 0x%08X)\n",
                     &instanceContext->VolumeName,
                     FltObjects->Volume, 
                     FltObjects->Instance,
                     status) );
        goto CtxInstanceSetupCleanup;
    }

CtxInstanceSetupCleanup:

    //
    //  If FltAllocateContext suceeded then we MUST release the context, 
    //  irrespective of whether FltSetInstanceContext suceeded or not.
    //  
    //  FltAllocateContext increments the ref count by one.
    //  A successful FltSetInstanceContext increments the ref count by one 
    //  and also associates the context with the file system object
    //
    //  FltReleaseContext decrements the ref count by one.
    //
    //  When FltSetInstanceContext succeeds, calling FltReleaseContext will
    //  leave the context with a ref count of 1 corresponding to the internal 
    //  reference to the context from the file system structures
    //
    //  When FltSetInstanceContext fails, calling FltReleaseContext will
    //  leave the context with a ref count of 0 which is correct since 
    //  there is no reference to the context from the file system structures
    //

    if ( instanceContext != NULL ) {

        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS,
                    ("[Ctx]: Releasing instance context %p (Volume = %p, Instance = %p)\n",
                     instanceContext,
                     FltObjects->Volume, 
                     FltObjects->Instance) );

        FltReleaseContext( instanceContext );
    }


    if (NT_SUCCESS( status )) {

        DebugTrace( DEBUG_TRACE_INSTANCES, 
                    ("[Ctx]: Instance setup complete (Volume = %p, Instance = %p). Filter will attach to the volume.\n",
                     FltObjects->Volume,
                     FltObjects->Instance) );    
    } else {

        DebugTrace( DEBUG_TRACE_INSTANCES, 
                    ("[Ctx]: Instance setup complete (Volume = %p, Instance = %p). Filter will not attach to the volume.\n",
                     FltObjects->Volume,
                     FltObjects->Instance) );
    }

    return status;
}


NTSTATUS
CtxInstanceQueryTeardown (
    IN PCFLT_RELATED_OBJECTS FltObjects,
    IN FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags
    )
/*++

Routine Description:

    This is called when an instance is being manually deleted by a
    call to FltDetachVolume or FilterDetach thereby giving us a
    chance to fail that detach request.

Arguments:

    FltObjects - Pointer to the FLT_RELATED_OBJECTS data structure containing
        opaque handles to this filter, instance and its associated volume.

    Flags - Indicating where this detach request came from.

Return Value:

    Returns the status of this operation.

--*/
{
    UNREFERENCED_PARAMETER( FltObjects );
    UNREFERENCED_PARAMETER( Flags );

    DebugTrace( DEBUG_TRACE_INSTANCES,
                ("[Ctx]: Instance query teardown started (Instance = %p)\n",
                 FltObjects->Instance) );


    DebugTrace( DEBUG_TRACE_INSTANCES,
                ("[Ctx]: Instance query teadown ended (Instance = %p)\n",
                 FltObjects->Instance) );
    return STATUS_SUCCESS;
}


VOID
CtxInstanceTeardownStart (
    IN PCFLT_RELATED_OBJECTS FltObjects,
    IN FLT_INSTANCE_TEARDOWN_FLAGS Flags
    )
/*++

Routine Description:

    This routine is called at the start of instance teardown.

Arguments:

    FltObjects - Pointer to the FLT_RELATED_OBJECTS data structure containing
        opaque handles to this filter, instance and its associated volume.

    Flags - Reason why this instance is been deleted.

Return Value:

    None.

--*/
{
    UNREFERENCED_PARAMETER( FltObjects );
    UNREFERENCED_PARAMETER( Flags );

    DebugTrace( DEBUG_TRACE_INSTANCES, 
                ("[Ctx]: Instance teardown start started (Instance = %p)\n",
                 FltObjects->Instance) );


    DebugTrace( DEBUG_TRACE_INSTANCES, 
                ("[Ctx]: Instance teardown start ended (Instance = %p)\n",
                 FltObjects->Instance) );
}


VOID
CtxInstanceTeardownComplete (
    IN PCFLT_RELATED_OBJECTS FltObjects,
    IN FLT_INSTANCE_TEARDOWN_FLAGS Flags
    )
/*++

Routine Description:

    This routine is called at the end of instance teardown.

Arguments:

    FltObjects - Pointer to the FLT_RELATED_OBJECTS data structure containing
        opaque handles to this filter, instance and its associated volume.

    Flags - Reason why this instance is been deleted.

Return Value:

    None.

--*/
{
    PCTX_INSTANCE_CONTEXT instanceContext;
    NTSTATUS status;

    UNREFERENCED_PARAMETER( Flags );

    DebugTrace( DEBUG_TRACE_INSTANCES,
                ("[Ctx]: Instance teardown complete started (Instance = %p)\n",
                 FltObjects->Instance) );

    DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS,
                ("[Ctx]: Getting instance context (Volume = %p, Instance = %p)\n",
                 FltObjects->Volume, 
                 FltObjects->Instance) );

    status = FltGetInstanceContext( FltObjects->Instance,
                                    &instanceContext );

    if (NT_SUCCESS( status )) {

        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS,
                    ("[Ctx]: Instance teardown for volume %wZ (Volume = %p, Instance = %p, InstanceContext = %p)\n",
                     &instanceContext->VolumeName,
                     FltObjects->Volume, 
                     FltObjects->Instance,
                     instanceContext) );


        //
        //  Here the filter may perform any teardown of its own structures associated
        //  with this instance.
        //
        //  The filter should not free memory or synchronization objects allocated to 
        //  objects within the instance context. That should be performed in the 
        //  cleanup callback for the instance context
        //
                    
        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS,
                    ("[Ctx]: Releasing instance context %p for volume %wZ (Volume = %p, Instance = %p)\n",
                     instanceContext,
                     &instanceContext->VolumeName,
                     FltObjects->Volume, 
                     FltObjects->Instance) );

        FltReleaseContext( instanceContext );
    } else {

        DebugTrace( DEBUG_TRACE_INSTANCE_CONTEXT_OPERATIONS | DEBUG_TRACE_ERROR,
                    ("[Ctx]: Failed to get instance context (Volume = %p, Instance = %p Status = 0x%x)\n",
                     FltObjects->Volume, 
                     FltObjects->Instance,
                     status) );
    }

    DebugTrace( DEBUG_TRACE_INSTANCES,
                ("[Ctx]: Instance teardown complete ended (Instance = %p)\n",
                 FltObjects->Instance) );
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品久久只有精品| 日韩美女一区二区三区| 日韩欧美国产电影| 亚洲婷婷在线视频| 激情久久久久久久久久久久久久久久| 97se狠狠狠综合亚洲狠狠| 精品国产第一区二区三区观看体验| 18欧美亚洲精品| 国产成人av资源| 久久久精品影视| 日韩经典一区二区| 欧美日韩日本视频| 亚洲欧美区自拍先锋| 成人国产视频在线观看| 久久嫩草精品久久久精品| 蜜桃视频在线观看一区| 欧美亚洲国产bt| 一区二区三区日韩欧美精品| 成人看片黄a免费看在线| 久久综合九色综合久久久精品综合| 首页欧美精品中文字幕| 欧美日韩精品高清| 一区二区三区自拍| 色999日韩国产欧美一区二区| 欧美国产日韩a欧美在线观看 | 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 国产精品美日韩| 狠狠色丁香婷综合久久| 精品久久免费看| 蜜臀av性久久久久蜜臀aⅴ | 蜜臀av国产精品久久久久| 欧美日韩精品三区| 日韩精品五月天| 91精品国产一区二区三区香蕉| 午夜久久电影网| 欧美日本国产一区| 蜜桃视频在线观看一区二区| 欧美一级理论片| 久久国产尿小便嘘嘘尿| 久久一夜天堂av一区二区三区| 精品一二线国产| 久久久一区二区| 成人午夜电影小说| 亚洲精品第1页| 91极品视觉盛宴| 日本不卡一二三区黄网| 精品国产成人在线影院| 成人精品国产一区二区4080| 国产精品美女久久久久久2018| 99v久久综合狠狠综合久久| 亚洲综合一区二区精品导航| 欧美色欧美亚洲另类二区| 青草国产精品久久久久久| 精品久久国产老人久久综合| 成人精品小蝌蚪| 亚洲午夜成aⅴ人片| 日韩欧美色综合网站| 成人av中文字幕| 午夜视频在线观看一区二区三区| 日韩三级av在线播放| 国产成人精品午夜视频免费| 日韩高清不卡在线| 精品久久一区二区| 97久久超碰国产精品| 琪琪久久久久日韩精品| 欧美国产一区二区| 欧美日韩国产成人在线免费| 国产一区二区在线免费观看| 亚洲影院理伦片| 精品对白一区国产伦| 在线观看日韩电影| 国产一区激情在线| 午夜久久久久久电影| 欧美韩国日本一区| 日韩欧美国产不卡| 欧美亚洲国产一区二区三区| 东方欧美亚洲色图在线| 三级不卡在线观看| 亚洲男同性视频| 欧美精品一区男女天堂| 欧美日韩一区二区三区四区五区 | 奇米精品一区二区三区在线观看一| 久久久国产精华| 欧美日韩大陆一区二区| 成人精品视频一区二区三区| 九九精品视频在线看| 亚洲一区视频在线观看视频| 久久久久国产精品麻豆| 69精品人人人人| av亚洲精华国产精华精华| 久久99精品一区二区三区| 亚洲电影视频在线| 亚洲精品欧美综合四区| 欧美激情一区二区三区全黄| 欧美tk—视频vk| 91精品国产乱| 欧美一三区三区四区免费在线看| 色综合网站在线| 99综合影院在线| 丰满岳乱妇一区二区三区| 久久91精品国产91久久小草| 亚洲成a人片在线不卡一二三区| 1024亚洲合集| 国产精品亲子乱子伦xxxx裸| 欧美激情资源网| 国产精品素人视频| 国产精品视频你懂的| 久久一夜天堂av一区二区三区| 日韩一区二区三区电影在线观看| 欧美日本视频在线| 91精品国产乱码久久蜜臀| 这里是久久伊人| 欧美一区二区三区人| 日韩网站在线看片你懂的| 日韩欧美中文字幕公布| 欧美一级夜夜爽| 欧美一二区视频| 欧美不卡一二三| 久久欧美中文字幕| 国产精品视频线看| 日韩伦理av电影| 亚洲国产欧美日韩另类综合| 亚洲图片欧美色图| 日韩成人一区二区三区在线观看| 日韩精品色哟哟| 久久99精品一区二区三区| 国产精品资源在线看| 成人激情免费视频| 日韩一区二区三区在线视频| 日韩免费福利电影在线观看| 国产午夜精品福利| 国产精品久久久久aaaa樱花| 亚洲激情图片qvod| 麻豆精品视频在线观看免费| 国产伦精一区二区三区| 福利一区二区在线| 在线视频综合导航| 日韩三级电影网址| 国产精品毛片a∨一区二区三区 | 中文字幕电影一区| 一区二区三区精品| 久久精品国产成人一区二区三区 | 九色综合狠狠综合久久| 国产91精品欧美| 在线日韩av片| 精品88久久久久88久久久| 国产精品乱人伦| 男人的j进女人的j一区| 成人美女在线观看| 91精品国产综合久久蜜臀| 久久久久国产精品麻豆| 亚洲一区二区偷拍精品| 久久99精品一区二区三区| 色婷婷综合中文久久一本| 日韩欧美不卡在线观看视频| 中文字幕亚洲不卡| 久草这里只有精品视频| 色悠悠亚洲一区二区| 精品国产乱码91久久久久久网站| 一区二区三区四区亚洲| 精彩视频一区二区| 欧美区在线观看| 国产精品免费aⅴ片在线观看| 日韩精品视频网| 一本久道中文字幕精品亚洲嫩| 精品嫩草影院久久| 婷婷亚洲久悠悠色悠在线播放| 国产成人综合视频| 日韩欧美一级精品久久| 亚洲一区二区四区蜜桃| 不卡的看片网站| 精品福利av导航| 日韩精品免费视频人成| 色狠狠色狠狠综合| 国产精品免费久久久久| 国产一区欧美日韩| 欧美电影免费提供在线观看| 一区二区三区免费在线观看| 成人免费观看视频| 亚洲精品一区二区三区四区高清| 一区二区高清免费观看影视大全| 丁香婷婷综合激情五月色| 精品国产伦理网| 日本三级亚洲精品| 欧美三级日韩三级| 亚洲一区精品在线| 91首页免费视频| 亚洲视频一区二区在线观看| 大胆亚洲人体视频| 久久久精品tv| 国产91精品在线观看| 久久久不卡网国产精品一区| 国精品**一区二区三区在线蜜桃| 91麻豆精品国产91久久久更新时间 | 蜜桃视频一区二区三区在线观看| 精品婷婷伊人一区三区三| 亚洲一二三级电影| 欧美日韩电影在线播放| 午夜精品久久久| 中文字幕免费在线观看视频一区|