Tech Support > Microsoft Windows > Drivers > WdfFileObjectGetFileName failing
WdfFileObjectGetFileName failing
Posted by Michael on April 22nd, 2008


In my EvtIoDeviceControl() callback I get a file object by calling
WdfRequestGetFileObject, and then call WdfFileObjectGetFileName to determine
the file name that was opened by the client. The client is able to open the
device and make several requests, and I am able to determine the file name
each time. However, on some requests WdfRequestGetFileObject is returning
NULL, and a breakpoint is being hit somewhere in the WDF library. The client
is using the same handle that was used in previous requests that were
successful, and the handle was not closed. I've inspected the request, and
file objects, and they appear to be valid WDF objects. Why would the file
name suddenly disappear from the FileObject?

Thanks!

Posted by Doron Holan [MSFT] on April 22nd, 2008


WdfFileObjectGetFileName is only valid in the context of
EvtDeviceFileCreate. if you need to do something based on the file name,
copy the name into your context on the WDFFILEOBJECT or use some other state
in the context to indicate whatever you need. What is the callstack when
you hit the breakpoint? my guess is that there is no file object in the
current irp stack location or a file object that KMDF has never seen before
so it does not have a mapping back to a WDFFILEOBJECT.

What device class are you in? modem? is the modem driver above your driver
as a filter? who is opening the file handle to your driver? another KM
driver or just an application?

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Michael" <Michael@discussions.microsoft.com> wrote in message
news:49DD43B4-ED51-4A4F-8727-F7F052DB3F23@microsoft.com...


Similar Posts