首页
社区
课程
招聘
[旧帖] 请教:WdfRequestCompleteWithInformation为什么结束不了请求? 0.00雪花
发表于: 2016-2-28 00:58 3955

[旧帖] 请教:WdfRequestCompleteWithInformation为什么结束不了请求? 0.00雪花

2016-2-28 00:58
3955
最近在尝试把WDF框架的ramdisk改造成filedisk,现在遇到一个问题,想请教一下,实在是不明白:

1、

VOID
RamDiskEvtIoDeviceControl(
    IN WDFQUEUE Queue,
    IN WDFREQUEST Request,
    IN size_t OutputBufferLength,
    IN size_t InputBufferLength,
    IN ULONG IoControlCode
    )
{
    NTSTATUS          Status = STATUS_INVALID_DEVICE_REQUEST;
    ULONG_PTR         information = 0;
    size_t            bufSize;
    PDEVICE_EXTENSION devExt = QueueGetExtension(Queue)->DeviceExtension;

    UNREFERENCED_PARAMETER(OutputBufferLength);
    UNREFERENCED_PARAMETER(InputBufferLength);

    KdPrint( ( "IoControlCode:%x\n",IoControlCode));

    if ( !devExt->MediaInDevice && IoControlCode!= IOCTL_FILE_DISK_OPEN_FILE ) 
    {
        Status = STATUS_NO_MEDIA_IN_DEVICE;
        information = 0;
        KdPrint(("FileDisk Dosen`t Opened Yet!\n"));
        _asm int 3
        [COLOR="Red"]WdfRequestCompleteWithInformation(Request, Status, information);
    [/COLOR]}
_asm int 3
    switch (IoControlCode) 
    {
    case IOCTL_FILE_DISK_OPEN_FILE:


为什么WdfRequestCompleteWithInformation调用之后没有完成请求,而是直接向下执行??百思不得解啊

2、撇开第一个问题不谈,这样处理

   
case [COLOR="red"]IOCTL_DISK_IS_WRITABLE:
        [/COLOR]{
            KdPrint(("IOCTL_DISK_IS_WRITABLE\n"));
            information=0;
            Status = STATUS_SUCCESS;
        }
    break;
default:
        {
            KdPrint(("IOCTL Code:%x\n",IoControlCode));
            information=0;
            Status = STATUS_INVALID_DEVICE_REQUEST;
            break;
        }
    }

    WdfRequestCompleteWithInformation(Request, Status, information);

IOCTL_DISK_IS_WRITABLE:这一个分支执行完以后,就蓝屏了,我是参照filedisk填写的,为什么会导致蓝屏呢?

错误信息:

kd> !analyze -v
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

FAT_FILE_SYSTEM (23)
    If you see FatExceptionFilter on the stack then the 2nd and 3rd
    parameters are the exception record and context record. Do a .cxr
    on the 3rd parameter and then kb to obtain a more informative stack
    trace.
Arguments:
Arg1: 000e0100
Arg2: ee0ea538
Arg3: ee0ea234
Arg4: edfb0931

Debugging Details:

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 244
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
厉害顶你一下
2016-3-24 13:47
0
游客
登录 | 注册 方可回帖
返回
//