Remembering shares

Can someone explain how the system remembers shares? I have a FSD that
starts at boot time (start = 1 in registry), and after boot, I logon and
share the root. When I reboot, the share is gone, and I have to manually
share it again.

I see that my driver gets a bunch of IRPs targeted to my disk device object
when the system comes up, so I succeed IRP_MJ_CREATE, CLOSE and CLEANUPs,
but respond with STATUS_INVALID_DEVICE_REQUEST when any other IRP comes in
for this device. My driver talks to a user-mode service for IRPs targeted
to my File System device object, but this service is not started until later
in the boot process. However, if I get a IRP_MJ_CREATE for my file system
device, and it is for the volume, I succeed that one too. I also succeed
open for the root always.

Thanks,

Greg

On NT, the persistent shares are stored in
HKCU\Network<letter>

Non-persistent shared are not remembered.

Thanks for the reply Ladislav.

I was wondering what happens at the IRP level, at system initialization.

Greg

“Ladislav Zezula” wrote in message news:xxxxx@ntfsd…
> On NT, the persistent shares are stored in
> HKCU\Network<letter>
>
> Non-persistent shared are not remembered.
>

Hi, Greg,

I was wondering what happens at the IRP level, at system initialization.

I’m afraid I don’t understand the problem then.

The system initialization has nothing to do with shares,
this come to place after an user logs on. The system
creates a few symbolic links (each share drive
will create one symbolic link).

If you open a file on a share (e.g. I:), I/O manager loogs for
the symbolic links for the disk drives. It then finds the share
is actually \Server\ShareXXX, and the IRP is targeted to the
LanmanRedirector to open/create/whatever the file.

L.

Hi Ladislav,

The reason I asked this question is that I have my file system driver
installed on 4 w2k machines, and two of them remember the share point on the
root, and two do not. All 4 machines have SP4 applied. Of the two that
remember the shares, one is w2k pro, the other is w2k server. Of the two
which don’t remember the shares, one is w2k pro, and the other is w2k
server.

I’m trying to figure out what the differences might be (in the registry, I
guess), that is causing this. If you (or anyone else!) could point me in
the right direction, it would be most appreciated. If you know of any
documentation that describes how this works - that would be a big help.
I’ve examined several registry keys between the 4 systems and cannot see
anything obvious. I looked at the keys that you suggested, as well as
HKLM\System\CurrentControlSet\Services\lanmanserver\Shares

Thanks ahead of time, and regards,

Greg

“Ladislav Zezula” wrote in message news:xxxxx@ntfsd…
> Hi, Greg,
>
> > I was wondering what happens at the IRP level, at system initialization.
>
> I’m afraid I don’t understand the problem then.
>
> The system initialization has nothing to do with shares,
> this come to place after an user logs on. The system
> creates a few symbolic links (each share drive
> will create one symbolic link).
>
> If you open a file on a share (e.g. I:), I/O manager loogs for
> the symbolic links for the disk drives. It then finds the share
> is actually \Server\ShareXXX, and the IRP is targeted to the
> LanmanRedirector to open/create/whatever the file.
>
> L.
>
>

Greg,

I’m assuming you are talking about directories shared OUT from a
machine. In that case, SRV tries to reestablish the share during its
initialization. If SRV cannot open the directory at that time, it will
not re-create the share point.

So, this suggests that either (a) SRV is starting before your FSD, or
(b) SRV is trying to access the share point and for some reason it is
failing.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Pearce
Sent: Monday, May 03, 2004 2:21 PM
To: ntfsd redirect
Subject: Re:[ntfsd] Re:Remembering shares

Hi Ladislav,

The reason I asked this question is that I have my file system driver
installed on 4 w2k machines, and two of them remember the share point on
the root, and two do not. All 4 machines have SP4 applied. Of the two
that remember the shares, one is w2k pro, the other is w2k server. Of
the two which don’t remember the shares, one is w2k pro, and the other
is w2k server.

I’m trying to figure out what the differences might be (in the
registry, I guess), that is causing this. If you (or anyone else!)
could point me in the right direction, it would be most appreciated. If
you know of any documentation that describes how this works - that would
be a big help.
I’ve examined several registry keys between the 4 systems and cannot see
anything obvious. I looked at the keys that you suggested, as well as
HKLM\System\CurrentControlSet\Services\lanmanserver\Shares

Thanks ahead of time, and regards,

Greg

“Ladislav Zezula” wrote in message news:xxxxx@ntfsd…
> Hi, Greg,
>
> > I was wondering what happens at the IRP level, at system
initialization.
>
> I’m afraid I don’t understand the problem then.
>
> The system initialization has nothing to do with shares, this come to
> place after an user logs on. The system creates a few symbolic links
> (each share drive will create one symbolic link).
>
> If you open a file on a share (e.g. I:), I/O manager loogs for the
> symbolic links for the disk drives. It then finds the share is
> actually \Server\ShareXXX, and the IRP is targeted to the
> LanmanRedirector to open/create/whatever the file.
>
> L.
>
>


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

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

