阅读:1402回复:1
关于如可查看DriverEntry是否被加载
Mindriver.c:
/////////////////////////////////////////////////////////////////////// // Copyright (c) 2001-2002 // XStudio Technology All Right Reserved. // Author: Tony Zhu // 2001-7-10 Create // summary: // This Program to demo the Intermediate Miniport NDIS Driver. /////////////////////////////////////////////////////////////////////// #define DBGPRINT(Fmt) \ { \ DbgPrint("MinDriver debug: %s (%d)", __FILE__, __LINE__); \ DbgPrint (Fmt); \ } #include <ndis.h> VOID PacketUnload( IN PDRIVER_OBJECT DriverObject ) { PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT OldDeviceObject; DBGPRINT("DriverEntry unLoading...\n"); DeviceObject = DriverObject->DeviceObject; while (DeviceObject != NULL) { OldDeviceObject=DeviceObject; DeviceObject=DeviceObject->NextDevice; IoDeleteDevice(OldDeviceObject); } } NTSTATUS DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath ) { DBGPRINT("DriverEntry Loading...\n"); DriverObject->DriverUnload = PacketUnload; return(0); } 导入注册表文件内容: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MinDriver] "Type"=dword:00000001 "Start"=dword:00000003 "Group"="Extended Base" "ErrorControl"=dword:00000001 "ImagePath"=hex(2):53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4d,00,\ 69,00,6e,00,44,00,72,00,69,00,76,00,65,00,72,00,2e,00,73,00,79,00,73,00,00,\ 00 "DisplayName"="MinDriver" 我的生成的Driver.sys文件复制到system32文件夹内,然后导入上面的注册表文件,重启机器后,用net start开启服务,用dbgview却看不到应该输出的调试信息, 还有谁能教教我如何方便的查看自己的驱动程序是否被加载以及怎么加载,最好是动态的,用SCM开服务的方法的话,希望可以提高c语言代码或者是工具。谢谢 |
|
沙发#
发布于:2008-09-17 21:02
1. 怎么判断有没有加载我只知道看log了, 不过你已经用dbgview试过了, 这招对你就没用了
2. 可以用DriverMonitor强制加载驱动的, 不过只能到DriverEntry而已 |
|