标题:驱动编程,蓝屏问题,求助
取消只看楼主
gpp6025
Rank: 1
等 级:新手上路
帖 子:57
专家分:0
注 册:2010-7-8
结帖率:84.62%
 问题点数:0 回复次数:0 
驱动编程,蓝屏问题,求助
编译是过了,但是只要一加载就直接蓝了!DbgPrint("the  DriverEntry !!");这句也没执行到~~也没什么低中断级的函数调用,是在不知道哪里处理处了问题了~~
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject,PUNICODE_STRING unstr)
{
    NTSTATUS status=STATUS_UNSUCCESSFUL;
    PUNICODE_STRING SymbolicLinkName=NULL;
    PUNICODE_STRING D_Name=NULL;
    PDEVICE_OBJECT DeviceObject=NULL;
    ULONG i;
    DbgPrint("the  DriverEntry !!");
    RtlInitUnicodeString(D_Name,L"\\Device\\K_antive");
    RtlInitUnicodeString(SymbolicLinkName,L"\\DosDevices\\A_safe");
    DbgPrint("the device is prepare creat !!");
    for(i=0;i<IRP_MJ_MAXIMUM_FUNCTION;++i)
    {
        DriverObject->MajorFunction[i]=mydispatch;
    }
    DriverObject->DriverUnload=Antive_unload;
    status=IoCreateDevice(DriverObject,0,D_Name,
        FILE_DEVICE_UNKNOWN,
        0,
        FALSE,
        &DeviceObject);
    if(status!=STATUS_SUCCESS)
    {
        DbgPrint("the device is creat fail!!");
        return status;
    }
    DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;//DeviceObject+1ch Flags
    status=IoCreateSymbolicLink(SymbolicLinkName,D_Name);
    if(status!=STATUS_SUCCESS)
    {
        DbgPrint("the symbolic link is creat fail !!");
        IoDeleteDevice(DeviceObject);
        return status;
    }

    return status;
}
搜索更多相关主题的帖子: status 
2011-04-28 20:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-338286-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018463 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved