Hi,
my current project (a win32 firewall with lots of features) is a kernel mode device driver combined with a usermode UI. The driver is started by the UI using the CreateService and StartService APIs. Now I am close to release and I just wondered. My release build driver file has the size of 512kb. Is that too much? Where is the driver code allocated?
Thank you ![]()
As compared to the drivers installed with one of my reasonably standard
32-Bit XP SP2 test machine’s, it’s pretty much huge. That is, it is
bigger than everything other than NTFS by at least 100K, and probably by
something like a factor of five on average. That being said, I don’t
know of any particular reason why this makes a great deal of difference,
beyond whatever affect it’s presence makes on overall system
performance, which, in my opinion, is a totally meaningless conversation
unless you are going to take a great deal of time to analayze a
particular configuration - which basically nobody, including myself,
does, and doing so after the fact is useless unless you are willing to
make some seriously tough resource allocation decisions. Resources in
the sense of what is it going to cost me/us to rewrite this thing, if
necessary. What you may have some control over at this point is usage
of the non-paged pool, which is much, much more important than overall
memory usage. If your worried about overall memory usage, they place to
start, hands down, in my opinion, is with user mode services. Windows
ships with, in my opinion, based on my usage, an amazing number of
services turned on that, based on my disabling them, don’t seem to
affect what I do. Having just gone through this process with the July
CTP for Vista, it went from something 750 MB out of the box to somewhat
less than half of that, but I use very little for what I do. They are
also, if this affects you, in my opinion, generally speaking the largest
single cause of absolutely, at times, gaping security holes.
In the end however, in my mind, the only answer to the question that
matters, or really even makes sense, is that it is what it is. If you
need the features, you need them. Even if you don’t, you are kind of
stuck at this point.
MM
>> xxxxx@Safe-mail.net 2006-08-03 17:42 >>>
Hi,
my current project (a win32 firewall with lots of features) is a kernel
mode device driver combined with a usermode UI. The driver is started by
the UI using the CreateService and StartService APIs. Now I am close to
release and I just wondered. My release build driver file has the size
of 512kb. Is that too much? Where is the driver code allocated?
Thank you
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
>wondered. My release build driver file has the size of 512kb.
Very large. Maybe you’re abusing C++ templates, or linking in some huge
toolkit.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
A 50K driver can do an awful lot, so 500K probably means there is a giant array defined in the data segment (check the map file to find it). Note even *uninitialized* structures (bss) take up their full size in the binary. Large structures/arrays should be dynamically allocated manually, and do so in paged pool if permissible. And don’t put anything large, even if 1K or less, on the stack since it is tiny in the kernel.
eof