阅读:1855回复:5
IRP完成出错
DriverObject->MajorFunction[IRP_MJ_CREATE] = FsFileCreateOpen;
NTSTATUS FsFileCreateOpen( IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp ) { KEVENT waitevent; void *buf; ULONG Length; NTSTATUS status = STATUS_UNSUCCESSFUL; PDEVICE_EXTENSION DevExt = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; PIO_STACK_LOCATION CurrentIrpStack = IoGetCurrentIrpStackLocation(Irp); PFILE_OBJECT FileObject = CurrentIrpStack->FileObject; PFSRTL_COMMON_FCB_HEADER pFileHeader = (PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext; PAGED_CODE(); KeInitializeEvent(&waitevent,NotificationEvent,FALSE); IoCopyCurrentIrpStackLocationToNext(Irp); IoSetCompletionRoutine(Irp,FsFileCreateOpenCompletion,&waitevent,TRUE,TRUE,TRUE); status = IoCallDriver(DevExt->AttachedToDevice,Irp); if(STATUS_PENDING==status) { KeWaitForSingleObject(&waitevent,Executive,KernelMode,FALSE,NULL); } Irp->IoStatus.Status =status ; IoCompleteRequest(Irp, IO_NO_INCREMENT); *************************************** return status; } 驱动设备绑定系统卷 程序运行到 ***************************************处出错 MULTIPLE_IRP_COMPLETE_REQUESTS (44) A driver has requested that an IRP be completed (IoCompleteRequest()), but the packet has already been completed. This is a tough bug to find because the easiest case, a driver actually attempted to complete its own packet twice, is generally not what happened. Rather, two separate drivers each believe that they own the packet, and each attempts to complete it. The first actually works, and the second fails. Tracking down which drivers in the system actually did this is difficult, generally because the trails of the first driver have been covered by the second. However, the driver stack for the current request can be found by examining the DeviceObject fields in each of the stack locations. Arguments: Arg1: 869ea760, Address of the IRP Arg2: 00000d64 Arg3: 00000000 Arg4: 00000000 Debugging Details: ------------------ ************************************************************************* *** *** *** *** *** Your debugger is not using the correct symbols *** *** *** *** In order for this command to work properly, your symbol path *** *** must point to .pdb files that have full type information. *** *** *** *** Certain .pdb files (such as the public OS symbols) do not *** *** contain the required information. Contact the group that *** *** provided you with these symbols if you need this command to *** *** work. *** *** *** *** Type referenced: kernel32!pNlsUserInfo *** *** *** ************************************************************************* ************************************************************************* *** *** *** *** *** Your debugger is not using the correct symbols *** *** *** *** In order for this command to work properly, your symbol path *** *** must point to .pdb files that have full type information. *** *** *** *** Certain .pdb files (such as the public OS symbols) do not *** *** contain the required information. Contact the group that *** *** provided you with these symbols if you need this command to *** *** work. *** *** *** *** Type referenced: kernel32!pNlsUserInfo *** *** *** ************************************************************************* IRP_ADDRESS: 869ea760 DEFAULT_BUCKET_ID: DRIVER_FAULT BUGCHECK_STR: 0x44 PROCESS_NAME: services.exe DEVICE_OBJECT: 86a40020 DRIVER_OBJECT: 86a685f8 IMAGE_NAME: Sfilter.sys DEBUG_FLR_IMAGE_TIMESTAMP: 4a3b2f7b MODULE_NAME: Sfilter FAULTING_MODULE: ba61d000 Ntfs LAST_CONTROL_TRANSFER: from 804f8b9d to 80528bdd STACK_TEXT: ba3a453c 804f8b9d 00000003 ba3a4898 00000000 nt!RtlpBreakWithStatusInstruction+0x1 ba3a4588 804f978a 00000003 869ea8e8 869ea760 nt!KiBugCheckDebugBreak+0x19 ba3a4968 804f9cb5 00000044 869ea760 00000d64 nt!KeBugCheck2+0x574 ba3a4988 804f18c1 00000044 869ea760 00000d64 nt!KeBugCheckEx+0x1b ba3a49c0 bac0909a 869ea770 86a93da0 ba3a4c38 nt!IopfCompleteRequest+0x2c5 ba3a4a04 804ef119 86621020 869ea760 869ea760 Sfilter!FsFileCreateOpen+0x15b [c:\winddk\sfilter\sfilter.c @ 281] ba3a4a14 80579616 866ad8e8 8679591c ba3a4bbc nt!IopfCallDriver+0x31 ba3a4af4 805b5cbc 866ad900 00000000 86795878 nt!IopParseDevice+0xa12 ba3a4b7c 805b2065 00000000 ba3a4bbc 00000040 nt!ObpLookupObjectName+0x56a ba3a4bd0 8056d1bf 00000000 00000000 0006f501 nt!ObOpenObjectByName+0xeb ba3a4d54 8053e638 0007efb8 0007ef90 0007efe4 nt!NtQueryAttributesFile+0xf1 ba3a4d54 7c92e4f4 0007efb8 0007ef90 0007efe4 nt!KiFastCallEntry+0xf8 0007ef70 7c92d6fc 7c936ea2 0007efb8 0007ef90 ntdll!KiFastSystemCallRet 0007ef74 7c936ea2 0007efb8 0007ef90 0007f280 ntdll!NtQueryAttributesFile+0xc 0007efe4 7c938cf3 0007f298 00000001 00091e90 ntdll!RtlDoesFileExists_UstrEx+0x6b 0007f248 7c80e83d 00000007 0007f290 0007f298 ntdll!RtlDosSearchPath_Ustr+0x16e 0007f2b0 7c82f2a4 00000000 000b6f1a 7c82f328 kernel32!SearchPathW+0x118 0007fcf4 7c802362 00000000 00000000 000b6f18 kernel32!CreateProcessInternalW+0x5cc 0007fd2c 010076f8 00000000 000b6f18 00000000 kernel32!CreateProcessW+0x2c 0007fe10 0100763d 006ca548 000b6f18 0007fe48 services!ScLogonAndStartImage+0x278 0007fe50 01006480 00000000 00000000 00000000 services!ScStartService+0x19c 0007fe80 01006b88 00000000 00000000 00000000 services!ScStartMarkedServices+0xa8 0007feb8 01008b99 00000000 00000000 00000000 services!ScStartServiceAndDependencies+0x1b7 0007fef8 01008971 0007ff2c 00000000 00000000 services!ScAutoStartServices+0x134 0007ff34 0100d27b 00000001 00034230 0007ffc0 services!SvcctrlMain+0x2eb 0007ff44 0100c269 00000001 00034230 00032920 services!main+0x15 0007ffc0 7c817067 00000000 00000000 7ffdf000 services!mainCRTStartup+0x125 0007fff0 00000000 0100c15b 00000000 78746341 kernel32!BaseProcessStart+0x23 STACK_COMMAND: kb FOLLOWUP_IP: Sfilter!FsFileCreateOpen+15b [c:\winddk\sfilter\sfilter.c @ 281] bac0909a 8b45f0 mov eax,dword ptr [ebp-10h] FAULTING_SOURCE_CODE: 277: return SfPassThrough(DeviceObject,Irp); 278: */ 279: Irp->IoStatus.Status = status ; 280: IoCompleteRequest(Irp, IO_NO_INCREMENT); > 281: return status; 282: } 283: 284: NTSTATUS FsFileCreateOpenCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context) 285: { 286: PIO_STACK_LOCATION CurrentIrpStack = IoGetCurrentIrpStackLocation(Irp); SYMBOL_STACK_INDEX: 5 SYMBOL_NAME: Sfilter!FsFileCreateOpen+15b FOLLOWUP_NAME: MachineOwner FAILURE_BUCKET_ID: 0x44_Sfilter!FsFileCreateOpen+15b BUCKET_ID: 0x44_Sfilter!FsFileCreateOpen+15b Followup: MachineOwner --------- 这个怎么处理啊 大侠们说话啊 |
|
沙发#
发布于:2009-06-24 12:12
Irp->IoStatus.Information = 0; 你的完成代码中没看见!
|
|
板凳#
发布于:2009-07-01 10:07
Irp->IoStatus.Information = 0; 你的完成代码中没看见!
为什么要这么设置 |
|
|
地板#
发布于:2009-07-01 18:09
即使加上也是错误 我是对卷的绑定 似乎过滤驱动完成了没有权限的任务
|
|
地下室#
发布于:2009-07-01 23:50
你要这样调用的话需要在FsFileCreateOpenCompletion中返回STATUS_MORE_PROCESSING_REQUIRED!
|
|
5楼#
发布于:2009-07-02 09:18
好像确实如此 奇怪 之前我记得在完成函数中确实返回STATUS_MORE_PROCESSING_REQUIRED但依然报这个错 现在返回这个却不报了 不知道什么原因
|
|