none
UMDF driver can't communicate with KMDF driver because of initializing stage. RRS feed

  • Question

  • Experts, Please Help me.

    I'm a new Windows Driver Developer.

    I'm developing UMDF sample driver. Firstly, I made KMDF sample driver which can access some i/o ports.

    My user application can get the Handle from KMDF driver by CreateFile() and receive some data from it using IOCTL. KMDF dirver path is "\\\\.\\drv".

    Also, the user application can get the Handle and data from UMDF driver using same way. It's just a test, not important.

    Now, I want access KMDF driver through the UMDF driver. I think UMDF driver is a filter driver and another is a funtion driver.

    Maybe there are 2 way to get I/O target. GetDefaultTarget() and CreateFileHandleTarget().

    I don't use first thing because two drivers are not pair. I mean the KMDF driver will be used by other UMDF dirvers not only this one.

    So I'm trying to get file handle based I/O Target but I'm faced with some problems.

    Before run CreateFileHandleTarget(), I have to get the Handle from KMDF driver by CreateFile() but I can't, it's impossible.

    KDMF driver path is same as above. I wonder why it doesn't work. Why can't UMDF driver run CreateFile()? Is there something important that I don't know?

    Please give a answer. Here is mt last Hope. If there are better methods to communicate both KDMF and UMDF, let me know. Thank you.

    Thursday, January 10, 2013 2:04 PM

Answers

All replies

  • what error code is returned from CreateFile in the umdf driver when opening the kmdf driver?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, January 10, 2013 4:04 PM
  • Error code is "INVALID_HANDLE_VALUE". I can't understand. User application can open  the kmdf driver without problem.

    I'm trying to resolve this problem. How about inf file of the kmdf driver? Is it possible that is the problem's cause?

    I want see the light at the end of this tunnel.

    -----------------------------------------------------------------------------------------------------------------------------------------

    Thank you for your reply. It's my first question in this site. I always just look aroud. That's why Your name is familiar to me.:)

    Thursday, January 10, 2013 4:55 PM
  • Call GetLastError and see what the error is immediately after the call to CreateFile fails

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, January 10, 2013 9:14 PM
  • GetLastError is "5". It's "ERROR_ACCESS_DENIED", isn't it?

    Friday, January 11, 2013 12:44 AM
  • what device class is your KMDF driver installed under (it is in the INF at the top)? are you assigning an SDDL string or class to the WDFDEVICE before creating it? cleary the problem is that your UMDF driver does not have the right permissions to open the kmdf driver. can you open your kmdf driver from a normal application that is not running as administrator?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, January 11, 2013 7:43 AM
  • My KMDF driver class type is "Sample". I did't assign an SDDL string. Do I need it?

    I opened kmdf driver with administrator application. If it's about permission issue, How can I get the permisson for the umdf drvier?

    Friday, January 11, 2013 8:41 AM
  • try running your application NOT as an administrator, does that succeed?  I am guessing it won't. the simplest solution is to assign an SDDL string to your device in the INF that installs the driver with a .security section, see http://msdn.microsoft.com/en-us/library/windows/hardware/ff546320(v=vs.85).aspx


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, January 11, 2013 5:23 PM
  • I see, I think you are right. I 'll give it a try, thanks Doron.
    Sunday, January 13, 2013 9:57 AM