阅读:1570回复:6
请问
自己构造IRP_MJ_CREATE的请求包发给文件系统驱动设备对象而不用ZwCreateFile等的具体步骤是什么?给出有用的连接也可以,谢谢
|
|
沙发#
发布于:2003-07-22 14:25
几乎不太可能手工构造IRP_MJ_CREATE,至少我还没有遇到过,在OSR也有人提出,都没有答案。 不是的,重入很好解决 以前也有人构造过的,不知道现在究竟有没人知道。 郁闷中...... |
|
板凳#
发布于:2003-07-22 14:06
几乎不太可能手工构造IRP_MJ_CREATE,至少我还没有遇到过,在OSR也有人提出,都没有答案。
死心吧! 不知道你是要解决什么问题?,是重入吗? |
|
地板#
发布于:2003-07-22 09:21
如下顺序: 首先谢谢你的回答,不过你可能没仔细看首贴的问题。 [编辑 - 7/22/03 by kernel_kernel] |
|
地下室#
发布于:2003-07-22 09:08
如下顺序:
RtlInitUnicodeString---->InitializeObjectAttributes----->ZwCreateFile--->ObReferenceObjectByHandle 可以得到fileobject,具体可参见filemon的代码。 |
|
|
5楼#
发布于:2003-07-21 19:12
参照这个: |
|
6楼#
发布于:2003-07-21 18:52
参照这个:
BOOLEAN UndeleteIsDirectory(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileObject ) { PIRP irp; KEVENT event; IO_STATUS_BLOCK IoStatusBlock; PIO_STACK_LOCATION ioStackLocation; FILE_STANDARD_INFORMATION fileInfo; // // First, start by initializing the event // KeInitializeEvent(&event, SynchronizationEvent, FALSE); // // Allocate an irp for this request. This could also come from a // private pool, for instance. // irp = IoAllocateIrp(DeviceObject->StackSize, FALSE); if (!irp) { // // Failure! // return FALSE; } irp->AssociatedIrp.SystemBuffer = &fileInfo; irp->UserEvent = &event; irp->UserIosb = &IoStatusBlock; irp->Tail.Overlay.Thread = PsGetCurrentThread(); irp->Tail.Overlay.OriginalFileObject = FileObject; irp->RequestorMode = KernelMode; irp->Flags = 0; // // Set up the I/O stack location. // ioStackLocation = IoGetNextIrpStackLocation(irp); ioStackLocation->MajorFunction = IRP_MJ_QUERY_INFORMATION; ioStackLocation->DeviceObject = DeviceObject; ioStackLocation->FileObject = FileObject; ioStackLocation->Parameters.QueryVolume.Length = sizeof(FILE_STANDARD_INFORMATION); ioStackLocation->Parameters.QueryVolume.FsInformationClass = FileStandardInformation; // // Set the completion routine. // IoSetCompletionRoutine(irp, UndeleteIoComplete, 0, TRUE, TRUE, TRUE); // // Send the request to the lower layer driver. // (void) IoCallDriver(DeviceObject, irp); // // Wait for the I/O // KeWaitForSingleObject(&event, Executive, KernelMode, TRUE, 0); // // Return whether its a directory or not // if( !NT_SUCCESS( IoStatusBlock.Status ) || fileInfo.Directory) { return TRUE; } else { return FALSE; } } |
|
|