FileId

Hi,

I’m writing a filter driver. But i would
like to know how to get a unique file id during
the IRP_MJ_CREATE.

Thanks.
Pascal.

Hi Pascal,

Please see below.

(PIO_STACK_LOCATION)CurrentStack = IoGetCurrentIrpStackLocation(IRP)
(PVOID)UniqueFileId = CurrentStack->FileObject.FsContext

Yuji

Thank you very mush.

Pascal.

Pascal Vantrepote wrote:

Thank you very mush.

^^^^
much

Pascal.

This file ID is only unique while the file is open. Once it has been
closed the ID can be re-used by a different file. We use the same trick.

Andy.

Hello,
Be aware that the FsContext field is NOT a unique identifier, since it may
be reused for another file after IRP_MJ_CLOSE.
But it is OK to assert that all fileobjects that have the same FsContext
field describe the same file.

Just my 2 (euro) cents

Regards,
Pascal.
----- Original Message -----
From:
To: “File Systems Developers”
Sent: Tuesday, March 12, 2002 12:41 PM
Subject: [ntfsd] Re: FileId

> Hi Pascal,
>
> Please see below.
>
> (PIO_STACK_LOCATION)CurrentStack = IoGetCurrentIrpStackLocation(IRP)
> (PVOID)UniqueFileId = CurrentStack->FileObject.FsContext
>
> Yuji
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@evidian.com
> To unsubscribe send a blank email to %%email.unsub%%
>

Pass the create down and then, after it completes, call FSCTL to get the
ID and then use IoCancelFileOpen() to close it.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pascal Vantrepote
Sent: Tuesday, March 12, 2002 3:11 AM
To: File Systems Developers
Subject: [ntfsd] FileId

Hi,

I’m writing a filter driver. But i would
like to know how to get a unique file id during
the IRP_MJ_CREATE.

Thanks.
Pascal.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

This only works if the file has already been opened.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@itg.hitachi.co.jp
Sent: Tuesday, March 12, 2002 3:41 AM
To: File Systems Developers
Subject: [ntfsd] Re: FileId

Hi Pascal,

Please see below.

(PIO_STACK_LOCATION)CurrentStack = IoGetCurrentIrpStackLocation(IRP)
(PVOID)UniqueFileId = CurrentStack->FileObject.FsContext

Yuji


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

Plus, this may not hold true for all file systems. I recommend calling
the FSD to get the ID properly

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@itg.hitachi.co.jp
Sent: Tuesday, March 12, 2002 3:41 AM
To: File Systems Developers
Subject: [ntfsd] Re: FileId

Hi Pascal,

Please see below.

(PIO_STACK_LOCATION)CurrentStack = IoGetCurrentIrpStackLocation(IRP)
(PVOID)UniqueFileId = CurrentStack->FileObject.FsContext

Yuji


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%