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

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

?? context.c

?? 文件系統(tǒng)過(guò)濾驅(qū)動(dòng)程序的框架
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*++

Copyright (c) 1999 - 2002  Microsoft Corporation

Module Name:

    context.c

Abstract:

    This is the stream nd stream handle context module of the kernel mode
    context sample filter driver


Environment:

    Kernel mode


--*/


#include "pch.h"


#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, CtxFindOrCreateStreamContext)
#pragma alloc_text(PAGE, CtxCreateStreamContext)
#pragma alloc_text(PAGE, CtxUpdateNameInStreamContext)
#pragma alloc_text(PAGE, CtxCreateOrReplaceStreamHandleContext)
#pragma alloc_text(PAGE, CtxCreateStreamHandleContext)
#pragma alloc_text(PAGE, CtxUpdateNameInStreamHandleContext)
#endif


NTSTATUS
CtxFindOrCreateStreamContext (
    IN PFLT_CALLBACK_DATA Cbd,
    IN BOOLEAN CreateIfNotFound,
    OUT PCTX_STREAM_CONTEXT *StreamContext,
    OUT PBOOLEAN ContextCreated OPTIONAL
    )
/*++

Routine Description:

    This routine finds the stream context for the target stream.
    Optionally, if the context does not exist this routing creates
    a new one and attaches the context to the stream.

Arguments:

    Cbd                   - Supplies a pointer to the callbackData which
                            declares the requested operation.
    CreateIfNotFound      - Supplies if the stream must be created if missing
    StreamContext         - Returns the stream context
    ContextCreated        - Returns if a new context was created

Return Value:

    Status

--*/
{
    NTSTATUS status;
    PCTX_STREAM_CONTEXT streamContext;
    PCTX_STREAM_CONTEXT oldStreamContext;

    PAGED_CODE();

    *StreamContext = NULL;
    if (ContextCreated != NULL) *ContextCreated = FALSE;

    //
    //  First try to get the stream context.
    //

    DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                ("[Ctx]: Trying to get stream context (FileObject = %p, Instance = %p)\n",
                 Cbd->Iopb->TargetFileObject,
                 Cbd->Iopb->TargetInstance) );

    status = FltGetStreamContext( Cbd->Iopb->TargetInstance,
                                  Cbd->Iopb->TargetFileObject,
                                  &streamContext );

    //
    //  If the call failed because the context does not exist
    //  and the user wants to creat a new one, the create a
    //  new context
    //

    if (!NT_SUCCESS( status ) &&
        (status == STATUS_NOT_FOUND) &&
        CreateIfNotFound) {


        //
        //  Create a stream context
        //

        DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                    ("[Ctx]: Creating stream context (FileObject = %p, Instance = %p)\n",
                     Cbd->Iopb->TargetFileObject,
                     Cbd->Iopb->TargetInstance) );

        status = CtxCreateStreamContext( &streamContext );

        if (!NT_SUCCESS( status )) {

            DebugTrace( DEBUG_TRACE_ERROR | DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                        ("[Ctx]: Failed to create stream context with status 0x%x. (FileObject = %p, Instance = %p)\n",
                        status,
                        Cbd->Iopb->TargetFileObject,
                        Cbd->Iopb->TargetInstance) );

            return status;
        }


        //
        //  Set the new context we just allocated on the file object
        //

        DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                    ("[Ctx]: Setting stream context %p (FileObject = %p, Instance = %p)\n",
                     streamContext,
                     Cbd->Iopb->TargetFileObject,
                     Cbd->Iopb->TargetInstance) );

        status = FltSetStreamContext( Cbd->Iopb->TargetInstance,
                                      Cbd->Iopb->TargetFileObject,
                                      FLT_SET_CONTEXT_KEEP_IF_EXISTS,
                                      streamContext,
                                      &oldStreamContext );

        if (!NT_SUCCESS( status )) {

            DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                        ("[Ctx]: Failed to set stream context with status 0x%x. (FileObject = %p, Instance = %p)\n",
                        status,
                        Cbd->Iopb->TargetFileObject,
                        Cbd->Iopb->TargetInstance) );
            //
            //  We release the context here because FltSetStreamContext failed
            //
            //  If FltSetStreamContext succeeded then the context will be returned
            //  to the caller. The caller will use the context and then release it
            //  when he is done with the context.
            //

            DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                        ("[Ctx]: Releasing stream context %p (FileObject = %p, Instance = %p)\n",
                         streamContext,
                         Cbd->Iopb->TargetFileObject,
                         Cbd->Iopb->TargetInstance) );

            FltReleaseContext( streamContext );

            if (status != STATUS_FLT_CONTEXT_ALREADY_DEFINED) {

                //
                //  FltSetStreamContext failed for a reason other than the context already
                //  existing on the stream. So the object now does not have any context set
                //  on it. So we return failure to the caller.
                //

                DebugTrace( DEBUG_TRACE_ERROR | DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                            ("[Ctx]: Failed to set stream context with status 0x%x != STATUS_FLT_CONTEXT_ALREADY_DEFINED. (FileObject = %p, Instance = %p)\n",
                            status,
                            Cbd->Iopb->TargetFileObject,
                            Cbd->Iopb->TargetInstance) );

                return status;
            }

            //
            //  Race condition. Someone has set a context after we queried it.
            //  Use the already set context instead
            //

            DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                        ("[Ctx]: Stream context already defined. Retaining old stream context %p (FileObject = %p, Instance = %p)\n",
                         oldStreamContext,
                         Cbd->Iopb->TargetFileObject,
                         Cbd->Iopb->TargetInstance) );

            //
            //  Return the existing context. Note that the new context that we allocated has already been
            //  realeased above.
            //

            streamContext = oldStreamContext;
        } else {

            if (ContextCreated != NULL) *ContextCreated = TRUE;
        }
    }

    *StreamContext = streamContext;

    return status;
}




