OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Fri, 24 May 2013     98599 members

   Login
   Join


 
 
Contents
  About This Site
What's New?
OSR Dev Blog
The NT Insider
The Basics
File Systems
Downloads
ListServer / Forum
Driver Jobs
Store
  Express Links
  · WdfSend: Are There REALLY Three Useful Variants?
  · Turning a Breakpoint into a Busypoint
  · Investigating a NULL Pointer Dereference
  · Understanding WDFMEMORY Objects
  · Using WinDbg to hunt for strings

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.

Windows Internals and SW Drivers
LAB

Santa Clara, CA
5-9 Aug 2013

Kernel Debugging & Crash Analysis
LAB

Santa Clara, CA
9-13 Sep 2013

Writing WDF Drivers
LAB

Boston/Waltham, MA
7-11 Oct 2013

Developing File Systems
Seattle, WA
5-8 Nov 2013

 
 

Windows Debugger
V6.12.2.633 -- 26 Feb 10

Checked Build Downloads
29-Apr-10

Debugging Symbols

 

WDK Doc Updates
Now updated bi-monthly!

Windows WDK
V7.1.0 -- 26 Feb 10

 
 
x
LetUsHelp
 

Need to develop a Windows file system solution?

We've got a kit for that.

Need Windows internals or kernel driver expertise?

Bring us your most challenging project - we can help!

System hangs/crashes?

We've got a special diagnostic team that's standing by.

Visit the OSR Corporate Web site for more information about how OSR can help!

 
bottom nav links