OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Wed, 19 Jun 2013     98942 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

Querying the name of a file

When using ObQueryNameString in a driver, you should note that under some circumstances it will return STATUS_INFO_LENGTH_MISMATCH.  This is because some of the subroutines called require that the output buffer be at least as large as the OBJECT_NAME_INFORMATION buffer.

This is an issue for drivers that attempt to call with a zero-length buffer in order to determine the buffer size - it does not work in all circumstances, and this call does not tell you how big to make the buffer.

The solution to this is to use a buffer that is at least sizeof(OBJECT_NAME_INFORMATION) large on the initial call - this will ensure that the returned length is the necessary size.

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

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