OSR Dev Blog

ExAllocatePoolWithQuota Raises Exceptions
(By: Hector J. Rodriguez | Published: 29-Jun-04| Modified: 29-Jun-04)

Right in the midst of my busy schedule, I happened to be up in Redmond. A dev from the Windows group stops me and says "OK, Mr. Know-It-All Rodriguez, answer me this: Are there any flavors of ExAllocatePool that will raise an exception by default?"

After exchanging a few pleasantries (suitable for "internal use only") he finally gave me the answer: By default, ExAllocatePoolWithQuota and it's friend ExAllocatePoolWithQuotaTag will raise an exception if the request can't be fullfilled because of quota contraints.

With all of us being more security and resource conscious, it's often a good idea to use ExAllocatePoolWithQuotaTag when allocating storage on behalf of a user. Just be sure to guard that call with a try / except block.

This article was printed from OSR Online http://www.osronline.com

Copyright 2017 OSR Open Systems Resources, Inc.