| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Thu Jan 22, 2009 8:45 pm Post subject: ExAllocatePool Question |
|
|
| When your driver unloads does the pools unload too?
|
|
| Back to top |
|
 |
Spudgy Newbie cheater
Reputation: 0
Joined: 13 Jan 2009 Posts: 13
|
Posted: Thu Jan 22, 2009 8:48 pm Post subject: |
|
|
| No, you must call ExFreePool.
|
|
| Back to top |
|
 |
whtwht Master Cheater
Reputation: 0
Joined: 21 May 2006 Posts: 390
|
Posted: Thu Jan 22, 2009 8:49 pm Post subject: |
|
|
it 'technically' does, but i believe, its still in the memory, kinda like how on a harddrive the data is still there until another data overwrites it, otherwise its physically there, but it doesn't show up on the records
_________________
zzzzzzz |
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Thu Jan 22, 2009 8:53 pm Post subject: |
|
|
| yes thats what I wanted to hear. Cause I want that pool to stay in the memory.
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Thu Jan 22, 2009 8:54 pm Post subject: |
|
|
i agree with Spudgy its better to use ExFreePool to cleanup after yourself, if you dont and your driver loads multiple times and it doesnt free the memory it uses then theoreticlly you could get the low memory warning and not be able to fix it..
regards BanMe
|
|
| Back to top |
|
 |
FerrisBuellerYourMyHero Master Cheater
Reputation: 0
Joined: 14 Feb 2007 Posts: 401 Location: Inside your <kernel>
|
Posted: Thu Jan 22, 2009 9:13 pm Post subject: |
|
|
| whtwht wrote: | | it 'technically' does, but i believe, its still in the memory, kinda like how on a harddrive the data is still there until another data overwrites it, otherwise its physically there, but it doesn't show up on the records |
Really? it can be overwritten?
Because I only make a copy of my kernel once, even after the driver unloads I don't free it. But when the driver loads again I don't make a new copy, instead I just use the address that the copy is already made at... I use a volatile registry key to store the address so if the computer restarts or something it's automatically erased so I don't have to worry about clearing it myself...
I haven't had any problems so far so I don't think it can be overwritten...
So yeah you can neglect to call ExFreePool if you want what you allocated to stay in memory for longer than the life of your driver, but just don't keep allocating everytime your driver loads. Just remember the address...
_________________
You know, life moves pretty fast. If you don't stop and look around once in a while, You could miss it!
 |
|
| Back to top |
|
 |
|