Can anybody guide me how to write to file in an ISR? Can I use ZwCreateFile, ZwWriteFile and ZwCloseFile?
You can’t in ISR but you can implement a queue and schedule it to be written by another thread.
> Can anybody guide me how to write to file in an ISR?
Impossible absolutely, use KeInsertQueueDpc and then IoQueueWorkItem.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
How does OS knows that a routine belongs to which level (PASSIVE_LEVEL, APC_LEVEL, etc…)
for example, I create a routine
void ZwCreateFile(…)
{
//Do something here
}
And I have an isr routine and a non-isr routine
void IsrRoutine()
{
ZwCreateFile(…);
}
void NonIsrRoutine()
{
ZwCreateFile(…);
}
How does OS knows that ZwCreateFile should run at what level? Should there be some sort of KeRaiseIRQL(…) within ZwCreateFile routine to force it to run within specific level?
Hope I have explained myself clearly. Trying to understand IRQL’s
The OS doesn’t know, the compiler doesn’t know. You are expected to
know what is allowed and where. How do you do know ? You read the
documentation for the DDI which tells you at what IRQL the DDI can be
called. Kernel mode programming puts a lot more onus on the
programmer to learn these things and “get it right”.
There’s also an element of common sense involved. ISR’s and DPC’s
always have been sections of code that you want to spend as little
time in as possible. That is, you acknowledge the reason for being
in the routine and queue up work to be processed by another thread
that has the leisure to take as long as it needs. Anything related
to file handling is ipso facto expensive in processing time and bound
to touch memory or other resources unavailable at anything but a low IRQL.
As others have said, the only way to do such things with an ISR is to
queue it up and schedule it in another thread running at PASSIVE_LEVEL.
At 11:25 08/06/2010, xxxxx@yahoo.com wrote:
How does OS knows that a routine belongs to which level
(PASSIVE_LEVEL, APC_LEVEL, etc…)for example, I create a routine
void ZwCreateFile(…)
{
//Do something here
}And I have an isr routine and a non-isr routine
void IsrRoutine()
{
ZwCreateFile(…);
}void NonIsrRoutine()
{
ZwCreateFile(…);
}How does OS knows that ZwCreateFile should run at what level? Should
there be some sort of KeRaiseIRQL(…) within ZwCreateFile routine
to force it to run within specific level?Hope I have explained myself clearly. Trying to understand IRQL’s
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminarsTo unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
The OS pops up a BSOD to let you know that you have violated basic
assumptions.
Mark Roddy
On Tue, Jun 8, 2010 at 6:25 AM, wrote:
> How does OS knows that a routine belongs to which level (PASSIVE_LEVEL,
> APC_LEVEL, etc…)
>
> for example, I create a routine
>
> void ZwCreateFile(…)
> {
> //Do something here
> }
>
> And I have an isr routine and a non-isr routine
>
> void IsrRoutine()
> {
> ZwCreateFile(…);
> }
>
> void NonIsrRoutine()
> {
> ZwCreateFile(…);
> }
>
> How does OS knows that ZwCreateFile should run at what level? Should there
> be some sort of KeRaiseIRQL(…) within ZwCreateFile routine to force it to
> run within specific level?
>
> Hope I have explained myself clearly. Trying to understand IRQL’s
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
I just wonder where Mr.Little is…
He is normally quite hard with this particular poster, and I fully agree with him here, because this particular poster just refuses to do his homework…
Anton Bassov
If you want to understand IRQL’s then start with
http://www.microsoft.com/whdc/driver/kernel/IRQL.mspx The paper is old,
but is still excellent.
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
-----Original Message-----
From: xxxxx@yahoo.com [mailto:xxxxx@yahoo.com]
Posted At: Tuesday, June 08, 2010 3:38 AM
Posted To: ntdev
Conversation: Write to file in an ISR
Subject: Write to file in an ISRCan anybody guide me how to write to file in an ISR? Can I use
ZwCreateFile,
ZwWriteFile and ZwCloseFile?__________ Information from ESET Smart Security, version of virus
signature
database 5181 (20100608) __________The message was checked by ESET Smart Security.
OP: This is NOT the “Lazy Chutiyas Learn Windows Internals” list.
The OP needs to (a) Read a recent set of the processor architecture manuals, (b) Take a course in OS concepts, (c) Read Russinovich and Solomon, (d) At least invest the TINY amount of time necessary to look at the WDK documentation A LITTLE BIT… before posting these kinds of questions.
So, OP, in answer to your question: What IRQL does an ISR run at? And, having answered that, what does the documentation say about the IRQL restrictions for the functions you listed? You won’t look this up but you want US to take the time to answer you?
But on a larger note:
Nobody here minds helping out a newb learner. But I for one don’t much appreciate these sorts of REPEATED questions from somebody who refuses to do their homework before posting. It’s disrespectful to the list.
So, OP in future be REALLY sure you’ve done homework before posting, describe what that homework was in detail, and ask your questions really nicely. Please. Thank you. Arrrgh.
Peter
Distinguished List Slave
I’m here. I was about to jump but read on and realized I didn’t need too.
Hey Gupta … First, go read the fucking manual and then go take a fucking
seminar on financial planning. You have no business in the kernel, either
Windows or LINUX.
The personal opinion of
Gary G. Little
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Tuesday, June 08, 2010 6:37 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Write to file in an ISR
I just wonder where Mr.Little is…
He is normally quite hard with this particular poster, and I fully agree
with him here, because this particular poster just refuses to do his
homework…
Anton Bassov
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
> How does OS knows that a routine belongs to which level (PASSIVE_LEVEL, APC_LEVEL, etc…)
for example, I create a routine
void ZwCreateFile(…)
ZwCreateFile internally does some PASSIVE-only things, and thus the requirement for it to be called at PASSIVE.
In the ISR, you cannot do nearly anything except touching the hardware, the nonpaged memory and KeInsertQueueDpc.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
The guy’s annoying, for sure… But, please, Mr. Little in future… DO try to be a bit more temperate. Please?
I think I had already covered your point pretty well in my post this morning (AND demonstrated my working knowledge of Hindi epithets). Heaping abuse on the dude isn’t likely to provide him with any further enlightenment or increase his future level of compliance with our suggestions.
The suggestion that he take a seminar in financial planning is a good one, though, I have to admit…
Peter
OSR
Mr Peter,
You seem to have learnt the right words in Indian National language ![]()
Harish
-----Original Message-----
From: xxxxx@osr.com [mailto:xxxxx@osr.com]
Sent: Tuesday, June 08, 2010 6:14 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Write to file in an ISR
OP: This is NOT the “Lazy Chutiyas Learn Windows Internals” list.
The OP needs to (a) Read a recent set of the processor architecture
manuals, (b) Take a course in OS concepts, (c) Read Russinovich and
Solomon, (d) At least invest the TINY amount of time necessary to look
at the WDK documentation A LITTLE BIT… before posting these kinds of
questions.
So, OP, in answer to your question: What IRQL does an ISR run at? And,
having answered that, what does the documentation say about the IRQL
restrictions for the functions you listed? You won’t look this up but
you want US to take the time to answer you?
But on a larger note:
Nobody here minds helping out a newb learner. But I for one don’t much
appreciate these sorts of REPEATED questions from somebody who refuses
to do their homework before posting. It’s disrespectful to the list.
So, OP in future be REALLY sure you’ve done homework before posting,
describe what that homework was in detail, and ask your questions really
nicely. Please. Thank you. Arrrgh.
Peter
Distinguished List Slave
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
OP: The fundamental reason for IRQL restriction is, the higher the IRQL, the
less types of interrupt can be generated. Hence, services that require
asynchronous interactions between individual components could become
unavailable.
File I/O is very heavy and expensive, it’s not possible at DIRQL.
> So, OP in future be REALLY sure you’ve done homework before posting,
> describe what that homework was in detail, and ask your questions
> really nicely. Please. Thank you. Arrrgh.
PeterG:
In some college math and physics forums, for homework questions, the
following must be provided:
- The problem statement, all variables and given/known data.
- Relevant equations if any.
- THE ATTEMPT AT A SOLUTION.
And no one should give full solution to homework questions. The attitude is
that we are not going to do your homework. I think these are good rules for
someone wants to learn how to fish instead of getting a quick fish.
Calvin
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Tuesday, June 08, 2010 6:14 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Write to file in an ISR
OP: This is NOT the “Lazy Chutiyas Learn Windows Internals” list.
The OP needs to (a) Read a recent set of the processor architecture manuals,
(b) Take a course in OS concepts, (c) Read Russinovich and Solomon, (d) At
least invest the TINY amount of time necessary to look at the WDK
documentation A LITTLE BIT… before posting these kinds of questions.
So, OP, in answer to your question: What IRQL does an ISR run at? And,
having answered that, what does the documentation say about the IRQL
restrictions for the functions you listed? You won’t look this up but you
want US to take the time to answer you?
But on a larger note:
Nobody here minds helping out a newb learner. But I for one don’t much
appreciate these sorts of REPEATED questions from somebody who refuses to do
their homework before posting. It’s disrespectful to the list.
So, OP in future be REALLY sure you’ve done homework before posting,
describe what that homework was in detail, and ask your questions really
nicely. Please. Thank you. Arrrgh.
Peter
Distinguished List Slave
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
I’ve learned a new word!
it is very important to understand how to tell someody to fuck off in their
dialect.
Mark Roddy
On Tue, Jun 8, 2010 at 2:03 PM, Arora, Harish wrote:
> Mr Peter,
> You seem to have learnt the right words in Indian National language ![]()
>
>
> Harish
>
> -----Original Message-----
> From: xxxxx@osr.com [mailto:xxxxx@osr.com]
> Sent: Tuesday, June 08, 2010 6:14 AM
> To: Windows System Software Devs Interest List
> Subject: RE:[ntdev] Write to file in an ISR
>
>
> OP: This is NOT the “Lazy Chutiyas Learn Windows Internals” list.
>
> The OP needs to (a) Read a recent set of the processor architecture
> manuals, (b) Take a course in OS concepts, (c) Read Russinovich and
> Solomon, (d) At least invest the TINY amount of time necessary to look
> at the WDK documentation A LITTLE BIT… before posting these kinds of
> questions.
>
> So, OP, in answer to your question: What IRQL does an ISR run at? And,
> having answered that, what does the documentation say about the IRQL
> restrictions for the functions you listed? You won’t look this up but
> you want US to take the time to answer you?
>
>
> But on a larger note:
>
> Nobody here minds helping out a newb learner. But I for one don’t much
> appreciate these sorts of REPEATED questions from somebody who refuses
> to do their homework before posting. It’s disrespectful to the list.
>
> So, OP in future be REALLY sure you’ve done homework before posting,
> describe what that homework was in detail, and ask your questions really
> nicely. Please. Thank you. Arrrgh.
>
> Peter
> Distinguished List Slave
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
Hey, it’s been a bad day. It looks like the laptop I just leased from Dell
has 1394 issues in WinDbg. At least I cannot get it to connect to the
target, and then to see that post; Yes Virginia, there really is such a
thing as a stupid question. … oh well … I consider myself chastised.
Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Tuesday, June 08, 2010 1:20 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Write to file in an ISR
The guy’s annoying, for sure… But, please, Mr. Little in future… DO try
to be a bit more temperate. Please?
I think I had already covered your point pretty well in my post this morning
(AND demonstrated my working knowledge of Hindi epithets). Heaping abuse on
the dude isn’t likely to provide him with any further enlightenment or
increase his future level of compliance with our suggestions.
The suggestion that he take a seminar in financial planning is a good one,
though, I have to admit…
Peter
OSR
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
> … oh well … I consider myself chastised.
Hey Gary, SOMEBODY has to say the things many of us are feeling ![]()
I periodically am just amazed at the questions on here and think perhaps my
time would be better spent on intellectual stimulation from activities like
reading Mad magazine. But then I remember there ARE gems to be learned from
this list, and REALLY good ideas from REALLY smart people when I get stuck,
so I put up with the, at times, annoying noise. I think teaching this stuff
would be WAY beyond my ability of remaining calm.
Jan
The students who have a company that PAYS to send them to classes are, by and large, pretty cool. Very often, they make you really think!
The questions we get here are WAAAAY more annoying than those I tend to get in any of our seminars.
Peter
OSR
Those of who are bombarding me with foul language - Are you been always like that? Do you guys do the same with other posters. You guys might be geniuses here and have tons of experience in kernel field, but at the same time you all have started somewhere and could have millions or zillions of questions at the time you started. How did you get those questions answered? Surely by asking someone who is an expert or better than you.
And I am doing the same (surely after doing some research)
Mr. Peter Viscarola - What do you think you are? I will not use any foul language because you seems to be ignorant as of now what a forum means? You might be a professional with lots and lots of knowledge. If you want to answer somebody, please feel free to do so, and if your consiousness doesn’t let you do that, atleast don’t bring negative synergy into this forum. This is a forum about helping others. Some people over here have replied to my posting very politely with the information I should be looking for, whereas others have shown same behavior as you (no offence from mypart).
For those of you who understand I am not doing my homework, that’s incorrect. It’s just that I have started digging into kernel only in past 2 months time and you know the learning curve is huge - intel documents, assembly language, driver writing, memory model, IDT’s, ISR’s, Driver levels, etc. etc. Could be true that my postings are very basic, but again emphasising on huge learning curve. Surely in coming months ahead, my postings won’t be as stupid as they are right now. And to let you know Mr. Peter Viscarola I will keep posting, and it’s upto you to decide if you want to answer them or not.
Next time I will always place a post with some clear text that to replied by positive repliers ![]()
On 6/8/2010 5:27 PM, xxxxx@yahoo.com wrote:
Those of who are bombarding me with foul language - Are you been always like that?
Some are. You caught a number of people on a bad day, apparently.
You guys might be geniuses here and have tons of experience in kernel field, but at the same time you all have started somewhere and could have millions or zillions of questions at the time you started. How did you get those questions answered? Surely by asking someone who is an expert or better than you.
Perhaps, but many of us picked up this stuff by OJT, because there
WEREN’T that many experts at the time.
Mr. Peter Viscarola - What do you think you are?
He runs the company that hosts this list and the equipment it runs on.
He is a Benevolent Dictator and has every right to say whatever he
wants. He also happens to be one of the best resources here.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.