> The reason I asked this question is that I have my file system driver

installed on 4 w2k machines, and two of them remember the share point on
the

Maybe it will help if you crete a watchpoint in your CREATE handler

if(FileName is DirNameWhichShouldBeShared)
Log(result)

But this is a suggestion only. You will create somehing like “kernel mode
filemon”, and after you start your debugger, you may look at the debug log
messages and try to figure out what happened.

L.

Tony, (or anyone else!)

Does a volume have to get successfully mounted (Via mount_volume fsctl)
before the system can apply a share to it?

Thanks,

Greg

Absolutely.

SRV will try to OPEN the root directory of the share - if that fails,
the volume will not be shared, and it is not retried again.

Regards,

Tony

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Pearce
Sent: Wednesday, May 05, 2004 12:25 PM
To: ntfsd redirect
Subject: Re:[ntfsd] Re:Remembering shares

Tony, (or anyone else!)

Does a volume have to get successfully mounted (Via mount_volume fsctl)
before the system can apply a share to it?

Thanks,

Greg


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

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

Thank you very much!

Greg

“Tony Mason” wrote in message news:xxxxx@ntfsd…
Absolutely.

SRV will try to OPEN the root directory of the share - if that fails,
the volume will not be shared, and it is not retried again.

Regards,

Tony

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Pearce
Sent: Wednesday, May 05, 2004 12:25 PM
To: ntfsd redirect
Subject: Re:[ntfsd] Re:Remembering shares

Tony, (or anyone else!)

Does a volume have to get successfully mounted (Via mount_volume fsctl)
before the system can apply a share to it?

Thanks,

Greg


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

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

Are you sure? I just created a share on an unmounted CDROM with no
problem…

C:\> net share nonexist=d:\
nonexist was shared successfully.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Wednesday, May 05, 2004 12:32 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Re:Remembering shares

Absolutely.

SRV will try to OPEN the root directory of the share - if that fails,
the volume will not be shared, and it is not retried again.

Regards,

Tony

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Pearce
Sent: Wednesday, May 05, 2004 12:25 PM
To: ntfsd redirect
Subject: Re:[ntfsd] Re:Remembering shares

Tony, (or anyone else!)

Does a volume have to get successfully mounted (Via mount_volume fsctl)
before the system can apply a share to it?

Thanks,

Greg


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

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


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

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

Ken,

Sigh. The question related to restoration of shares upon reboot. The
test you performed does not appear to address my comment (which is that
SRV will not create the share if it cannot open it during its
initialization).

A better test: take a removable storage device (USB drive). Create a
share against it. Remove the device, reboot the system. Plug the USB
drive back in - you will find the share has not been created. If I had
to guess, I suspect SRV is probably minimally invasive when checking for
existence (open for no data access, for instance) or some other test
that doesn’t even force a drive mount.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources Inc
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Cross
Sent: Wednesday, May 05, 2004 12:41 PM
To: ntfsd redirect
Subject: RE: [ntfsd] Re:Remembering shares

Are you sure? I just created a share on an unmounted CDROM with no
problem…

C:\> net share nonexist=d:\
nonexist was shared successfully.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Wednesday, May 05, 2004 12:32 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Re:Remembering shares

Absolutely.

SRV will try to OPEN the root directory of the share - if that fails,
the volume will not be shared, and it is not retried again.

Regards,

Tony

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Greg Pearce
Sent: Wednesday, May 05, 2004 12:25 PM
To: ntfsd redirect
Subject: Re:[ntfsd] Re:Remembering shares

Tony, (or anyone else!)

Does a volume have to get successfully mounted (Via mount_volume fsctl)
before the system can apply a share to it?

Thanks,

Greg


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

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


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

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


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

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

Yes.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Greg Pearce”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, May 05, 2004 8:24 PM
Subject: Re:[ntfsd] Re:Remembering shares

> Tony, (or anyone else!)
>
> Does a volume have to get successfully mounted (Via mount_volume fsctl)
> before the system can apply a share to it?
>
> Thanks,
>
> Greg
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

After some more research, I think I know what’s going on with remembering
shares (The original problem in the post was that if I share my drive and
reboot, the system does not restore the share next time it comes up).

At system initialization, I see that my driver gets called on behalf of
ftdisk several times (DeviceObject-DriverObject->Drivername = FTDISK.SYS).
I’m disallowing ftdisk from mounting my volume and returning
STATUS_UNRECOGNIZED_VOLUME.

Should I allow ftdisk to mount the volume, or can I get ftdisk to leave me
alone?

Thanks

Greg