Volume open in kernel mode ?

I’m a bit embarrassed on this one, I feel I should know the answer but I
can’t find it anywhere.

I want to use ZwCreateFile() to open the volume of a drive in kernel
mode. No matter what I try, I can’t get the right string to describe the path.

In user mode with CreateFile() I would simply use “\\.\D:”.

In kernel mode, I know the name of the device object associated with “D:”
so how do I construct a string to do the above ?

Everything I have tried that doesn’t generate an error always ends up
opening the root directory coz the filename passed in IRP_MJ_CREATE is ""
no matter that I don’t have a trailing '' in my path.

TIA,

Mark

\??\d:

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Mark S. Edwards
Sent: Friday, February 25, 2000 10:05 AM
To: File Systems Developers Interest List
Subject: [ntfsd] Volume open in kernel mode ?

I’m a bit embarrassed on this one, I feel I should know the answer but I
can’t find it anywhere.

I want to use ZwCreateFile() to open the volume of a drive in kernel
mode. No matter what I try, I can’t get the right string to
describe the path.

In user mode with CreateFile() I would simply use “\\.\D:”.

In kernel mode, I know the name of the device object associated with “D:”
so how do I construct a string to do the above ?

Everything I have tried that doesn’t generate an error always ends up
opening the root directory coz the filename passed in
IRP_MJ_CREATE is ""
no matter that I don’t have a trailing '' in my path.

TIA,

Mark


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Well if you know the device Object represnting your
Drive, then there should be no problem.
If u want to open say D:\foo.
Then u can check the value u want to substitute by
seeing the Objdir.
Type this command at the Command Prompt and u will see
Object Manager Directory contents.
Now if u want to open say D:, then u can see the
symbolic link.
and that’s it.
I would be like this
L"\Device\HardDisk0\Partition0";
Hope it helps.
Gurpreet

— “Mark S. Edwards” wrote:
> I’m a bit embarrassed on this one, I feel I should
> know the answer but I
> can’t find it anywhere.
>
> I want to use ZwCreateFile() to open the volume of a
> drive in kernel
> mode. No matter what I try, I can’t get the right
> string to describe the path.
>
> In user mode with CreateFile() I would simply use
> “\\.\D:”.
>
> In kernel mode, I know the name of the device object
> associated with “D:”
> so how do I construct a string to do the above ?
>
> Everything I have tried that doesn’t generate an
> error always ends up
> opening the root directory coz the filename passed
> in IRP_MJ_CREATE is ""
> no matter that I don’t have a trailing '' in my
> path.
>
> TIA,
>
> Mark
>
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> $subst(‘Email.Unsub’)
>
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

> Well if you know the device Object represnting your

Drive, then there should be no problem.
If u want to open say D:\foo.

Open ??\D:

Max

I am not pretty sure is it not the Object Manager that
adds ??\ to D:\foo

— “Maxim S. Shatskih”
wrote:
> > Well if you know the device Object represnting
> your
> > Drive, then there should be no problem.
> > If u want to open say D:\foo.
>
> Open ??\D:
>
> Max
>
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> $subst(‘Email.Unsub’)
>
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

You must addd ??

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Gurpreet Anand
Sent: Saturday, February 26, 2000 11:08 AM
To: File Systems Developers Interest List
Subject: [ntfsd] Re: Volume open in kernel mode ?

I am not pretty sure is it not the Object Manager that
adds ??\ to D:\foo

— “Maxim S. Shatskih”
> wrote:
> > > Well if you know the device Object represnting
> > your
> > > Drive, then there should be no problem.
> > > If u want to open say D:\foo.
> >
> > Open ??\D:
> >
> > Max
> >
> >
> > —
> > You are currently subscribed to ntfsd as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> > $subst(‘Email.Unsub’)
> >
> >
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>

Win32 subsystem adds ??.

-----Original Message-----
From: Gurpreet Anand [SMTP:xxxxx@yahoo.com]
Sent: Sunday, February 27, 2000 12:38 AM
To: File Systems Developers Interest List
Subject: [ntfsd] Re: Volume open in kernel mode ?

I am not pretty sure is it not the Object Manager that
adds ??\ to D:\foo

— “Maxim S. Shatskih”
wrote:
> > Well if you know the device Object represnting
> your
> > Drive, then there should be no problem.
> > If u want to open say D:\foo.
>
> Open ??\D:
>
> Max
>
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> $subst(‘Email.Unsub’)
>
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


You are currently subscribed to ntfsd as: xxxxx@amiindia.co.in
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Yeah I got it.
Thanks for correcting me.

— “Sajeev.S” wrote:
> Win32 subsystem adds ??.
>
> -----Original Message-----
> From: Gurpreet Anand
> [SMTP:xxxxx@yahoo.com]
> Sent: Sunday, February 27, 2000 12:38 AM
> To: File Systems Developers Interest List
> Subject: [ntfsd] Re: Volume open in kernel mode ?
>
> I am not pretty sure is it not the Object Manager
> that
> adds ??\ to D:\foo
>
> — “Maxim S. Shatskih”
> wrote:
> > > Well if you know the device Object represnting
> > your
> > > Drive, then there should be no problem.
> > > If u want to open say D:\foo.
> >
> > Open ??\D:
> >
> > Max
> >
> >
> > —
> > You are currently subscribed to ntfsd as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> > $subst(‘Email.Unsub’)
> >
> >
>
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@amiindia.co.in
> To unsubscribe send a blank email to
> $subst(‘Email.Unsub’)
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> $subst(‘Email.Unsub’)
>
>

Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com