how does the ms word open a file?Why can not open a redirected file?

I write a filter driver to redirect a directory to another.for
example,explorer open D:\XXX,it will show the data of E:\yyy.

now, in winxp explorer, the redirecting work well.Open D:\xxx,will
show the data of E:\yyy. But, when double click a .doc file, the word
can not open the file,says:“file not found”.

In my filter driver,I hold up the IRP_MJ_CREATE and changed the
FileName to new file name when the file is equal to my target file.
Then

Irp->IoStatus.Information = IO_REPARSE;

//ExFreePool( FileNameBuffer);

Irp->IoStatus.Status = STATUS_REPARSE;

IoCompleteRequest(Irp, IO_NO_INCREMENT);

return STATUS_REPARSE;

==========================

I monitor the Files with FileMon, and found, before IRP_MJ_CREATE,
there is a FASTIO_QUERY_OPEN , and if the file is redirected, it
returned “FILE¡¡NOT FOUND”.When ms word open a file such as a .doc,a .
txt, a .html, it get the FASTIO_QUERY_OPEN result “FILE NOT FOUND” ,
then only IRP_MJ_CREATE, and IRP_MJ_CLEAN_UP , IRP_MJ_CLOSE . But,in
notepad.exe, it get the FASTIO_QUERY_OPEN result “FILE NOT FOUND”
will go on doing open.

why word can not open the redirected file? and how can i do?

It works for me.
Did you see the IO manager sent a new IRP with the new file name to
Your filter driver after you return STATUS_REPARSE?
You might want to try ??\e:\yyy.doc

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of BrillyWu
Sent: Wednesday, August 11, 2004 9:41 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] how does the ms word open a file?Why can not open a
redirected file?

I write a filter driver to redirect a directory to another.for
example,explorer open D:\XXX,it will show the data of E:\yyy.

now, in winxp explorer, the redirecting work well.Open D:\xxx,will
show the data of E:\yyy. But, when double click a .doc file, the word
can not open the file,says:“file not found”.

In my filter driver,I hold up the IRP_MJ_CREATE and changed the
FileName to new file name when the file is equal to my target file. Then

Irp->IoStatus.Information = IO_REPARSE;

//ExFreePool( FileNameBuffer);

Irp->IoStatus.Status = STATUS_REPARSE;

IoCompleteRequest(Irp, IO_NO_INCREMENT);

return STATUS_REPARSE;

==========================

I monitor the Files with FileMon, and found, before IRP_MJ_CREATE,
there is a FASTIO_QUERY_OPEN , and if the file is redirected, it
returned “FILE??NOT FOUND”.When ms word open a file such as a .doc,a .
txt, a .html, it get the FASTIO_QUERY_OPEN result “FILE NOT FOUND” ,
then only IRP_MJ_CREATE, and IRP_MJ_CLEAN_UP , IRP_MJ_CLOSE . But,in
notepad.exe, it get the FASTIO_QUERY_OPEN result “FILE NOT FOUND”
will go on doing open.

why word can not open the redirected file? and how can i do?


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@sbcglobal.net To
unsubscribe send a blank email to xxxxx@lists.osr.com

yes,after return STATUS_REPARSE,the io manager send IRP_MJ_CREATE
again with the new file name.

11:47:44 AM Default 2569: \Device\HarddiskVolume2\xxx\
—>IRP_CREATE with the originality file name

11:47:44 AM Default 2607:the realfilename=
\Device\HarddiskVolume2\xxx\ –> compair

11:47:44 AM Default 2610:the realfilepath=
\Device\HarddiskVolume2\xxx

11:47:44 AM Default 2625

11:47:44 AM Default 2631: bDoRemap =00000001
–> it will redirect

11:47:44 AM Default 2666:new file name =
\Device\HarddiskVolume4\112233\ —> new file name

11:47:44 AM Default 2690: \Device\HarddiskVolume4\112233\

11:47:44 AM Default 2700: return STATUS_REPARSE;
–> return

11:47:44 AM Default 2569: \Device\HarddiskVolume4\112233\
—>IRP_MJ_CREATE again with new file

11:47:44 AM Default 5339: \Device\HarddiskVolume2\xxx\aaa.
html —> FastIoQueryOpen ,why the name not chaned?

11:47:44 AM Default 5358: FastIoQueryOpen result =00000001

11:47:44 AM Default 5339: \Device\HarddiskVolume2\xxx\aaa.
html

11:47:44 AM Default 5358: FastIoQueryOpen result =00000001

I found that, FastIoQueryOpen with the old file name, and will return
NOT FOUND FILE. how to do?