OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Thu, 14 Mar 2019     118020 members

   Login
   Join


 
 
Contents
  Online Dump Analyzer
OSR Dev Blog
The NT Insider
The Basics
File Systems
Downloads
ListServer / Forum
  Express Links
  · The NT Insider Digital Edition - May-June 2016 Now Available!
  · Windows 8.1 Update: VS Express Now Supported
  · HCK Client install on Windows N versions
  · There's a WDFSTRING?
  · When CAN You Call WdfIoQueueP...ously

DDI's That Raise An Exception

There's a rumor that's been around for a while that says that there are some Windows DDIs that can raise exceptions, instead of (or in addition to) returning status or output values.  When this issue once again reared its ugly head, developer Nick Ryan used his resources to chase down real answer.  Nick can be regularly found sharing his insights and expertise on the NTDEV and NTFSD lists.

It seems that the DDK and IFS kit at one time failed to mention a number of the functions that could raise.  Most of those omissions have been fixed, however.  Nick says the folks at Microsoft that he contacted agreed that any functions that raise an exception should be documented (with the exception of functions that raise as a result of bad input -- such as the exception caused by dereferencing a bad pointer --  or other similar situations).  He provides the list of functions that are currently documented as raising exceptions below.

Microsoft has confirmed that a Structured Exception Handler is only needed by a driver to handle exceptions raised by kernel APIs documented to raise, or around accesses to user-mode memory ranges (such as when calling ProbeForRead/Write). Any other case where an exception is raised is due to coding bugs in the driver or as a result of the driver deliberately raising an exception via the provided DDIs.

Our thanks to Nick for being pro-active in helping out the community!

CcCopyWrite
CcFastCopyWrite
CcCopyRead
CcMdlRead
CcZeroData
CcInitializeCacheMap

PsReturnPoolQuota
PsChargePoolQuota

IoCreateStreamFileObjectLite
IoCreateStreamFileObjectEx
IoCreateStreamFileObject

FsRtlSplitLargeMcb
FsRtlRemoveLargeMcbEntry
FsRtlNotifyInitializeSync
FsRtlAreNamesEqual
FsRtlAllocatePoolWithTag
FsRtlAllocatePoolWithQuotaTag
FsRtlAddLargeMcbEntry
FsRtlInitializeLargeMcb

ProbeForRead
ProbeForWrite

ExRaiseDatatypeMisalignment
ExRaiseAccessViolation
ExAllocatePoolWithQuotaTag

MmMapLockedPagesSpecifyCache
MmProbeAndLockPages

 

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

"One more routine"
FsRtlIsNameInExpression() is also worth mentioning, especially in case of the lack of PagedPool (it raises with STATUS_INSUFFICIENT_RESOURCES)!

Rating:
22-Mar-13, Konstantin Manurin


"CcSetFileSizes"
I've seen CcSetFileSizes raise as well...

Rating:
27-Feb-06, Rod Widdowson


"another raiser.."
FsRtlProcessFileLock() can also raise STATUS_INSUFFICIENT_RESOURCES on some of the IRP_MN_LOCK paths.

Rating:
19-Aug-04, David Goebel


Post Your Comments.
Print this article.
Email this article.
bottom nav links