NTSTATUS
CtxCreateStreamContext (
    OUT PCTX_STREAM_CONTEXT *StreamContext
    )
/*++

Routine Description:

    This routine creates a new stream context

Arguments:

    StreamContext         - Returns the stream context

Return Value:

    Status

--*/
{
    NTSTATUS status;
    PCTX_STREAM_CONTEXT streamContext;

    PAGED_CODE();

    //
    //  Allocate a stream context
    //

    DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS,
                ("[Ctx]: Allocating stream context \n") );

    status = FltAllocateContext( Globals.Filter,
                                 FLT_STREAM_CONTEXT,
                                 CTX_STREAM_CONTEXT_SIZE,
                                 PagedPool,
                                 &streamContext );

    if (!NT_SUCCESS( status )) {

        DebugTrace( DEBUG_TRACE_STREAM_CONTEXT_OPERATIONS | DEBUG_TRACE_ERROR,
                    ("[Ctx]: Failed to allocate stream context with status 0x%x \n",
                     status) );
        return status;
    }

    //
    //  Initialize the newly created context
    //

    RtlZeroMemory( streamContext, CTX_STREAM_CONTEXT_SIZE );

    streamContext->Resource = CtxAllocateResource();
    if(streamContext->Resource == NULL) {

        FltReleaseContext( streamContext );
        return STATUS_INSUFFICIENT_RESOURCES;
    }
    ExInitializeResourceLite( streamContext->Resource );

    *StreamContext = streamContext;

    return STATUS_SUCCESS;
}


NTSTATUS
CtxUpdateNameInStreamContext (
    IN PUNICODE_STRING FileName,
    OUT PCTX_STREAM_CONTEXT StreamContext
    )
