hi,all
I am a new guy in driver programming.this is a part of my file system filter driver.
there is some wrong in my code. I think the information of buffer2 will be shown on monitor,but it doesn’t,buffer1 instead.
can anyone tell me waht is wrong ?
case IRP_MJ_WRITE:
if(Irp->MdlAddress)
buffer1 = MmGetSystemAddressForMdlSafe(Irp->MdlAddress , NormalPagePriority);
else
buffer1 = Irp->UserBuffer;
KeInitializeEvent( &waitEvent, SynchronizationEvent, FALSE );
IoCopyCurrentIrpStackLocationToNext( Irp );
IoSetCompletionRoutine( Irp,
&MyFilterCompletion,
&waitEvent,
TRUE,
TRUE,
TRUE );
status = IoCallDriver( MyExtension->NextDeviceObject, Irp );
if (STATUS_PENDING == status) {
NTSTATUS localStatus = KeWaitForSingleObject(
&waitEvent,
Executive,
KernelMode,
FALSE,
NULL);
ASSERT(STATUS_SUCCESS == localStatus);
}
// init buffer2.
…
RtlCopyMemory(buffer1,buffer2,Len);
…
status = Irp->IoStatus.Status;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return status;
thanks in advance.