Hi,
I want to get the system environment variables like SystemRoot,
SystemDrive etc inside my driver.
How can I get it. Is it a well defined value or there is some call to
get it.
Regards,
Avinash
Hi,
I want to get the system environment variables like SystemRoot,
SystemDrive etc inside my driver.
How can I get it. Is it a well defined value or there is some call to
get it.
Regards,
Avinash
For what?
To access files in SystemRoot, just use the \SystemRoot\path pathname. It
works for kernel code.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Avinash Kumar”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, February 05, 2004 1:12 AM
Subject: [ntfsd] How to get the system env variables inside a driver.
> Hi,
>
> I want to get the system environment variables like SystemRoot,
> SystemDrive etc inside my driver.
>
> How can I get it. Is it a well defined value or there is some call to
> get it.
>
> Regards,
> Avinash
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Thanks Max,
I wanted to use SystemDrive instead of SystemRoot to build my path
information. Will that work? I’ll give that a try.
Regards,
Avinash
-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Wednesday, February 04, 2004 5:25 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] How to get the system env variables inside a
driver.
For what?
To access files in SystemRoot, just use the \SystemRoot\path
pathname. It works for kernel code.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Avinash Kumar”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, February 05, 2004 1:12 AM
Subject: [ntfsd] How to get the system env variables inside a driver.
> Hi,
>
> I want to get the system environment variables like SystemRoot,
> SystemDrive etc inside my driver.
>
> How can I get it. Is it a well defined value or there is some call to
> get it.
>
> Regards,
> Avinash
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.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: xxxxx@commvault.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
It is a good design idea that all files accessed from the driver are
located under \SystemRoot.
Why not follow it?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Avinash Kumar”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, February 05, 2004 1:36 AM
Subject: RE: [ntfsd] How to get the system env variables inside a driver.
> Thanks Max,
>
> I wanted to use SystemDrive instead of SystemRoot to build my path
> information. Will that work? I’ll give that a try.
>
> Regards,
> Avinash
>
>
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Wednesday, February 04, 2004 5:25 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] How to get the system env variables inside a
> driver.
>
>
> For what?
>
> To access files in SystemRoot, just use the \SystemRoot\path
> pathname. It works for kernel code.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Avinash Kumar”
> To: “Windows File Systems Devs Interest List”
> Sent: Thursday, February 05, 2004 1:12 AM
> Subject: [ntfsd] How to get the system env variables inside a driver.
>
>
> > Hi,
> >
> > I want to get the system environment variables like SystemRoot,
> > SystemDrive etc inside my driver.
> >
> > How can I get it. Is it a well defined value or there is some call to
> > get it.
> >
> > Regards,
> > Avinash
> >
> > —
> > Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@storagecraft.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: xxxxx@commvault.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: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
I want to keep a file in system volume information so that no one
touches it by mistake too.
I am having this problem that if the file is opened by someone in
usermode ( even explorer ) my open is kernel fails. I am not sure why so
I felt let me keep it in system volume information where the chances are
very less for someone to browse/open.
Any idea why a Kmode File Open starts failing if someone opens it in the
user mode.
Regards,
Avinash
-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Wednesday, February 04, 2004 6:00 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] How to get the system env variables inside a
driver.
It is a good design idea that all files accessed from the driver are
located under \SystemRoot.
Why not follow it?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Avinash Kumar”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, February 05, 2004 1:36 AM
Subject: RE: [ntfsd] How to get the system env variables inside a
driver.
> Thanks Max,
>
> I wanted to use SystemDrive instead of SystemRoot to build my path
> information. Will that work? I’ll give that a try.
>
> Regards,
> Avinash
>
>
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Wednesday, February 04, 2004 5:25 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] How to get the system env variables inside a
> driver.
>
>
> For what?
>
> To access files in SystemRoot, just use the \SystemRoot\path
> pathname. It works for kernel code.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Avinash Kumar”
> To: “Windows File Systems Devs Interest List”
> Sent: Thursday, February 05, 2004 1:12 AM
> Subject: [ntfsd] How to get the system env variables inside a driver.
>
>
> > Hi,
> >
> > I want to get the system environment variables like SystemRoot,
> > SystemDrive etc inside my driver.
> >
> > How can I get it. Is it a well defined value or there is some call
> > to get it.
> >
> > Regards,
> > Avinash
> >
> > —
> > Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@storagecraft.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: xxxxx@commvault.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: xxxxx@storagecraft.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: xxxxx@commvault.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
How should I use the path(file name) to access a file “myfile” in system
root folder?
1 \systemroot\myfile ->I get a status C000003B
2 systemroot\myfile -> I get a status C000003B
3 ??\systemroot\myfile -> I get a status C000003A
4 ??%systemroot%\myfile -> I get a status C000003A
RtlInitUnicodeString(&fileName, deviceExtension->myFile);
InitializeObjectAttributes(&objectAttributes,
(PUNICODE_STRING)&fileName, OBJ_CASE_INSENSITIVE, NULL, NULL);
status=ZwCreateFile(&fileHandle, GENERIC_READ|SYNCHRONIZE,
&objectAttributes, &IoStatus,
0, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, FILE_OPEN,
FILE_SYNCHRONOUS_IO_NONALERT|FILE_NO_INTERMEDIATE_BUFFERING, NULL,
0);
Regards,
Avinash
-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Wednesday, February 04, 2004 6:00 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] How to get the system env variables inside a
driver.
It is a good design idea that all files accessed from the driver are
located under \SystemRoot.
Why not follow it?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Avinash Kumar”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, February 05, 2004 1:36 AM
Subject: RE: [ntfsd] How to get the system env variables inside a
driver.
> Thanks Max,
>
> I wanted to use SystemDrive instead of SystemRoot to build my path
> information. Will that work? I’ll give that a try.
>
> Regards,
> Avinash
>
>
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Wednesday, February 04, 2004 5:25 PM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] How to get the system env variables inside a
> driver.
>
>
> For what?
>
> To access files in SystemRoot, just use the \SystemRoot\path
> pathname. It works for kernel code.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Avinash Kumar”
> To: “Windows File Systems Devs Interest List”
> Sent: Thursday, February 05, 2004 1:12 AM
> Subject: [ntfsd] How to get the system env variables inside a driver.
>
>
> > Hi,
> >
> > I want to get the system environment variables like SystemRoot,
> > SystemDrive etc inside my driver.
> >
> > How can I get it. Is it a well defined value or there is some call
> > to get it.
> >
> > Regards,
> > Avinash
> >
> > —
> > Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: xxxxx@storagecraft.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: xxxxx@commvault.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: xxxxx@storagecraft.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: xxxxx@commvault.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
> 1 \systemroot\myfile ->I get a status C000003B
This must work.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
> ----------
From: xxxxx@storagecraft.com[SMTP:xxxxx@storagecraft.com]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, February 05, 2004 1:35 AM
To: xxxxx@lists.osr.com
Subject: Re: [ntfsd] How to get the system env variables inside a
driver.> 1 \systemroot\myfile ->I get a status C000003B
This must work.
STATUS_OBJECT_PATH_SYNTAX_BAD… I’d check if all '' are doubled (sorry if
it is obvious).
Best regards,
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]
You can check status returned by ZwCreateFile. I guess it is
STATUS_SHARING_VIOLATION. If it is the case you can try to supply different
SharedAccess or DesiredAccess to ZwCreateFile.
Alternatively you can open the file once at system startup and keep it
opened.
Alexei.
I am having this problem that if the file is opened by someone in
usermode ( even explorer ) my open is kernel fails. I am not sure why so
I felt let me keep it in system volume information where the chances are
very less for someone to browse/open.Any idea why a Kmode File Open starts failing if someone opens it in the
user mode.Regards,
Avinash
Yup I am taking care of it by having \ for each . One thing to mention
here. I am below the file system in the stack if that causes any issue
here.
Regards,
Avinash
-----Original Message-----
From: Vodicka, Michal [mailto:michal.vodicka@st.com]
Sent: Wednesday, February 04, 2004 7:51 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] How to get the system env variables inside a
driver.
From: xxxxx@storagecraft.com[SMTP:xxxxx@storagecraft.com]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, February 05, 2004 1:35 AM
To: xxxxx@lists.osr.com
Subject: Re: [ntfsd] How to get the system env variables inside a
driver.> 1 \systemroot\myfile ->I get a status C000003B
This must work.
STATUS_OBJECT_PATH_SYNTAX_BAD… I’d check if all '' are doubled (sorry
if it is obvious).
Best regards,
Michal Vodicka
STMicroelectronics Design and Application s.r.o. [michal.vodicka@st.com,
http:://www.st.com]
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@commvault.com To
unsubscribe send a blank email to xxxxx@lists.osr.com