I can think of at least two solutions here:
- You can build a table within your user mode app mapping device
letter/mount point and device name. [use QueryDosDevice or mount manager
IOCTL]
- Use Nt API from the userpace service.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Hinkle
Sent: Tuesday, April 04, 2006 3:05 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] How do I open \Device\HarddiskVolume1\test.txt in
userspace?
An unfortunate cut-and-paste mishap there. What I meant to say was:
I just can’t figure this out. My minifilter is shooting my userspace
service the filename ‘\Device\HarddiskVolume1\test.txt’ … But I cannot
figure out any way to open the file up. Is there a way to open the file
with this name? If not is there a way to reliably translate
‘\Device\HarddiskVolume1\test.txt in’ into ‘c:\test.txt’
Thankyou for any help.
David
On 4/4/06, David Hinkle > wrote:
I just can’t figure this out. My minifilter is shooting my userspace
service the filename ‘\Device\HarddiskVolume1\test.txt in userspace’ … But
I cannot figure out any way to open the file up. Is there a way to open
the file with this name? If not is there a way to reliably translate
‘\Device\HarddiskVolume1\test.txt in userspace’ into ‘c:\test.txt’
Thankyou for any help.
David
— Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank email
to xxxxx@lists.osr.com
When you say to use the NT Api, are you referning to NtCreateFile? I’ve
read references to that in my searching but havn’t found any example code.
Also, I really would like to be able to retreive a file descriptor that I
can be pased to the standard C library functions. If that’s not possible,
I can live without it however.
Do you have an example of the NtCreateFile in action? And if so is it
possible to get a file descriptor that can be passed to the standard C
library functions like read?
David
On 4/4/06, Pashupati Kumar wrote:
>
> I can think of at least two solutions here:
> 1. You can build a table within your user mode app mapping device
> letter/mount point and device name. [use QueryDosDevice or mount manager
> IOCTL]
> 2. Use Nt API from the userpace service.
>
>
> ------------------------------
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *David Hinkle
> Sent: Tuesday, April 04, 2006 3:05 PM
> To: Windows File Systems Devs Interest List
> Subject: Re:[ntfsd] How do I open \Device\HarddiskVolume1\test.txt in
> userspace?
>
> An unfortunate cut-and-paste mishap there. What I meant to say was:
>
> I just can’t figure this out. My minifilter is shooting my userspace
> > service the filename ‘\Device\HarddiskVolume1\test.txt’ … But I cannot
> > figure out any way to open the file up. Is there a way to open the file
> > with this name? If not is there a way to reliably translate
> > ‘\Device\HarddiskVolume1\test.txt in’ into ‘c:\test.txt’
> >
> > Thankyou for any help.
> >
> > David
> >
>
>
> On 4/4/06, David Hinkle wrote:
> >
> > I just can’t figure this out. My minifilter is shooting my userspace
> > service the filename ‘\Device\HarddiskVolume1\test.txt in userspace’ … But
> > I cannot figure out any way to open the file up. Is there a way to open
> > the file with this name? If not is there a way to reliably translate
> > ‘\Device\HarddiskVolume1\test.txt in userspace’ into ‘c:\test.txt’
> >
> > Thankyou for any help.
> >
> > David
> >
>
> — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed
> to ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank
> email to xxxxx@lists.osr.com
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Yep, I meant NtCreateFile and related API. Function signature is same as
that ZwXXXX. NtCreateFile will return you HANDLE to file. You can use
open_osfhandle routine to get CRT file descriptor.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Hinkle
Sent: Tuesday, April 04, 2006 3:21 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] How do I open \Device\HarddiskVolume1\test.txt in use
rspace?
When you say to use the NT Api, are you referning to NtCreateFile? I’ve
read references to that in my searching but havn’t found any example code.
Also, I really would like to be able to retreive a file descriptor that I
can be pased to the standard C library functions. If that’s not possible,
I can live without it however.
Do you have an example of the NtCreateFile in action? And if so is it
possible to get a file descriptor that can be passed to the standard C
library functions like read?
David
On 4/4/06, Pashupati Kumar mailto:xxxxx > wrote:
I can think of at least two solutions here:
1. You can build a table within your user mode app mapping device
letter/mount point and device name. [use QueryDosDevice or mount manager
IOCTL]
2. Use Nt API from the userpace service.
_____
From: xxxxx@lists.osr.com
mailto:xxxxx
[mailto:xxxxx@lists.osr.com
mailto:xxxxx] On Behalf Of David Hinkle
Sent: Tuesday, April 04, 2006 3:05 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] How do I open \Device\HarddiskVolume1\test.txt in
userspace?
An unfortunate cut-and-paste mishap there. What I meant to say was:
I just can’t figure this out. My minifilter is shooting my userspace
service the filename ‘\Device\HarddiskVolume1\test.txt’ … But I cannot
figure out any way to open the file up. Is there a way to open the file
with this name? If not is there a way to reliably translate
‘\Device\HarddiskVolume1\test.txt in’ into ‘c:\test.txt’
Thankyou for any help.
David
On 4/4/06, David Hinkle > wrote:
I just can’t figure this out. My minifilter is shooting my userspace
service the filename ‘\Device\HarddiskVolume1\test.txt in userspace’ … But
I cannot figure out any way to open the file up. Is there a way to open
the file with this name? If not is there a way to reliably translate
‘\Device\HarddiskVolume1\test.txt in userspace’ into ‘c:\test.txt’
Thankyou for any help.
David
— Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
https: You are currently subscribed
to ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank
email to xxxxx@lists.osr.com
mailto:xxxxx
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
https:
You are currently subscribed to ntfsd as: xxxxx@gmail.com
mailto:xxxxx
To unsubscribe send a blank email to xxxxx@lists.osr.com
mailto:xxxxx
— Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank email
to xxxxx@lists.osr.com</mailto:xxxxx></mailto:xxxxx></https:></mailto:xxxxx></https:></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>
Does anybody have an example snippet of using NtCreateFile to open a file in
read mode? I’m not sure I understand some of the create modes.
On 4/4/06, Pashupati Kumar wrote:
>
> Yep, I meant NtCreateFile and related API. Function signature is same as
> that ZwXXXX. NtCreateFile will return you HANDLE to file. You can use
> open_osfhandle routine to get CRT file descriptor.
>
>
>
> ------------------------------
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *David Hinkle
> Sent: Tuesday, April 04, 2006 3:21 PM
>
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] How do I open \Device\HarddiskVolume1\test.txt in
> use rspace?
>
> When you say to use the NT Api, are you referning to NtCreateFile? I’ve
> read references to that in my searching but havn’t found any example code.
> Also, I really would like to be able to retreive a file descriptor that I
> can be pased to the standard C library functions. If that’s not possible,
> I can live without it however.
>
> Do you have an example of the NtCreateFile in action? And if so is it
> possible to get a file descriptor that can be passed to the standard C
> library functions like read?
>
> David
>
> On 4/4/06, Pashupati Kumar wrote:
>
> > I can think of at least two solutions here:
> 1. You can build a table within your user mode app mapping device
> letter/mount point and device name. [use QueryDosDevice or mount manager
> IOCTL]
> 2. Use Nt API from the userpace service.
>
>
> ------------------------------
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *David Hinkle
> Sent: Tuesday, April 04, 2006 3:05 PM
> To: Windows File Systems Devs Interest List
> Subject: Re:[ntfsd] How do I open \Device\HarddiskVolume1\test.txt in
> userspace?
>
> An unfortunate cut-and-paste mishap there. What I meant to say was:
>
> I just can’t figure this out. My minifilter is shooting my userspace
> service the filename ‘\Device\HarddiskVolume1\test.txt’ … But I cannot
> figure out any way to open the file up. Is there a way to open the file
> with this name? If not is there a way to reliably translate
> ‘\Device\HarddiskVolume1\test.txt in’ into ‘c:\test.txt’
>
> Thankyou for any help.
>
> David
>
>
> On 4/4/06, David Hinkle wrote:
> >
> > I just can’t figure this out. My minifilter is shooting my userspace
> > service the filename ‘\Device\HarddiskVolume1\test.txt in userspace’ … But
> > I cannot figure out any way to open the file up. Is there a way to open
> > the file with this name? If not is there a way to reliably translate
> > ‘\Device\HarddiskVolume1\test.txt in userspace’ into ‘c:\test.txt’
> >
> > Thankyou for any help.
> >
> > David
> >
>
> — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed
> to ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank
> email to xxxxx@lists.osr.com
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed
> to ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank
> email to xxxxx@lists.osr.com
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> Do you have an example of the NtCreateFile in action?
There’s a tool called FileTest, available for download at OSR
online. As it’s provided with sull source, you may find how to
call this function.
And if so is it possible to get a file descriptor that can be
passed to the standard C library functions like read?
The havdle can be used in the Win32 API functions.
Better don’t insist on functions like “read” and use Win32 equivalents
instead
L.