Re: write data in IRP_MJ_WRITE

sorry,I am poor in English.
Now,I found when I write data to disk,the os is bluescreen.
the information on screen is:
STOP:0x0000044(0x859D8168 , 0x0000CCA ,0x0000000,0x000000)
MULTPLE_IRP_COMPLETE_REQUESTS.

----- Original Message -----
From: jackzdk
Newsgroups: ntfsd
To: xxxxx@lists.osr.com
Sent: Thursday, December 02, 2004 10:11 AM
Subject: write data in IRP_MJ_WRITE

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.

??1.5G ȫ???ռ䡪???126??? http://www.126.com ???ע??>>>
???30?׳???ͣ???100???˹??רҵɱ???೬G???ܵ???飡

You might be returing STATUS_SUCCESS in your
completion routine, which is wrong since the I/O
Manager would complete the Irp. Thus, by calling
IoCompleteRequest, you try to complete an Irp which
the I/O Manager already completed, so that’s why it
bugchecks with MULTPLE_IRP_COMPLETE_REQUESTS.

What does MyFilterCompletion look like? You have to
return STATUS_MORE_PROCESSING_REQUIRED from your
completion routine.

Regards,
Razvan

— jackzdk wrote:

> sorry,I am poor in English.
> Now,I found when I write data to disk,the os is
> bluescreen.
> the information on screen is:
> STOP:0x0000044(0x859D8168 , 0x0000CCA
> ,0x0000000,0x000000)
> MULTPLE_IRP_COMPLETE_REQUESTS.
>
>
> ----- Original Message -----
> From: jackzdk
> Newsgroups: ntfsd
> To: xxxxx@lists.osr.com
> Sent: Thursday, December 02, 2004 10:11 AM
> Subject: write data in IRP_MJ_WRITE
>
>
> 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.
>
>
> ¡¤1.5G È«¹ú×î´ó¿Õ¼ä¡ª¡ªÍøÒ×126Ãâ·ÑÓÊÏä
> http://www.126.com »ðÈÈÇÀ×¢ÖÐ>>>
>
>
ÌåÑé30Õ׳¬´ó¸½¼þ·¢ËÍ£¬ÏíÊÜ100£¥¿¨°Í˹»ùרҵɱ¶¾¡­¡­¸ü¶à³¬G¸ÐÊܵÈÄúÀ´ÌåÑ飡
>
>
>
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to $subst(‘List.Name’)
> as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to
$subst(‘Email.UnSub’)

__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

Razvan Hobeanu :
thank you.under your help,I solved the problem.

jack

----- Original Message -----
From: Razvan Hobeanu
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] write data in IRP_MJ_WRITE
Sent: Thu Dec 02 20:49:46 CST 2004

You might be returing STATUS_SUCCESS in your
completion routine, which is wrong since the I/O
Manager would complete the Irp. Thus, by calling
IoCompleteRequest, you try to complete an Irp which
the I/O Manager already completed, so that’s why it
bugchecks with MULTPLE_IRP_COMPLETE_REQUESTS.

What does MyFilterCompletion look like? You have to
return STATUS_MORE_PROCESSING_REQUIRED from your
completion routine.

Regards,
Razvan

— jackzdk wrote:
>
> > sorry,I am poor in English.
> > Now,I found when I write data to disk,the os is
> > bluescreen.
> > the information on screen is:
> > STOP:0x0000044(0x859D8168 , 0x0000CCA
> > ,0x0000000,0x000000)
> > MULTPLE_IRP_COMPLETE_REQUESTS.
> >
> >
> > ----- Original Message -----
> > From: jackzdk
> > Newsgroups: ntfsd
> > To: xxxxx@lists.osr.com
> > Sent: Thursday, December 02, 2004 10:11 AM
> > Subject: write data in IRP_MJ_WRITE
> >
> >
> > 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.
> >
> >
> > ·1.5G ???126???
> > http://www.126.com ???>>>
> >
> >
> ??30???100???G???
> >
> >
> >
> >
> >
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd
> > as: xxxxx@sohu.com
> > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>