SL_OPEN_TARGET_DIRECTORY flag

I’m still trying to understand what is going on with this flag during the
IRP_MJ_CREATE and I’m not quite getting it. In the IFS Kit docs, it says:

“The file being opened need not exist if the directory exists. This is used
to create a file object for a subsequent rename operation.”

I saw one of these come through and expected to see a filename (which I
would expect to trim off to get the directory being opened - the true target
of the open according to my understanding), but in the post-callback when I
grabbed the file name, it was a directory path. Now I suppose you could
call this with a directory, but I’m not sure now.

So my understand is (and please correct me):

When I see SL_OPEN_TARGET_DIRECTORY, I should get the path, and trim off the
last element (ie go back one backslash). The thing I’m trimming off might
be a directory or a file, but at least I know that what I’m left with after
the trim is a directory. Therefore, the true target of the IRP_MJ_CREATE is
the remaining directory path.

Is that correct?

Thanks for any help.

Doug

Look at FASTFAT source for this.


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

“Buy” wrote in message news:xxxxx@ntfsd…
> I’m still trying to understand what is going on with this flag during the
> IRP_MJ_CREATE and I’m not quite getting it. In the IFS Kit docs, it says:
>
>
>
> “The file being opened need not exist if the directory exists. This is used
> to create a file object for a subsequent rename operation.”
>
>
>
> I saw one of these come through and expected to see a filename (which I
> would expect to trim off to get the directory being opened - the true target
> of the open according to my understanding), but in the post-callback when I
> grabbed the file name, it was a directory path. Now I suppose you could
> call this with a directory, but I’m not sure now.
>
>
>
> So my understand is (and please correct me):
>
> When I see SL_OPEN_TARGET_DIRECTORY, I should get the path, and trim off the
> last element (ie go back one backslash). The thing I’m trimming off might
> be a directory or a file, but at least I know that what I’m left with after
> the trim is a directory. Therefore, the true target of the IRP_MJ_CREATE is
> the remaining directory path.
>
>
>
> Is that correct?
>
>
>
> Thanks for any help.
>
> Doug
>
>
>
>