OSRLogo
OSRLogoOSRLogoOSRLogo x Subscribe to The NT Insider
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Wed, 19 Jun 2013     98953 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
  · OSR Seminar Schedule
  · WdfSend: Are There REALLY Three Useful Variants?
  · Turning a Breakpoint into a Busypoint
  · Investigating a NULL Pointer Dereference
  · Understanding WDFMEMORY Objects

Relative opens and IoCreateFileSpecifyDeviceObjectHint

This might be old news to some, but it certainly caught me by surprise....

I wrote some seemingly innocuous filter code to create a stream within a file on an NTFS volume. Using a HANDLE to the file as the RootDirectory within the OBJECT_ATTRIBUTES, I tried to do a relative create on the file using IoCreateFileSpecifyDeviceObjectHint. Much to my surprise, the IRP_MJ_CREATE appeared at the top of the device stack. Googling a bit turned up a post on NTFSD from last year in which this was acknowledged as a bug.

The gist of the thread is that you're OK doing relative opens with IoCreateFileSpecifyDevice ObjectHint if the RootDirectory is a HANDLE to:

  • A FILE_OBJECT that was also returned from a call to IoCreateFileSpecifyDeviceObjectHint
  • A FILE_OBJECT that represents a volume open

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

"IRP_MN_QUERY_DIRECTORY and IoCreateFileSpecifyDeviceObjectHint"
I used IoCreateFileSpecifyDeviceObjectHint in IRP_MJ_DIRECTORY_CONTROL dispatch routine,the IRP_MJ_CREATE appeared at my filter dirver

01-Nov-11, kay lc


Post Your Comments.
Print this article.
Email this article.

Kernel Debugging & Crash Analysis
LAB

Santa Clara, CA
9-13 Sep 2013

Windows Internals and SW Drivers
LAB

Santa Clara, CA
16-20 Sep 2013

Writing WDF Drivers
LAB

Boston/Waltham, MA
7-11 Oct 2013

Developing File Systems
Seattle, WA
5-8 Nov 2013

 
 

Windows Debugger

Checked Build Downloads
29-Apr-10

Debugging Symbols

WDK Documentation

Windows WDK

 
 
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