|
Prev: Problems sending requests to IO targets in KMDF
Next: Question about WCEUSB device and USB Composite Device
From: Michael on 22 Apr 2008 11:37 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!
From: Doron Holan [MSFT] on 22 Apr 2008 13:27
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(a)discussions.microsoft.com> wrote in message news:49DD43B4-ED51-4A4F-8727-F7F052DB3F23(a)microsoft.com... > 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! |