A puzzle about DEVICE???

Hi all,

Could you tell me the difference between FileObject and DeviceObject?

Thax!

Anthony

A DeviceObject is a Object that a Driver creates that is the target of I/O
requests. A file object represents a open instance of a object
(file,directory, socket, disk, device, etc). File objects are created when
a user issues a CreateFile request (think of it as createFileObject). The
Object manager parses the input name and passes it to the appropriate device
object for processing. The handle that the user gets back maps to the
FileObject which represents the open instance to the opened device object.

Hope that helps,
Mark


Mark Cariddi
Consulting Associate
OSR, Open Systems Resources, Inc.
http://www.osr.com/
“Anthony” wrote in message news:xxxxx@ntdev…
> Hi all,
>
> Could you tell me the difference between FileObject and DeviceObject?
>
> Thax!
>
> Anthony
>
>
>

File object is a structure to which the handle created by CreateFile is
refererred.

Its handle must be specified to ReadFile/WriteFile/DeviceIoControl.

File object represents an “open instance” on the device object, and
contains the data like the lseek() offset, byte range locking stuff, and
possibly the 2 driver’s context areas.

The first of these contexts (->FsContext and ->SectionObjectPointer) is
used by FSDs only and is necessary to support memory-mapped file. The second
(->FsContext2) is open for any possibly use by the driver.

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

----- Original Message -----
From: “Anthony”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Sunday, May 09, 2004 6:43 AM
Subject: [ntdev] A puzzle about DEVICE???

> Hi all,
>
> Could you tell me the difference between FileObject and DeviceObject?
>
> Thax!
>
> Anthony
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

That raises a question I’ve been wondering about: What are the rules about
using FsContext2? Who “owns” it? Is it ever safe for a filter driver to
use it?

Thanks,
Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Sunday, May 09, 2004 9:24 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] A puzzle about DEVICE???

File object is a structure to which the handle created by CreateFile is
refererred.

Its handle must be specified to ReadFile/WriteFile/DeviceIoControl.

File object represents an “open instance” on the device object, and
contains the data like the lseek() offset, byte range locking stuff, and
possibly the 2 driver’s context areas.

The first of these contexts (->FsContext and ->SectionObjectPointer) is
used by FSDs only and is necessary to support memory-mapped file. The second
(->FsContext2) is open for any possibly use by the driver.

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

----- Original Message -----
From: “Anthony”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Sunday, May 09, 2004 6:43 AM
Subject: [ntdev] A puzzle about DEVICE???

> Hi all,
>
> Could you tell me the difference between FileObject and DeviceObject?
>
> Thax!
>
> Anthony
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

> That raises a question I’ve been wondering about: What are the rules about

using FsContext2? Who “owns” it? Is it ever safe for a filter driver to
use it?

No. The bottom-most driver in the stack owns it.

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

Hello Maxim,

What dose your title" DDK MVP" mean?

Anthony
“Maxim S. Shatskih” ??? news:xxxxx@ntdev…
> > That raises a question I’ve been wondering about: What are the rules
about
> > using FsContext2? Who “owns” it? Is it ever safe for a filter driver
to
> > use it?
>
> No. The bottom-most driver in the stack owns it.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>

> Hello Maxim,

What dose your title" DDK MVP" mean?

http://mvp.support.microsoft.com/

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