Hi, Guys,
I have a stupid question: in the driver code, if I declare a variable
as a local one, is the memory for the variable resident? Can it be in a paged pool?
The question is can the driver code get paged?
Thanks.
Lijun
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
By default the drivers code, stack and static data are
non-paged.
Don Burn
Egenera, Inc.
----- Original Message -----
From: Lijun Wang
To: File Systems Developers
Sent: Saturday, May 11, 2002 10:18 AM
Subject: [ntfsd] Memory state of a local variable in the driver
Hi, Guys,
I have a stupid question: in the driver code, if I declare a variable
as a local one, is the memory for the variable resident? Can it be in a paged pool?
The question is can the driver code get paged?
Thanks.
Lijun
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience — You are currently subscribed to ntfsd as: xxxxx@acm.org To unsubscribe send a blank email to %%email.unsub%%
Kernel stacks are swappable by default - when you are blocked waiting on
behalf of user mode. If you supply a wait mode of kernel mode however,
the stack is guaranteed resident (or you specifically disable stack
swap)
A common mistake is for people to allocate an event on the stack & issue
a KeWaitForSingleObject() on the event with WaitMode == UserMode, and
let the completion routine signal the event. The completion routine of
course faults when the stack is swapped out as it attempts to touch the
event.
Ravi
This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
From: Don Burn [mailto:xxxxx@acm.org]
Sent: Saturday, May 11, 2002 7:14 AM
To: File Systems Developers
Subject: [ntfsd] Re: Memory state of a local variable in the driver
By default the drivers code, stack and static data are
non-paged.
Don Burn
Egenera, Inc.
----- Original Message ----- From: Lijun Wang
mailto:xxxxx To: File Systems Developers
mailto:xxxxx Sent: Saturday, May 11, 2002 10:18 AM
Subject: [ntfsd] Memory state of a local variable in the driver
Hi, Guys,
I have a stupid question: in the driver code, if I
declare a variable
as a local one, is the memory for the variable resident?
Can it be in a paged pool?
The question is can the driver code get paged?
Thanks.
Lijun</mailto:xxxxx></mailto:xxxxx>
Such a variable is on the stack. Stack is usually resident, and can go non-resident only if the thread is in user-mode wait. If the thread is running or in kernel-mode wait - then the stack is resident.
Code is resident by default, but can be declared pageable by #pragma code_seg()
Max
----- Original Message -----
From: Lijun Wang
To: File Systems Developers
Sent: Saturday, May 11, 2002 6:18 PM
Subject: [ntfsd] Memory state of a local variable in the driver
Hi, Guys,
I have a stupid question: in the driver code, if I declare a variable
as a local one, is the memory for the variable resident? Can it be in a paged pool?
The question is can the driver code get paged?
Thanks.
Lijun
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience — You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To unsubscribe send a blank email to %%email.unsub%%
>A common mistake is for people to allocate an event on the stack & issue
a KeWaitForSingleObject() on the event with WaitMode == UserMode, and
Any need in using KeWaitForSingleObject(…UserMode…) in drivers at all? Is KernelMode not enough?
Max
The practice is to make a much of a drivers code pagable as possible
-----Original Message-----
From: Don Burn [mailto:xxxxx@acm.org]
Sent: Saturday, May 11, 2002 7:14 AM
To: File Systems Developers
Subject: [ntfsd] Re: Memory state of a local variable in the driver
By default the drivers code, stack and static data are
non-paged.
Don Burn
Egenera, Inc.
----- Original Message -----
From: Lijun Wang mailto:xxxxx
To: File Systems Developers mailto:xxxxx
Sent: Saturday, May 11, 2002 10:18 AM
Subject: [ntfsd] Memory state of a local variable in the driver
Hi, Guys,
I have a stupid question: in the driver code, if I declare a variable
as a local one, is the memory for the variable resident? Can it be in a
paged pool?
The question is can the driver code get paged?
Thanks.
Lijun
_____
Do You Yahoo!?
LAUNCH http: - Your Yahoo!
Music Experience — You are currently subscribed to ntfsd as: xxxxx@acm.org
To unsubscribe send a blank email to %%email.unsub%%
—
You are currently subscribed to ntfsd as: xxxxx@congruent.com
To unsubscribe send a blank email to %%email.unsub%%</http:></mailto:xxxxx></mailto:xxxxx>