Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTFSD
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


STATUS_REPARSE for changing drive/paths on the fly

OSR_Community_UserOSR_Community_User Member Posts: 110,217
I read somewhere that STATUS_REPARSE at IRP_MJ_CREATE time can be used to direct a file to another drive and/or path. Can someone clarity if this is possible. Is it simply a matter of changing the object name in the fileObject before returning STATUS_REPARSE or is there more involved, and/or drawbacks ? Any information is appreciated.

Thanks,
Bill

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    yeah. it is possible and as simple as you have mentioned, provided the fileobject->RelatedFileObject != NULL. Once I designed a filter driver ignorant of this and ended up changing my whole design after my initial working prototype !! because there is really no GOOD work around for this problem. it was in NT 4.0 i dunno about W2K

    regds
    -------- alexander suresh

    ----- Original Message -----
    From: Bill
    To: File Systems Developers
    Sent: Monday, May 01, 2000 11:17 AM
    Subject: [ntfsd] STATUS_REPARSE for changing drive/paths on the fly


    I read somewhere that STATUS_REPARSE at IRP_MJ_CREATE time can be used to direct a file to another drive and/or path. Can someone clarity if this is possible. Is it simply a matter of changing the object name in the fileObject before returning STATUS_REPARSE or is there more involved, and/or drawbacks ? Any information is appreciated.

    Thanks,
    Bill
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    set iosb->Status = IO_REPARSE


    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Bill
    Sent: Monday, May 01, 2000 8:17 AM
    To: File Systems Developers
    Subject: [ntfsd] STATUS_REPARSE for changing drive/paths on the fly


    I read somewhere that STATUS_REPARSE at IRP_MJ_CREATE time can be used to
    direct a file to another drive and/or path. Can someone clarity if this is
    possible. Is it simply a matter of changing the object name in the
    fileObject before returning STATUS_REPARSE or is there more involved, and/or
    drawbacks ? Any information is appreciated.

    Thanks,
    Bill
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    The routine from which come IRP_MJ_CREATE to your drive is IopParseDevice.

    Short code look like this:

    NTSTATUS
    IopParseDevice (
    ...,
    IN OUT PUNICODE_STRING CompleteName,
    ....
    )
    {
    NTSTATUS Status;
    IO_STATUS_BLOCK Iosb;
    ....;

    Remount:;
    .....;

    Status = IoCallDriver(DeviceObject, Irp)
    //IRP_MJ_CREATE
    .....;

    if (Status == STATUS_REPARSE)
    {
    if (Iosb.Information == IO_REPARSE)
    {
    ....;
    RtlCopyUnicodeString(CompleteName,
    &FileObject->FileName);
    }

    ....;

    if (Iosb.Information == IO_REPARSE)
    {
    return STATUS_REPARSE;
    }

    else
    {
    goto Remount;
    }
    }

    .....;
    }

    If your code returns STATUS_REPARSE:

    1. if Information is IO_REPARSE the I/O manager should copy the full path
    (from the Object Manager's root) to the CompletePath and return
    STATUS_REPARSE
    to Object Manager. Object Manager then starts path parsing at the root.
    This should be useful eg. for MUP which replaces the full path by the
    registered
    redirector's path.

    2. if Information is IO_REMOUNT the I/O Manager will undo its work and
    execution
    starts again from the begin of IopParseDevice.
    This case is useful when in the middle of processing create request
    there is a volume
    verify which does volume unmount. In this case the FSD requests the I/O
    Manager to
    reprocess this request to the newly mounted volume device object.

    > -----P?vodn? zpr?va-----
    > Od: Bill [SMTP:[email protected]]
    > Odesl?no: 1. kv?tna 2000 17:17
    > Komu: File Systems Developers
    > P?edm?t: [ntfsd] STATUS_REPARSE for changing drive/paths on the fly
    >
    > I read somewhere that STATUS_REPARSE at IRP_MJ_CREATE time can be used to
    > direct a file to another drive and/or path. Can someone clarity if this is
    > possible. Is it simply a matter of changing the object name in the
    > fileObject before returning STATUS_REPARSE or is there more involved,
    > and/or drawbacks ? Any information is appreciated.
    >
    > Thanks,
    > Bill
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    That's all there is to it?

    Thanks for the reply.
    ----- Original Message -----
    From: Jamey Kirby
    To: File Systems Developers
    Sent: Monday, May 01, 2000 11:50 AM
    Subject: [ntfsd] RE: STATUS_REPARSE for changing drive/paths on the fly


    set iosb->Status = IO_REPARSE


    -----Original Message-----
    From: [email protected] [mailto:[email protected]]On Behalf Of Bill
    Sent: Monday, May 01, 2000 8:17 AM
    To: File Systems Developers
    Subject: [ntfsd] STATUS_REPARSE for changing drive/paths on the fly


    I read somewhere that STATUS_REPARSE at IRP_MJ_CREATE time can be used to direct a file to another drive and/or path. Can someone clarity if this is possible. Is it simply a matter of changing the object name in the fileObject before returning STATUS_REPARSE or is there more involved, and/or drawbacks ? Any information is appreciated.

    Thanks,
    Bill
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Sorry, iosb->Information = IO_REPARSE.

    I gave you the wrong field.

    Jamey
    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Bill
    Sent: Tuesday, May 02, 2000 11:18 AM
    To: File Systems Developers
    Subject: [ntfsd] RE: STATUS_REPARSE for changing drive/paths on the fly


    That's all there is to it?

    Thanks for the reply.
    ----- Original Message -----
    From: Jamey Kirby
    To: File Systems Developers
    Sent: Monday, May 01, 2000 11:50 AM
    Subject: [ntfsd] RE: STATUS_REPARSE for changing drive/paths on the fly


    set iosb->Status = IO_REPARSE


    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Bill
    Sent: Monday, May 01, 2000 8:17 AM
    To: File Systems Developers
    Subject: [ntfsd] STATUS_REPARSE for changing drive/paths on the fly


    I read somewhere that STATUS_REPARSE at IRP_MJ_CREATE time can be used
    to direct a file to another drive and/or path. Can someone clarity if this
    is possible. Is it simply a matter of changing the object name in the
    fileObject before returning STATUS_REPARSE or is there more involved, and/or
    drawbacks ? Any information is appreciated.

    Thanks,
    Bill
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Where is IO_REPARSE defined, it does not appear in the DDK ?
    ----- Original Message -----
    From: Jamey Kirby
    To: File Systems Developers
    Sent: Tuesday, May 02, 2000 5:29 PM
    Subject: [ntfsd] RE: STATUS_REPARSE for changing drive/paths on the fly


    Sorry, iosb->Information = IO_REPARSE.

    I gave you the wrong field.

    Jamey
    -----Original Message-----
    From: [email protected] [mailto:[email protected]]On Behalf Of Bill
    Sent: Tuesday, May 02, 2000 11:18 AM
    To: File Systems Developers
    Subject: [ntfsd] RE: STATUS_REPARSE for changing drive/paths on the fly


    That's all there is to it?

    Thanks for the reply.
    ----- Original Message -----
    From: Jamey Kirby
    To: File Systems Developers
    Sent: Monday, May 01, 2000 11:50 AM
    Subject: [ntfsd] RE: STATUS_REPARSE for changing drive/paths on the fly


    set iosb->Status = IO_REPARSE


    -----Original Message-----
    From: [email protected] [mailto:[email protected]]On Behalf Of Bill
    Sent: Monday, May 01, 2000 8:17 AM
    To: File Systems Developers
    Subject: [ntfsd] STATUS_REPARSE for changing drive/paths on the fly


    I read somewhere that STATUS_REPARSE at IRP_MJ_CREATE time can be used to direct a file to another drive and/or path. Can someone clarity if this is possible. Is it simply a matter of changing the object name in the fileObject before returning STATUS_REPARSE or is there more involved, and/or drawbacks ? Any information is appreciated.

    Thanks,
    Bill
  • Bo_BranténBo_Brantén Member Posts: 99
    On Tue, 2 May 2000, Bill wrote:

    > Where is IO_REPARSE defined, it does not appear in the DDK ?

    It's in the Windows 2000 DDK:

    d:\ntDDK\inc\ddk\ntddk.h(12852):#define IO_REPARSE 0x0




    Bo Branten
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE