|
|
|
FltUnregisterFilter( gFilterHandle )卸载卡死是什么原因
走过路过的能给分析一下么 |
|
[分享]吕鑫VS2015 全套C/C++、MFC实战、Linux视频教程 最好的基础入门教程没有之一
有没有windows驱动开发的资料 |
|
[求助]文件微过滤的问题,在S_PostCreate无法获得文件大小?
你这个是对的吧?我也是这么写的,都可以 |
|
FltUnregisterFilter( gFilterHandle )卸载卡死是什么原因
卡死的时候不蓝屏,没有dump文件呀! 后来我把PostCreate注释掉就可以正常卸载 PostCreate代码如下,我在precreate中只是简单的返回了FLT_PREOP_SUCCESS_WITH_CALLBACK #pragma LOCKEDCODE FLT_POSTOP_CALLBACK_STATUS MyPostCreate( __inout PFLT_CALLBACK_DATA Data, __in PCFLT_RELATED_OBJECTS FltObjects, __in PVOID CompletionContext, __in FLT_POST_OPERATION_FLAGS Flags ) { FLT_POSTOP_CALLBACK_STATUS retValue = FLT_POSTOP_FINISHED_PROCESSING; PSTREAM_HANDLE_CONTEXT streamCtx = NULL; NTSTATUS status; __try{ //初始化流临时上下文 STREAM_HANDLE_CONTEX temCtx; temCtx.isEncyptFile = IS_NOT_ENCRYPT_FILE; //初始化是不加密文件 temCtx.isEncypted = IS_NOT_ENCRYPTED; //文件没有加密 temCtx.keyWord = NULL; //文件类型为空 //获取文件的加密信息,判断文件是不是已经加密 status = GetFileEncryptInfoToCtx(Data,FltObjects,&temCtx,key_word_header); if(!NT_SUCCESS(status)) { return retValue; } //如果不是加密类型,直接放过 if (temCtx.isEncyptFile!=IS_ENCRYPT_FILE) { return retValue; } //清除缓冲 cfFileCacheClear(FltObjects->FileObject); //检查开关 if(!IS_SYSTEM_OPEN) { return retValue; } status=FltGetStreamHandleContext(FltObjects->Instance, FltObjects->FileObject, (PFLT_CONTEXT *)&streamCtx);//接收上下文返回的地址 if (!NT_SUCCESS(status)) { //创建流上下文,分配一个上下文结构体 status = FltAllocateContext( FltObjects->Filter, //过滤器 FLT_STREAMHANDLE_CONTEXT, //上下文类型 sizeof(STREAM_HANDLE_CONTEX), //上下文大小 NonPagedPool,//池子类型 (PFLT_CONTEXT *)(&streamCtx)); //返回的上下文 if (!NT_SUCCESS(status)) { return retValue; } PFLT_CONTEXT oldCtx; //设置文件流句柄上下文 status=FltSetStreamHandleContext(FltObjects->Instance, FltObjects->FileObject, FLT_SET_CONTEXT_KEEP_IF_EXISTS, //操作类型 streamCtx, //新的上下文 &oldCtx); //以前存在的旧的上下文 if (oldCtx!=NULL) { streamCtx=(PSTREAM_HANDLE_CONTEXT)oldCtx; } if (!NT_SUCCESS(status)) { return retValue; } } //复制streamCtx streamCtx->isEncypted=temCtx.isEncypted; streamCtx->isEncyptFile=temCtx.isEncyptFile; streamCtx->keyWord=temCtx.keyWord; if (streamCtx->isEncypted == IS_NOT_ENCRYPTED) { //在是加密类型的基础上并且没有加密,如果是机密进程,打开就加密 //获取进程名称 PCHAR procName=GetCurrentProcessName(ProcessNameOffset); //如果是机密进程则加密文件 if (IsSecretProcess(streamCtx->keyWord,procName)) { //加密文件 status=EncryptFile(Data,FltObjects,key); if(NT_SUCCESS(status)) { streamCtx->isEncypted=IS_ENCRYPTED; DbgPrint("文件加密完成 \n"); } else { //DbgPrint("encrypt a file fail"); } } } //获取文件的信息 status=FltQueryInformationFile(FltObjects->Instance, Data->Iopb->TargetFileObject, &(streamCtx->fileInfo), //接收文件信息 sizeof(FILE_STANDARD_INFORMATION), FileStandardInformation, NULL); //清除缓冲 cfFileCacheClear(FltObjects->FileObject); KdPrint(("FltReleaseContext \n")); if (streamCtx!=NULL) { FltReleaseContext(streamCtx); } } __except(EXCEPTION_EXECUTE_HANDLER) { DbgPrint("a exception happened in postCreate"); if (streamCtx!=NULL) { FltReleaseContext(streamCtx); } } return retValue; } |
|
FltUnregisterFilter( gFilterHandle )卸载卡死是什么原因
就是还不该怎么分析呀, 看不懂windbg对dump分析的信息 |
|
FltUnregisterFilter( gFilterHandle )卸载卡死是什么原因
就是还不该怎么分析呀, 看不懂windbg对dump分析的信息 |
|
FltUnregisterFilter( gFilterHandle )卸载卡死是什么原因
#pragma LOCKEDCODE NTSTATUS FilterUnload ( __in FLT_FILTER_UNLOAD_FLAGS Flags ) { UNREFERENCED_PARAMETER( Flags ); NTSTATUS status; KdPrint(("卸载 ! \n ")); ExDeleteNPagedLookasideList( &Pre2PostContextList ); FreeStrategy(key_word_header); FltCloseCommunicationPort(serverPort); KdPrint(("1\n")); FltUnregisterFilter( gFilterHandle ); KdPrint(("卸载完成 ! \n ")); return STATUS_SUCCESS; } //关闭回调 VOID MyDisconnectCallback ( __in_opt PVOID ConnectionCookie ) { PAGED_CODE(); UNREFERENCED_PARAMETER(ConnectionCookie); KdPrint(("Disconnect\n")); //关闭通信连接 FltCloseClientPort(gFilterHandle , &gClientPort); } |
|
|
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值