阅读:1182回复:8
为什么我在加载驱动的时候,为什么说找不到文件呢?
为什么我调用CreateFile,例:
hDevice = CreateFile( “\\\\\\\\.\\\\Gloab\\\\xxx\", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); 说找不到文件呢?在那里关联呢? 我已经CreateService了:( [编辑 - 7/22/03 by Dragon_Rider] |
|
沙发#
发布于:2003-07-22 13:53
驱动中注册符号连接了吗?好象不用写global
|
|
板凳#
发布于:2003-07-22 14:39
我查看符号连接表,没有找到连接,如何建立连接呢?
|
|
地板#
发布于:2003-07-22 16:59
用这个试试吧。
IoCreateSymbolicLink(); 查ddk帮助看看。 |
|
地下室#
发布于:2003-07-24 20:48
:( 9494, 我也是刚学做驱动,可发现这个问题,老火啊。
|
|
5楼#
发布于:2003-07-25 09:58
不用global的。
我是直接利用.ini文件把.sys加载成一个设备的。 |
|
|
6楼#
发布于:2003-07-25 20:54
[我已经CreateService了]
我想你是忘了还要StartService吧!! |
|
7楼#
发布于:2003-07-28 11:39
已经StartService了
都没有问题,但是我发现一加载驱动,就调用unload 是不是filter程序的IoCreateDevice都需要写到DeviceEntry中吗? |
|
8楼#
发布于:2003-07-30 08:59
在DriverEntry结束后,通过Monitor发现一个ERROR:(1058)The driver is marked as disabled(Start=4) in its service database entry.
用softice跟踪发现,没有物理设备?是一个宏,我记得是...NO_PHYSICS_DEVICE. 我有点晕了. 我的程序如下: NTSTATUS DriverEntry ( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath ) /*++ Routine Description: Initialize the entry points of the driver. --*/ { ULONG i; UNREFERENCED_PARAMETER (RegistryPath); NTSTATUS Status = InitializeCppRunTime(); if (STATUS_SUCCESS != Status) { TerminateCppRunTime(); return Status; } #if USE_CPP_EXCEPTIONS KException::Install(); #endif PAGED_CODE(); // // Fill in all the dispatch entry points with the pass through function // and the explicitly fill in the functions we are going to intercept // for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++) { DriverObject->MajorFunction = KbFilter_DispatchPassThrough; } DriverObject->MajorFunction [IRP_MJ_CREATE] = DriverObject->MajorFunction [IRP_MJ_CLOSE] = KbFilter_CreateClose; DriverObject->MajorFunction [IRP_MJ_PNP] = KbFilter_PnP; DriverObject->MajorFunction [IRP_MJ_POWER] = KbFilter_Power; DriverObject->MajorFunction [IRP_MJ_INTERNAL_DEVICE_CONTROL] = KbFilter_InternIoCtl; // // If you are planning on using this function, you must create another // device object to send the requests to. Please see the considerations // comments for KbFilter_DispatchPassThrough for implementation details. // // DriverObject->MajorFunction [IRP_MJ_DEVICE_CONTROL] = KbFilter_IoCtl; DriverObject->DriverUnload = KbFilter_Unload; DriverObject->DriverExtension->AddDevice = KbFilter_AddDevice; DriverObject->HardwareDatabase = RegistryPath; return STATUS_SUCCESS; } 还请高手指点.多多指教. |
|