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
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
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