/*++

Routine Description:

    This routine updates the name of the target in the supplied stream context

Arguments:

    FileName         - Supplies the directory name
    StreamContext    - Returns the updated name in the stream context

Return Value:

    Status

Note:

    The caller must synchronize access to the context. This routine does no
    synchronization

--*/
{
    NTSTATUS status;

    //
    //  Free any existing name
    //

    if (StreamContext->FileName.Buffer != NULL) {

        CtxFreeUnicodeString(&StreamContext->FileName);
    }


    //
    //  Allocate and copy off the directory name
    //

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国三级在线一区| 国产成人av电影| 国产亚洲美州欧州综合国| 在线观看欧美精品| 国产麻豆精品95视频| 亚洲综合激情网| 欧美高清在线视频| 欧美一级免费大片| 91行情网站电视在线观看高清版| 极品美女销魂一区二区三区免费| 亚洲v日本v欧美v久久精品| 国产亚洲女人久久久久毛片| 3d成人h动漫网站入口| 色综合久久99| www.日韩在线| 高清av一区二区| 极品少妇xxxx精品少妇| 天天亚洲美女在线视频| 一区二区三区四区在线| 亚洲国产成人一区二区三区| 337p日本欧洲亚洲大胆精品| 欧美福利视频导航| 一本大道久久a久久精品综合| 国产精品12区| 国产精品99久久久久久似苏梦涵| 久久精品国产一区二区| 七七婷婷婷婷精品国产| 亚洲成人av一区二区三区| 亚洲精品一二三| 亚洲欧美偷拍另类a∨色屁股| 国产欧美日韩亚州综合| 久久久久国色av免费看影院| 精品对白一区国产伦| 日韩一区二区免费在线观看| 欧美肥妇bbw| 欧美福利一区二区| 91精品在线一区二区| 91精品欧美福利在线观看| 在线播放欧美女士性生活| 欧美日韩精品是欧美日韩精品| 色激情天天射综合网| 欧美在线免费播放| 欧美日韩视频不卡| 9191成人精品久久| 日韩亚洲国产中文字幕欧美| 精品国产乱子伦一区| 精品国产乱码久久| 久久久不卡网国产精品二区| 国产精品丝袜91| 中文欧美字幕免费| 亚洲欧美aⅴ...| 亚洲黄网站在线观看| 亚洲福利一二三区| 日本va欧美va瓶| 国产美女一区二区三区| 高清视频一区二区| 一本到不卡免费一区二区| 91精品福利视频| 91麻豆精品国产91久久久 | 成人ar影院免费观看视频| 成人国产精品免费观看动漫| 色乱码一区二区三区88| 欧美精选一区二区| 2023国产精品视频| 综合中文字幕亚洲| 亚洲高清视频中文字幕| 久久99最新地址| 成人av电影观看| 欧美麻豆精品久久久久久| 精品奇米国产一区二区三区| 国产欧美精品一区| 亚洲国产精品麻豆| 精品写真视频在线观看| 99精品国产91久久久久久| 欧美日韩高清不卡| 久久久亚洲午夜电影| 国产精品不卡在线观看| 日韩 欧美一区二区三区| 国产在线视视频有精品| 91福利国产成人精品照片| 日韩欧美成人激情| 亚洲男帅同性gay1069| 久热成人在线视频| 91麻豆免费看片| 欧美成人三级电影在线| 亚洲男女一区二区三区| 免费观看在线综合色| 91亚洲国产成人精品一区二区三| 69久久99精品久久久久婷婷| 国产精品国产三级国产a| 视频一区国产视频| 99re视频精品| 久久蜜桃av一区二区天堂| 亚洲一区二区三区在线| 国产精品一区二区三区99| 欧美精品99久久久**| 国产精品成人在线观看| 激情都市一区二区| 欧美视频一区二| 中文字幕一区二区不卡| 国产资源在线一区| 欧美喷水一区二区| 成人免费在线视频观看| 国产精品18久久久久久久网站| 欧美日韩高清一区二区不卡| 亚洲色图一区二区| 国产大陆亚洲精品国产| 日韩女优视频免费观看| 亚洲妇熟xx妇色黄| 一本到高清视频免费精品| 国产三级精品视频| 久久国产精品色| 欧美电影一区二区三区| 亚洲激情成人在线| 99re在线视频这里只有精品| 国产日韩欧美a| 国产一区二区三区免费| 欧美xxxxx牲另类人与| 日本视频中文字幕一区二区三区 | 日韩免费高清av| 亚洲国产人成综合网站| 91久久精品日日躁夜夜躁欧美| 国产精品免费aⅴ片在线观看| 国产精品一卡二卡在线观看| 日韩欧美aaaaaa| 美女在线观看视频一区二区| 777a∨成人精品桃花网| 午夜激情一区二区| 欧美军同video69gay| 午夜精品久久久久久久| 欧美三级电影网| 五月婷婷综合激情| 欧美三区在线观看| 亚洲国产日韩av| 欧美美女黄视频| 婷婷综合五月天| 欧美高清激情brazzers| 日本欧美在线观看| 日韩欧美在线1卡| 理论电影国产精品| 2024国产精品视频| 懂色中文一区二区在线播放| 日本一区二区电影| 不卡欧美aaaaa| 亚洲女与黑人做爰| 欧美影院午夜播放| 日韩精品欧美成人高清一区二区| 日韩一区二区在线免费观看| 免费成人小视频| 久久久青草青青国产亚洲免观| 国产乱国产乱300精品| 国产精品乱码人人做人人爱 | 精品少妇一区二区三区免费观看 | 亚洲国产精品视频| 欧美一区二区不卡视频| 国产一区二区伦理片| 国产精品视频yy9299一区| 91黄色在线观看| 日本美女一区二区三区视频| 久久―日本道色综合久久| 成人91在线观看| 亚洲成人tv网| 久久久av毛片精品| 91在线高清观看| 日韩av一区二| 国产精品嫩草影院av蜜臀| 色视频成人在线观看免| 日日噜噜夜夜狠狠视频欧美人| 久久久蜜臀国产一区二区| 97久久精品人人爽人人爽蜜臀| 香蕉久久一区二区不卡无毒影院| 欧美成人vps| 99国产精品国产精品久久| 日本欧美大码aⅴ在线播放| 国产日韩视频一区二区三区| 91官网在线观看| 老鸭窝一区二区久久精品| 一区二区中文视频| 欧美一区二区三区免费观看视频| 国产精品系列在线播放| 亚洲午夜久久久久久久久久久| 亚洲一区av在线| 久久久久久久久97黄色工厂| 在线一区二区三区做爰视频网站| 久久99国产精品成人| 中文字幕亚洲视频| 欧美r级在线观看| 色综合久久中文综合久久牛| 麻豆精品在线观看| 亚洲乱码国产乱码精品精小说| 欧美成人三级在线| 欧美亚洲另类激情小说| 丁香六月综合激情| 琪琪久久久久日韩精品| 亚洲日本va午夜在线影院| 精品国产欧美一区二区| 欧美色视频在线观看| 99综合电影在线视频| 精品一区二区三区的国产在线播放| 亚洲激情自拍偷拍|